"""Application configuration."""

from functools import lru_cache
from pydantic_settings import BaseSettings


class Settings(BaseSettings):
    """Application settings from environment variables."""

    # Database
    database_url: str = "postgresql+asyncpg://app:changeme@localhost:5432/mockupaws"

    # Application
    app_name: str = "mockupAWS"
    debug: bool = False

    # Pagination
    default_page_size: int = 20
    max_page_size: int = 100

    # Report Storage
    reports_storage_path: str = "./storage/reports"
    reports_max_file_size_mb: int = 50
    reports_cleanup_days: int = 30
    reports_rate_limit_per_minute: int = 10

    class Config:
        env_file = ".env"
        case_sensitive = False


@lru_cache()
def get_settings() -> Settings:
    """Get cached settings instance."""
    return Settings()


settings = get_settings()
