<?php

namespace App\Models;

use App\Traits\BelongsToTenant;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class WaitingList extends Model
{
    use HasFactory, BelongsToTenant;

    // Define explicitamente o nome da tabela se não for o plural padrão do inglês
    protected $table = 'waiting_list';

    protected $fillable = [
        'tenant_id',
        'queue_id',
        'caller_name',
        'caller_number',
        'entered_at',
        'attempt_count'
    ];

    protected $casts = [
        'entered_at' => 'datetime',
    ];

    public function queue()
    {
        return $this->belongsTo(Queue::class);
    }
}
