Skip to content

feat: add GET /analytics/users/retention endpoint (#527)#586

Merged
phertyameen merged 1 commit into
MindBlockLabs:mainfrom
abdoolyaro:feat/issue-527-analytics-users-retention
Jul 22, 2026
Merged

feat: add GET /analytics/users/retention endpoint (#527)#586
phertyameen merged 1 commit into
MindBlockLabs:mainfrom
abdoolyaro:feat/issue-527-analytics-users-retention

Conversation

@abdoolyaro

Copy link
Copy Markdown
Contributor
  • Wire GetRetentionCurveProvider into AnalyticsController via new users/retention route, reusing the existing DateRangeDto for query validation (start/end/granularity)
  • Add AnalyticsAdminGuard restricting the route to admin users, checking req.user.userRole populated by the global JwtAuthMiddleware
  • Add e2e coverage in test/analytics.e2e-spec.ts: 200 with documented response shape, 403 for non-admin, 400 for invalid granularity, start-after-end, and unrecognized query params

closes #527

- Wire GetRetentionCurveProvider into AnalyticsController via new
  users/retention route, reusing the existing DateRangeDto for
  query validation (start/end/granularity)
- Add AnalyticsAdminGuard restricting the route to admin users,
  checking req.user.userRole populated by the global JwtAuthMiddleware
- Add e2e coverage in test/analytics.e2e-spec.ts: 200 with documented
  response shape, 403 for non-admin, 400 for invalid granularity,
  start-after-end, and unrecognized query params
@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
mind-block-app-frontend Skipped Skipped Jul 21, 2026 10:29pm

@phertyameen phertyameen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one

@phertyameen
phertyameen merged commit ab293c4 into MindBlockLabs:main Jul 22, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add /analytics/users/retention endpoint

2 participants