<?php

namespace App\Models\Dialler;

use App\Models\Solicitor\Solicitor;
use App\Models\User\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class AgentStatus extends Model
{
    public $fillable = [
        'agent_id',
        'status',
        'solicitor_id',
        'status_changed_at',
        'last_seen_at',
        'current_communication_id',
    ];

    protected $casts = [
        'status_changed_at' => 'datetime',
        'last_seen_at'      => 'datetime',
    ];

    public function agent(): BelongsTo
    {
        return $this->belongsTo(User::class, 'agent_id');
    }

    public function solicitor(): BelongsTo
    {
        return $this->belongsTo(Solicitor::class);
    }
}
