<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Relations\HasMany;

class LeaveType extends BaseModel
{
    protected $fillable = [
        'name',
        'color',
        'icon',
        'is_paid',
        'default_allowance',
        'status',
    ];

    protected function casts(): array
    {
        return [
            'is_paid' => 'boolean',
            'status' => 'boolean',
            'default_allowance' => 'integer',
        ];
    }

    public function leaveRequests(): HasMany
    {
        return $this->hasMany(LeaveRequest::class);
    }

    public function leaveBalances(): HasMany
    {
        return $this->hasMany(LeaveBalance::class);
    }
}
