feat(#21): contas bancárias e patrimônio consolidado

CRUD de contas (corrente/poupança/investimento/cartão) com saldo calculado
automaticamente. account_id nullable em transactions. Widget patrimônio no
dashboard. Tela /contas. Seletor de conta nas transações manuais.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
This commit is contained in:
2026-05-26 21:34:56 -03:00
co-authored by Claude Sonnet 4.6
parent fbcb1d76aa
commit 9a964423fd
21 changed files with 667 additions and 24 deletions
+17
View File
@@ -0,0 +1,17 @@
package model
type Account struct {
ID int `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
InitialBalance float64 `json:"initial_balance"`
Balance float64 `json:"balance"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
}
type AccountInput struct {
Name string `json:"name"`
Type string `json:"type"`
InitialBalance float64 `json:"initial_balance"`
}
+1
View File
@@ -28,6 +28,7 @@ type DashboardData struct {
TotalIncome float64 `json:"total_income"`
TotalExpenses float64 `json:"total_expenses"`
SavingsPct float64 `json:"savings_pct"`
TotalPatrimony float64 `json:"total_patrimony"`
ByCategory []CategoryTotal `json:"by_category"`
MonthlyEvolution []MonthEvolution `json:"monthly_evolution"`
RecentTransactions []RecentTransaction `json:"recent_transactions"`
+1
View File
@@ -10,6 +10,7 @@ type Transaction struct {
Type string `json:"type"` // income | expense
Source string `json:"source"` // manual | import
CategoryID *int `json:"category_id"`
AccountID *int `json:"account_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}