diff --git a/backend/app/api/v1/customer.py b/backend/app/api/v1/customer.py index acf08e2..1d3814e 100644 --- a/backend/app/api/v1/customer.py +++ b/backend/app/api/v1/customer.py @@ -39,6 +39,24 @@ async def get_silent( } +@router.get("/health-overview") +async def get_health_overview( + user_id: str = Depends(get_current_user_id), + db: AsyncSession = Depends(get_db), +): + service = CustomerHealthService(db) + return await service.get_health_overview(user_id) + + +@router.get("/health-scores") +async def get_all_health_scores( + user_id: str = Depends(get_current_user_id), + db: AsyncSession = Depends(get_db), +): + service = CustomerHealthService(db) + return {"items": await service.get_all_health_scores(user_id)} + + @router.get("/{customer_id}") async def get_customer( customer_id: str, @@ -148,24 +166,6 @@ async def export_customers( ) -@router.get("/health-overview") -async def get_health_overview( - user_id: str = Depends(get_current_user_id), - db: AsyncSession = Depends(get_db), -): - service = CustomerHealthService(db) - return await service.get_health_overview(user_id) - - -@router.get("/health-scores") -async def get_all_health_scores( - user_id: str = Depends(get_current_user_id), - db: AsyncSession = Depends(get_db), -): - service = CustomerHealthService(db) - return {"items": await service.get_all_health_scores(user_id)} - - @router.get("/{customer_id}/health") async def get_customer_health( customer_id: str,