Skip to content

feat: add explainable spending insights endpoint#879

Open
Mohye24k wants to merge 1 commit intorohitdash08:mainfrom
Mohye24k:fix/issue-89-spending-insights
Open

feat: add explainable spending insights endpoint#879
Mohye24k wants to merge 1 commit intorohitdash08:mainfrom
Mohye24k:fix/issue-89-spending-insights

Conversation

@Mohye24k
Copy link
Copy Markdown

Summary

  • Add GET /spending-insights endpoint that analyzes spending by category
  • Detect spending spikes (>30% increase) and drops (>30% decrease) compared to previous period
  • Warn when a single category exceeds 40% concentration of total spending
  • Return insights with human-readable explanations, category breakdowns, total_spent, and daily_average
  • Add comprehensive test suite (auth required, empty state, with data, daily average)
  • Add TypeScript API client (app/src/api/spendingInsights.ts)
  • Register blueprint in __init__.py

Test plan

  • Auth required returns 401
  • Empty state returns zeroed response
  • With data detects spikes correctly
  • Daily average calculation is correct

/claim #89
Fixes #89

- Add GET /spending-insights route with category analysis
- Detect spending spikes (>30% increase) and drops (>30% decrease)
- Warn on category concentration (>40% of total)
- Return insights with explanations, categories, total_spent, daily_average
- Add tests for auth, empty state, with data, and daily average
- Add TypeScript API client

Fixes rohitdash08#89
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.

Explainable Spending Insights

1 participant