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]);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user