Sync launcher (Merchant/Mini/Give/One) and DemoWorld Care specialty RBAC staff.
Deploy Ladill Meet / deploy (push) Successful in 1m20s
Deploy Ladill Meet / deploy (push) Successful in 1m20s
This commit is contained in:
+135
-32
@@ -187,33 +187,52 @@ final class DemoWorld
|
||||
* }>>
|
||||
*/
|
||||
/**
|
||||
* Care specialty module doctors (Pro / Enterprise). Emails: demo-{tier}-{key}@ladill.com
|
||||
* Care specialty module clinicians (Pro / Enterprise).
|
||||
* Emails: demo-{tier}-{key}@ladill.com
|
||||
* Roles follow the Care RBAC matrix when a dedicated slug exists;
|
||||
* remaining modules stay on legacy `doctor` + desk specialty keywords.
|
||||
*
|
||||
* @var array<string, string> module key => display name
|
||||
* @var array<string, array{name: string, role: string}>
|
||||
*/
|
||||
public const SPECIALTY_DOCTORS = [
|
||||
'emergency' => 'Dr. Kojo Emergency',
|
||||
'blood_bank' => 'Dr. Ama Blood Bank',
|
||||
'dentistry' => 'Dr. Ama Dental',
|
||||
'ophthalmology' => 'Dr. Kofi Eye',
|
||||
'physiotherapy' => 'Dr. Efua Physio',
|
||||
'maternity' => 'Dr. Abena Maternity',
|
||||
'radiology' => 'Dr. Yaw Radiology',
|
||||
'cardiology' => 'Dr. Kwesi Cardiology',
|
||||
'psychiatry' => 'Dr. Adwoa Psychiatry',
|
||||
'pediatrics' => 'Dr. Fiifi Pediatrics',
|
||||
'orthopedics' => 'Dr. Kojo Orthopedics',
|
||||
'ent' => 'Dr. Esi ENT',
|
||||
'oncology' => 'Dr. Mansa Oncology',
|
||||
'renal' => 'Dr. Nana Renal',
|
||||
'surgery' => 'Dr. Kwadwo Surgery',
|
||||
'vaccination' => 'Dr. Afia Vaccination',
|
||||
'pathology' => 'Dr. Yaw Pathology',
|
||||
'infusion' => 'Dr. Akosua Infusion',
|
||||
'dermatology' => 'Dr. Ama Dermatology',
|
||||
'podiatry' => 'Dr. Kofi Podiatry',
|
||||
'fertility' => 'Dr. Abena Fertility',
|
||||
'child_welfare' => 'Dr. Efua Child Welfare',
|
||||
'emergency' => ['name' => 'Dr. Kojo Emergency', 'role' => 'emergency_physician'],
|
||||
'blood_bank' => ['name' => 'Ama Blood Bank Officer', 'role' => 'blood_bank_officer'],
|
||||
'dentistry' => ['name' => 'Dr. Ama Dental', 'role' => 'dentist'],
|
||||
'ophthalmology' => ['name' => 'Dr. Kofi Eye', 'role' => 'doctor'],
|
||||
'physiotherapy' => ['name' => 'Dr. Efua Physio', 'role' => 'physiotherapist'],
|
||||
'maternity' => ['name' => 'Abena Midwife', 'role' => 'midwife'],
|
||||
'radiology' => ['name' => 'Dr. Yaw Radiology', 'role' => 'radiologist'],
|
||||
'cardiology' => ['name' => 'Dr. Kwesi Cardiology', 'role' => 'doctor'],
|
||||
'psychiatry' => ['name' => 'Dr. Adwoa Psychiatry', 'role' => 'psychiatrist'],
|
||||
'pediatrics' => ['name' => 'Dr. Fiifi Pediatrics', 'role' => 'pediatrician'],
|
||||
'orthopedics' => ['name' => 'Dr. Kojo Orthopedics', 'role' => 'doctor'],
|
||||
'ent' => ['name' => 'Dr. Esi ENT', 'role' => 'doctor'],
|
||||
'oncology' => ['name' => 'Dr. Mansa Oncology', 'role' => 'oncologist'],
|
||||
'renal' => ['name' => 'Dr. Nana Renal', 'role' => 'doctor'],
|
||||
'surgery' => ['name' => 'Dr. Kwadwo Surgery', 'role' => 'surgeon'],
|
||||
'vaccination' => ['name' => 'Dr. Afia Vaccination', 'role' => 'doctor'],
|
||||
'pathology' => ['name' => 'Dr. Yaw Pathology', 'role' => 'pathologist'],
|
||||
'infusion' => ['name' => 'Dr. Akosua Infusion', 'role' => 'doctor'],
|
||||
'dermatology' => ['name' => 'Dr. Ama Dermatology', 'role' => 'doctor'],
|
||||
'podiatry' => ['name' => 'Dr. Kofi Podiatry', 'role' => 'doctor'],
|
||||
'fertility' => ['name' => 'Dr. Abena Fertility', 'role' => 'doctor'],
|
||||
'child_welfare' => ['name' => 'Dr. Efua Child Welfare', 'role' => 'doctor'],
|
||||
'ambulance' => ['name' => 'Kojo Ambulance', 'role' => 'ambulance_staff'],
|
||||
];
|
||||
|
||||
/**
|
||||
* Extra Care matrix roles (not covered by SPECIALTY_DOCTORS keys).
|
||||
*
|
||||
* @var list<array{key: string, name: string, role: string}>
|
||||
*/
|
||||
public const CARE_MATRIX_STAFF = [
|
||||
['key' => 'ed-nurse', 'name' => 'Ama ED Nurse', 'role' => 'ed_nurse'],
|
||||
['key' => 'theatre-nurse', 'name' => 'Efua Theatre Nurse', 'role' => 'theatre_nurse'],
|
||||
['key' => 'radiographer', 'name' => 'Kofi Radiographer', 'role' => 'radiographer'],
|
||||
['key' => 'dialysis-nurse', 'name' => 'Abena Dialysis Nurse', 'role' => 'dialysis_nurse'],
|
||||
['key' => 'billing-officer', 'name' => 'Yaw Billing Officer', 'role' => 'billing_officer'],
|
||||
['key' => 'department-manager', 'name' => 'Adwoa Department Manager', 'role' => 'department_manager'],
|
||||
['key' => 'hospital-admin', 'name' => 'Kojo Hospital Admin', 'role' => 'hospital_admin'],
|
||||
];
|
||||
|
||||
public const STAFF = [
|
||||
@@ -242,7 +261,14 @@ final class DemoWorld
|
||||
'email' => 'demo-pro-doctor@ladill.com',
|
||||
'name' => 'Dr. Kwame Mensah (Pro)',
|
||||
'apps' => ['care'],
|
||||
'roles' => ['care' => 'doctor'],
|
||||
'roles' => ['care' => 'general_physician'],
|
||||
],
|
||||
[
|
||||
'key' => 'general-physician',
|
||||
'email' => 'demo-pro-general-physician@ladill.com',
|
||||
'name' => 'Dr. Ama General Physician (Pro)',
|
||||
'apps' => ['care'],
|
||||
'roles' => ['care' => 'general_physician'],
|
||||
],
|
||||
[
|
||||
'key' => 'nurse',
|
||||
@@ -282,13 +308,36 @@ final class DemoWorld
|
||||
'apps' => ['care'],
|
||||
'roles' => ['care' => 'lab_technician'],
|
||||
],
|
||||
[
|
||||
'key' => 'lab_manager',
|
||||
'email' => 'demo-pro-lab-manager@ladill.com',
|
||||
'name' => 'Ama Lab Manager (Pro)',
|
||||
'apps' => ['care'],
|
||||
'roles' => ['care' => 'lab_manager'],
|
||||
],
|
||||
[
|
||||
'key' => 'blood_bank_manager',
|
||||
'email' => 'demo-pro-blood-bank-manager@ladill.com',
|
||||
'name' => 'Kofi Blood Bank Manager (Pro)',
|
||||
'apps' => ['care'],
|
||||
'roles' => ['care' => 'blood_bank_manager'],
|
||||
],
|
||||
[
|
||||
'key' => 'cashier',
|
||||
'email' => 'demo-pro-cashier@ladill.com',
|
||||
'name' => 'Kojo Cashier (Pro)',
|
||||
'apps' => ['care', 'pos'],
|
||||
// Care cashiers collect via Billing — not Ladill POS.
|
||||
'apps' => ['care'],
|
||||
'roles' => [
|
||||
'care' => 'cashier',
|
||||
],
|
||||
],
|
||||
[
|
||||
'key' => 'pos_cashier',
|
||||
'email' => 'demo-pro-pos-cashier@ladill.com',
|
||||
'name' => 'Kofi POS Cashier (Pro)',
|
||||
'apps' => ['pos'],
|
||||
'roles' => [
|
||||
'pos' => 'cashier',
|
||||
],
|
||||
],
|
||||
@@ -321,7 +370,14 @@ final class DemoWorld
|
||||
'email' => 'demo-enterprise-doctor@ladill.com',
|
||||
'name' => 'Dr. Kwame Mensah',
|
||||
'apps' => ['care'],
|
||||
'roles' => ['care' => 'doctor'],
|
||||
'roles' => ['care' => 'general_physician'],
|
||||
],
|
||||
[
|
||||
'key' => 'general-physician',
|
||||
'email' => 'demo-enterprise-general-physician@ladill.com',
|
||||
'name' => 'Dr. Ama General Physician',
|
||||
'apps' => ['care'],
|
||||
'roles' => ['care' => 'general_physician'],
|
||||
],
|
||||
[
|
||||
'key' => 'nurse',
|
||||
@@ -361,13 +417,36 @@ final class DemoWorld
|
||||
'apps' => ['care'],
|
||||
'roles' => ['care' => 'lab_technician'],
|
||||
],
|
||||
[
|
||||
'key' => 'lab_manager',
|
||||
'email' => 'demo-enterprise-lab-manager@ladill.com',
|
||||
'name' => 'Ama Lab Manager',
|
||||
'apps' => ['care'],
|
||||
'roles' => ['care' => 'lab_manager'],
|
||||
],
|
||||
[
|
||||
'key' => 'blood_bank_manager',
|
||||
'email' => 'demo-enterprise-blood-bank-manager@ladill.com',
|
||||
'name' => 'Kofi Blood Bank Manager',
|
||||
'apps' => ['care'],
|
||||
'roles' => ['care' => 'blood_bank_manager'],
|
||||
],
|
||||
[
|
||||
'key' => 'cashier',
|
||||
'email' => 'demo-enterprise-cashier@ladill.com',
|
||||
'name' => 'Kojo Cashier',
|
||||
'apps' => ['care', 'pos'],
|
||||
// Care cashiers collect via Billing — not Ladill POS.
|
||||
'apps' => ['care'],
|
||||
'roles' => [
|
||||
'care' => 'cashier',
|
||||
],
|
||||
],
|
||||
[
|
||||
'key' => 'pos_cashier',
|
||||
'email' => 'demo-enterprise-pos-cashier@ladill.com',
|
||||
'name' => 'Kofi POS Cashier',
|
||||
'apps' => ['pos'],
|
||||
'roles' => [
|
||||
'pos' => 'cashier',
|
||||
],
|
||||
],
|
||||
@@ -525,7 +604,7 @@ final class DemoWorld
|
||||
return $roster;
|
||||
}
|
||||
|
||||
foreach (self::SPECIALTY_DOCTORS as $key => $name) {
|
||||
foreach (self::SPECIALTY_DOCTORS as $key => $meta) {
|
||||
$email = sprintf('demo-%s-%s@ladill.com', $tier, $key);
|
||||
$already = false;
|
||||
foreach ($roster as $row) {
|
||||
@@ -537,13 +616,37 @@ final class DemoWorld
|
||||
if ($already) {
|
||||
continue;
|
||||
}
|
||||
$name = is_array($meta) ? (string) ($meta['name'] ?? $key) : (string) $meta;
|
||||
$role = is_array($meta) ? (string) ($meta['role'] ?? 'doctor') : 'doctor';
|
||||
$suffix = $tier === 'pro' ? ' (Pro)' : '';
|
||||
$roster[] = [
|
||||
'key' => $key,
|
||||
'email' => $email,
|
||||
'name' => $name.$suffix,
|
||||
'apps' => ['care'],
|
||||
'roles' => ['care' => $role],
|
||||
];
|
||||
}
|
||||
|
||||
foreach (self::CARE_MATRIX_STAFF as $extra) {
|
||||
$email = sprintf('demo-%s-%s@ladill.com', $tier, $extra['key']);
|
||||
$already = false;
|
||||
foreach ($roster as $row) {
|
||||
if (strtolower((string) ($row['email'] ?? '')) === $email) {
|
||||
$already = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($already) {
|
||||
continue;
|
||||
}
|
||||
$suffix = $tier === 'pro' ? ' (Pro)' : '';
|
||||
$roster[] = [
|
||||
'key' => $key,
|
||||
'key' => $extra['key'],
|
||||
'email' => $email,
|
||||
'name' => $name.$suffix,
|
||||
'name' => $extra['name'].$suffix,
|
||||
'apps' => ['care'],
|
||||
'roles' => ['care' => 'doctor'],
|
||||
'roles' => ['care' => $extra['role']],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user