<?php

namespace App\Modules\HR\Core\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use App\Modules\PLATFORM\Settings\Models\Branch;
use App\Modules\PLATFORM\Settings\Models\BranchScoped;
use App\Modules\PLATFORM\Settings\Models\Country;

class IdentificationType extends Model
{
    use HasFactory;
    use BranchScoped;
    protected $table = 'identification_types';

    protected $fillable = [
        'branch_id',
        'code',
        'name',
        'country_id',
        'expiry_required',
        'status',
    ];

    protected $casts = [
        'expiry_required' => 'boolean',
        'status'          => 'boolean',
    ];

    /* ================= Relationships ================= */

    public function branch()
    {
        return $this->belongsTo(Branch::class);
    }

    public function country()
    {
        return $this->belongsTo(Country::class);
    }
}
