TorbatYar/backend/services/delivery/app/api/v1/health.py
Mortezakoohjani 5c6a2e78cf feat(platform): seed service registry, deploy all modules, and fix homepage catalog.
Register all active platform services and base features in core DB so admin can manage them, add delivery/hospitality/sports-center backend phases, update apps catalog and production deploy tooling.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-27 12:39:51 +03:30

87 lines
2.6 KiB
Python

from fastapi import APIRouter
from app import __version__
from app.core.config import settings
router = APIRouter()
@router.get("/health")
async def health_check():
return {
"status": "ok",
"service": settings.service_name,
"version": __version__,
}
@router.get("/capabilities")
async def capabilities():
return {
"service": settings.service_name,
"version": __version__,
"phase": "10.1",
"commercial_product": "Torbat Driver",
"features": {
"foundation": True,
"health": True,
"capabilities": True,
"metrics": True,
"external_providers_ready": True,
"future_routing_engines_ready": True,
"drivers": True,
"driver_lifecycle": True,
"driver_credentials": True,
"driver_documents": True,
"fleet": False,
"dispatch_engine": False,
"routing_engine": False,
"tracking": False,
"proof_of_delivery": False,
"settlement": False,
"ai": False,
},
"independence": {
"standalone": True,
"superapp": True,
"integrations": [
"accounting",
"communication",
"loyalty",
"crm",
"hospitality",
"marketplace",
"sports_center",
"clinic",
"pharmacy",
],
"integration_mode": "api_and_events_only",
},
}
@router.get("/metrics")
async def metrics():
"""Phase 10.1 metrics discovery — driver counters reserved for ops wiring."""
return {
"service": settings.service_name,
"version": __version__,
"phase": "10.1",
"metrics": {
"organizations": "tenant_scoped",
"hubs": "tenant_scoped",
"external_providers": "tenant_scoped",
"routing_engines": "tenant_scoped",
"configurations": "tenant_scoped",
"drivers": "tenant_scoped",
"driver_credentials": "tenant_scoped",
"driver_documents": "tenant_scoped",
"driver_lifecycle_events": "tenant_scoped",
"outbox_events": "tenant_scoped",
"dispatch_jobs": 0,
"active_routes": 0,
"tracking_sessions": 0,
},
"note": "Driver aggregates live; dispatch/routing/tracking counters reserved for later phases",
}