Skip to content

feat: Goal-based savings tracking#659

Open
chengyixu wants to merge 1 commit intorohitdash08:mainfrom
chengyixu:feat/goal-based-savings-tracking
Open

feat: Goal-based savings tracking#659
chengyixu wants to merge 1 commit intorohitdash08:mainfrom
chengyixu:feat/goal-based-savings-tracking

Conversation

@chengyixu
Copy link

Summary

Implements goal-based savings tracking feature allowing users to create, manage, and visually track progress toward financial saving targets. Closes #133.

/claim #133

Backend (Flask/SQLAlchemy/PostgreSQL)

  • Models: SavingsGoal (name, description, target/current amount, currency, target date, icon, color, status) and SavingsContribution (amount, note, date) with full lifecycle management (ACTIVE → COMPLETED → CANCELLED)
  • API Endpoints (/savings):
    • GET /savings — List goals with status filter (ACTIVE/COMPLETED/ALL)
    • GET /savings/<id> — Single goal with contribution history
    • POST /savings — Create goal (auto-defaults to user's preferred currency)
    • PATCH /savings/<id> — Update goal details
    • DELETE /savings/<id> — Delete goal and contributions
    • POST /savings/<id>/contributions — Add deposit (auto-completes at 100%)
    • POST /savings/<id>/withdraw — Withdraw with balance validation
    • GET /savings/summary — Aggregate stats across all goals
  • Schema: PostgreSQL migration with indexed savings_goals and savings_contributions tables
  • Tests: 9 comprehensive tests covering CRUD, contributions, auto-complete, withdrawals, validation, status filtering, and currency defaults

Frontend (React/TypeScript/Tailwind)

  • API Client (api/savings.ts): Type-safe client for all endpoints
  • SavingsGoals Page (pages/SavingsGoals.tsx):
    • Summary cards: total saved, total target, overall progress bar, completed count
    • Goal cards with color-coded progress bars, deposit/withdraw/edit/delete actions
    • Target date tracking with days remaining + monthly savings needed calculation
    • Status filter tabs (Active / Completed / All)
    • Create/edit/contribute/withdraw dialogs with validation
    • Empty state with onboarding CTA
  • Navigation: "Savings" link added to navbar between Budgets and Bills
  • Routing: /savings route registered as protected route
  • Test: Frontend integration test suite

Documentation

  • OpenAPI spec updated with all 8 savings endpoints and 6 new schemas

Test plan

  • Backend: pytest tests/test_savings.py — 9 tests pass (CRUD, contributions, auto-complete, withdraw, validation, filtering, currency)
  • Frontend: jest SavingsGoals.integration.test — renders goals, empty state, progress bars, filtering
  • Manual: Create goal → add contributions → verify progress bar updates → complete goal → verify status change
  • Manual: Test withdraw with insufficient balance → verify error
  • Manual: Navigate to /savings from navbar → verify protected route

Generated with Claude Code

…ng, and visual indicators

Implements savings goals feature allowing users to create, track, and manage
financial saving targets with visual progress indicators and contribution history.

Backend:
- SavingsGoal and SavingsContribution SQLAlchemy models with status lifecycle
- Full REST API: CRUD + contributions + withdrawals + summary stats
- Auto-complete when target reached, re-activate on withdrawal below target
- PostgreSQL schema migration with proper indexes
- Comprehensive test suite (9 tests covering CRUD, contributions, auto-complete,
  withdrawals, validation, status filtering, currency defaults)

Frontend:
- Type-safe API client for all savings endpoints
- SavingsGoals page with summary cards, color-coded progress bars,
  goal cards with deposit/withdraw/edit/delete, target date tracking
  with days remaining and monthly savings needed, status filtering
- Navigation link added to navbar, route registered in App.tsx
- Frontend integration test suite

Documentation:
- OpenAPI spec updated with all savings endpoints and schemas

Closes rohitdash08#133

/claim rohitdash08#133

Co-Authored-By: Claude Opus 4.6 (1M context) <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