<?php

namespace Database\Seeders;

use App\Models\LeaveType;
use Illuminate\Database\Seeder;

class LeaveTypeSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $types = [
            [
                'name' => 'Sick Leave',
                'color' => '#ef4444',
                'icon' => 'Activity',
                'is_paid' => true,
                'default_allowance' => 15,
            ],
            [
                'name' => 'Casual Leave',
                'color' => '#3b82f6',
                'icon' => 'CalendarRange',
                'is_paid' => true,
                'default_allowance' => 10,
            ],
            [
                'name' => 'Non-paid Leave',
                'color' => '#6b7280',
                'icon' => 'Clock',
                'is_paid' => false,
                'default_allowance' => 0,
            ],
        ];

        foreach ($types as $type) {
            \App\Models\LeaveType::updateOrCreate(['name' => $type['name']], $type);
        }
    }
}
