Expand specialty modules; pin Emergency and Blood Bank on Pro.
Deploy Ladill Care / deploy (push) Successful in 1m37s

Add Cardiology through Child Welfare to the specialty catalog, keep Emergency and Blood Bank always enabled on Pro/Enterprise sidebars, and generate matching demo specialty doctors.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-18 09:27:05 +00:00
co-authored by Cursor
parent f87f216fb4
commit e9a76fec80
9 changed files with 524 additions and 140 deletions
@@ -342,4 +342,49 @@ class CareSpecialtyModulesTest extends TestCase
),
);
}
public function test_emergency_and_blood_bank_are_default_on_pro(): void
{
Http::fake();
$service = app(SpecialtyModuleService::class);
$this->assertTrue($service->isEnabled($this->organization, 'emergency'));
$this->assertTrue($service->isEnabled($this->organization, 'blood_bank'));
$this->assertFalse($service->isEnabled($this->organization, 'cardiology'));
$service->ensureDefaultModulesProvisioned($this->organization, $this->owner->public_id);
$this->assertDatabaseHas('care_departments', [
'branch_id' => $this->branch->id,
'type' => 'emergency',
'is_active' => true,
]);
$this->assertDatabaseHas('care_departments', [
'branch_id' => $this->branch->id,
'type' => 'blood_bank',
'is_active' => true,
]);
$this->actingAs($this->owner)
->get(route('care.specialty.show', 'emergency'))
->assertOk()
->assertSee('Emergency');
$this->expectException(\RuntimeException::class);
$service->deactivate($this->organization->fresh(), $this->owner->public_id, 'emergency');
}
public function test_catalog_includes_expanded_specialty_modules(): void
{
$catalog = app(SpecialtyModuleService::class)->catalog();
foreach ([
'emergency', 'blood_bank', 'cardiology', 'psychiatry', 'pediatrics', 'orthopedics',
'ent', 'oncology', 'renal', 'surgery', 'vaccination', 'pathology', 'infusion',
'dermatology', 'podiatry', 'fertility', 'child_welfare',
] as $key) {
$this->assertArrayHasKey($key, $catalog);
}
$this->assertTrue((bool) ($catalog['emergency']['default_on_paid_plans'] ?? false));
$this->assertTrue((bool) ($catalog['blood_bank']['default_on_paid_plans'] ?? false));
}
}