from functools import lru_cache
from pydantic import BaseSettings


class Settings(BaseSettings):
    API_KEY: str
    API_KEY_NAME: str = "X-API-KEY"
    SECRET_KEY: str
    ENVIRONMENT: str
    DATA_BUCKET: str
    SAP_PREDICTIONS_BUCKET: str
    CARBON_PREDICTIONS_BUCKET: str
    HEAT_PREDICTIONS_BUCKET: str
    PLAN_TRIGGER_BUCKET: str
    EPC_AUTH_TOKEN: str
    ORDNANCE_SURVEY_API_KEY: str
    GOOGLE_SOLAR_API_KEY: str
    DB_HOST: str
    DB_PASSWORD: str
    DB_USERNAME: str
    DB_PORT: str
    DB_NAME: str

    class Config:
        env_file = "backend/.env"


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