Fix display voice prompts requiring browser unlock and failed acks.
Deploy Ladill Queue / deploy (push) Successful in 28s
Deploy Ladill Queue / deploy (push) Successful in 28s
Add tap-to-enable speech overlay, stop marking announcements played on TTS errors, pick voices by locale, and scope pending announcements to the display's queues. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -55,8 +55,8 @@ class DisplayService
|
||||
->where('status', 'completed')
|
||||
->whereDate('issued_at', today())
|
||||
->whereNotNull('called_at')
|
||||
->selectRaw('AVG(TIMESTAMPDIFF(SECOND, issued_at, called_at)) as avg_wait')
|
||||
->value('avg_wait');
|
||||
->get(['issued_at', 'called_at'])
|
||||
->avg(fn (Ticket $t) => $t->called_at->diffInSeconds($t->issued_at));
|
||||
|
||||
return [
|
||||
'screen' => [
|
||||
@@ -71,7 +71,10 @@ class DisplayService
|
||||
'prefix' => $q->prefix,
|
||||
'is_paused' => $q->is_paused,
|
||||
]),
|
||||
'announcements' => app(VoiceAnnouncementService::class)->pendingForBranch((int) $screen->branch_id),
|
||||
'announcements' => app(VoiceAnnouncementService::class)->pendingForBranch(
|
||||
(int) $screen->branch_id,
|
||||
array_map('intval', $screen->service_queue_ids ?? []),
|
||||
),
|
||||
'updated_at' => now()->toIso8601String(),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ namespace App\Services\Qms;
|
||||
use App\Models\Counter;
|
||||
use App\Models\Ticket;
|
||||
use App\Models\VoiceAnnouncement;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class VoiceAnnouncementService
|
||||
{
|
||||
@@ -41,13 +40,17 @@ class VoiceAnnouncementService
|
||||
}
|
||||
|
||||
/**
|
||||
* @param list<int>|null $queueIds
|
||||
* @return list<array<string, mixed>>
|
||||
*/
|
||||
public function pendingForBranch(int $branchId, int $limit = 10): array
|
||||
public function pendingForBranch(int $branchId, ?array $queueIds = null, int $limit = 10): array
|
||||
{
|
||||
return VoiceAnnouncement::query()
|
||||
->where('branch_id', $branchId)
|
||||
->where('status', 'pending')
|
||||
->when($queueIds, function ($query, array $queueIds) {
|
||||
$query->whereHas('ticket', fn ($ticket) => $ticket->whereIn('service_queue_id', $queueIds));
|
||||
})
|
||||
->orderBy('id')
|
||||
->limit($limit)
|
||||
->get()
|
||||
|
||||
Reference in New Issue
Block a user