Fix empty demo lab catalog for admins.
Deploy Ladill Care / deploy (push) Successful in 2m7s

Seed investigation types early (before clinical data), expand the default catalog, scope Lab → Catalog by organization, and harden practitioner-branch sync so a mid-reseed failure cannot wipe the catalog.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-18 09:06:35 +00:00
co-authored by Cursor
parent 899b08179e
commit f87f216fb4
5 changed files with 73 additions and 13 deletions
+9 -1
View File
@@ -79,12 +79,20 @@ class DemoSeedCommandTest extends TestCase
$this->assertSame(3, Branch::query()->where('owner_ref', $user->public_id)->count());
$this->assertTrue(app(PlanService::class)->canUseProModules($org));
$this->assertGreaterThan(0, InvestigationType::query()->where('owner_ref', $user->public_id)->count());
$this->assertGreaterThanOrEqual(12, InvestigationType::query()->where('organization_id', $org->id)->count());
$this->assertGreaterThan(0, InvestigationRequest::query()->where('owner_ref', $user->public_id)->count());
$this->assertGreaterThan(0, Drug::query()->where('owner_ref', $user->public_id)->count());
$this->assertGreaterThan(0, Prescription::query()->where('owner_ref', $user->public_id)->count());
$this->assertGreaterThan(0, Bill::query()->where('owner_ref', $user->public_id)->count());
$this->actingAs($user)
->withoutMiddleware(\App\Http\Middleware\EnsurePlatformSession::class)
->get(route('care.lab.catalog.index'))
->assertOk()
->assertSee('Full Blood Count')
->assertSee('Chest X-Ray')
->assertDontSee('No tests in catalog.');
$catalog = array_keys(config('care.specialty_modules', []));
$this->assertNotEmpty($catalog);
foreach ($catalog as $key) {