<?php

namespace Database\Factories;

use App\Models\Cutting;
use App\Models\CuttingResult;
use App\Models\ProductVariant;
use Illuminate\Database\Eloquent\Factories\Factory;

/**
 * @extends Factory<CuttingResult>
 */
class CuttingResultFactory extends Factory
{
    public function definition(): array
    {
        $cuttingResult = fake()->numberBetween(10, 200);
        $originalOutsideSample = fake()->numberBetween(0, (int) ($cuttingResult * 0.1));

        return [
            'cutting_id' => Cutting::factory(),
            'product_variant_id' => ProductVariant::factory(),
            'cutting_result' => $cuttingResult,
            'sample' => $cuttingResult - $originalOutsideSample,
            'original_outside_sample' => $originalOutsideSample,
        ];
    }
}
