<?php
namespace Database\Factories;

use App\Models\Store;
use App\Models\StoreHour;
use Illuminate\Database\Eloquent\Factories\Factory;

class StoreHourFactory extends Factory
{
    protected $model = StoreHour::class;

    public function definition(): array
    {
        return [
            'store_id' => Store::factory(),
            'day_of_week' => fake()->numberBetween(0, 6),
            'is_closed' => false,
            'opens_at' => '08:00:00',
            'closes_at' => '21:00:00',
        ];
    }

    public function closed(): static
    {
        return $this->state(fn(array $attr) => [
            'is_closed' => true,
            'opens_at' => null,
            'closes_at' => null,
        ]);
    }
}
