<?php

use Spatie\LaravelSettings\Migrations\SettingsMigration;

return new class extends SettingsMigration
{
    public function up(): void
    {
        $this->migrator->inGroup('security', function (Spatie\LaravelSettings\Migrations\SettingsBlueprint $blueprint): void {
            // Authentication Settings
            $blueprint->add('enable_two_factor_auth', false);
            $blueprint->add('session_timeout_minutes', 60);
            $blueprint->add('password_expiry_days', 90);
            $blueprint->add('max_login_attempts', 5);
            $blueprint->add('lockout_duration_minutes', 15);

            // Password Requirements
            $blueprint->add('min_password_length', 8);
            $blueprint->add('require_uppercase', true);
            $blueprint->add('require_lowercase', true);
            $blueprint->add('require_numbers', true);
            $blueprint->add('require_special_characters', false);

            // Data Protection
            $blueprint->add('enable_data_encryption', true);
            $blueprint->add('enable_audit_logging', true);
            $blueprint->add('audit_log_retention_days', 365);
            $blueprint->add('enable_backup_alerts', true);

            // API Security
            $blueprint->add('enable_api_rate_limiting', true);
            $blueprint->add('api_requests_per_minute', 60);
            $blueprint->add('allowed_ip_addresses', []);

            // Customer Data Access
            $blueprint->add('allow_customer_portal', true);
            $blueprint->add('allow_customer_data_download', false);
            $blueprint->add('customer_session_timeout_minutes', 30);
        });
    }
};
