<?php

namespace Database\Seeders;

use App\Models\Department;
use Illuminate\Database\Seeder;
use Illuminate\Support\Str;

class DepartmentSeeder extends Seeder
{
    public function run(): void
    {
        $items = [
            ['name' => 'IT Department',        'color' => '#2563eb'],
            ['name' => 'Volunteer Department', 'color' => '#16a34a'],
            ['name' => 'Accounts Department',  'color' => '#f59e0b'],
            ['name' => 'Myositis Task',        'color' => '#06b6d4'],
            ['name' => 'Madalasa Task',        'color' => '#a855f7'],
            ['name' => 'Gurukool Task',        'color' => '#ef4444'],
        ];

        foreach ($items as $i) {
            Department::updateOrCreate(
                ['slug' => Str::slug($i['name'])],
                ['name' => $i['name'], 'color' => $i['color'], 'is_active' => true]
            );
        }
    }
}
