<?php

namespace Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;

class RoleSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $roles = [
            ['name' => 'Superadmin', 'slug' => 'superadmin', 'description' => 'Super Administrator dengan akses penuh ke sistem'],
            ['name' => 'Admin Dinas', 'slug' => 'admin_dinas', 'description' => 'Administrator tingkat Dinas Pendidikan'],
            ['name' => 'Admin KCD', 'slug' => 'admin_kcd', 'description' => 'Administrator tingkat Kantor Cabang Dinas'],
            ['name' => 'Pengawas', 'slug' => 'pengawas', 'description' => 'Pengawas Sekolah'],
            ['name' => 'Admin Sekolah', 'slug' => 'admin_sekolah', 'description' => 'Administrator Sekolah'],
            ['name' => 'Guru', 'slug' => 'guru', 'description' => 'Guru/Tenaga Pendidik'],
        ];

        foreach ($roles as $role) {
            DB::table('roles')->insert([
                'name' => $role['name'],
                'slug' => $role['slug'],
                'description' => $role['description'],
                'created_at' => now(),
                'updated_at' => now(),
            ]);
        }
    }
}
