<?php

namespace Database\Seeders;

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

class DriverSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        // إنشاء سائقين وهميين للاختبار
        $drivers = [
            [
                'name' => 'أحمد محمد',
                'phone' => '+964780123456',
                'email' => 'ahmed.driver@taxi.com',
                'password' => Hash::make('123456'),
                'user_type' => 'driver',
                'status' => 'active',
                'latitude' => 33.3152,
                'longitude' => 44.3661,
            ],
            [
                'name' => 'محمد علي',
                'phone' => '+964780123457',
                'email' => 'mohammed.driver@taxi.com',
                'password' => Hash::make('123456'),
                'user_type' => 'driver',
                'status' => 'active',
                'latitude' => 33.3200,
                'longitude' => 44.3700,
            ],
            [
                'name' => 'علي حسن',
                'phone' => '+964780123458',
                'email' => 'ali.driver@taxi.com',
                'password' => Hash::make('123456'),
                'user_type' => 'driver',
                'status' => 'active',
                'latitude' => 33.3100,
                'longitude' => 44.3600,
            ],
            [
                'name' => 'حسن محمود',
                'phone' => '+964780123459',
                'email' => 'hassan.driver@taxi.com',
                'password' => Hash::make('123456'),
                'user_type' => 'driver',
                'status' => 'active',
                'latitude' => 33.3250,
                'longitude' => 44.3750,
            ],
            [
                'name' => 'محمود أحمد',
                'phone' => '+964780123460',
                'email' => 'mahmoud.driver@taxi.com',
                'password' => Hash::make('123456'),
                'user_type' => 'driver',
                'status' => 'active',
                'latitude' => 33.3050,
                'longitude' => 44.3550,
            ],
        ];

        foreach ($drivers as $driverData) {
            User::create($driverData);
        }

        $this->command->info('تم إنشاء ' . count($drivers) . ' سائق بنجاح');
    }
}