MoneyHub.SpendingGoals (MoneyHub v1.0.0)

Copy Markdown View Source

Spending and income goals: budgeting targets scoped to a category and date range (for example "spend less than £500/month on groceries").

See Spending and Income Goals.

Summary

Functions

Creates a spending/income goal. attrs typically includes "category", "targetAmount", and "period" (e.g. "monthly").

Deletes a spending/income goal.

Fetches a single spending/income goal, including current progress.

Lists spending/income goals for the user identified by token.

Types

goal()

@type goal() :: map()

Functions

create(config, token, attrs)

@spec create(MoneyHub.Config.t(), String.t(), map()) ::
  {:ok, goal()} | {:error, MoneyHub.Error.t()}

Creates a spending/income goal. attrs typically includes "category", "targetAmount", and "period" (e.g. "monthly").

delete(config, token, goal_id)

@spec delete(MoneyHub.Config.t(), String.t(), String.t()) ::
  :ok | {:error, MoneyHub.Error.t()}

Deletes a spending/income goal.

get(config, token, goal_id)

@spec get(MoneyHub.Config.t(), String.t(), String.t()) ::
  {:ok, goal()} | {:error, MoneyHub.Error.t()}

Fetches a single spending/income goal, including current progress.

list(config, token)

@spec list(MoneyHub.Config.t(), String.t()) ::
  {:ok, [goal()]} | {:error, MoneyHub.Error.t()}

Lists spending/income goals for the user identified by token.