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>
55 lines
1.2 KiB
PHP
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');
|
|
}
|
|
}
|