Files
gsfdc/server/app/api/site/public.py
T

32 lines
785 B
Python

from fastapi import APIRouter
from app.models.uploaded_case import (
KIND_LABELS,
OPEN_KINDS,
commercial_options,
office_options,
regions,
residential_options,
industrial_options,
)
router = APIRouter()
@router.get("/health")
def site_health() -> dict:
return {"status": "ok", "scope": "site"}
@router.get("/uploaded-case-options")
def uploaded_case_options() -> dict:
return {
"kinds": [{"key": key, "label": label} for key, label in KIND_LABELS.items()],
"openKinds": [key for key in KIND_LABELS if key in OPEN_KINDS],
"regions": regions(),
"residential": residential_options(),
"commercial": commercial_options(),
"office": office_options(),
"industrial": industrial_options(),
}