<?php

namespace App\Modules\HR\Recruitment\Models;

use App\Models\User;
use App\Modules\Admin\Tenancy\Traits\BelongsToTenant;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class RecruitmentReportSavedFilter extends Model
{
    use BelongsToTenant;

    protected $table = 'recruitment_report_saved_filters';

    protected $fillable = [
        'tenant_id',
        'user_id',
        'name',
        'report_type',
        'filters',
        'is_default',
    ];

    protected function casts(): array
    {
        return [
            'filters' => 'array',
            'is_default' => 'boolean',
        ];
    }

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