Strip healthcare packaging and Care integration from Queue.
Deploy Ladill Queue / deploy (push) Successful in 3m12s
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:
@@ -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]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user