<?php

declare(strict_types=1);

namespace Database\Seeders;

use App\Models\City;
use App\Models\Zone;
use Illuminate\Database\Seeder;

class CityZoneSeeder extends Seeder
{
    public function run(): void
    {
        $djerba = City::query()->firstOrCreate(
            ['name' => 'Djerba', 'country' => 'TN'],
        );

        $zones = ['Houmt Souk', 'Midoun', 'Zone touristique', 'Autre / non listé'];

        foreach ($zones as $name) {
            Zone::query()->firstOrCreate(
                ['city_id' => $djerba->id, 'name' => $name],
            );
        }
    }
}
