Improve operator CRM flows and UI
This commit is contained in:
@@ -157,6 +157,13 @@ SERVICE_URLS = {
|
||||
}
|
||||
|
||||
|
||||
def _env_flag(name: str, default: bool = False) -> bool:
|
||||
value = os.getenv(name)
|
||||
if value is None:
|
||||
return default
|
||||
return value.strip().lower() in {"1", "true", "yes", "on"}
|
||||
|
||||
|
||||
@app.get("/health", response_model=HealthResponse)
|
||||
def health() -> HealthResponse:
|
||||
return HealthResponse(status="ok", service="api-gateway")
|
||||
@@ -179,6 +186,15 @@ def registry() -> dict:
|
||||
return {"services": SERVICE_URLS}
|
||||
|
||||
|
||||
@app.get("/operator/config")
|
||||
def operator_ui_config() -> dict[str, Any]:
|
||||
return {
|
||||
"features": {
|
||||
"whatsapp": _env_flag("OPERATOR_WHATSAPP_ENABLED", default=False),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@app.get("/contracts")
|
||||
def contracts() -> dict:
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user