MoneyHub.Categories (MoneyHub v1.0.0)

Copy Markdown View Source

The Moneyhub category and category-group taxonomy used to classify transactions, plus business/personal categorisation-as-a-service for data not connected through Moneyhub.

See Categories and Category Groups and Categorisation as a Service.

Summary

Functions

Categorises arbitrary transaction descriptions without requiring a live bank connection ("categorisation as a service"). transactions is a list of maps with at least a "description" key (and ideally "amount" for better accuracy).

Creates a custom category, in addition to Moneyhub's built-in taxonomy. attrs typically includes "name" and the parent "categoryGroup".

Fetches a single category by id.

Lists all categories and category groups.

Lists all category groups (the parent grouping for individual categories).

Types

category()

@type category() :: map()

Functions

categorise(config, token, transactions)

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

Categorises arbitrary transaction descriptions without requiring a live bank connection ("categorisation as a service"). transactions is a list of maps with at least a "description" key (and ideally "amount" for better accuracy).

create(config, token, attrs)

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

Creates a custom category, in addition to Moneyhub's built-in taxonomy. attrs typically includes "name" and the parent "categoryGroup".

get(config, token, category_id)

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

Fetches a single category by id.

list(config, token, opts \\ [])

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

Lists all categories and category groups.

Options

  • :type - :personal (default) or :business, selecting which taxonomy to return.

list_groups(config, token)

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

Lists all category groups (the parent grouping for individual categories).