<?php

namespace Database\Seeders;

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

class CustomerSeeder extends Seeder
{
    public function run(): void
    {
        // ======================
        // ZONA BARAT (SUMATERA - MEDAN)
        // ======================
        $user1 = User::create([
            'name' => 'Budi Santoso',
            'email' => 'budi@gmail.com',
            'password' => Hash::make('12345678'),
            'role' => 'User',
        ]);

        Address::create([
            'user_id' => $user1->id,
            'province_code' => '12', // Sumatera Utara
            'city_code' => '1271', // Medan
            'district_code' => '1271010',
            'village_code' => '1271010001',
            'street' => 'Jl. Gatot Subroto',
            'address_detail' => 'No 10, Rumah warna putih',
            'latitude' => 3.5952,
            'longitude' => 98.6722,
            'recipient_name' => 'Budi Santoso',
            'phone' => '081234567890',
            
        ]);

        // ======================
        // ZONA TENGAH (JAWA - BANDUNG)
        // ======================
        $user2 = User::create([
            'name' => 'Mutiara Ramadhani',
            'email' => 'mutiara.ramadhani@smk.belajar.id',
            'password' => Hash::make('12345678'),
            'role' => 'User',
        ]);

        Address::create([
            'user_id' => $user2->id,
            'province_code' => '32', // Jawa Barat
            'city_code' => '3273', // Bandung
            'district_code' => '3273010',
            'village_code' => '3273010001',
            'street' => 'Jl. Asia Afrika',
            'address_detail' => 'No 20, Dekat alun-alun',
            'latitude' => -6.9175,
            'longitude' => 107.6191,
            'recipient_name' => 'Siti Aminah',
            'phone' => '082233445566',
            
        ]);

        // ======================
        // ZONA TIMUR (SULAWESI - MAKASSAR)
        // ======================
        $user3 = User::create([
            'name' => 'Andi Pratama',
            'email' => 'andi@gmail.com',
            'password' => Hash::make('12345678'),
            'role' => 'User',
        ]);

        Address::create([
            'user_id' => $user3->id,
            'province_code' => '73', // Sulawesi Selatan
            'city_code' => '7371', // Makassar
            'district_code' => '7371010',
            'village_code' => '7371010001',
            'street' => 'Jl. Pettarani',
            'address_detail' => 'No 5, Dekat kampus',
            'latitude' => -5.1477,
            'longitude' => 119.4327,
            'recipient_name' => 'Andi Pratama',
            'phone' => '083344556677',
        ]);
    }
}