Fix display board to one ticket per counter
Deploy Ladill Queue / deploy (push) Successful in 1m16s

Filter now-serving to the latest called/serving ticket per destination so historical calls no longer crowd the public board, and scale ticket cards so numbers no longer clip destination text.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-17 15:51:03 +00:00
co-authored by Cursor
parent 9e52ddd1e7
commit 01792b38e7
4 changed files with 91 additions and 51 deletions
+8 -2
View File
@@ -34,19 +34,25 @@ class DisplayService
->orderBy('name')
->get();
// One active ticket per destination (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'])
->orderByDesc('called_at')
->limit(12)
->limit(48)
->get()
->unique(fn (Ticket $t) => $t->counter_id
? 'counter:'.$t->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,
])
->values()
->all();
$waiting = Ticket::query()