Skip to content

feat: Goal-based savings tracking & milestones (Closes #133)#1055

Open
508704820 wants to merge 1 commit into
rohitdash08:mainfrom
508704820:feature/savings-goals
Open

feat: Goal-based savings tracking & milestones (Closes #133)#1055
508704820 wants to merge 1 commit into
rohitdash08:mainfrom
508704820:feature/savings-goals

Conversation

@508704820
Copy link
Copy Markdown

Summary

Implements #133 — Goal-based savings tracking & milestones.

Changes

Backend — Models

  • SavingsGoal model: name, target_amount, current_amount, currency, deadline, status (ACTIVE/COMPLETED/CANCELLED)
  • SavingsMilestone model: threshold_pct, label, reached_at (auto-timestamped when progress reaches threshold)

Backend — API Endpoints

Method Path Description
POST /api/savings-goals Create a goal (auto-creates 25/50/75/100% milestones)
GET /api/savings-goals List goals (optional ?status= filter)
GET /api/savings-goals/:id Get single goal
PATCH /api/savings-goals/:id Update goal / add funds
DELETE /api/savings-goals/:id Cancel a goal
POST /api/savings-goals/:id/milestones Add custom milestone

Features

  • Auto-complete milestones when progress reaches threshold
  • Auto-complete goal at 100% progress
  • Custom or default milestone templates
  • JWT-protected endpoints, user-scoped data

Tests

  • Create, list, update (add funds), delete goals
  • Missing field validation, negative amount rejection
  • Auto-completion at 100%

Validation

  • python -m py_compile — all files pass
  • Tests written with pytest fixtures

🛡️ Security: All endpoints require JWT auth, user-scoped queries prevent IDOR, input validated.

— Xeophon

- Add SavingsGoal and SavingsMilestone models
- CRUD API for savings goals with JWT auth
- Auto-create default milestones (25%, 50%, 75%, 100%)
- Add funds endpoint with milestone auto-completion
- Auto-complete goal at 100% progress
- Filter goals by status
- Comprehensive test suite

Closes rohitdash08#133

Co-authored-by: Xeophon <508704820@users.noreply.github.com>
@508704820 508704820 requested a review from rohitdash08 as a code owner May 17, 2026 13:08
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.

1 participant