Bring Care service-queue console to Queue handoff parity.
Deploy Ladill Care / deploy (push) Successful in 24s
Deploy Ladill Care / deploy (push) Successful in 24s
Staff can hand off patients between queues with ticket number kept, clearer actions, and success feedback. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -81,12 +81,30 @@ class ServiceQueueController extends Controller
|
||||
]);
|
||||
|
||||
try {
|
||||
$queue->consoleAction($owner, $counterUuid, $validated);
|
||||
} catch (RequestException) {
|
||||
return back()->with('error', 'Queue action failed. Try again.');
|
||||
$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.');
|
||||
}
|
||||
|
||||
return back()->with('success', 'Queue updated.');
|
||||
$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
|
||||
|
||||
Reference in New Issue
Block a user