<?php

namespace Database\Factories;

use App\Enums\EarnMemberStatus;
use App\Models\EarnMember;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Facades\Hash;

/** @extends Factory<EarnMember> */
class EarnMemberFactory extends Factory
{
    protected $model = EarnMember::class;

    public function definition(): array
    {
        return [
            'name' => fake()->name(),
            'email' => fake()->unique()->safeEmail(),
            'password' => Hash::make('password'),
            'status' => EarnMemberStatus::Active,
            'email_verified_at' => now(),
        ];
    }

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

    public function unverified(): static
    {
        return $this->state(['email_verified_at' => null]);
    }
}
