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
+1 -1
View File
@@ -102,7 +102,7 @@
<li>Laboratory & pharmacy</li>
<li>Encounter billing</li>
<li>Your own Paystack / Flutterwave / Hubtel</li>
<li>Ladill Queue integration</li>
<li>In-app service queues</li>
<li>Unlimited branches (billed per branch)</li>
</ul>
<div class="mt-6">
@@ -1,145 +0,0 @@
{{-- Compact Ladill Queue panel for role-native pages (not a standalone Service Queues nav). --}}
@php
$panel = $serviceQueuePanel ?? null;
@endphp
@if (! empty($panel['enabled']))
@php
$counterUuid = $panel['counter_uuid'] ?? null;
$state = $panel['state'] ?? null;
$counters = $panel['counters'] ?? [];
$current = $state['current_ticket'] ?? null;
$queues = $state['queues'] ?? [];
$waiting = $state['waiting_by_queue'] ?? [];
$counter = $state['counter'] ?? [];
$stubs = $panel['stubs'] ?? [];
$statusLabel = match ($current['status'] ?? null) {
'called' => 'Called',
'serving' => 'Serving',
'on_hold' => 'On hold',
default => $current['status'] ?? null,
};
@endphp
<section class="rounded-2xl border border-indigo-100 bg-gradient-to-br from-indigo-50/80 via-white to-white shadow-sm">
<div class="flex flex-wrap items-start justify-between gap-3 border-b border-indigo-100 px-5 py-4">
<div>
<p class="text-xs font-semibold uppercase tracking-wider text-indigo-600">Service counter</p>
<h2 class="mt-0.5 text-sm font-semibold text-slate-900">
{{ $counter['name'] ?? 'Ladill Queue' }}
@if (! empty($counter['branch']))
<span class="font-normal text-slate-500">· {{ $counter['branch'] }}</span>
@endif
</h2>
</div>
<div class="flex flex-wrap items-center gap-2">
@if (count($counters) > 1 && $counterUuid)
<form method="GET" class="flex items-center gap-2">
@foreach (request()->except('counter_uuid') as $key => $value)
@if (is_scalar($value))
<input type="hidden" name="{{ $key }}" value="{{ $value }}">
@endif
@endforeach
<select name="counter_uuid" class="rounded-lg border-slate-300 text-xs" onchange="this.form.submit()">
@foreach ($counters as $option)
<option value="{{ $option['uuid'] }}" @selected(($option['uuid'] ?? '') === $counterUuid)>{{ $option['name'] ?? 'Counter' }}</option>
@endforeach
</select>
</form>
@endif
@if ($counterUuid)
<a href="{{ route('care.service-queues.console', $counterUuid) }}" class="text-xs font-medium text-indigo-600 hover:text-indigo-800">Full console</a>
@endif
</div>
</div>
<div class="space-y-4 px-5 py-4">
@if (! empty($panel['error']))
<p class="rounded-lg bg-amber-50 px-3 py-2 text-sm text-amber-900">{{ $panel['error'] }}</p>
@endif
@if ($current && $counterUuid)
<div class="flex flex-wrap items-start justify-between gap-3">
<div>
<p class="text-xs font-medium uppercase tracking-wide text-slate-500">Now serving</p>
<p class="mt-1 text-3xl font-bold tracking-tight text-slate-900">{{ $current['ticket_number'] }}</p>
<p class="mt-1 text-sm text-slate-600">{{ $current['customer_name'] ?? 'Walk-in' }} · {{ $current['queue']['name'] ?? '' }}</p>
</div>
@if ($statusLabel)
<span class="rounded-full bg-indigo-100 px-2.5 py-1 text-xs font-semibold text-indigo-700">{{ $statusLabel }}</span>
@endif
</div>
<div class="flex flex-wrap gap-2">
@foreach ([
'start' => 'Start',
'complete' => 'Complete',
'recall' => 'Recall',
'skip' => 'Skip',
] as $action => $label)
<form method="POST" action="{{ route('care.service-queues.action', $counterUuid) }}">
@csrf
<input type="hidden" name="action" value="{{ $action }}">
<input type="hidden" name="ticket_uuid" value="{{ $current['uuid'] }}">
<button type="submit" class="{{ $action === 'complete' || $action === 'start' ? 'btn-primary' : 'btn-secondary' }} text-xs">{{ $label }}</button>
</form>
@endforeach
</div>
@elseif ($counterUuid)
<p class="text-sm text-slate-600">No active ticket. Call the next patient from a queue below.</p>
@elseif (count($stubs))
<div class="rounded-xl border border-dashed border-slate-200 bg-slate-50 px-4 py-3 text-sm text-slate-600">
<p class="font-medium text-slate-800">Specialty queues ready</p>
<ul class="mt-2 space-y-1 text-xs">
@foreach ($stubs as $stub)
<li>
{{ $stub['name'] ?? 'Queue' }}
@if (! empty($stub['branch_name'])) · {{ $stub['branch_name'] }} @endif
@if (! empty($stub['prefix']))
<span class="font-mono text-slate-500">({{ $stub['prefix'] }})</span>
@endif
@if (! empty($stub['synced']))
<span class="text-emerald-600">· linked</span>
@else
<span class="text-slate-400">· create in Queue admin if missing</span>
@endif
</li>
@endforeach
</ul>
</div>
@elseif (! $panel['error'])
<p class="text-sm text-slate-500">No counters found for this branch. Create counters in Queue admin, then refresh.</p>
@endif
@if ($counterUuid && count($queues))
<div class="grid gap-3 sm:grid-cols-2">
@foreach ($queues as $queue)
@php $waitingTickets = $waiting[$queue['uuid']] ?? []; @endphp
<div class="rounded-xl border border-slate-200 bg-white px-4 py-3">
<div class="flex items-center justify-between gap-2">
<div>
<p class="text-sm font-semibold text-slate-900">{{ $queue['name'] }}</p>
<p class="text-xs text-slate-500">{{ count($waitingTickets) }} waiting</p>
</div>
<form method="POST" action="{{ route('care.service-queues.action', $counterUuid) }}">
@csrf
<input type="hidden" name="action" value="call_next">
<input type="hidden" name="queue_uuid" value="{{ $queue['uuid'] }}">
<button type="submit" class="btn-primary text-xs">Call next</button>
</form>
</div>
@if (count($waitingTickets))
<ul class="mt-2 space-y-1 border-t border-slate-50 pt-2">
@foreach (array_slice($waitingTickets, 0, 3) as $ticket)
<li class="flex justify-between text-xs text-slate-600">
<span class="font-mono font-semibold text-slate-800">{{ $ticket['ticket_number'] }}</span>
<span class="truncate pl-2">{{ $ticket['customer_name'] ?? 'Walk-in' }}</span>
</li>
@endforeach
</ul>
@endif
</div>
@endforeach
</div>
@endif
</div>
</section>
@endif
@@ -1,142 +0,0 @@
@php
$counter = $state['counter'] ?? [];
$current = $state['current_ticket'] ?? null;
$queues = $state['queues'] ?? [];
$waiting = $state['waiting_by_queue'] ?? [];
$transferQueues = collect($state['transfer_queues'] ?? []);
$handoffQueues = $transferQueues
->filter(fn ($q) => ($q['uuid'] ?? '') !== ($current['queue']['uuid'] ?? ''))
->values();
$statusLabel = match ($current['status'] ?? null) {
'called' => 'Called',
'serving' => 'Serving',
'on_hold' => 'On hold',
default => $current['status'] ?? null,
};
@endphp
<x-app-layout title="Console · {{ $counter['name'] ?? 'Counter' }}">
<div class="flex flex-wrap items-start justify-between gap-4">
<div>
<a href="{{ route('care.queue.index') }}" class="text-sm font-medium text-indigo-600 hover:text-indigo-800"> Patient queue</a>
<h1 class="mt-2 text-xl font-semibold text-slate-900">{{ $counter['name'] ?? 'Counter' }}</h1>
<p class="mt-1 text-sm text-slate-500">{{ $counter['branch'] ?? '' }} · Ladill Queue console</p>
</div>
<div class="flex flex-wrap items-center gap-2">
@if (! empty($counter['status']))
<span class="rounded-full bg-slate-100 px-2.5 py-1 text-xs font-medium capitalize text-slate-600">{{ $counter['status'] }}</span>
@endif
<div class="btn-group">
<form method="POST" action="{{ route('care.service-queues.action', $counterUuid) }}">@csrf<input type="hidden" name="action" value="available"><button class="btn-secondary text-sm">Mark available</button></form>
<form method="POST" action="{{ route('care.service-queues.action', $counterUuid) }}">@csrf<input type="hidden" name="action" value="offline"><button class="btn-secondary text-sm">Go offline</button></form>
</div>
</div>
</div>
@if (session('success'))
<p class="mt-4 rounded-lg bg-emerald-50 px-3 py-2 text-sm text-emerald-800">{{ session('success') }}</p>
@endif
@if (session('error'))
<p class="mt-4 rounded-lg bg-rose-50 px-3 py-2 text-sm text-rose-800">{{ session('error') }}</p>
@endif
@if ($current)
<section class="mt-6 overflow-hidden rounded-2xl border border-indigo-200 bg-gradient-to-br from-indigo-50 via-white to-white shadow-sm">
<div class="border-b border-indigo-100 px-6 py-4">
<p class="text-xs font-semibold uppercase tracking-wider text-indigo-600">Current customer</p>
</div>
<div class="px-6 py-5">
<div class="flex flex-wrap items-start justify-between gap-4">
<div>
<p class="text-5xl font-bold tracking-tight text-slate-900">{{ $current['ticket_number'] }}</p>
<p class="mt-2 text-sm text-slate-600">{{ $current['queue']['name'] ?? '' }}</p>
<p class="mt-1 text-base font-medium text-slate-800">{{ $current['customer_name'] ?? 'Walk-in customer' }}</p>
</div>
@if ($statusLabel)
<span class="rounded-full bg-indigo-100 px-2.5 py-1 text-xs font-semibold text-indigo-700">{{ $statusLabel }}</span>
@endif
</div>
<div class="mt-6 grid gap-2 sm:grid-cols-2 lg:grid-cols-3">
@foreach ([
'recall' => ['Recall', 'btn-secondary'],
'start' => ['Start serving', 'btn-primary'],
'hold' => ['Hold', 'btn-secondary'],
'skip' => ['Skip', 'btn-secondary'],
'complete' => ['Complete', 'btn-primary'],
'no_show' => ['No show', 'btn-secondary'],
] as $action => [$label, $btnClass])
<form method="POST" action="{{ route('care.service-queues.action', $counterUuid) }}">
@csrf
<input type="hidden" name="action" value="{{ $action }}">
<input type="hidden" name="ticket_uuid" value="{{ $current['uuid'] }}">
<button type="submit" class="{{ $btnClass }} w-full text-sm">{{ $label }}</button>
</form>
@endforeach
</div>
@if ($handoffQueues->isNotEmpty())
<form method="POST" action="{{ route('care.service-queues.action', $counterUuid) }}" class="mt-4 border-t border-indigo-100 pt-4">
@csrf
<input type="hidden" name="action" value="transfer">
<input type="hidden" name="ticket_uuid" value="{{ $current['uuid'] }}">
<div class="mb-3">
<p class="text-sm font-medium text-slate-800">Hand off to another queue</p>
<p class="mt-1 text-xs text-slate-500">Sends this patient to the next service while keeping ticket <span class="font-mono font-semibold text-slate-700">{{ $current['ticket_number'] }}</span>.</p>
</div>
<div class="flex flex-wrap items-end gap-2">
<div class="min-w-[12rem] flex-1">
<label class="block text-xs font-medium text-slate-500">Next queue</label>
<select name="to_queue_uuid" required class="mt-1 w-full rounded-lg border-slate-300 text-sm">
@foreach ($handoffQueues as $q)
<option value="{{ $q['uuid'] }}">{{ $q['name'] }}@if (! empty($q['prefix'])) ({{ $q['prefix'] }})@endif</option>
@endforeach
</select>
</div>
<div class="min-w-[12rem] flex-1">
<label class="block text-xs font-medium text-slate-500">Reason (optional)</label>
<input type="text" name="reason" placeholder="e.g. Lab tests needed" class="mt-1 w-full rounded-lg border-slate-300 text-sm">
</div>
<button type="submit" class="btn-primary text-sm">Hand off</button>
</div>
</form>
@endif
</div>
</section>
@else
<section class="mt-6 rounded-2xl border border-dashed border-slate-300 bg-slate-50 px-6 py-10 text-center">
<p class="text-sm font-medium text-slate-700">No active customer</p>
<p class="mt-1 text-sm text-slate-500">Call the next waiting ticket from a queue below.</p>
</section>
@endif
<div class="mt-6 grid gap-4 lg:grid-cols-2">
@foreach ($queues as $queue)
@php $waitingTickets = $waiting[$queue['uuid']] ?? []; @endphp
<section class="rounded-2xl border border-slate-200 bg-white shadow-sm">
<div class="flex items-center justify-between border-b border-slate-100 px-5 py-4">
<div>
<h2 class="font-semibold text-slate-900">{{ $queue['name'] }}</h2>
<p class="text-xs text-slate-500">{{ count($waitingTickets) }} waiting</p>
</div>
<form method="POST" action="{{ route('care.service-queues.action', $counterUuid) }}">
@csrf
<input type="hidden" name="action" value="call_next">
<input type="hidden" name="queue_uuid" value="{{ $queue['uuid'] }}">
<button type="submit" class="btn-primary text-sm">Call next</button>
</form>
</div>
<ul class="divide-y divide-slate-50 px-2 py-2">
@forelse ($waitingTickets as $ticket)
<li class="flex items-center justify-between rounded-lg px-3 py-2.5 text-sm hover:bg-slate-50">
<span class="font-mono text-base font-semibold text-slate-900">{{ $ticket['ticket_number'] }}</span>
<span class="text-slate-500">{{ $ticket['customer_name'] ?? 'Walk-in' }}</span>
</li>
@empty
<li class="px-3 py-6 text-center text-sm text-slate-500">Queue is empty</li>
@endforelse
</ul>
</section>
@endforeach
</div>
</x-app-layout>
@@ -1,34 +0,0 @@
<x-app-layout title="Service queues">
<div class="flex flex-wrap items-start justify-between gap-4">
<div>
<h1 class="text-xl font-semibold text-slate-900">Service queues</h1>
<p class="mt-1 text-sm text-slate-500">Powered by Ladill Queue call tickets and manage counters without leaving Care</p>
</div>
<a href="https://queue.ladill.com" target="_blank" class="btn-secondary text-sm">Open Queue admin</a>
</div>
@if (session('error'))
<div class="mt-4 rounded-lg bg-rose-50 px-4 py-3 text-sm text-rose-800">{{ session('error') }}</div>
@endif
<div class="mt-5 grid gap-4 md:grid-cols-2 xl:grid-cols-3">
@forelse ($counters as $counter)
<article class="rounded-2xl border border-slate-200 bg-white p-5 shadow-sm">
<div class="flex items-start justify-between gap-3">
<div>
<h2 class="text-lg font-semibold text-slate-900">{{ $counter['name'] }}</h2>
<p class="mt-1 text-sm text-slate-500">{{ $counter['status'] ?? 'offline' }}</p>
</div>
</div>
<p class="mt-3 text-sm text-slate-600">
Queues: {{ collect($counter['queues'] ?? [])->join(', ') ?: 'None assigned' }}
</p>
<a href="{{ route('care.service-queues.console', $counter['uuid']) }}" class="btn-primary mt-4 inline-block w-full text-center text-sm">Open console</a>
</article>
@empty
<div class="col-span-full rounded-2xl border border-dashed border-slate-300 bg-slate-50 px-6 py-12 text-center text-sm text-slate-600">
No counters found in Ladill Queue. Create counters in Queue admin, then return here.
</div>
@endforelse
</div>
</x-app-layout>
+2 -2
View File
@@ -134,7 +134,7 @@
</label>
</x-settings.card>
<x-settings.card title="Patient journey workflow" description="Move each visit through configured stages and control when it may enter a Ladill Queue service line.">
<x-settings.card title="Patient journey workflow" description="Move each visit through configured stages and control when it may enter a service queue.">
<div class="space-y-4">
<label class="flex items-start gap-3 text-sm">
<input type="checkbox" name="workflow_engine" value="1"
@@ -237,7 +237,7 @@
</div>
</x-settings.card>
<x-settings.card title="Service queues" description="Enable in-app ticket numbers and Call next → Serve → Complete on patient queue, pharmacy, lab, billing, and specialty modules. Requires Care Pro or Enterprise. (Legacy remote Ladill Queue is only used when CARE_QUEUE_DRIVER=remote.)">
<x-settings.card title="Service queues" description="Enable in-app ticket numbers and Call next → Serve → Complete on patient queue, pharmacy, lab, billing, and specialty modules. Requires Care Pro or Enterprise.">
@if (! empty($canUseQueueIntegration))
<label class="flex items-center gap-2 text-sm">
<input type="checkbox" name="queue_integration_enabled" value="1" @checked(data_get($organization->settings, 'queue_integration_enabled'))>
@@ -9,7 +9,7 @@
<x-settings.card title="Upgrade your plan">
<p class="text-sm text-slate-600">
GHS {{ number_format($proPriceMinor / 100, 0) }} / branch / month for Pro
multi-branch locations, laboratory, pharmacy, encounter billing, and Ladill Queue integration.
multi-branch locations, laboratory, pharmacy, encounter billing, and in-app service queues.
</p>
<div class="mt-4 flex flex-wrap items-center gap-3">
<a href="{{ route('care.pro.index') }}" class="btn-primary">View plans</a>