Fix queue handoff so tickets keep their number across services.
Deploy Ladill Queue / deploy (push) Successful in 40s

Handoff now frees the counter, ends the service session, and requeues
the same ticket for the next department — critical for hospital flows
like doctor → lab.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-14 21:22:01 +00:00
co-authored by Cursor
parent d938acf909
commit d2f5ff11d2
12 changed files with 333 additions and 74 deletions
+54
View File
@@ -0,0 +1,54 @@
<?php
namespace App\Models;
use App\Models\Concerns\BelongsToOwner;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class TicketTransfer extends Model
{
use BelongsToOwner;
protected $table = 'queue_ticket_transfers';
public $timestamps = false;
protected $fillable = [
'owner_ref',
'ticket_id',
'from_service_queue_id',
'to_service_queue_id',
'from_counter_id',
'reason',
'transferred_by',
'transferred_at',
];
protected function casts(): array
{
return [
'transferred_at' => 'datetime',
];
}
public function ticket(): BelongsTo
{
return $this->belongsTo(Ticket::class, 'ticket_id');
}
public function fromQueue(): BelongsTo
{
return $this->belongsTo(ServiceQueue::class, 'from_service_queue_id');
}
public function toQueue(): BelongsTo
{
return $this->belongsTo(ServiceQueue::class, 'to_service_queue_id');
}
public function fromCounter(): BelongsTo
{
return $this->belongsTo(Counter::class, 'from_counter_id');
}
}