<?php

return [
    'app_name' => 'Lab LIMS',
    'timezone' => 'Asia/Baghdad',
    'db' => [
        'host' => 'localhost',
        'port' => 3306,
        'name' => 'amanarac_lab_lims',
        'user' => 'amanarac_lab_lims',
        'pass' => 'asd123asd@',
        'charset' => 'utf8mb4'
    ],
    'security' => [
        'password_algo' => PASSWORD_BCRYPT,
        'portal_token_secret' => 'lab_portal_2024_secret',
        'password_policy' => [
            'enabled' => true,
            'min_length' => 8,
            'require_uppercase' => true,
            'require_lowercase' => true,
            'require_numbers' => true,
            'require_special' => false
        ],
        'auto_block_suspicious_ips' => true,
        'suspicious_ip_threshold' => 5, // عدد المحاولات الفاشلة قبل الحظر
        'ip_block_duration_hours' => 24 // مدة الحظر بالساعات
    ],
    'whatsapp' => [
        'enabled' => false,
        'provider' => 'meta_cloud_api',
        'from_number' => '',
        'api_url' => '',
        'access_token' => ''
    ],
    'sms' => [
        'enabled' => false,
        'provider' => 'unifonic',
        'app_sid' => '',
        'sender_id' => ''
    ],
    'backup' => [
        'enabled' => true,
        'retention_days' => 7,
        'cloud_upload' => false,
        'cloud_provider' => null,
        'cloud_bucket' => null
    ],
    'session' => [
        'cookie_secure' => true, // HTTPS only
        'cookie_httponly' => true,
        'cookie_samesite' => 'Strict',
        'regenerate_id' => true, // بعد login
        'lifetime' => 1800, // 30 دقيقة
        'name' => 'SMARTLAB_SESSION'
    ],
    'rate_limiting' => [
        'enabled' => true,
        'login_max_attempts' => 5,
        'login_window_seconds' => 900, // 15 دقيقة
        'login_block_duration' => 3600, // ساعة واحدة
        'api_max_attempts' => 100,
        'api_window_seconds' => 3600, // ساعة واحدة
        'search_max_attempts' => 30,
        'search_window_seconds' => 60 // دقيقة واحدة
    ],
    'cache' => [
        'enabled' => true,
        'default_ttl' => 3600, // ساعة واحدة
        'driver' => 'file', // file, redis, memcached
        'redis' => [
            'host' => '127.0.0.1',
            'port' => 6379,
            'password' => null,
            'database' => 0,
            'prefix' => 'lab_lims:'
        ]
    ],
    'logging' => [
        'enabled' => true,
        'level' => 'info', // debug, info, warning, error, critical
        'max_file_size' => 10485760, // 10MB
        'max_files' => 5
    ],
    'api' => [
        'allowed_origins' => ['*'], // أو قائمة محددة: ['https://example.com']
        'enable_cors' => true,
        'versioning' => [
            'enabled' => true,
            'current_version' => 'v1',
            'supported_versions' => ['v1'],
            'deprecated_versions' => []
        ]
    ],
    'performance' => [
        'monitoring' => [
            'enabled' => true,
            'slow_query_threshold' => 1.0, // seconds
            'slow_request_threshold' => 2.0, // seconds
            'log_all_queries' => false
        ]
    ],
    'translation' => [
        'default_locale' => 'ar',
        'fallback_locale' => 'ar',
        'available_locales' => ['ar', 'en']
    ],
    'email' => [
        'enabled' => false,
        'from_email' => 'noreply@lablims.com',
        'from_name' => 'Smart Lab LIMS',
        'reply_to' => 'noreply@lablims.com',
        'notification_to' => '', // Email للإشعارات (backup, errors, etc.)
        'smtp' => [
            'enabled' => false,
            'host' => 'smtp.gmail.com',
            'port' => 587,
            'auth' => true,
            'username' => '',
            'password' => '',
            'encryption' => 'tls'
        ]
    ],
    'cloud_storage' => [
        'enabled' => false,
        'provider' => 's3', // s3, gcs
        's3' => [
            'access_key' => '',
            'secret_key' => '',
            'region' => 'us-east-1',
            'bucket' => ''
        ],
        'gcs' => [
            'project_id' => '',
            'key_file' => '',
            'bucket' => ''
        ]
    ],
    'pagination' => [
        'default_per_page' => 25,
        'max_per_page' => 100,
        'min_per_page' => 10
    ],
    'search' => [
        'patients_limit' => 15,
        'orders_limit' => 15,
        'doctors_limit' => 10,
        'max_results' => 50
    ],
    'debug' => false // تفعيل في بيئة التطوير فقط
];
