from pydantic_settings import BaseSettings


class Settings(BaseSettings):
    SECRET_KEY: str
    ADMIN_SECRET: str
    DATABASE_URL: str = "sqlite:///./swift.db"
    JWT_ALGORITHM: str = "HS256"
    JWT_EXPIRE_MINUTES: int = 15
    RATE_LIMIT_DEFAULT: int = 100
    API_VERSION: str = "v1"
    ENVIRONMENT: str = "development"

    SMTP_HOST: str = ""
    SMTP_PORT: int = 465
    SMTP_USER: str = ""
    SMTP_PASSWORD: str = ""
    CONTACT_TO_EMAIL: str = ""

    # Redirect 301 de dominios legados hacia PRIMARY_HOST. Vacío = sin redirect.
    PRIMARY_HOST: str = ""
    REDIRECT_LEGACY_HOSTS: str = ""

    class Config:
        env_file = ".env"
        env_file_encoding = "utf-8"


settings = Settings()
