Adiciona GET /api/dashboard?month=YYYY-MM com resumo mensal (% poupado, gastos por categoria, evolução 6 meses, últimas 10 transações, recorrências pendentes). HomeView.vue reescrita com 4 widgets e gráficos CSS nativos. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
36 lines
1.2 KiB
Go
36 lines
1.2 KiB
Go
package model
|
|
|
|
type CategoryTotal struct {
|
|
CategoryID *int `json:"category_id"`
|
|
CategoryName string `json:"category_name"`
|
|
Color string `json:"color"`
|
|
Total float64 `json:"total"`
|
|
}
|
|
|
|
type MonthEvolution struct {
|
|
Month string `json:"month"`
|
|
Income float64 `json:"income"`
|
|
Expenses float64 `json:"expenses"`
|
|
Saved float64 `json:"saved"`
|
|
}
|
|
|
|
type RecentTransaction struct {
|
|
ID int `json:"id"`
|
|
Date string `json:"date"`
|
|
Description string `json:"description"`
|
|
CategoryName string `json:"category_name"`
|
|
Amount float64 `json:"amount"`
|
|
Type string `json:"type"`
|
|
}
|
|
|
|
type DashboardData struct {
|
|
Month string `json:"month"`
|
|
TotalIncome float64 `json:"total_income"`
|
|
TotalExpenses float64 `json:"total_expenses"`
|
|
SavingsPct float64 `json:"savings_pct"`
|
|
ByCategory []CategoryTotal `json:"by_category"`
|
|
MonthlyEvolution []MonthEvolution `json:"monthly_evolution"`
|
|
RecentTransactions []RecentTransaction `json:"recent_transactions"`
|
|
PendingRecurring int `json:"pending_recurring"`
|
|
}
|