<?php

namespace Database\Factories;

use App\Enums\OrderStatus;
use App\Models\OrderStatusLog;
use Illuminate\Database\Eloquent\Factories\Factory;

/** @extends Factory<OrderStatusLog> */
class OrderStatusLogFactory extends Factory
{
    protected $model = OrderStatusLog::class;

    public function definition(): array
    {
        $status = $this->faker->randomElement(OrderStatus::cases());

        return [
            'order_reference' => 'XXXXXXXXX',
            'status' => $status->value,
            'note' => $this->faker->optional(0.4)->sentence(),
            'happened_at' => $this->faker->dateTimeBetween('-10 days', 'now'),
        ];
    }
}
