"""
Configurări comune pentru toate aplicațiile ROA2WEB
"""
import os
from typing import List, Dict, Any
from pydantic import BaseSettings

class SharedConfig(BaseSettings):
    """Configurări partajate între microservicii"""
    
    # Database
    oracle_user: str = os.getenv('ORACLE_USER', '')
    oracle_password: str = os.getenv('ORACLE_PASSWORD', '')
    oracle_dsn: str = os.getenv('ORACLE_DSN', '')
    
    # Database Pool
    db_min_connections: int = int(os.getenv('DB_MIN_CONNECTIONS', 2))
    db_max_connections: int = int(os.getenv('DB_MAX_CONNECTIONS', 10))
    db_connection_increment: int = int(os.getenv('DB_CONNECTION_INCREMENT', 1))
    
    # JWT Authentication
    jwt_secret_key: str = os.getenv('JWT_SECRET_KEY', 'your-super-secret-jwt-key-change-in-production')
    jwt_algorithm: str = os.getenv('JWT_ALGORITHM', 'HS256')
    access_token_expire_minutes: int = int(os.getenv('ACCESS_TOKEN_EXPIRE_MINUTES', 30))
    refresh_token_expire_days: int = int(os.getenv('REFRESH_TOKEN_EXPIRE_DAYS', 7))
    
    # Authentication Settings
    auth_cache_ttl_minutes: int = int(os.getenv('AUTH_CACHE_TTL_MINUTES', 15))
    rate_limit_max_requests: int = int(os.getenv('RATE_LIMIT_MAX_REQUESTS', 5))
    rate_limit_time_window: int = int(os.getenv('RATE_LIMIT_TIME_WINDOW', 300))
    
    # Logging
    log_level: str = os.getenv('LOG_LEVEL', 'INFO')
    
    class Config:
        env_file = '.env'

# Instance globală
shared_config = SharedConfig()