Strip healthcare packaging and Care integration from Queue.
Deploy Ladill Queue / deploy (push) Successful in 3m12s

Queue is general-purpose QMS only; Care runs its own native engine.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-18 10:15:32 +00:00
co-authored by Cursor
parent b5ffa499b9
commit b208e59bd0
16 changed files with 123 additions and 501 deletions
@@ -27,7 +27,7 @@ class IntegrationController extends Controller
'data' => [
'provisioned' => false,
'onboarded' => false,
'integrations' => ['care' => false, 'frontdesk' => false],
'integrations' => ['frontdesk' => false],
],
]);
}
@@ -40,7 +40,6 @@ class IntegrationController extends Controller
'industry' => data_get($organization->settings, 'industry'),
'industry_package' => data_get($organization->settings, 'industry_package.key'),
'integrations' => [
'care' => (bool) data_get($organization->settings, 'integrations.care_enabled', false),
'frontdesk' => (bool) data_get($organization->settings, 'integrations.frontdesk_enabled', false),
],
],
@@ -61,7 +60,6 @@ class IntegrationController extends Controller
]);
$defaultIndustry = match ($caller) {
'care' => 'healthcare',
'frontdesk' => 'visitor',
'pos' => 'restaurant',
default => 'custom',
@@ -85,7 +83,6 @@ class IntegrationController extends Controller
'industry' => $industry,
'appointment_mode' => 'hybrid',
'integrations' => [
'care_enabled' => false,
'frontdesk_enabled' => false,
],
],
@@ -127,19 +124,17 @@ class IntegrationController extends Controller
}
}
if (in_array($caller, ['care', 'frontdesk'], true)) {
if ($caller === 'frontdesk') {
$this->syncIntegrationFlag($organization->fresh(), $caller, true);
$organization = $organization->fresh();
}
// Care owns clinical stage graphs; still apply healthcare terminology/package metadata.
$packageResult = app(IndustryPackageInstaller::class)->install(
$organization->fresh(),
$branch,
$industry,
[
'actor_ref' => $owner,
'skip_stages' => $caller === 'care',
'include_optional' => true,
],
);
@@ -151,7 +146,6 @@ class IntegrationController extends Controller
'industry' => $industry,
'industry_package' => $packageResult,
'integrations' => [
'care' => (bool) data_get($organization->fresh()->settings, 'integrations.care_enabled', false),
'frontdesk' => (bool) data_get($organization->fresh()->settings, 'integrations.frontdesk_enabled', false),
],
],
@@ -161,7 +155,6 @@ class IntegrationController extends Controller
public function update(Request $request): JsonResponse
{
$validated = $request->validate([
'care_enabled' => ['nullable', 'boolean'],
'frontdesk_enabled' => ['nullable', 'boolean'],
]);
@@ -170,9 +163,6 @@ class IntegrationController extends Controller
$settings = $organization->settings ?? [];
$integrations = $settings['integrations'] ?? [];
if (array_key_exists('care_enabled', $validated) && in_array($caller, ['care', 'crm'], true)) {
$integrations['care_enabled'] = (bool) $validated['care_enabled'];
}
if (array_key_exists('frontdesk_enabled', $validated) && in_array($caller, ['frontdesk', 'crm'], true)) {
$integrations['frontdesk_enabled'] = (bool) $validated['frontdesk_enabled'];
}
@@ -183,7 +173,6 @@ class IntegrationController extends Controller
return response()->json([
'data' => [
'integrations' => [
'care' => (bool) ($integrations['care_enabled'] ?? false),
'frontdesk' => (bool) ($integrations['frontdesk_enabled'] ?? false),
],
],
@@ -192,14 +181,13 @@ class IntegrationController extends Controller
protected function syncIntegrationFlag(Organization $organization, string $caller, bool $enabled): void
{
if (! in_array($caller, ['care', 'frontdesk'], true)) {
if ($caller !== 'frontdesk') {
return;
}
$settings = $organization->settings ?? [];
$integrations = $settings['integrations'] ?? [];
$key = $caller.'_enabled';
$integrations[$key] = $enabled;
$integrations['frontdesk_enabled'] = $enabled;
$settings['integrations'] = $integrations;
$organization->update(['settings' => $settings]);
}
@@ -72,7 +72,6 @@ class SettingsController extends Controller
'appointment_mode' => ['required', 'string', 'in:'.implode(',', array_keys(config('qms.appointment_modes')))],
'industry' => ['nullable', 'string', 'max:64'],
'notifications_enabled' => ['boolean'],
'care_integration_enabled' => ['nullable', 'boolean'],
'frontdesk_integration_enabled' => ['nullable', 'boolean'],
'logo' => ['nullable', 'image', 'mimes:jpeg,png,jpg,webp,svg', 'max:2048'],
'remove_logo' => ['nullable', 'boolean'],
@@ -92,9 +91,6 @@ class SettingsController extends Controller
}
$settings['notifications_enabled'] = $request->boolean('notifications_enabled', true);
$integrations = $settings['integrations'] ?? [];
if ($request->has('care_integration_enabled')) {
$integrations['care_enabled'] = $request->boolean('care_integration_enabled');
}
if ($request->has('frontdesk_integration_enabled')) {
$integrations['frontdesk_enabled'] = $request->boolean('frontdesk_integration_enabled');
}
@@ -177,8 +173,6 @@ class SettingsController extends Controller
if (($result['skipped_reason'] ?? null) === 'plan_queue_limit') {
$message .= ' Some stages were skipped because of your plan queue limit — upgrade to Pro for the full template.';
} elseif (($result['skipped_reason'] ?? null) === 'stages_managed_by_integration') {
$message .= ' Stages are managed by Ladill Care; terminology and announcements were updated.';
}
return back()->with('success', $message);
@@ -12,7 +12,7 @@ class EnsureQueueIntegration
public function handle(Request $request, Closure $next): Response
{
$caller = (string) $request->attributes->get('service_caller', '');
if (! in_array($caller, ['care', 'frontdesk'], true)) {
if ($caller !== 'frontdesk') {
return $next($request);
}
@@ -63,11 +63,6 @@ class IndustryPackageInstaller
$replace = (bool) ($options['replace'] ?? false);
$actor = $options['actor_ref'] ?? $organization->owner_ref;
// Care (and similar) own clinical stage provisioning — still apply terminology.
if (! $skipStages && data_get($organization->settings, 'integrations.care_enabled') && $key === 'healthcare') {
$skipStages = true;
}
$result = [
'package' => $key,
'departments' => 0,
@@ -81,7 +76,6 @@ class IndustryPackageInstaller
return DB::transaction(function () use ($organization, $branch, $package, $key, $skipStages, $includeOptional, $replace, $actor, &$result) {
// Replacing a package wipes queues/tickets/points so the new template is clean.
// Care-managed healthcare keeps clinical queues (skip_stages).
if ($replace && ! $skipStages) {
$this->clearOperationalData($organization);
$result['replaced'] = true;
+85 -9
View File
@@ -186,19 +186,55 @@ final class DemoWorld
* account_role?: string
* }>>
*/
/**
* Care specialty module doctors (Pro / Enterprise). Emails: demo-{tier}-{key}@ladill.com
*
* @var array<string, string> module key => display name
*/
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',
];
public const STAFF = [
'free' => [
[
'key' => 'receptionist',
'email' => 'demo-free-receptionist@ladill.com',
'name' => 'Abena Reception (Free)',
'apps' => ['care', 'frontdesk', 'queue'],
'apps' => ['care', 'frontdesk'],
'roles' => [
'care' => 'receptionist',
'frontdesk' => 'receptionist',
'queue' => 'receptionist',
],
],
[
'key' => 'queue',
'email' => 'demo-free-queue@ladill.com',
'name' => 'Ama Queue (Free)',
'apps' => ['queue'],
'roles' => ['queue' => 'receptionist'],
],
],
'pro' => [
[
@@ -219,13 +255,19 @@ final class DemoWorld
'key' => 'receptionist',
'email' => 'demo-pro-receptionist@ladill.com',
'name' => 'Abena Reception (Pro)',
'apps' => ['care', 'frontdesk', 'queue'],
'apps' => ['care', 'frontdesk'],
'roles' => [
'care' => 'receptionist',
'frontdesk' => 'receptionist',
'queue' => 'receptionist',
],
],
[
'key' => 'queue',
'email' => 'demo-pro-queue@ladill.com',
'name' => 'Ama Queue (Pro)',
'apps' => ['queue'],
'roles' => ['queue' => 'receptionist'],
],
[
'key' => 'pharmacist',
'email' => 'demo-pro-pharmacist@ladill.com',
@@ -292,13 +334,19 @@ final class DemoWorld
'key' => 'receptionist',
'email' => 'demo-enterprise-receptionist@ladill.com',
'name' => 'Abena Reception',
'apps' => ['care', 'frontdesk', 'queue'],
'apps' => ['care', 'frontdesk'],
'roles' => [
'care' => 'receptionist',
'frontdesk' => 'receptionist',
'queue' => 'receptionist',
],
],
[
'key' => 'queue',
'email' => 'demo-enterprise-queue@ladill.com',
'name' => 'Ama Queue',
'apps' => ['queue'],
'roles' => ['queue' => 'receptionist'],
],
[
'key' => 'pharmacist',
'email' => 'demo-enterprise-pharmacist@ladill.com',
@@ -471,7 +519,35 @@ final class DemoWorld
*/
public static function staff(string $tier): array
{
return self::STAFF[self::normalizeTier($tier)] ?? [];
$tier = self::normalizeTier($tier);
$roster = self::STAFF[$tier] ?? [];
if (! in_array($tier, ['pro', 'enterprise'], true)) {
return $roster;
}
foreach (self::SPECIALTY_DOCTORS as $key => $name) {
$email = sprintf('demo-%s-%s@ladill.com', $tier, $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,
'email' => $email,
'name' => $name.$suffix,
'apps' => ['care'],
'roles' => ['care' => 'doctor'],
];
}
return $roster;
}
/**
@@ -484,8 +560,8 @@ final class DemoWorld
return null;
}
foreach (self::STAFF as $roster) {
foreach ($roster as $member) {
foreach (['free', 'pro', 'enterprise'] as $tier) {
foreach (self::staff($tier) as $member) {
if (strtolower($member['email']) === $email) {
return $member;
}