<?php

declare(strict_types=1);

namespace Database\Factories;

use App\Models\BlockedDate;
use App\Models\Property;
use Illuminate\Database\Eloquent\Factories\Factory;

/**
 * @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\BlockedDate>
 */
final class BlockedDateFactory extends Factory
{
    protected $model = BlockedDate::class;

    /**
     * Define the model's default state.
     *
     * @return array<string, mixed>
     */
    public function definition(): array
    {
        $startDate = fake()->dateTimeBetween('now', '+6 months');
        $endDate = fake()->dateTimeBetween($startDate, $startDate->format('Y-m-d').' +14 days');

        return [
            'property_id' => Property::factory(),
            'start_date' => $startDate,
            'end_date' => $endDate,
            'reason' => fake()->randomElement(['maintenance', 'personal', 'other']),
            'notes' => fake()->optional(0.6)->sentence(),
        ];
    }
}
