<?php

namespace App\Database\Seeds;

use CodeIgniter\Database\Seeder;

class UserSeeder extends Seeder
{
    public function run()
    {
        // Pastikan Role 'Super Admin' memiliki ID 1 (berdasarkan RolesSeeder)
        $data = [
            'role_id'       => 1, 
            'username'      => 'superadmin',
            'email'         => 'admin@siakad.local',
            'password_hash' => password_hash('password123', PASSWORD_BCRYPT),
            'is_active'     => 1,
            'created_at'    => date('Y-m-d H:i:s'),
            'updated_at'    => date('Y-m-d H:i:s'),
        ];

        $this->db->table('users')->insert($data);
    }
}
