Enable all specialty modules with demo traffic for Pro/Enterprise demos.
Deploy Ladill Care / deploy (push) Successful in 1m9s
Deploy Ladill Care / deploy (push) Successful in 1m9s
Free and real onboarding stay opt-in; Pro/Enterprise demos activate every catalog specialty and seed waiting appointments so module pages are populated. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -84,6 +84,53 @@ class DemoSeedCommandTest extends TestCase
|
||||
$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());
|
||||
|
||||
$catalog = array_keys(config('care.specialty_modules', []));
|
||||
$this->assertNotEmpty($catalog);
|
||||
foreach ($catalog as $key) {
|
||||
$this->assertTrue(
|
||||
(bool) data_get($org->settings, "specialty_modules.{$key}"),
|
||||
"Expected specialty module [{$key}] enabled for pro demo"
|
||||
);
|
||||
$type = config("care.specialty_modules.{$key}.department_type");
|
||||
$this->assertGreaterThan(
|
||||
0,
|
||||
\App\Models\Department::query()
|
||||
->where('owner_ref', $user->public_id)
|
||||
->where('type', $type)
|
||||
->where('is_active', true)
|
||||
->count(),
|
||||
"Expected active departments for [{$key}]"
|
||||
);
|
||||
$this->assertGreaterThan(
|
||||
0,
|
||||
Appointment::query()
|
||||
->where('owner_ref', $user->public_id)
|
||||
->whereIn('status', [Appointment::STATUS_WAITING, Appointment::STATUS_CHECKED_IN])
|
||||
->whereHas('department', fn ($q) => $q->where('type', $type))
|
||||
->count(),
|
||||
"Expected waiting specialty appointments for [{$key}]"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public function test_free_demo_does_not_enable_specialty_modules(): void
|
||||
{
|
||||
$user = User::create([
|
||||
'public_id' => 'demo-free-specialty-id',
|
||||
'name' => 'Ladill Demo (Free)',
|
||||
'email' => 'demo-free@ladill.com',
|
||||
]);
|
||||
|
||||
$this->artisan('demo:seed', [
|
||||
'identity' => 'demo-free@ladill.com',
|
||||
'--plan' => 'free',
|
||||
])->assertSuccessful();
|
||||
|
||||
$org = Organization::query()->where('owner_ref', $user->public_id)->firstOrFail();
|
||||
foreach (array_keys(config('care.specialty_modules', [])) as $key) {
|
||||
$this->assertFalse((bool) data_get($org->settings, "specialty_modules.{$key}"));
|
||||
}
|
||||
}
|
||||
|
||||
public function test_enterprise_seeds_assessments_and_more_branches(): void
|
||||
|
||||
Reference in New Issue
Block a user