feat(analytics): add churn risk route validation, export support, and… - #597
Merged
A6dulmalik merged 2 commits intoJul 25, 2026
Merged
Conversation
… e2e test coverage
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
Author
|
@A6dulmalik kindly review, I sent you message on telegram please check |
A6dulmalik
approved these changes
Jul 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #528
Description
Implements the
GET /analytics/users/churn-riskcontroller route to expose the current churn-risk user list for admin/staff callers. Updates query parameter DTOs, connects the route toGetChurnRiskProvider, adds CSV/JSON export support for churn risk metrics, and provides end-to-end (e2e) test coverage.Key Changes
GET /analytics/users/churn-riskinAnalyticsControllerguarded byAnalyticsAdminGuardand decorated with Swagger metadata.CHURN_RISK = 'churn_risk'toExportMetricinanalytics-query.dto.ts. Query params are validated withDateRangeDto(class-validator).ExportCsvProviderto handle exporting churn risk metrics as CSV or JSON.describe('GET /analytics/users/churn-risk (e2e)')test suite tobackend/test/analytics.e2e-spec.ts.Acceptance Criteria Checklist
GET /analytics/users/churn-riskreturns200 OKwith the documented response shape for admin callers.400 Bad Requestwith clear validation error messages.AnalyticsAdminGuard(returns403otherwise).backend/test/analytics.e2e-spec.ts.Verification & Testing Performed
Unit Tests (24/24 Passed)