Description
Add a provider that computes churn risk scoring: flag users whose activity frequency has dropped sharply vs. their historical baseline. Accept a DateRangeDto and optional granularity query, and return a typed AnalyticsMetricResult. Query against pre-aggregated tables where one exists rather than scanning raw AnalyticsEvent rows.
Why this matters
Churn risk scoring is one of the core metrics product/growth needs surfaced on the analytics dashboard; without a dedicated provider it can't be exposed via an API endpoint.
Files to touch
backend/src/analytics/providers/get-churn-risk.provider.ts
backend/src/analytics/providers/get-churn-risk.provider.spec.ts
Acceptance Criteria
Notes
This issue is part of the new analytics module effort (tracking, aggregation,
and reporting on player/game activity). Please keep new code inside
backend/src/analytics/ following the same module/controller/service/provider
layout used by existing modules (e.g. progress, streak, quests).
Description
Add a provider that computes churn risk scoring: flag users whose activity frequency has dropped sharply vs. their historical baseline. Accept a
DateRangeDtoand optionalgranularityquery, and return a typedAnalyticsMetricResult. Query against pre-aggregated tables where one exists rather than scanning rawAnalyticsEventrows.Why this matters
Churn risk scoring is one of the core metrics product/growth needs surfaced on the analytics dashboard; without a dedicated provider it can't be exposed via an API endpoint.
Files to touch
backend/src/analytics/providers/get-churn-risk.provider.tsbackend/src/analytics/providers/get-churn-risk.provider.spec.tsAcceptance Criteria
AnalyticsEvent)Notes
This issue is part of the new
analyticsmodule effort (tracking, aggregation,and reporting on player/game activity). Please keep new code inside
backend/src/analytics/following the same module/controller/service/providerlayout used by existing modules (e.g.
progress,streak,quests).