<?php

namespace Database\Factories\Pilkades;

use App\Modules\Pilkades\Models\Desa;
use App\Modules\Pilkades\Models\Kecamatan;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;

class DesaFactory extends Factory
{
    protected $model = Desa::class;

    public function definition(): array
    {
        $nama = 'Desa '.fake()->unique()->numerify('#########');

        return [
            'kecamatan_id' => Kecamatan::factory(),
            'nama' => $nama,
            'slug' => Str::slug($nama),
            'status' => 'published',
            'is_active' => true,
        ];
    }

    public function draft(): static
    {
        return $this->state(['status' => 'draft']);
    }

    public function suspended(): static
    {
        return $this->state(['status' => 'suspended']);
    }
}
