<?php

namespace Database\Factories;

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

class RetailStockHistoryFactory extends Factory
{
    public function definition(): array
    {
        $stockBefore = fake()->numberBetween(0, 500);
        $retailBefore = fake()->numberBetween(0, 200);
        $quantity = fake()->numberBetween(1, 100);

        return [
            'product_variant_id' => ProductVariant::factory(),
            'user_id' => User::factory(),
            'quantity' => $quantity,
            'stock_before' => $stockBefore,
            'retail_stock_before' => $retailBefore,
            'stock_after' => $stockBefore - $quantity,
            'retail_stock_after' => $retailBefore + $quantity,
            'notes' => fake()->sentence(),
        ];
    }
}
