<?php

use Spatie\LaravelSettings\Migrations\SettingsMigration;

return new class extends SettingsMigration
{
    public function up(): void
    {
        $this->migrator->inGroup('notifications', function (Spatie\LaravelSettings\Migrations\SettingsBlueprint $blueprint): void {
            // Email Settings
            $blueprint->add('from_email', 'noreply@safetrack-auto.com');
            $blueprint->add('from_name', 'SafeTrack Auto Repair');
            $blueprint->add('enable_customer_notifications', true);
            $blueprint->add('enable_technician_notifications', true);
            $blueprint->add('enable_manager_notifications', true);

            // SMS Settings
            $blueprint->add('enable_sms', false);
            $blueprint->add('sms_provider', null);
            $blueprint->add('sms_api_key', null);
            $blueprint->add('sms_from_number', null);

            // Customer Notification Preferences
            $blueprint->add('customer_notification_types', [
                'appointment_reminder' => true,
                'service_complete' => true,
                'estimate_ready' => true,
                'vehicle_ready' => true,
                'payment_reminder' => true,
                'service_due' => true
            ]);

            $blueprint->add('notification_timing', [
                'appointment_reminder_hours' => 24,
                'service_due_days' => 30
            ]);

            // Internal Notifications
            $blueprint->add('notify_on_new_job', true);
            $blueprint->add('notify_on_job_completion', true);
            $blueprint->add('notify_on_low_stock', true);
            $blueprint->add('notify_on_overdue_inspection', true);
            $blueprint->add('notify_on_warranty_expiry', true);

            // Escalation Settings
            $blueprint->add('enable_escalation', false);
            $blueprint->add('escalation_hours', 24);
            $blueprint->add('escalation_contacts', []);
        });
    }
};
