<?php

namespace App\Models\Communication;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;

class PhoneNumberType extends Model
{
    protected $fillable = [
        'name',
        'slug',
        'routing_strategy',
        'default_queue_type',
        'is_client_facing',
        'is_default_outbound',
        'auto_record',
        'allowed_channels',
        'meta',
        'is_active',
    ];

    protected $casts = [
        'is_client_facing'    => 'boolean',
        'is_default_outbound' => 'boolean',
        'auto_record'         => 'boolean',
        'is_active'           => 'boolean',
        'allowed_channels'    => 'array',
        'meta'                => 'array',
    ];

    public function phoneNumbers(): HasMany
    {
        return $this->hasMany(SolicitorPhoneNumber::class, 'phone_number_type_id');
    }
}
