feat(loyalty): add Chart.js visualizations to analytics page
Some checks failed
Some checks failed
Wire the Phase 7 analytics API endpoints into the store analytics page with interactive visualizations: - Revenue chart (Chart.js bar+line combo): monthly points earned as bars + active customers as line overlay with dual Y axes. - At-risk members panel: ranked list of churning cards showing customer name and days inactive, with count badge. - Cohort retention table: enrollment month rows × M0-M5 retention columns with color-coded percentage cells (green >60%, yellow >30%, red <30%). Chart.js loaded on-demand via existing CDN loader with local fallback. Data fetched in parallel via Promise.all for the 3 analytics endpoints. All sections gracefully degrade to "not enough data" message when empty. 7 new i18n keys (EN only — FR/DE/LB translations to be added). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -801,7 +801,15 @@
|
||||
"quick_actions": "Quick Actions",
|
||||
"open_terminal": "Open Terminal",
|
||||
"view_members": "View Members",
|
||||
"view_program": "View Program"
|
||||
"view_program": "View Program",
|
||||
"revenue_title": "Points & Customers",
|
||||
"at_risk_title": "At-Risk Members",
|
||||
"cards_at_risk": "members at risk of churn",
|
||||
"no_at_risk": "All members are active!",
|
||||
"cohort_title": "Cohort Retention",
|
||||
"cohort_month": "Enrollment Month",
|
||||
"cohort_enrolled": "Enrolled",
|
||||
"no_data_yet": "Not enough data yet. Analytics will appear as customers enroll and transact."
|
||||
},
|
||||
"program": {
|
||||
"title": "Loyalty Program",
|
||||
|
||||
Reference in New Issue
Block a user