<?php

use Spatie\LaravelSettings\Migrations\SettingsMigration;

return new class extends SettingsMigration
{
    public function up(): void
    {
        $this->migrator->inGroup('service', function (Spatie\LaravelSettings\Migrations\SettingsBlueprint $blueprint): void {
            // Default Labor Rates
            $blueprint->add('standard_labor_rate', 95.00);
            $blueprint->add('overtime_labor_rate', 142.50);
            $blueprint->add('weekend_labor_rate', 120.00);
            $blueprint->add('holiday_labor_rate', 150.00);

            // Service Intervals & Reminders
            $blueprint->add('oil_change_interval', 5000);
            $blueprint->add('tire_rotation_interval', 6000);
            $blueprint->add('brake_inspection_interval', 12000);
            $blueprint->add('general_inspection_interval', 12000);
            $blueprint->add('enable_service_reminders', true);
            $blueprint->add('reminder_advance_days', 14);

            // Warranty Settings
            $blueprint->add('default_parts_warranty_days', 365);
            $blueprint->add('default_labor_warranty_days', 90);
            $blueprint->add('enable_extended_warranty', true);

            // Quality Control
            $blueprint->add('require_quality_inspection', true);
            $blueprint->add('require_technician_signature', true);
            $blueprint->add('require_customer_signature', true);
            $blueprint->add('enable_photo_documentation', true);

            // Service Categories
            $blueprint->add('service_categories', [
                'Oil Change',
                'Brake Service',
                'Tire Service',
                'Engine Repair',
                'Transmission Service',
                'Electrical Repair',
                'Air Conditioning',
                'Suspension Repair',
                'Diagnostic',
                'Preventive Maintenance',
                'Annual Inspection',
                'Emergency Repair'
            ]);

            $blueprint->add('priority_levels', [
                'Low' => ['color' => 'green', 'description' => 'Non-urgent service'],
                'Normal' => ['color' => 'blue', 'description' => 'Standard priority'],
                'High' => ['color' => 'yellow', 'description' => 'Important service'],
                'Critical' => ['color' => 'red', 'description' => 'Safety-critical repair'],
                'Emergency' => ['color' => 'red', 'description' => 'Immediate attention required']
            ]);
        });
    }
};
