Skip to content

feat: savings opportunity detection engine#577

Open
mendarb wants to merge 1 commit intorohitdash08:mainfrom
mendarb:feat/savings-detection-119
Open

feat: savings opportunity detection engine#577
mendarb wants to merge 1 commit intorohitdash08:mainfrom
mendarb:feat/savings-detection-119

Conversation

@mendarb
Copy link

@mendarb mendarb commented Mar 20, 2026

Summary

  • Add savings opportunity detection engine that analyzes spending patterns and returns actionable suggestions (closes Savings opportunity detection engine #119)
  • Backend: GET /api/insights/savings-opportunities endpoint with four detection rules: month-over-month category increases, high-frequency small purchases (latte factor), subscription duplicates, and above-average category spending
  • Frontend: SavingsOpportunities component integrated into the Analytics page, showing opportunity cards with potential savings amounts and trend badges

Detection Rules

Rule Trigger Suggestion
MoM Increase Category spending up >=20% vs previous month Return to last month's level
Latte Factor 8+ small purchases (under $10) in a month Cut in half
Duplicate Subs Same description+amount appearing multiple times Remove duplicate
Above Average Category >130% of 3-month rolling average Return to average

Test plan

  • Backend: pytest tests/test_savings.py -- 7 tests covering all detection rules, sorting, auth, and empty states
  • Frontend: npx jest SavingsOpportunities -- 5 tests covering loading, data rendering, empty state, error state, and month re-fetch
  • Manual: verify cards render on /analytics page with real spending data

🤖 Generated with Claude Code

Analyze user spending patterns and surface actionable savings
opportunities via four detection rules: month-over-month category
increases, high-frequency small purchases (latte factor), subscription
duplicates, and above-average category spending.

- Backend: GET /api/insights/savings-opportunities endpoint with
  savings service module
- Frontend: SavingsOpportunities component with opportunity cards,
  potential savings amounts, and trend badges
- Tests: backend integration tests and frontend component tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mendarb mendarb requested a review from rohitdash08 as a code owner March 20, 2026 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Savings opportunity detection engine

1 participant