<?php

declare(strict_types=1);

namespace Database\Factories;

use App\Enums\BonusType;
use App\Models\Bonus;
use App\Models\Employee;
use Illuminate\Database\Eloquent\Factories\Factory;

/**
 * @extends Factory<Bonus>
 */
class BonusFactory extends Factory
{
    protected $model = Bonus::class;

    /**
     * @return array<string, mixed>
     */
    public function definition(): array
    {
        return [
            'employee_id' => Employee::factory(),
            'bonus_date' => fake()->dateTimeBetween('-1 year', 'now'),
            'bonus_type' => fake()->randomElement(BonusType::cases()),
            'amount' => fake()->randomFloat(2, 100, 5000),
            'reason' => fake()->optional()->sentence(),
        ];
    }
}
