<?php

namespace Modules\HR\Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Modules\Core\Database\Seeders\Traits\DisableForeignKeys;
use Modules\Core\Enums\StatusEnum;
use Modules\HR\Models\LeaveType;

class LeaveTypeSeeder extends Seeder
{
    use DisableForeignKeys, WithoutModelEvents;
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $this->disableForeignKeys();
        LeaveType::truncate();

        LeaveType::create([
            'name'               => 'Annual Leave',
            'days_per_year'      => 20,
            'is_paid'           => true,
            'is_encashable'     => false,
            'status'             => StatusEnum::ACTIVE,
        ]);

        $this->enableForeignKeys();
    }
}
