Skip to content

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

Open
sinatragianpaolo-oc wants to merge 1 commit intorohitdash08:mainfrom
sinatragianpaolo-oc:feat/multi-account-overview
Open

feat: multi-account financial overview dashboard (#132)#392
sinatragianpaolo-oc wants to merge 1 commit intorohitdash08:mainfrom
sinatragianpaolo-oc:feat/multi-account-overview

Conversation

@sinatragianpaolo-oc
Copy link

Summary

Implements Issue #132: Multi-account financial overview — view multiple financial accounts in one place.

Features

Account types supported

BANK, CREDIT, CASH, INVESTMENT, WALLET, OTHER

Endpoints

Method Path Description
GET /accounts List active accounts
POST /accounts Create account
GET /accounts/<id> Get account detail
PATCH /accounts/<id> Update account
DELETE /accounts/<id> Soft-delete (deactivate)
GET /accounts/overview Aggregate view: balance per account + net worth

Overview response

{
  "accounts": [
    {"name": "Main Bank", "balance": 8000.0, "income": 0, "expenses": 2000.0, ...}
  ],
  "summary": {
    "total_assets": 10500.0,
    "total_liabilities": 2000.0,
    "net_worth": 8500.0,
    "unassigned_income": 0.0,
    "unassigned_expenses": 300.0,
    "account_count": 3
  }
}

Backward compatibility

expenses.account_id is nullable — existing expenses continue to work unchanged. Unassigned expenses appear in summary.unassigned_expenses.

Net worth calculation

  • Assets = sum of BANK + CASH + INVESTMENT + WALLET + OTHER balances
  • Liabilities = sum of CREDIT balances
  • Net worth = Assets − Liabilities

Files changed

File Description
app/models.py Account + AccountType + Expense.account_id
app/routes/accounts.py All account endpoints
app/routes/__init__.py Register accounts blueprint
app/db/migrations/005_accounts.sql DB migration
tests/test_accounts.py 27 tests

Acceptance Criteria

  • Production-ready implementation
  • Includes tests (27 tests)
  • Documentation updated

Closes #132

- Account model (BANK/CREDIT/CASH/INVESTMENT/WALLET/OTHER)
- Full CRUD: GET/POST/PATCH/DELETE /accounts
- GET /accounts/overview — aggregate balance, income, expenses per account
- Net worth = total_assets - total_liabilities (CREDIT accounts = liabilities)
- Soft delete (deactivate) to preserve expense history
- Expense.account_id FK (nullable, backward-compatible)
- Migration 005_accounts.sql
- 27 tests covering CRUD, overview, balances, auth

Closes rohitdash08#132
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multi-account financial overview dashboard

1 participant