from functools import lru_cache
from pydantic_settings import BaseSettings, SettingsConfigDict


class Settings(BaseSettings):
    # JWT
    jwt_secret_key: str = "changeme-use-a-strong-secret-in-production"
    jwt_algorithm: str = "HS256"
    jwt_access_token_expire_minutes: int = 480  # 8 hours

    # Database URLs
    internal_db_url: str = "postgresql://internal-database-user:v2E61F75zUgdu0Of@localhost:5555/internal-database"
    platform_db_url: str = "postgresql://user-database-user:M9He5G2ggpfyxyAU@localhost:55557/user-database"

    # Paths (override via env var in Docker)
    models_base_path: str = "/app/models"

    model_config = SettingsConfigDict(env_file=".env", extra="ignore")


@lru_cache
def get_settings() -> Settings:
    return Settings()
