feat: goal-based savings tracking & milestones (bounty #133)#937
Open
alexanderxfgl-bit wants to merge 1 commit intorohitdash08:mainfrom
Open
feat: goal-based savings tracking & milestones (bounty #133)#937alexanderxfgl-bit wants to merge 1 commit intorohitdash08:mainfrom
alexanderxfgl-bit wants to merge 1 commit intorohitdash08:mainfrom
Conversation
Implements a full savings goal tracking system with auto-milestones: - SavingsGoal model: name, target_amount, current_amount, currency, deadline, status - SavingsMilestone model: auto-created at 25%/50%/75%/100% thresholds - SavingsContribution model: track deposits with notes and timestamps - Service layer: create_goal, add_contribution, milestone auto-detection, progress calc - REST API: CRUD for goals, contributions, milestones + complete/abandon actions - PostgreSQL schema with indexes for efficient queries - 12 tests covering CRUD, validation, contributions, milestones, abandon Closes rohitdash08#133
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.
Bounty Claim: $250 — Issue #133
Implementation
Full savings goal tracking system with auto-milestones, contributions, and progress monitoring.
Backend Changes
Models (
app/models.py):SavingsGoalStatusenum: active → completed / abandonedSavingsGoal: name, target_amount, current_amount, currency, deadline, statusSavingsMilestone: goal_id, name, target_amount, reached_atSavingsContribution: goal_id, amount, contributed_at, notesService (
app/services/savings.py):create_goal()— with auto-milestone creation at 25%/50%/75%/100% thresholdsadd_contribution()— deposit tracking with auto-completion detection_check_milestones()— marks milestones as reached when current_amount crosses thresholdget_goal_progress()— percent complete, remaining amount, days remainingmark_goal_completed()/abandon_goal()— status transitionsparse_amount()— Decimal validation for all money inputsRoutes (
app/routes/savings.py):POST /savings— create goal with validationGET /savings— list goals with optional status filterGET /savings/<id>— get goal with progress statsPATCH /savings/<id>— update goal (name, target, deadline, status)DELETE /savings/<id>— delete goal with cascading milestones/contributionsPOST /savings/<id>/contributions— add contributionGET /savings/<id>/contributions— list contributionsGET /savings/<id>/milestones— list milestonesPOST /savings/<id>/complete— manually complete goalPOST /savings/<id>/abandon— abandon goalSchema (
app/db/schema.sql):savings_goals,savings_milestones,savings_contributionstablessavings_goal_statusenum typeTests
12 tests covering:
Closes #133