Summary
The GET /api/stats endpoint returns total cumulative revenue but no time-series breakdown. Add a /revenue-history sub-route that aggregates payment events by day so the admin dashboard can render a revenue trend chart.
Acceptance Criteria
GET /api/stats/revenue-history?days=30 returns { history: [{ date, revenue_xlm }] }
- Days parameter capped at 90
- Sourced from Soroban payment events filtered by contract ID
- Cached for 60 seconds
Files to touch
backend/src/routes/stats.ts
Summary
The
GET /api/statsendpoint returns total cumulative revenue but no time-series breakdown. Add a/revenue-historysub-route that aggregates payment events by day so the admin dashboard can render a revenue trend chart.Acceptance Criteria
GET /api/stats/revenue-history?days=30returns{ history: [{ date, revenue_xlm }] }Files to touch
backend/src/routes/stats.ts