<?php

namespace Database\Seeders;

use App\Models\Province;
use Illuminate\Database\Seeder;

class ProvinceSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $provinces = [
            ['name' => 'Bengo', 'code' => 'BGO'],
            ['name' => 'Benguela', 'code' => 'BGU'],
            ['name' => 'Bié', 'code' => 'BIE'],
            ['name' => 'Cabinda', 'code' => 'CAB'],
            ['name' => 'Cuando Cubango', 'code' => 'CCU'],
            ['name' => 'Cuanza Norte', 'code' => 'CNO'],
            ['name' => 'Cuanza Sul', 'code' => 'CUS'],
            ['name' => 'Cunene', 'code' => 'CNN'],
            ['name' => 'Huambo', 'code' => 'HUA'],
            ['name' => 'Huíla', 'code' => 'HUI'],
            ['name' => 'Luanda', 'code' => 'LUA'],
            ['name' => 'Lunda Norte', 'code' => 'LNO'],
            ['name' => 'Lunda Sul', 'code' => 'LSU'],
            ['name' => 'Malanje', 'code' => 'MAL'],
            ['name' => 'Moxico', 'code' => 'MOX'],
            ['name' => 'Namibe', 'code' => 'NAM'],
            ['name' => 'Uíge', 'code' => 'UIG'],
            ['name' => 'Zaire', 'code' => 'ZAI'],
        ];

        foreach ($provinces as $province) {
            Province::firstOrCreate(
                ['code' => $province['code']],
                $province
            );
        }
    }
}
