<?php

namespace Functional\Streaks\Database\Factories;

use Functional\Streaks\Enums\StreakDaySource;
use Functional\Streaks\Models\StreakDay;
use Functional\Users\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;

/**
 * @extends Factory<StreakDay>
 */
class StreakDayFactory extends Factory
{
    protected $model = StreakDay::class;

    /**
     * Define the model's default state.
     *
     * @return array<string, mixed>
     */
    public function definition(): array
    {
        return [
            'user_id' => User::factory(),
            'date' => fake()->unique()->dateTimeBetween('-60 days', 'now')->format('Y-m-d'),
            'source' => fake()->randomElement(StreakDaySource::cases()),
            'workout_session_id' => null,
        ];
    }
}
