Remove unused prop
This commit is contained in:
@ -25,19 +25,17 @@ func getFirstOfMonthTime(date time.Time) time.Time {
|
||||
|
||||
type CategoryWithBalance struct {
|
||||
*postgres.GetCategoriesRow
|
||||
Available numeric.Numeric
|
||||
AvailableLastMonth numeric.Numeric
|
||||
Activity numeric.Numeric
|
||||
Assigned numeric.Numeric
|
||||
Available numeric.Numeric
|
||||
Activity numeric.Numeric
|
||||
Assigned numeric.Numeric
|
||||
}
|
||||
|
||||
func NewCategoryWithBalance(category *postgres.GetCategoriesRow) CategoryWithBalance {
|
||||
return CategoryWithBalance{
|
||||
GetCategoriesRow: category,
|
||||
Available: numeric.Zero(),
|
||||
AvailableLastMonth: numeric.Zero(),
|
||||
Activity: numeric.Zero(),
|
||||
Assigned: numeric.Zero(),
|
||||
GetCategoriesRow: category,
|
||||
Available: numeric.Zero(),
|
||||
Activity: numeric.Zero(),
|
||||
Assigned: numeric.Zero(),
|
||||
}
|
||||
}
|
||||
|
||||
@ -91,7 +89,6 @@ func (h *Handler) prepareBudgeting(ctx context.Context, budget postgres.Budget,
|
||||
}
|
||||
|
||||
cat.Available = availableBalance
|
||||
cat.AvailableLastMonth = availableBalance
|
||||
}
|
||||
|
||||
data := BudgetingForMonthResponse{categoriesWithBalance, availableBalance}
|
||||
@ -201,9 +198,7 @@ func (*Handler) CalculateCategoryBalances(cat *postgres.GetCategoriesRow,
|
||||
categoryWithBalance.Available = numeric.Zero()
|
||||
}
|
||||
|
||||
if bal.Date.Before(firstOfMonth) {
|
||||
categoryWithBalance.AvailableLastMonth = categoryWithBalance.Available
|
||||
} else if bal.Date.Before(firstOfNextMonth) {
|
||||
if bal.Date.Before(firstOfNextMonth) {
|
||||
categoryWithBalance.Activity = bal.Transactions
|
||||
categoryWithBalance.Assigned = bal.Assignments
|
||||
}
|
||||
|
Reference in New Issue
Block a user