File size: 1,287 Bytes
5f12c93
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31c8dd6
5f12c93
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from pydantic_settings import BaseSettings, SettingsConfigDict


class Settings(BaseSettings):
    model_config = SettingsConfigDict(
        env_file=".env",
        case_sensitive=False,
        extra="ignore",
    )

    # Base de datos — sin default para forzar configuración explícita en producción
    database_url: str

    # JWT — sin default para evitar secretos hardcodeados en código fuente
    jwt_secret: str
    jwt_algorithm: str = "HS256"
    jwt_expire_minutes: int = 60

    # Entorno — controla comportamiento de endpoints de desarrollo
    environment: str = "development"

    # CORS — lista explícita de orígenes permitidos
    allowed_origins: list[str] = ["http://localhost:3000", "http://localhost:5173"]

    # Timeout HTTP para llamadas a módulos externos (segundos)
    http_timeout_seconds: float = 5.0

    # URLs de módulos externos
    m1_hce_url: str = "http://localhost:8001"
    m2_turnos_url: str = "http://localhost:8002"
    m7_facturacion_url: str = "http://localhost:8007"
    m9_monitoreo_url: str = "http://localhost:8009"
    m10_core_url: str = "http://localhost:8010"

    # Si True, no llama a módulos externos (útil para desarrollo local sin stack completo)
    mock_external_services: bool = True


settings = Settings()