Expand description

This is an abstract class representing a document and provides methods for creating and manipulating documents.

@typeparam

T - The type of data stored in the document.

@typeparam

A - The type of action the document can take.

Constructors

Creates a new BudgetStatement instance.

Properties

The file extension used to save budget statements.

Account

Returns an array of all accounts in the budget statement.

Adds one or more accounts to the budget statement.

Deletes one or more accounts from the budget statement.

Returns the Account object with the specified address.

Sorts the accounts inthe budget statement.

Updates one or more existing accounts in the budget statement.

Budget Statement

Gets the month of the budget statement.

Gets the owner of the budget statement.

Gets the quote currency of the budget statement.

Other

Gets the timestamp of the date the document was created.

Gets the type of document.

Gets the initial state of the document.

Gets the timestamp of the date the document was last modified.

Gets the name of the document.

Gets the list of operations performed on the document.

Gets the revision number of the document.

Audit

Adds audit reports to the budget statement.

Deletes audit reports from the budget statement.

Retrieves a specific audit report from the budget statement.

@returns

The audit report object if it exists, or undefined if not.

Retrieves all audit reports from the budget statement.

@returns

An array of audit report objects.

Methods

Dispatches an action to update the state of the document.

@returns

The Document instance.

Gets the attachment associated with the given key.

Loads the budget statement from a file.

@returns

A promise that resolves with the loaded BudgetStatement instance.

Loads a document state and a set of operations.

Removes a range of operations from the document.

Reapplies a number of actions to the document.

Saves the budget statement to a file.

@returns

A promise that resolves when the save operation completes.

Sets the name of the document.

Reverts a number of actions from the document.

Creates a new BudgetStatement instance from a file.

@returns

A promise that resolves with the loaded BudgetStatement instance.

Loads the state of the document from a file and returns it.

@returns

The state of the document.

Line Item

Adds a line item to the specified account.

Deletes line items for the specified account.

Retrieves a specific line item for the specified account.

@returns

The line item object that matches the specified category and group, or undefined if it does not exist.

Retrieves line items for the specified account.

@returns

An array of line item objects for the specified account, or undefined if the account does not exist.

Sorts the line items of an account.

Updates line items for the specified account.