<?php

namespace Database\Factories;

use App\Models\Bottle;
use App\Models\Perfume;
use App\Models\Product;
use App\Models\Restock;
use App\Models\RestockItem;
use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;

class RestockItemFactory extends Factory
{
    protected $model = RestockItem::class;

    public function definition(): array
    {
        $restockableType = fake()->randomElement([Perfume::class, Product::class, Bottle::class]);
        $restockable = $restockableType::factory()->create();

        return [
            'restock_id' => Restock::factory(),
            'user_id' => User::factory(),
            'restockable_type' => $restockableType,
            'restockable_id' => $restockable->id,
            'quantity' => fake()->numberBetween(1, 100),
        ];
    }
}
