"""
Configuration management for production system
"""

import os
from pydantic_settings import BaseSettings
from functools import lru_cache

class Settings(BaseSettings):
    """Application settings"""
    
    # Database
    DATABASE_URL: str = "mysql+pymysql://root:root@127.0.0.1:3306/medicine_service?charset=utf8mb4"
    DB_POOL_SIZE: int = 20
    DB_MAX_OVERFLOW: int = 40
    
    # API
    API_TITLE: str = "MedTech NLP API - Production"
    API_VERSION: str = "3.0.0"
    API_PORT: int = 8000
    
    # Search
    MAX_SEARCH_RESULTS: int = 50
    MIN_SEARCH_SCORE: float = 0.1
    
    # Environment
    ENVIRONMENT: str = "production"  # development, staging, production
    DEBUG: bool = False
    
    class Config:
        env_file = ".env"
        case_sensitive = True

@lru_cache()
def get_settings() -> Settings:
    """Get cached settings instance"""
    return Settings()
