<?php

namespace Database\Seeders;

use App\Enums\RoleEnum;
use App\Models\User;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Hash;

class UserSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        // developer
        $developer = User::create([
            'name' => 'Yoga Pangestu',
            'email' => 'info.pangestuyoga@gmail.com',
            'username' => 'pangestu',
            'password' => Hash::make(config('auth.password_default')),
        ]);
        $developer->assignRole(RoleEnum::DEVELOPER);

        // owner
        $owner = User::create([
            'name' => 'Owner',
            'email' => 'owner@gmail.com',
            'username' => 'owner',
            'password' => Hash::make(config('auth.password_default')),
        ]);
        $owner->assignRole(RoleEnum::OWNER);

        // admin
        $administrator = User::create([
            'name' => 'Administrator',
            'email' => 'admin@gmail.com',
            'username' => 'admin',
            'password' => Hash::make(config('auth.password_default')),
            'base_salary' => 2000000,
        ]);
        $administrator->assignRole(RoleEnum::ADMINISTRATOR);
    }
}
