Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PrintDeltas ¶
func PrintDeltas(groups []*BudgetCategoryDeltaGroup)
func SumChanges ¶
func SumChanges(deltas []*BudgetCategoryDelta) (int64, int16)
SumChanges calculates the sum of all changes across the given groups It returns the dollars and cents of the changes
Types ¶
type BudgetCategoryDelta ¶
type BudgetCategoryDelta struct { BudgetCategory *model.BudgetCategory InitialDollars int64 InitialCents int16 FinalDollars int64 FinalCents int16 }
func (*BudgetCategoryDelta) CalculateDelta ¶
func (bcd *BudgetCategoryDelta) CalculateDelta() (int64, int16)
CalculateDelta calculates the delta from the initial amount to the final amount. It returns the dollars and cents' difference. This currently only works with additive operations.
func (*BudgetCategoryDelta) HasChanges ¶
func (bcd *BudgetCategoryDelta) HasChanges() bool
HasChanges determines if this delta has any actual changes to be applied
type BudgetCategoryDeltaGroup ¶
type BudgetCategoryDeltaGroup struct { Name string CategoryDeltas []*BudgetCategoryDelta }
func NewDeltas ¶
func NewDeltas(client ynab.Client, budget *model.Budget, actual []*model.BudgetCategoryGroup, toApply *input.BudgetChange) ([]*BudgetCategoryDeltaGroup, error)
Click to show internal directories.
Click to hide internal directories.