Files
ladill-queue/app/Models/TicketTransfer.php
T
isaaccladandCursor d2f5ff11d2
Deploy Ladill Queue / deploy (push) Successful in 40s
Fix queue handoff so tickets keep their number across services.
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>
2026-07-14 21:22:01 +00:00

55 lines
1.2 KiB
PHP

<?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');
}
}