This commit is contained in:
2026-05-31 20:19:44 +12:00
parent 2f2466ecac
commit 84792c0947
59 changed files with 5412 additions and 898 deletions
+9 -3
View File
@@ -28,6 +28,7 @@ from app.api.powerbi import router as powerbi_router
from app.api.products import router as products_router
from app.api.raw_materials import router as raw_materials_router
from app.api.scenarios import router as scenarios_router
from app.api.throughput import router as throughput_router
from app.core.config import settings
from app.core.logging import (
LoggingSettings,
@@ -46,7 +47,7 @@ from app.core.logging import (
)
from app.db.session import Base, engine
from app.db.migrations import MigrationReport, bootstrap_schema, sync_product_visibility, sync_tenant_ids
from app.seed import seed_if_empty
from app.seed import seed_startup_basics
def _resolve_version() -> str:
@@ -100,7 +101,7 @@ def ensure_database_ready() -> MigrationReport:
return MigrationReport()
schema_report = bootstrap_schema(engine, Base.metadata)
seed_if_empty()
seed_startup_basics()
tenant_sync_report = sync_tenant_ids(engine)
hidden_product_count = sync_product_visibility(engine)
@@ -153,7 +154,10 @@ async def lifespan(app: FastAPI):
section_heading("Services")
success("HTTP API ready")
info("Docs available at /docs", logger_name="data_entry_app.services")
if settings.docs_enabled:
info("Docs available at /docs", logger_name="data_entry_app.services")
else:
info("Docs disabled in this environment", logger_name="data_entry_app.services")
info("Health probe available at /health", logger_name="data_entry_app.services")
yield
@@ -195,6 +199,7 @@ app.include_router(mixes_router)
app.include_router(mix_calculator_router)
app.include_router(products_router)
app.include_router(scenarios_router)
app.include_router(throughput_router)
app.include_router(powerbi_router)
@@ -300,6 +305,7 @@ def root():
"mix_calculator": "/api/mix-calculator",
"products": "/api/products",
"scenarios": "/api/scenarios",
"operations_throughput": "/api/throughput",
"client_access": "/api/client-access",
"docs": "/docs",
},