SRV-38 — V2 — Advanced analytics
Cohorts, reseller activity scoring, delegate benchmarking, demand trends by zone.
| Field | Details |
|---|---|
| Task code | SRV-38 |
| Phase | P4 — V2 evolutions |
| Product scope | V2 |
| Status | Planned |
| Start | Wed 10 Feb 2027 |
| Due | Sun 14 Feb 2027 |
| Responsible | Anis — Full-stack developer |
| Co-responsible | — |
| Effort | 2.5 person-day(s) planned · 6 from scratch · size M |
| Area · app | Server · server |
| Depends on | SRV-37 |
| Unblocks | — |
| Milestones | V2 delivered |
Summary
Cohorts, reseller activity scoring, delegate benchmarking, demand trends by zone.
Description
Advanced analytics are V2 (cahier §14.2; ANA-06) and build on the V1 aggregates of SRV-25. This task adds reseller cohorts (by sign-up month and first-order month with retention), reseller activity scoring (recency, frequency, monetary value), delegate benchmarking (conversion, visits per day, revenue per visit, normalised by zone), and demand trends by zone, brand and category with a simple forecast — exposed as new report keys through admin.reports.* and refreshed by scheduled jobs on materialised views. Out of scope: a separate BI tool.
Subtasks
| # | Subtask | Owner |
|---|---|---|
| 1 | Materialised views for cohorts and reseller activity, refreshed nightly | Anis |
| 2 | Cohort report (sign-up and first-order cohorts, monthly retention) | Anis |
| 3 | Activity scoring (RFM) with segments and score history | Anis |
| 4 | Delegate benchmarking report normalised by zone size and potential | Anis |
| 5 | Demand trends by zone, brand and category with a moving-average forecast | Anis |
| 6 | Report registrations, permissions and export support | Anis |
Deliverables
- apps/server/src/modules/analytics/advanced/{cohorts,scoring,benchmark,trends}.ts
- SQL migrations for materialised views
- Metric definitions added to the metrics glossary
Acceptance criteria
- Cohort retention numbers match a hand-computed sample (ANA-06)
- Every reseller has an activity score refreshed nightly
- Benchmark and trend reports run with filters and export like V1 reports
Requirements covered
| Requirement | Title | Release |
|---|---|---|
| ANA-06 | Advanced analytics (cohorts, forecasting, delegate benchmarking) | V2 |
API surface
| Endpoint group | Operations |
|---|---|
| Reports & exports | 5 |
Test measures
- DB tests with seeded cohorts and expected retention
- Performance check of view refresh on a production-sized dataset
KPI
- Delivered by Sun 14 Feb 2027 within 2.5 person-day(s).
- Every acceptance criterion above demonstrated before hand-off; linked requirements' acceptance criteria pass.
- Zero open critical defects, permission gaps or data-integrity regressions at sign-off.
Generated from content/plan/tasks.json by scripts/generate-team-tasks.mjs. Dates are computed by the scheduler (Sunday–Thursday weeks, holidays excluded) — change the plan, not this page.