Commit 8b72e80
fix: use real-time balances for dashboard net worth calculation (#200)
* fix: use real-time balances for dashboard net worth calculation
The dashboard was using only Account.CurrentBalance (the static initial
balance) to calculate TotalBalance, NetWorth, TotalAssets, and
TotalLiabilities. This ignored all transactions, causing the dashboard
to show incorrect values compared to the accounts page.
Now uses GetAccountBalancesAsync() which correctly computes
InitialBalance + Sum(Transactions) — the same method the accounts page
already uses.
Fixes #199
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
* refactor: calculate balance, assets, liabilities in a single pass
Refactored the three separate LINQ iterations over userAccounts into a
single GroupBy pass using a dictionary, as suggested by code review.
This improves performance and consolidates the related calculations.
---------
Co-authored-by: Rodrigo Leote <rodrigol@leapthought.co.nz>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent cc1168d commit 8b72e80
1 file changed
Lines changed: 15 additions & 10 deletions
Lines changed: 15 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
44 | 49 | | |
45 | 50 | | |
46 | 51 | | |
| |||
0 commit comments