feat: add analytics overview endpoint

This commit is contained in:
ivannoskov
2026-01-06 16:55:31 +03:00
parent 52e65dff05
commit 1a5ce621bc
6 changed files with 332 additions and 1 deletions

View File

@@ -75,3 +75,21 @@ async def get_spending_analytics(
grouping=grouping,
)
return await deps.get_usecase().get_spending_analytics(input)
@analytics_router.get('/overview')
async def get_overview_analytics(
workspace_id: uuid.UUID,
current_user: Annotated[JWTPayload, Depends(deps.get_current_user)],
date_from: datetime.datetime,
date_to: datetime.datetime,
project_id: uuid.UUID | None = None,
) -> dto.GetOverviewAnalyticsOutput:
input = dto.GetOverviewAnalyticsInput(
user_id=current_user.user_id,
workspace_id=workspace_id,
date_from=date_from,
date_to=date_to,
project_id=project_id,
)
return await deps.get_usecase().get_overview_analytics(input)