feat(summary): Smart Weekly Digest — GET /summary/weekly (Issue #121)#616
Open
XavierAbraham wants to merge 3 commits intorohitdash08:mainfrom
Open
feat(summary): Smart Weekly Digest — GET /summary/weekly (Issue #121)#616XavierAbraham wants to merge 3 commits intorohitdash08:mainfrom
XavierAbraham wants to merge 3 commits intorohitdash08:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #121 — implements the Smart Weekly Digest feature with a new
GET /summary/weeklyendpoint.What's included
packages/backend/app/routes/summary.py(new)GET /summary/weekly?weeks_back=N— returns a structured financial digest for the authenticated user_aggregate_week,_category_breakdown,_daily_trend,_generate_insights) for testabilitypackages/backend/tests/test_summary.py(new)packages/backend/app/routes/__init__.py(updated)summary_bpat/summaryAPI Response shape
{ "period": { "start": "2026-03-16", "end": "2026-03-22", "label": "Week of Mar 16, 2026" }, "summary": { "total_expenses": 150.0, "total_income": 500.0, "net": 350.0, "expense_count": 5, "income_count": 2 }, "previous_week": { "total_expenses": 120.0, ... }, "category_breakdown": [{ "category": "Food", "amount": 80.0, "count": 3 }], "daily_trend": [{ "date": "2026-03-16", "amount": 0.0 }, ...], "insights": ["Total spending increased by 25.0% vs last week (120.00 → 150.00).", "Positive cash flow this week: +350.00."] }Testing
cd packages/backend pytest tests/test_summary.py -vAuthored-by: Xavier Abraham Sandoval abrahamsandoval.as@gmail.com