MoneyHub.NotificationThresholds (MoneyHub v1.0.0)

Copy Markdown View Source

Balance notification thresholds on an account - configure a balance level which, when crossed, triggers the balanceThreshold webhook (see MoneyHub.Webhooks). Used for low-balance alerts and patterns like "Smart Saver" VRP sweeping.

Summary

Functions

Adds a notification threshold to an account. attrs typically includes the threshold "amount" and direction (e.g. below/above).

Deletes a notification threshold.

Lists notification thresholds configured for an account.

Updates a notification threshold's attributes.

Types

threshold()

@type threshold() :: map()

Functions

create(config, token, account_id, attrs)

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

Adds a notification threshold to an account. attrs typically includes the threshold "amount" and direction (e.g. below/above).

delete(config, token, account_id, threshold_id)

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

Deletes a notification threshold.

list(config, token, account_id)

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

Lists notification thresholds configured for an account.

update(config, token, account_id, threshold_id, attrs)

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

Updates a notification threshold's attributes.