42 lines
1.5 KiB
Go
42 lines
1.5 KiB
Go
package model
|
|
|
|
type Budget struct {
|
|
ID int64 `json:"id"`
|
|
Year int `json:"year"`
|
|
Month *int `json:"month"`
|
|
CategoryID *int64 `json:"category_id"`
|
|
CategoryName string `json:"category_name"`
|
|
CategoryType string `json:"category_type"`
|
|
Amount int64 `json:"amount"`
|
|
Spent int64 `json:"spent"`
|
|
Remaining int64 `json:"remaining"`
|
|
UsagePercent float64 `json:"usage_percent"`
|
|
Note string `json:"note"`
|
|
CreatedAt string `json:"created_at"`
|
|
UpdatedAt string `json:"updated_at"`
|
|
}
|
|
|
|
type UpsertBudgetRequest struct {
|
|
Year int `json:"year"`
|
|
Month *int `json:"month"`
|
|
CategoryID *int64 `json:"category_id"`
|
|
Amount int64 `json:"amount"`
|
|
Note string `json:"note"`
|
|
}
|
|
|
|
type BudgetOverview struct {
|
|
Year int `json:"year"`
|
|
Month int `json:"month"`
|
|
AnnualBudget int64 `json:"annual_budget"`
|
|
AnnualSpent int64 `json:"annual_spent"`
|
|
AnnualRemaining int64 `json:"annual_remaining"`
|
|
AnnualUsagePercent float64 `json:"annual_usage_percent"`
|
|
MonthlyBudget int64 `json:"monthly_budget"`
|
|
MonthlySpent int64 `json:"monthly_spent"`
|
|
MonthlyBudgetedSpent int64 `json:"monthly_budgeted_spent"`
|
|
MonthlyUnbudgetedSpent int64 `json:"monthly_unbudgeted_spent"`
|
|
MonthlyRemaining int64 `json:"monthly_remaining"`
|
|
MonthlyUsagePercent float64 `json:"monthly_usage_percent"`
|
|
Items []Budget `json:"items"`
|
|
}
|