Skip to content

feat: goal-based savings tracking with milestones#595

Open
promisingcoder wants to merge 2 commits intorohitdash08:mainfrom
promisingcoder:bounty/133-savings-goals
Open

feat: goal-based savings tracking with milestones#595
promisingcoder wants to merge 2 commits intorohitdash08:mainfrom
promisingcoder:bounty/133-savings-goals

Conversation

@promisingcoder
Copy link

Summary

Implements goal-based savings tracking with automatic milestone detection.

/claim #133

Changes

SavingsGoal Model

  • Status enum: active/completed/cancelled
  • Fields: target_amount, current_amount, deadline, currency (USD default)
  • achieved_milestones() method for dynamic 25/50/75/100% computation
  • Auto-complete when current_amount >= target_amount

API Endpoints (all JWT-protected)

  • POST /savings-goals — create goal
  • GET /savings-goals — list with optional ?status= filter
  • GET /savings-goals/<id> — single goal with milestones
  • PUT /savings-goals/<id> — partial update, auto-completion
  • DELETE /savings-goals/<id> — soft delete (status=cancelled)
  • GET /savings-goals/<id>/progress — percentage, remaining, days left, on-track

Tests

  • 47 new tests (69 total), all passing
  • Covers: CRUD, auth, validation, milestone boundaries, progress calculations, user isolation

Documentation

  • README updated with full feature + endpoint reference

Fixes #133

promisingcoder and others added 2 commits March 21, 2026 14:21
- SavingsGoal model (id, user_id FK, name, target_amount, current_amount,
  deadline, currency, status enum, created_at, updated_at)
- CRUD routes at /savings-goals (POST/GET/PUT/DELETE), all JWT-protected
- GET /savings-goals/<id>/progress returns % complete, remaining amount,
  days left, and on-track boolean relative to deadline
- Auto-milestone detection at 25/50/75/100% of target; returned on every
  response as achieved_milestones list
- Status auto-advances to 'completed' when current_amount >= target_amount
- Backward-compatible migration (CREATE TABLE IF NOT EXISTS) in schema.sql
- 47 tests covering model logic, CRUD, milestone boundaries, and progress
- conftest.py patched with fakeredis so full suite runs without live Redis

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

Goal-based savings tracking & milestones

1 participant