<?php

namespace Database\Seeders;

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

class AdminUserSeeder extends Seeder
{
    public function run(): void
    {
        // Create Admin User
        $admin = User::firstOrCreate(
            ['email' => 'admin@example.com'],
            [
                'name' => 'Admin User',
                'password' => Hash::make('admin123'),
                'role' => 'admin',
                'email_verified_at' => now(),
            ]
        );

        $this->command->info('Admin user created:');
        $this->command->info('Email: admin@example.com');
        $this->command->info('Password: admin123');

        // Create Sub-Admin User
        $subAdmin = User::firstOrCreate(
            ['email' => 'subadmin@example.com'],
            [
                'name' => 'Sub Admin User',
                'password' => Hash::make('subadmin123'),
                'role' => 'sub_admin',
                'email_verified_at' => now(),
            ]
        );

        $this->command->info('Sub-admin user created:');
        $this->command->info('Email: subadmin@example.com');
        $this->command->info('Password: subadmin123');
    }
}
