<?php

namespace Database\Factories;

use App\Enums\CuttingStatus;
use App\Models\Cutting;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;

/**
 * @extends Factory<Cutting>
 */
class CuttingFactory extends Factory
{
    public function definition(): array
    {
        return [
            'status' => CuttingStatus::IN_PROGRESS->value,
            'description' => fake()->optional()->sentence(3),
            'created_by_id' => User::factory(),
        ];
    }

    public function completed(): static
    {
        return $this->state(fn (array $attributes) => [
            'status' => CuttingStatus::COMPLETED->value,
        ]);
    }

    public function verified(): static
    {
        return $this->state(fn (array $attributes) => [
            'status' => CuttingStatus::VERIFIED->value,
        ]);
    }
}
