<?php

use Spatie\LaravelSettings\Migrations\SettingsMigration;

return new class extends SettingsMigration
{
    public function up(): void
    {
        $this->migrator->inGroup('inventory', function (Spatie\LaravelSettings\Migrations\SettingsBlueprint $blueprint): void {
            // Stock Management
            $blueprint->add('low_stock_threshold', 10);
            $blueprint->add('critical_stock_threshold', 3);
            $blueprint->add('enable_auto_reorder', false);
            $blueprint->add('default_reorder_quantity', 50);
            $blueprint->add('default_lead_time_days', 7);

            // Pricing Settings
            $blueprint->add('default_markup_percentage', 30.0);
            $blueprint->add('enable_tiered_pricing', false);
            $blueprint->add('price_tiers', [
                'retail' => 1.0,
                'wholesale' => 0.85,
                'dealer' => 0.75
            ]);
            $blueprint->add('include_labor_in_estimates', true);

            // Supplier Settings
            $blueprint->add('preferred_supplier_count', 3);
            $blueprint->add('require_multiple_quotes', false);
            $blueprint->add('minimum_order_amount', 100.00);

            // Part Categories
            $blueprint->add('part_categories', [
                'Engine Parts',
                'Brake Components',
                'Suspension Parts',
                'Electrical Components',
                'Filters',
                'Fluids',
                'Belts & Hoses',
                'Tires',
                'Batteries',
                'Body Parts'
            ]);

            $blueprint->add('part_conditions', [
                'New',
                'Used',
                'Refurbished',
                'Remanufactured'
            ]);

            // Barcode & Tracking
            $blueprint->add('enable_barcode_scanning', false);
            $blueprint->add('track_part_history', true);
            $blueprint->add('enable_serial_tracking', false);
        });
    }
};
