Savings goals: user-defined targets tracked against the combined balance of one or more accounts, surfacing progress as both an amount and a percentage.
See Spending and Income Goals and the savings-goals recipe.
Summary
Functions
Creates a savings goal. attrs typically includes "name",
"targetAmount", and "accountIds" (the account(s) whose combined
balance counts toward the goal).
Deletes a savings goal.
Fetches a single savings goal, including current progress.
Lists savings goals for the user identified by token.
Updates a savings goal's attributes (e.g. target amount, name, accounts).
Types
@type goal() :: map()
Functions
@spec create(MoneyHub.Config.t(), String.t(), map()) :: {:ok, goal()} | {:error, MoneyHub.Error.t()}
Creates a savings goal. attrs typically includes "name",
"targetAmount", and "accountIds" (the account(s) whose combined
balance counts toward the goal).
@spec delete(MoneyHub.Config.t(), String.t(), String.t()) :: :ok | {:error, MoneyHub.Error.t()}
Deletes a savings goal.
@spec get(MoneyHub.Config.t(), String.t(), String.t()) :: {:ok, goal()} | {:error, MoneyHub.Error.t()}
Fetches a single savings goal, including current progress.
@spec list(MoneyHub.Config.t(), String.t()) :: {:ok, [goal()]} | {:error, MoneyHub.Error.t()}
Lists savings goals for the user identified by token.
@spec update(MoneyHub.Config.t(), String.t(), String.t(), map()) :: {:ok, goal()} | {:error, MoneyHub.Error.t()}
Updates a savings goal's attributes (e.g. target amount, name, accounts).