Skip to content
This repository was archived by the owner on Jun 19, 2026. It is now read-only.

feat: Add savings goals with milestones tracking (#133) - #158

Open
ryantryor wants to merge 1 commit into
rohitdash08:mainfrom
ryantryor:feat/savings-goals-133
Open

feat: Add savings goals with milestones tracking (#133)#158
ryantryor wants to merge 1 commit into
rohitdash08:mainfrom
ryantryor:feat/savings-goals-133

Conversation

@ryantryor

Copy link
Copy Markdown

Summary

Implements Goal-based Savings Tracking feature as requested in #133.

Users can now create savings goals, track progress, and set milestones!

Features

Savings Goals

  • Create goals with name, target amount, deadline
  • Track current savings progress
  • Auto-completion when target is reached
  • Custom icons and colors for visualization

Milestones

  • Add milestones within goals (e.g., "25% there!")
  • Auto-detect when milestones are reached
  • Track milestone completion

API Endpoints

Method Endpoint Description
POST /savings/goals Create new goal
GET /savings/goals List all goals
GET /savings/goals/<id> Get goal details
PUT /savings/goals/<id> Update goal
DELETE /savings/goals/<id> Delete goal
POST /savings/goals/<id>/contribute Add money
POST /savings/goals/<id>/milestones Add milestone
DELETE /savings/goals/<id>/milestones/<mid> Delete milestone

Changes

  • New Models: SavingsGoal, SavingsMilestone
  • New Routes: Full CRUD for goals and milestones
  • Database Schema: savings_goals and savings_milestones tables
  • Tests: 11 test cases covering all functionality

Testing

All code syntax validated:

  • ✅ models_savings.py
  • ✅ routes/savings.py
  • ✅ test_savings.py

/claim #133

Implements goal-based savings tracking functionality:
- SavingsGoal and SavingsMilestone models
- API endpoints for CRUD operations on goals
- Milestone management within goals
- Contribution endpoint to add money to goals
- Auto-completion when target is reached
- Progress tracking with percentage calculation

/claim rohitdash08#133

@rohitdash08 rohitdash08 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this solution need to be reworked, @ryantryor please review the comments also please run the test cases before submitting the rework.

created_at TIMESTAMP NOT NULL DEFAULT NOW()
);

CREATE TABLE IF NOT EXISTS household_members (

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it will create conflicts with the other requirements which we are having related to multiple user using the same dashboard please remove the household members if not required.

app.register_blueprint(categories_bp, url_prefix="/categories")
app.register_blueprint(docs_bp, url_prefix="/docs")
app.register_blueprint(dashboard_bp, url_prefix="/dashboard")
app.register_blueprint(households_bp, url_prefix="/households")

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep it to savings scope only.

target_amount = data.get("target_amount")
currency = data.get("currency", "INR")
deadline = data.get("deadline")
icon = data.get("icon")

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure where the icon is coming from, keep create_goal simple user can easily add the name of the goal and the amount and the deadline currency should be default not dynamic.

color = data.get("color")

if not name:
return jsonify({"error": "Goal name is required"}), 400

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should be 412 instead of 400

@rohitdash08

Copy link
Copy Markdown
Owner

@ryantryor, will be closing this one if no response withing 48 hours.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants