Use count-aware ticket grids and complete service destinations so active calls stay legible without clipping across TV and mobile layouts. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -7,6 +7,7 @@ use App\Models\Counter;
|
||||
use App\Models\DisplayScreen;
|
||||
use App\Models\Organization;
|
||||
use App\Models\ServiceQueue;
|
||||
use App\Models\Ticket;
|
||||
use App\Models\User;
|
||||
use App\Models\VoiceAnnouncement;
|
||||
use App\Services\Qms\OrganizationResolver;
|
||||
@@ -83,7 +84,65 @@ class DisplayVoiceTest extends TestCase
|
||||
$response->assertOk()
|
||||
->assertJsonPath('announcements.0.message', 'Ticket A001, please proceed to Counter 1.')
|
||||
->assertJsonPath('waiting_count', 0)
|
||||
->assertJsonPath('now_serving.0.ticket_number', 'A001');
|
||||
->assertJsonPath('now_serving.0.ticket_number', 'A001')
|
||||
->assertJsonPath('now_serving.0.queue_name', 'Reception')
|
||||
->assertJsonPath('now_serving.0.counter', 'Counter 1');
|
||||
|
||||
$this->get(route('qms.display.public', $screen->access_token))
|
||||
->assertOk()
|
||||
->assertSee('qms-display__tickets', false)
|
||||
->assertSee('data-ticket-count', false)
|
||||
->assertSee('qms-display__ticket--newest', false)
|
||||
->assertSee('Please proceed to')
|
||||
->assertSee('A001')
|
||||
->assertSee('Reception')
|
||||
->assertSee('Counter 1');
|
||||
}
|
||||
|
||||
public function test_display_returns_enough_active_tickets_for_a_busy_grid(): void
|
||||
{
|
||||
[$user, , $branch, $queue] = $this->setUpOrg();
|
||||
|
||||
$counter = Counter::create([
|
||||
'owner_ref' => $user->public_id,
|
||||
'organization_id' => $queue->organization_id,
|
||||
'branch_id' => $queue->branch_id,
|
||||
'name' => 'Room 12',
|
||||
'status' => 'available',
|
||||
'is_active' => true,
|
||||
]);
|
||||
|
||||
$screen = DisplayScreen::create([
|
||||
'owner_ref' => $user->public_id,
|
||||
'organization_id' => $queue->organization_id,
|
||||
'branch_id' => $branch->id,
|
||||
'name' => 'Busy Lobby',
|
||||
'layout' => 'standard',
|
||||
'service_queue_ids' => [$queue->id],
|
||||
'is_active' => true,
|
||||
]);
|
||||
|
||||
foreach (range(1, 7) as $number) {
|
||||
Ticket::create([
|
||||
'owner_ref' => $user->public_id,
|
||||
'organization_id' => $queue->organization_id,
|
||||
'branch_id' => $branch->id,
|
||||
'service_queue_id' => $queue->id,
|
||||
'counter_id' => $counter->id,
|
||||
'ticket_number' => sprintf('A%03d', $number),
|
||||
'status' => 'called',
|
||||
'issued_at' => now()->subMinutes(20 - $number),
|
||||
'called_at' => now()->subMinutes(7 - $number),
|
||||
]);
|
||||
}
|
||||
|
||||
$this->getJson(route('qms.display.data', $screen->access_token))
|
||||
->assertOk()
|
||||
->assertJsonCount(7, 'now_serving')
|
||||
->assertJsonPath('now_serving.0.ticket_number', 'A007')
|
||||
->assertJsonPath('now_serving.0.queue_name', 'Reception')
|
||||
->assertJsonPath('now_serving.0.counter', 'Room 12')
|
||||
->assertJsonPath('now_serving.6.ticket_number', 'A001');
|
||||
}
|
||||
|
||||
public function test_display_falls_back_to_branch_queues_when_none_assigned(): void
|
||||
|
||||
Reference in New Issue
Block a user