<?php

namespace Database\Seeders;

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

class UserSeeder extends Seeder
{
    public function run(): void
    {
        $owner = User::factory()->create([
            'name' => 'Owner',
            'username' => 'owner_01',
            'role' => 'owner',
            'email' => 'owner@example.com',
            'mobile' => '+966501234567',
            'email_verified_at' => now(),
            'mobile_verified_at' => now(),
            'password' => Hash::make('0000'),
            'locale' => 'ar',
            'is_active' => true,
        ]);
        $owner->assignRole('owner');

        $admin = User::factory()->create([
            'name' => 'Admin',
            'username' => 'admin_01',
            'role' => 'admin',
            'email' => 'admin@example.com',
            'mobile' => '+966501234560',
            'email_verified_at' => now(),
            'mobile_verified_at' => now(),
            'password' => Hash::make('0000'),
            'locale' => 'ar',
            'is_active' => true,
        ]);
        $admin->assignRole('admin');

        $employee = User::factory()->create([
            'name' => 'Employee',
            'username' => 'employee_01',
            'role' => 'employee',
            'email' => 'user@example.com',
            'mobile' => '+966501234566',
            'email_verified_at' => now(),
            'mobile_verified_at' => now(),
            'password' => Hash::make('0000'),
            'locale' => 'ar',
            'is_active' => true,
        ]);
        $employee->assignRole('employee');

        $coach = User::factory()->create([
            'name' => 'Coach',
            'username' => 'coach_01',
            'role' => 'coach',
            'email' => 'coach@example.com',
            'mobile' => '+966501234566',
            'email_verified_at' => now(),
            'mobile_verified_at' => now(),
            'password' => Hash::make('0000'),
            'locale' => 'ar',
            'is_active' => true,
        ]);
        $coach->assignRole('coach');

        $reception = User::factory()->create([
            'name' => 'Reception',
            'username' => 'reception_01',
            'role' => 'reception',
            'email' => 'reception@example.com',
            'mobile' => '+966501234566',
            'email_verified_at' => now(),
            'mobile_verified_at' => now(),
            'password' => Hash::make('0000'),
            'locale' => 'ar',
            'is_active' => true,
        ]);
        $reception->assignRole('reception');

        User::factory()->count(100)->completeProfile()->create(['email_verified_at' => now()]);

//        User::factory()->count(100)->withPassword('0000')->create(['email_verified_at' => now()]);

//        User::factory()->count(50)->inactive()->withPassword('0000')->create(['email_verified_at' => now()]);

    }
}
