Skip to content

feat: add weekly financial digest endpoint and UI#456

Open
bhubadinn wants to merge 1 commit intorohitdash08:mainfrom
bhubadinn:feat/weekly-digest
Open

feat: add weekly financial digest endpoint and UI#456
bhubadinn wants to merge 1 commit intorohitdash08:mainfrom
bhubadinn:feat/weekly-digest

Conversation

@bhubadinn
Copy link

Summary

  • What changed: Added GET /digest/weekly?week=YYYY-WNN endpoint and a React Digest page with week navigation, category breakdown, WoW comparison, trends, and insights.
  • Why: Closes Smart digest with weekly financial summary #121. Users need a weekly summary highlighting spending trends and patterns.

/claim #121

Validation

  • Frontend lint: cd app && npm run lint
  • Frontend tests: cd app && npm test -- --runInBand
  • Backend tests: ./scripts/test-backend.ps1
  • Updated docs if needed

Security and Ownership

  • PR opened from a fork (not direct push to main)
  • CODEOWNERS review requested

Checklist

  • No secrets added
  • No unrelated files changed
  • Breaking changes documented

@bhubadinn
Copy link
Author

bhubadinn commented Mar 15, 2026

Demo

Weekly Digest — W12 (2026-03-16 → 2026-03-22)

weekly-digest-demo
screenshot-dashboard
screenshot-digest-empty
screenshot-digest-with-data

Features shown:

  • GET /digest/weekly?week=2026-W12 returns total spent, total income, category breakdown with % shares, WoW change, trends and insights
  • Week navigation (← →) switches between weeks and fetches fresh data
  • Category breakdown with progress bars (Food & Dining 30.5%, Shopping 26%, Utilities 19.4%, Transportation 15.3%, Entertainment 8.8%)
  • Week-over-week badge: +52.41% (red = spending increased)
  • Trends: top category + WoW comparison text

W11 (2026-03-09 → 2026-03-15) — different data, different top category

  • Shopping leads at 44%, Food & Dining 20.9%
  • Confirms week isolation works correctly

API response sample

```json
GET /digest/weekly?week=2026-W12

{
"week": "2026-W12",
"period": { "start": "2026-03-16", "end": "2026-03-22" },
"total_spent": 691.93,
"total_income": 3200.00,
"week_over_week_change": 52.41,
"category_breakdown": [
{ "category_name": "Food & Dining", "amount": 211.25, "share_pct": 30.53 },
{ "category_name": "Shopping", "amount": 180.19, "share_pct": 26.04 },
{ "category_name": "Utilities", "amount": 134.00, "share_pct": 19.37 },
{ "category_name": "Transportation","amount": 105.50, "share_pct": 15.25 },
{ "category_name": "Entertainment", "amount": 60.99, "share_pct": 8.81 }
],
"trends": [
"Top spending category: Food & Dining (30.53% of total)",
"Spending increased 52.41% compared to previous week"
],
"insights": [
"You spent more than you earned this week",
"Spending spread across many categories this week"
]
}
```

Adds GET /digest/weekly?week=YYYY-WNN with:
- Category breakdown aggregation
- Week-over-week spending comparison
- Trend detection and insights generation
- Redis caching (10 min TTL)
- 7 pytest test cases

Frontend Digest page with:
- Card-based UI with progress bars
- Week navigation (prev/next)
- WoW change badge
- Trends and insights sections

Closes rohitdash08#121
@bhubadinn bhubadinn force-pushed the feat/weekly-digest branch from 1f60afa to 54d648c Compare March 15, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Smart digest with weekly financial summary

1 participant