<?php

namespace Database\Factories;

use App\Models\Invoice;
use App\Models\Order;
use Illuminate\Database\Eloquent\Factories\Factory;

class InvoiceFactory extends Factory
{
    public function definition(): array
    {
        return [
            'order_id' => Order::inRandomOrder()->first()->id ?? Order::factory(),
            'status' => fake()->randomElement(['generated', 'sent']),
            'pdf_path' => 'invoices/invoice-' . fake()->uuid() . '.pdf',
        ];
    }
}