<?php

namespace Database\Seeders;

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

class DepartmentSeeder extends Seeder
{
    public function run(): void
    {
        $departments = [
            ['name' => 'Teknologi Informasi', 'code' => 'IT', 'description' => 'Divisi Rekayasa Perangkat Lunak dan Infrastruktur'],
            ['name' => 'Human Resources', 'code' => 'HR', 'description' => 'Divisi Manajemen Sumber Daya Manusia'],
            ['name' => 'Keuangan & Akuntansi', 'code' => 'FIN', 'description' => 'Divisi Pengelolaan Finansial dan Pajak'],
            ['name' => 'Pemasaran & Penjualan', 'code' => 'MKT', 'description' => 'Divisi Marketing, Sales, dan Brand Awareness'],
            ['name' => 'Operasional', 'code' => 'OPS', 'description' => 'Divisi Manajemen Operasional Harian'],
        ];

        foreach ($departments as $dept) {
            Department::firstOrCreate(['name' => $dept['name']], $dept);
        }
    }
}
