<?php

namespace Database\Factories;

use App\Models\Supplier;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;

class PurchaseFactory extends Factory
{
    public function definition(): array
    {
        $subtotal = fake()->numberBetween(50000, 5000000);

        return [
            'supplier_id' => Supplier::factory(),
            'created_by_id' => User::factory(),
            'subtotal' => $subtotal,
            'discount' => fake()->numberBetween(0, 500000),
            'shipping_cost' => fake()->numberBetween(0, 200000),
            'total' => $subtotal + fake()->numberBetween(0, 200000) - fake()->numberBetween(0, 500000),
            'notes' => fake()->sentence(),
        ];
    }
}
