Add service-point routing so call-next cannot steal assigned tickets.
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:
isaacclad
2026-07-17 17:21:56 +00:00
co-authored by Cursor
parent 2d1f8c1eff
commit 0854b431bc
17 changed files with 753 additions and 42 deletions
@@ -0,0 +1,55 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
/**
* Service-point routing for departments that need explicit assignment
* (e.g. doctor rooms) while preserving shared-pool call-next for generic queues.
*
* Counter service point (room / desk / window). Destination + staff are
* display/assignment metadata; tickets may be pre-assigned via assigned_counter_id.
*/
return new class extends Migration
{
public function up(): void
{
Schema::table('queue_counters', function (Blueprint $table) {
$table->string('destination')->nullable()->after('code');
$table->string('staff_ref')->nullable()->index()->after('destination');
$table->string('staff_display_name')->nullable()->after('staff_ref');
});
Schema::table('queue_tickets', function (Blueprint $table) {
$table->foreignId('assigned_counter_id')
->nullable()
->after('counter_id')
->constrained('queue_counters')
->nullOnDelete();
$table->index(['service_queue_id', 'status', 'assigned_counter_id'], 'queue_tickets_waiting_assignment_idx');
});
Schema::table('queue_departments', function (Blueprint $table) {
$table->string('external_key')->nullable()->after('type');
$table->index(['owner_ref', 'external_key']);
});
}
public function down(): void
{
Schema::table('queue_tickets', function (Blueprint $table) {
$table->dropIndex('queue_tickets_waiting_assignment_idx');
$table->dropConstrainedForeignId('assigned_counter_id');
});
Schema::table('queue_counters', function (Blueprint $table) {
$table->dropColumn(['destination', 'staff_ref', 'staff_display_name']);
});
Schema::table('queue_departments', function (Blueprint $table) {
$table->dropIndex(['owner_ref', 'external_key']);
$table->dropColumn('external_key');
});
}
};