Skip to content

feat: goal-based savings tracking & milestones#1157

Draft
cyrillical00 wants to merge 1 commit into
rohitdash08:mainfrom
cyrillical00:feat/savings-goals
Draft

feat: goal-based savings tracking & milestones#1157
cyrillical00 wants to merge 1 commit into
rohitdash08:mainfrom
cyrillical00:feat/savings-goals

Conversation

@cyrillical00
Copy link
Copy Markdown

Closes #133

Summary

  • Adds SavingsGoal SQLAlchemy model with target_amount, current_amount, currency, deadline fields
  • REST API under /savings: list, create, get, update, delete goals; contribute amounts
  • Status computation (completed/on-track/ahead/behind) based on progress relative to deadline
  • Monthly target calculation based on remaining amount and months until deadline
  • Goals default to the authenticated user's preferred currency
  • React frontend: Budgets.tsx loads real savings goals from the API (with loading/empty states)
  • Frontend API client at app/src/api/savings.ts
  • 17 passing backend tests using fakeredis for Redis isolation

Test plan

  • cd packages/backend && python -m pytest tests/test_savings.py -v → 17 passed
  • Create a savings goal via POST /savings and verify status field
  • Contribute to a goal and verify status flips to completed when current >= target
  • Verify goals are isolated between users
  • Open Budgets page in browser — goals panel loads from API

Closes rohitdash08#133

- SavingsGoal model with target/current/currency/deadline fields
- REST API: GET/POST /savings, GET/PATCH/DELETE /savings/:id, POST /savings/:id/contribute
- Status computation: completed/on-track/ahead/behind based on progress vs deadline
- Monthly target calculation based on remaining amount and months to deadline
- Goals are scoped per user (JWT-authenticated)
- React frontend: Budgets page loads real savings goals via API
- API client in app/src/api/savings.ts
- 17 passing tests (fakeredis for test isolation)
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.

Goal-based savings tracking & milestones

2 participants