"""Configuration for the sqgen_risk."""

from pydantic import Field, field_validator
from pydantic_settings import BaseSettings, SettingsConfigDict


class Settings(BaseSettings):
    """Settings for the SaaS SDK.

    This class defines the configuration for the SaaS SDK, including the base URL
    for API requests.
    """

    BASE_URL: str = Field("https://saas.sqrgen.bsmk.xyz/", description="Base URL for API requests")

    @field_validator("BASE_URL")
    def base_url_must_not_end_with_slash(cls, v: str) -> str:
        """Validate that BASE_URL does not end with a slash."""
        return v.rstrip("/")

    model_config = SettingsConfigDict(
        env_prefix="SAAS_",
        env_file=".env",
        case_sensitive=True,
    )


settings = Settings()
