<?php

namespace Database\Seeders;

use App\Models\Bottle;
use App\Models\Formula;
use Illuminate\Database\Seeder;

class FormulaSeeder extends Seeder
{
    public function run(): void
    {
        $ratios = [
            'Premium' => 2 / 3,
            'Super Premium' => 3 / 4,
            'Murni' => 1.0,
        ];

        $sizes = Bottle::distinct()->pluck('size');

        foreach ($sizes as $size) {
            foreach ($ratios as $quality => $ratio) {
                Formula::create([
                    'quality' => $quality,
                    'size' => $size,
                    'volume' => round($size * $ratio),
                ]);
            }
        }
    }
}
