Add service-point routing so call-next cannot steal assigned tickets.
Deploy Ladill Queue / deploy (push) Successful in 2m17s
Deploy Ladill Queue / deploy (push) Successful in 2m17s
Counters gain destination/staff metadata; tickets can be pre-assigned to a service point with assigned_only queues for healthcare while shared_pool preserves generic bank/government behavior. Display and announcements expose ticket, staff, and destination clearly for Care and public boards. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -34,25 +34,35 @@ class DisplayService
|
||||
->orderBy('name')
|
||||
->get();
|
||||
|
||||
// One active ticket per destination (counter). Older called/serving
|
||||
// One active ticket per destination (service point / counter). Older called/serving
|
||||
// tickets at the same window must not crowd the public board.
|
||||
$nowServing = Ticket::query()
|
||||
->whereIn('service_queue_id', $queueIds)
|
||||
->whereIn('status', ['called', 'serving'])
|
||||
->with(['counter', 'serviceQueue'])
|
||||
->with(['counter', 'assignedCounter', 'serviceQueue'])
|
||||
->orderByDesc('called_at')
|
||||
->limit(48)
|
||||
->get()
|
||||
->unique(fn (Ticket $t) => $t->counter_id
|
||||
? 'counter:'.$t->counter_id
|
||||
: 'queue:'.$t->service_queue_id)
|
||||
: ($t->assigned_counter_id
|
||||
? 'assigned:'.$t->assigned_counter_id
|
||||
: 'queue:'.$t->service_queue_id))
|
||||
->take(12)
|
||||
->values()
|
||||
->map(fn (Ticket $t) => [
|
||||
'ticket_number' => $t->ticket_number,
|
||||
'queue_name' => $t->serviceQueue?->name,
|
||||
'counter' => $t->counter?->name,
|
||||
])
|
||||
->map(function (Ticket $t) {
|
||||
$point = $t->counter ?? $t->assignedCounter;
|
||||
|
||||
return [
|
||||
'ticket_number' => $t->ticket_number,
|
||||
'queue_name' => $t->serviceQueue?->name,
|
||||
'department' => $t->serviceQueue?->name,
|
||||
'counter' => $point?->displayDestination() ?? $point?->name,
|
||||
'destination' => $point?->displayDestination(),
|
||||
'staff_display_name' => $point?->staff_display_name,
|
||||
'announcement_text' => TicketPresenter::announcementText($t, $point),
|
||||
];
|
||||
})
|
||||
->all();
|
||||
|
||||
$waiting = Ticket::query()
|
||||
|
||||
Reference in New Issue
Block a user