Styleguide
This commit is contained in:
@@ -79,8 +79,7 @@ func (h *Handler) prepareBudgeting(ctx context.Context, budget postgres.Budget,
|
||||
return BudgetingForMonthResponse{}, fmt.Errorf("error loading balances: %w", err)
|
||||
}
|
||||
|
||||
categoriesWithBalance, moneyUsed := h.calculateBalances(
|
||||
budget, firstOfNextMonth, firstOfMonth, categories, cumultativeBalances)
|
||||
categoriesWithBalance, moneyUsed := h.calculateBalances(firstOfNextMonth, firstOfMonth, categories, cumultativeBalances)
|
||||
availableBalance := h.getAvailableBalance(budget, moneyUsed, cumultativeBalances, categoriesWithBalance, firstOfNextMonth)
|
||||
|
||||
data := BudgetingForMonthResponse{categoriesWithBalance, availableBalance}
|
||||
@@ -156,9 +155,8 @@ func (h *Handler) returnBudgetingData(c *gin.Context, budgetUUID uuid.UUID) {
|
||||
c.JSON(http.StatusOK, data)
|
||||
}
|
||||
|
||||
func (h *Handler) calculateBalances(budget postgres.Budget,
|
||||
firstOfNextMonth time.Time, firstOfMonth time.Time, categories []postgres.GetCategoriesRow,
|
||||
cumultativeBalances []postgres.GetCumultativeBalancesRow,
|
||||
func (h *Handler) calculateBalances(firstOfNextMonth time.Time, firstOfMonth time.Time,
|
||||
categories []postgres.GetCategoriesRow, cumultativeBalances []postgres.GetCumultativeBalancesRow,
|
||||
) ([]CategoryWithBalance, numeric.Numeric) {
|
||||
categoriesWithBalance := []CategoryWithBalance{}
|
||||
|
||||
|
Reference in New Issue
Block a user