Skip to content

feat: Weekly Financial Summary Digest#385

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

feat: Weekly Financial Summary Digest#385
Drgonzoh wants to merge 1 commit intorohitdash08:mainfrom
Drgonzoh:feat/weekly-financial-digest

Conversation

@Drgonzoh
Copy link

Description

This PR implements the smart weekly financial digest feature as requested in #121.

Changes:

Backend:

  • Added weekly_digest service in packages/backend/app/services/ai.py to aggregate weekly financial data (totals, category breakdown, daily spend, top expenses, and heuristic insights).
  • Added GET /insights/weekly-digest endpoint in packages/backend/app/routes/insights.py with caching support (10-minute TTL).
  • Added cache keys for weekly digest in packages/backend/app/services/cache.py.
  • Updated packages/backend/app/openapi.yaml and README.md with the new endpoint.

Frontend:

  • Added WeeklyDigest type and getWeeklyDigest API call in app/src/api/insights.ts.
  • Created a new WeeklyDigest page (app/src/pages/WeeklyDigest.tsx) with summary cards, insights list, category breakdown progress bars, and top expenses table.
  • Added navigation to the Weekly Digest page in Navbar.tsx.
  • Registered the new route in App.tsx.

Testing:

  • Added 10 new test cases in packages/backend/tests/test_insights.py covering various scenarios (empty week, populated week, WoW change, income tracking, net flow, invalid format).
  • Updated packages/backend/tests/conftest.py to use fakeredis for tests to ensure they are runnable without a live Redis server.
  • Added fakeredis to requirements.txt.

How to Test:

  1. Run backend tests: ='.'; pytest packages/backend/tests/test_insights.py.
  2. Start the frontend and navigate to the new 'Weekly Digest' tab.
  3. Use the week selector to view summaries for different weeks.

/claim #121

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.

1 participant