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

feat: multi-account financial overview dashboard (#132)#1073

Open
Entr0zy wants to merge 2 commits into
rohitdash08:mainfrom
Entr0zy:feat/multi-account-132
Open

feat: multi-account financial overview dashboard (#132)#1073
Entr0zy wants to merge 2 commits into
rohitdash08:mainfrom
Entr0zy:feat/multi-account-132

Conversation

@Entr0zy

@Entr0zy Entr0zy commented May 24, 2026

Copy link
Copy Markdown

Multi-account financial overview dashboard

Implements full multi-account support as described in issue #132.

What's added

Model (app/models.py)

  • AccountType enum — CHECKING | SAVINGS | CREDIT | INVESTMENT | CASH | OTHER
  • FinancialAccount — name, type, balance, currency, institution, is_default, notes, timestamps

Service (app/services/accounts.py)

  • create_account — validates name / type / balance; first account auto-flagged as default; setting is_default=True atomically clears the previous default
  • get_accounts — ordered default-first, then created_at ASC
  • get_account — owner-scoped
  • update_account — partial update with same validations; is_default swap supported
  • delete_account — owner-scoped
  • get_overview — aggregates total_assets (non-credit), total_liabilities (CREDIT), net_worth, by_type map, full accounts list
  • account_to_dict — clean serialiser

Routes (app/routes/accounts.py, registered at /accounts)

Method Path Description
GET /accounts List all accounts (default first)
POST /accounts Create account
GET /accounts/overview Net-worth summary
GET /accounts/ Get single account
PATCH /accounts/ Update account
DELETE /accounts/ Delete account (204)

All endpoints require JWT; every query is scoped to the authenticated user.

Tests (tests/test_accounts.py) — 44 tests, all green

  • Auth gates (401 without token)
  • CRUD happy-path + edge cases
  • Validation errors (missing name, invalid type, non-numeric balance)
  • Cross-user isolation (404 for other user's accounts)
  • Overview aggregation (assets vs liabilities, net_worth, by_type)
  • All six AccountType values accepted

/claim #132


🤖 Generated with Claude Code

Add FinancialAccount model, full CRUD service/routes, and net-worth
overview aggregation.

New model (models.py):
- AccountType enum: CHECKING, SAVINGS, CREDIT, INVESTMENT, CASH, OTHER
- FinancialAccount: id, user_id, name, account_type, balance, currency,
  institution, is_default, notes, created_at, updated_at

New service (app/services/accounts.py):
- create_account  – validates name/type/balance; auto-sets first account
  as default; clears previous default when is_default=True
- get_accounts    – ordered default-first then by created_at
- get_account     – owner-scoped lookup
- update_account  – partial update with same validations
- delete_account  – owner-scoped delete
- get_overview    – aggregates total_assets, total_liabilities (CREDIT),
  net_worth, by_type breakdown, full account list
- account_to_dict – serialiser

New routes (app/routes/accounts.py):
  GET    /accounts              list all accounts
  POST   /accounts              create account
  GET    /accounts/overview     net-worth summary
  GET    /accounts/<id>         get single account
  PATCH  /accounts/<id>         update account
  DELETE /accounts/<id>         delete account (204)

All endpoints require JWT; user isolation enforced throughout.

Tests (tests/test_accounts.py): 44 tests covering auth gates,
CRUD happy paths, validation errors, cross-user isolation, overview
aggregation, and all six account types.

Closes rohitdash08#132

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Entr0zy

Entr0zy commented May 30, 2026

Copy link
Copy Markdown
Author

Docs pass added for the /claim #132 implementation so the API surface is easier to review:

  • Documented /accounts, /accounts/overview, and /accounts/{accountId} in packages/backend/app/openapi.yaml
  • Added request/response schemas for financial accounts and the consolidated net-worth overview
  • Updated the README endpoint list and dashboard plan to mention multi-account overview

Verification:

  • python -m pytest -q tests/test_accounts.py -> 44 passed
  • OpenAPI YAML parse check -> ok
  • git diff --check -> clean aside from local Windows line-ending notices

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant