<?php

namespace App\Models;

use App\Models\Concerns\BelongsToOwner;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class CareVoiceAnnouncement extends Model
{
    use BelongsToOwner;

    protected $table = 'care_voice_announcements';

    protected $fillable = [
        'owner_ref', 'organization_id', 'branch_id', 'ticket_id',
        'locale', 'message', 'voice', 'volume', 'repeat_count', 'status', 'played_at',
    ];

    protected function casts(): array
    {
        return [
            'played_at' => 'datetime',
        ];
    }

    public function ticket(): BelongsTo
    {
        return $this->belongsTo(CareQueueTicket::class, 'ticket_id');
    }
}
