Seed Care demos from shared DemoWorld with staff roles.
Deploy Ladill Care / deploy (push) Successful in 1m0s
Deploy Ladill Care / deploy (push) Successful in 1m0s
Patients, branches, and org identity now match suite continuity keys; staff Members are created for training SSO without login reseed. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -224,4 +224,46 @@ class DemoSeedCommandTest extends TestCase
|
||||
$this->assertTrue($pro['paid_modules']);
|
||||
$this->assertSame(3, $pro['branches']);
|
||||
}
|
||||
|
||||
public function test_demo_world_continuity_and_staff_roles(): void
|
||||
{
|
||||
$user = User::create([
|
||||
'public_id' => 'demo-world-care-id',
|
||||
'name' => 'Ladill Demo (Pro)',
|
||||
'email' => 'demo-pro@ladill.com',
|
||||
]);
|
||||
|
||||
$this->artisan('demo:seed', [
|
||||
'identity' => 'demo-pro@ladill.com',
|
||||
'--plan' => 'pro',
|
||||
])->assertSuccessful();
|
||||
|
||||
$org = Organization::query()->where('owner_ref', $user->public_id)->firstOrFail();
|
||||
$this->assertSame(\App\Support\DemoWorld::business('pro')['name'], $org->name);
|
||||
|
||||
$ama = \App\Support\DemoWorld::personByKey('ama-mensah');
|
||||
$this->assertNotNull($ama);
|
||||
$patient = Patient::query()
|
||||
->where('owner_ref', $user->public_id)
|
||||
->where('phone', $ama['phone'])
|
||||
->first();
|
||||
$this->assertNotNull($patient);
|
||||
$this->assertSame($ama['email'], $patient->email);
|
||||
$this->assertSame($ama['national_id'], $patient->national_id);
|
||||
|
||||
$this->assertTrue(
|
||||
\App\Models\Member::query()
|
||||
->where('owner_ref', $user->public_id)
|
||||
->where('user_ref', 'demo-pro-doctor@ladill.com')
|
||||
->where('role', 'doctor')
|
||||
->exists()
|
||||
);
|
||||
$this->assertTrue(
|
||||
\App\Models\Member::query()
|
||||
->where('owner_ref', $user->public_id)
|
||||
->where('user_ref', 'demo-pro-receptionist@ladill.com')
|
||||
->where('role', 'receptionist')
|
||||
->exists()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user