<?php

declare(strict_types=1);

namespace Database\Factories;

use App\Enums\MembershipStatus;
use App\Models\Member;
use App\Models\MemberStatusHistory;
use Illuminate\Database\Eloquent\Factories\Factory;

/**
 * @extends Factory<MemberStatusHistory>
 */
class MemberStatusHistoryFactory extends Factory
{
    public function definition(): array
    {
        return [
            'member_id' => Member::factory(),
            'from_status' => null,
            'to_status' => fake()->randomElement(MembershipStatus::cases()),
            'reason' => fake()->optional(0.4)->sentence(),
            'effective_date' => fake()->dateTimeBetween('-5 years', 'now'),
            'changed_by' => null,
        ];
    }
}
