Add Balance Sheet report

New first-tab report showing a full breakdown of where money sits:
- Three KPI cards: total assets, total liabilities, net worth
- Proportional stacked bars showing asset and liability composition
- Side-by-side account lists grouped by type (Cash, Savings, ISAs,
  Investments, Pension, Crypto vs Credit Cards, Loans, Mortgages)
- Backend endpoint GET /api/v1/reports/balance-sheet with typed schema
- Balance Sheet is now the default tab on the Reports page

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
megaproxy 2026-04-21 15:33:34 +00:00
parent 70db18e89f
commit dd66b2d5fe
5 changed files with 337 additions and 5 deletions

View file

@ -6,6 +6,7 @@ from sqlalchemy.ext.asyncio import AsyncSession
from app.dependencies import get_current_user, get_db
from app.db.models.user import User
from app.schemas.report import (
BalanceSheetReport,
BudgetVsActualReport,
CashFlowReport,
CategoryBreakdownReport,
@ -80,3 +81,11 @@ async def spending_trends(
current_user: User = Depends(get_current_user),
):
return await report_service.get_spending_trends(db, current_user.id, months)
@router.get("/balance-sheet", response_model=BalanceSheetReport)
async def balance_sheet(
db: AsyncSession = Depends(get_db),
current_user: User = Depends(get_current_user),
):
return await report_service.get_balance_sheet(db, current_user.id, current_user.base_currency)