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

feat: Goal-based savings tracking & milestones - #165

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

feat: Goal-based savings tracking & milestones#165
V1ki wants to merge 1 commit into
rohitdash08:mainfrom
V1ki:feat/savings-goals

Conversation

@V1ki

@V1ki V1ki commented Feb 22, 2026

Copy link
Copy Markdown

Summary

Implements savings goal tracking (#133) with progress milestones and contributions.

Features

  • Create savings goals with target amount, currency, and optional deadline
  • Track progress with contributions
  • Auto-completion when target is reached
  • Progress percentage calculation

API Endpoints

  • POST /goals — Create goal
  • GET /goals — List (incomplete first)
  • GET /goals/:id — Detail
  • PATCH /goals/:id — Update
  • POST /goals/:id/contribute — Add contribution
  • DELETE /goals/:id — Delete

Tests

10 test cases covering CRUD, contributions, auto-complete, validation, auth.

Closes #133

/claim #133

Track savings goals with progress milestones and contributions.

- New SavingsGoal model with target, current amount, deadline, completion status
- Full CRUD for goals
- Contribution endpoint to add savings towards goals
- Auto-completion when target is reached
- Progress percentage calculation
- 10 test cases covering all functionality

API Endpoints:
- POST /goals — Create goal
- GET /goals — List goals (incomplete first)
- GET /goals/:id — Get goal
- PATCH /goals/:id — Update goal
- POST /goals/:id/contribute — Add contribution
- DELETE /goals/:id — Delete goal

Closes 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.

@V1ki, the requirement here is user can setup their goals, there can be multiple goals. also have you setup and run the project? tests are failing

logger = logging.getLogger("finmind.goals")


def _serialize(g: SavingsGoal) -> dict:

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.

generic use of parameter's name, please change it.

@bp.post("")
@jwt_required()
def create_goal():
uid = int(get_jwt_identity())

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 how it's helpful while creating multiple goals at the same time, it will override the previous one

target = data.get("target_amount")

if not name:
return jsonify({"error": "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.

use 412 instead of 400

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.

Goal-based savings tracking & milestones

2 participants