<?php

namespace Database\Seeders;

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

class DatabaseSeeder extends Seeder
{
    /**
     * Seed the application's database.
     */
    public function run(): void
    {
        // Insert user types
        DB::table('roles')->insert([
            ['nama_role' => 'superadmin', 'created_at' => now(), 'updated_at' => now()],
            ['nama_role' => 'admin', 'created_at' => now(), 'updated_at' => now()],
            ['nama_role' => 'penyewa', 'created_at' => now(), 'updated_at' => now()],
        ]);
        
        DB::table('rekenings')->insert([
            ['bank_name' => 'BCA', 'atas_nama' => 'MidHouse Regency', 'norek' => '12312333', 'created_at' => now(), 'updated_at' => now()],
            ['bank_name' => 'BNI', 'atas_nama' => 'MidHouse Regency', 'norek' => '12312333', 'created_at' => now(), 'updated_at' => now()],
            ['bank_name' => 'BRI', 'atas_nama' => 'MidHouse Regency', 'norek' => '12312333', 'created_at' => now(), 'updated_at' => now()],
        ]);
        
        DB::table('categories')->insert([
            ['cate_name' => 'kost', 'created_at' => now(), 'updated_at' => now()],
            ['cate_name' => 'kontrakan', 'created_at' => now(), 'updated_at' => now()],
        ]);
        
        DB::table('facilities')->insert([
            ['facility_name' => 'AC', 'created_at' => now(), 'updated_at' => now()],
            ['facility_name' => 'KM Dalam', 'created_at' => now(), 'updated_at' => now()],
            ['facility_name' => 'admin', 'created_at' => now(), 'updated_at' => now()],
            ['facility_name' => 'penyewa', 'created_at' => now(), 'updated_at' => now()],
        ]);

        // Create admin user
        DB::table('users')->insert([
            'name' => 'shin ryujin',
            'email' => 'rahmatt.dev@gmail.com',    
            'password' => Hash::make('password'),
            'id_role' => 2,
            'created_at' => now(),
            'updated_at' => now()
        ]);
        DB::table('users')->insert([
            'name' => 'shin haeri',
            'email' => 'ken@gmail.com',    
            'password' => Hash::make('password'),
            'id_role' => 1,
            'created_at' => now(),
            'updated_at' => now()
        ]);
        
    }
}
