<?php

namespace Database\Seeders;

use App\Models\BatchSizeConfig;
use Illuminate\Database\Seeder;

class BatchSizeConfigSeeder extends Seeder
{
    public function run(): void
    {
        $configs = [
            [
                'name' => '5 Liter Bowl',
                'size_code' => '5L',
                'size_value' => 5.00,
                'size_unit' => 'L',
                'scoops_per_batch' => 50,
                'ingredient_multiplier' => 5.0000,
                'default_expiry_hours' => 48,
                'is_active' => true,
            ],
            [
                'name' => '10 Liter Bowl',
                'size_code' => '10L',
                'size_value' => 10.00,
                'size_unit' => 'L',
                'scoops_per_batch' => 100,
                'ingredient_multiplier' => 10.0000,
                'default_expiry_hours' => 48,
                'is_active' => true,
            ],
            [
                'name' => '2.5 Liter Bowl',
                'size_code' => '2.5L',
                'size_value' => 2.50,
                'size_unit' => 'L',
                'scoops_per_batch' => 25,
                'ingredient_multiplier' => 2.5000,
                'default_expiry_hours' => 24,
                'is_active' => true,
            ],
            [
                'name' => '20 Liter Bowl',
                'size_code' => '20L',
                'size_value' => 20.00,
                'size_unit' => 'L',
                'scoops_per_batch' => 200,
                'ingredient_multiplier' => 20.0000,
                'default_expiry_hours' => 72,
                'is_active' => true,
            ],
        ];

        foreach ($configs as $config) {
            BatchSizeConfig::firstOrCreate(
                ['size_code' => $config['size_code']],
                $config
            );
        }

        $this->command->info('Batch size configurations seeded successfully.');
    }
}
