Styleguide

This commit is contained in:
2022-04-05 19:34:45 +00:00
parent 684efffbdf
commit ce466e0031
2 changed files with 8 additions and 10 deletions

View File

@@ -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{}