<?php

namespace Database\Factories;

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

class StockMutationFactory extends Factory
{
    public function definition(): array
    {
        $stockBefore = fake()->numberBetween(0, 1000);
        $quantity = fake()->numberBetween(-100, 100);

        return [
            'stockable_type' => fake()->word(),
            'stockable_id' => 1,
            'type' => fake()->randomElement(['in', 'out', 'adjustment']),
            'quantity' => $quantity,
            'stock_before' => $stockBefore,
            'stock_after' => $stockBefore + $quantity,
            'stock_quality' => fake()->randomElement(['good', 'reject', 'retail']),
            'description' => fake()->sentence(),
            'user_id' => User::factory(),
        ];
    }
}
