Hard-delete Care remote Queue adapter (Phase 5).
Deploy Ladill Care / deploy (push) Failing after 1m13s

Care Queue Engine is the only path; remove QueueClient, driver config, and remote HTTP tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-18 11:16:41 +00:00
co-authored by Cursor
parent 966f0496b2
commit dd4bc493b4
31 changed files with 441 additions and 2108 deletions
@@ -4,13 +4,12 @@ namespace App\Http\Controllers\Care;
use App\Http\Controllers\Controller;
use App\Http\Controllers\Care\Concerns\ScopesToAccount;
use App\Services\Care\ServiceQueuePresenter;
use App\Services\Queue\QueueClient;
use Illuminate\Http\Client\RequestException;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\View\View;
/**
* Legacy Ladill Queue console routes redirect to the Care patient queue.
*/
class ServiceQueueController extends Controller
{
use ScopesToAccount;
@@ -19,76 +18,20 @@ class ServiceQueueController extends Controller
{
$this->authorizeAbility($request, 'service_queues.console');
// Natural Queue: counters live on role pages (clinical queue, pharmacy, lab, specialties).
return redirect()->route('care.queue.index');
}
public function console(Request $request, string $counterUuid, QueueClient $queue): View|RedirectResponse
public function console(Request $request, string $counterUuid): RedirectResponse
{
$this->authorizeAbility($request, 'service_queues.console');
$organization = $this->organization($request);
$owner = (string) $organization->owner_ref;
if (! $this->integrationEnabled($organization)) {
return redirect()->route('care.settings');
}
try {
$state = $queue->console($owner, $counterUuid);
} catch (RequestException) {
return redirect()->route('care.queue.index')->with('error', 'Counter console unavailable.');
}
return view('care.service-queues.console', [
'state' => $state,
'counterUuid' => $counterUuid,
'organization' => $organization,
]);
return redirect()->route('care.queue.index');
}
public function action(Request $request, string $counterUuid, QueueClient $queue): RedirectResponse
public function action(Request $request, string $counterUuid): RedirectResponse
{
$this->authorizeAbility($request, 'service_queues.console');
$organization = $this->organization($request);
$owner = (string) $organization->owner_ref;
$validated = $request->validate([
'action' => ['required', 'string'],
'queue_uuid' => ['nullable', 'uuid'],
'ticket_uuid' => ['nullable', 'uuid'],
'to_queue_uuid' => ['nullable', 'uuid'],
'reason' => ['nullable', 'string', 'max:500'],
]);
try {
$result = $queue->consoleAction($owner, $counterUuid, $validated);
} catch (RequestException $e) {
$message = $e->response?->json('message')
?: $e->response?->json('error')
?: 'Queue action failed. Try again.';
return back()->with('error', is_string($message) ? $message : 'Queue action failed. Try again.');
}
$success = match ($validated['action']) {
'transfer' => sprintf(
'Handed off %s to %s. Ticket number unchanged.',
(string) ($result['ticket_number'] ?? 'ticket'),
(string) data_get($result, 'queue.name', 'next queue'),
),
'call_next' => ! empty($result['ticket_number'])
? "Called {$result['ticket_number']}."
: 'No tickets waiting in that queue.',
'available' => 'Counter marked available.',
'offline' => 'Counter went offline.',
default => 'Queue updated.',
};
return back()->with('success', $success);
}
protected function integrationEnabled(\App\Models\Organization $organization): bool
{
return (bool) data_get($organization->settings, 'queue_integration_enabled', false);
return redirect()->route('care.queue.index');
}
}
@@ -19,7 +19,6 @@ use App\Services\Care\PlanService;
use App\Services\Care\Workflow\WorkflowTemplateInstaller;
use App\Services\Care\Workflow\WorkflowTemplateRegistry;
use App\Services\Messaging\MessagingCredentialsService;
use App\Services\Queue\QueueClient;
use App\Support\OrganizationBranding;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
@@ -79,7 +78,7 @@ class SettingsController extends Controller
]);
}
public function update(Request $request, QueueClient $queue): RedirectResponse
public function update(Request $request): RedirectResponse
{
$this->authorizeAbility($request, 'settings.manage');
$organization = $this->organization($request);
@@ -130,7 +129,7 @@ class SettingsController extends Controller
if ($wantsQueue && ! $plans->canUseQueueIntegration($organization)) {
return redirect()
->route('care.pro.index')
->with('upsell', 'Ladill Queue integration is part of Care Pro. Upgrade to connect service queues and counters.');
->with('upsell', 'In-app service queues are part of Care Pro. Upgrade to enable ticket numbers and Call next.');
}
if (! $plans->canUseQueueIntegration($organization)) {
$wantsQueue = false;
@@ -144,15 +143,6 @@ class SettingsController extends Controller
$settings[AppointmentPatientNotifier::SETTING_VIDEO_SMS] = $request->boolean('notify_video_scheduled_sms');
$settings[AppointmentPatientNotifier::SETTING_VIDEO_EMAIL] = $request->boolean('notify_video_scheduled_email');
if ($wantsQueue && config('care.queue.driver', 'native') !== 'native' && $queue->configured()) {
$branch = Branch::owned($owner)->where('organization_id', $organization->id)->orderBy('name')->first();
try {
$queue->enable($owner, $organization->name, $branch?->name);
} catch (\Throwable) {
return back()->withInput()->with('error', 'Could not provision Ladill Queue for this account. Ensure Queue API keys are configured and Queue allows Care integration.');
}
}
$logoPath = $organization->logo_path;
if ($request->boolean('remove_logo')) {
@@ -187,8 +177,7 @@ class SettingsController extends Controller
}
// Queue department sync + waiting-ticket backfill — run after the redirect.
$queueReady = config('care.queue.driver', 'native') === 'native' || $queue->configured();
if ($wantsQueue && $queueReady) {
if ($wantsQueue) {
$organizationId = (int) $organization->id;
$backfillTickets = $queueJustEnabled;
dispatch(function () use ($organizationId, $owner, $backfillTickets) {