<?php

namespace Database\Seeders;

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


class DatabaseSeeder extends Seeder
{
    /**
     * Seed the application's database.
     */
    public function run(): void
    {
        $this->call(RolePermissionSeeder::class);

        // Create default users
        $admin = User::firstOrCreate(
            ['email' => 'admin@matergohotel.bi'],
            ['name' => 'Admin', 'password' => Hash::make('password')]
        );
        $admin->assignRole('admin');

        $manager = User::firstOrCreate(
            ['email' => 'manager@matergohotel.bi'],
            ['name' => 'Hotel Manager', 'password' => Hash::make('password')]
        );
        $manager->assignRole('manager');

        $receptionist = User::firstOrCreate(
            ['email' => 'reception@matergohotel.bi'],
            ['name' => 'Receptionist', 'password' => Hash::make('password')]
        );
        $receptionist->assignRole('receptionist');

        // Seed room data
        $this->call(RoomSeeder::class);
    }
}
