Class: Transact

Transact(storage)

Handles (non recurring) transactions.

Constructor

new Transact(storage)

Parameters:
Name Type Description
storage Storage Storage object.
Source:

Methods

addEarning(earningObj, allocationOn)

Stores a new earning entry in the corresponding data file.
Parameters:
Name Type Description
earningObj object The entry to add.
allocationOn bool Specifies whether the entry should be spread across multiple budgets.
Source:

addEarningSingle(earningObj)

Stores a new earning entry for a single budget.
Parameters:
Name Type Description
earningObj object The entry to add.
Source:

addEarningSplit(earningObj)

Stores a new earning entry which is spread across multiple budgets.
Parameters:
Name Type Description
earningObj object The entry to add.
Source:

addSpending(spendingObj)

Stores a new spending entry in the corresponding data file.
Parameters:
Name Type Description
spendingObj object The entry to add.
Source:

addTransferEntries(from, to, amount)

Transfers money from one budget to another by adding transfer entries for them.
Parameters:
Name Type Description
from string The budget from which money should be transferred.
to string The budget to which money should be transferred.
amount number The amount which should be transferred.
Source:

updateMainStorageArr(arrayKey, budgetName, valueToAdd)

Updates an array in the mainstorage, i.e., reads the value for a given budget and adds a given number to it.
Parameters:
Name Type Description
arrayKey string The field of the mainstorage to update (e.g. budgets, allTimeEarnings, allTimeSpendings).
budgetName string The name of the budget which should be updated.
valueToAdd number The number to add.
Source: