<?php

namespace Database\Seeders;

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
    {
        // Créer Super Administrateur
        $superAdmin = User::create([
            'name' => 'Super Administrateur',
            'email' => 'admin@hospital.com',
            'password' => Hash::make('password'),
            'email_verified_at' => now(),
        ]);
        $superAdmin->assignRole('Super Administrateur');

        // Créer Administrateur
        $admin = User::create([
            'name' => 'Administrateur',
            'email' => 'admin2@hospital.com',
            'password' => Hash::make('password'),
            'email_verified_at' => now(),
        ]);
        $admin->assignRole('Administrateur');

        // Créer Magasinier
        $magasinier = User::create([
            'name' => 'Magasinier',
            'email' => 'magasinier@hospital.com',
            'password' => Hash::make('password'),
            'email_verified_at' => now(),
        ]);
        $magasinier->assignRole('Magasinier');

        $this->command->info('Utilisateurs créés avec succès !');
        $this->command->info('Super Admin: admin@hospital.com / password');
        $this->command->info('Admin: admin2@hospital.com / password');
        $this->command->info('Magasinier: magasinier@hospital.com / password');
    }
}
