<?php

namespace App\Models;

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

class DailyMetric extends Model
{
    use HasFactory, BelongsToTenant;

    protected $fillable = [
        'queue_id', 'date', 
        'received_count', 'answered_count', 'abandoned_count', 
        'sla_percentage', 'avg_wait_time', 'avg_talk_time', 
        'max_wait_time', 'transferred_count',
        'tenant_id',
    ];

    protected $casts = [
        'date' => 'date',
        'sla_percentage' => 'float',
    ];

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