chore: replace int amount_cents for string storage and decimal pkg
This commit is contained in:
parent
13774eec7d
commit
c8a1eb5b7a
45 changed files with 706 additions and 587 deletions
|
|
@ -1,15 +1,19 @@
|
|||
package model
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/shopspring/decimal"
|
||||
)
|
||||
|
||||
type DailySpending struct {
|
||||
Date time.Time `db:"date"`
|
||||
TotalCents int `db:"total_cents"`
|
||||
Date time.Time `db:"date"`
|
||||
Total decimal.Decimal `db:"total"`
|
||||
}
|
||||
|
||||
type MonthlySpending struct {
|
||||
Month string `db:"month"`
|
||||
TotalCents int `db:"total_cents"`
|
||||
Month string `db:"month"`
|
||||
Total decimal.Decimal `db:"total"`
|
||||
}
|
||||
|
||||
type SpendingReport struct {
|
||||
|
|
@ -17,7 +21,7 @@ type SpendingReport struct {
|
|||
DailySpending []*DailySpending
|
||||
MonthlySpending []*MonthlySpending
|
||||
TopExpenses []*ExpenseWithTagsAndMethod
|
||||
TotalIncome int
|
||||
TotalExpenses int
|
||||
NetBalance int
|
||||
TotalIncome decimal.Decimal
|
||||
TotalExpenses decimal.Decimal
|
||||
NetBalance decimal.Decimal
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue