feat: goal-based savings tracking with milestones#595
Open
promisingcoder wants to merge 2 commits intorohitdash08:mainfrom
Open
feat: goal-based savings tracking with milestones#595promisingcoder wants to merge 2 commits intorohitdash08:mainfrom
promisingcoder wants to merge 2 commits intorohitdash08:mainfrom
Conversation
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements goal-based savings tracking with automatic milestone detection.
/claim #133
Changes
SavingsGoal Model
achieved_milestones()method for dynamic 25/50/75/100% computationAPI Endpoints (all JWT-protected)
POST /savings-goals— create goalGET /savings-goals— list with optional ?status= filterGET /savings-goals/<id>— single goal with milestonesPUT /savings-goals/<id>— partial update, auto-completionDELETE /savings-goals/<id>— soft delete (status=cancelled)GET /savings-goals/<id>/progress— percentage, remaining, days left, on-trackTests
Documentation
Fixes #133