Amatino Swift 0.0.7 is now available! You can install it via Carthage or get the source code from GitHub. 0.0.7 is a major new release that adds significant capability. The powerful Tree, Position, and Performance objects are now available. Here’s the full change-log:
InternalLibraryError, which sneakily survived the error consolidation purge in 0.0.6
PlaceholderNodeclasses (used by
- Drastically simplified and empowered the internal
EntityObjectprotocol, reducing code complexity and duplication (does not affect public API)
- Added unit tests for new features
Plant some Trees
Each node is represented by an instance of a class conforming to the
Node protocol. Two such classes existing:
TreeNodes present summarised account data, including individual and recursive balances. PlaceholderNodes stand in for
TreeNodes where the requesting User does not have read permissions for the Account in question. A PlaceholderNode still includes children, which may include TreeNodes if the User has permission to read from accounts further down the hierarchy.
Positions are generic representations of the accounting construct variously known as a balance sheet, statement of financial position, or something else depending on your jurisdiction. They include hierarchical representations of all asset, liability, and equity Accounts inside an Entity.
Like the Tree, each Account is represented by an instance of an object conforming to the Node protocol.
Performances are generic representations of the accounting construct variously known as an income statement, statement of financial performance, or comprehensive income statement, depending on your jurisdiction. They include hierarchical representations of all income and expense accounts inside an Entity.
Like the Tree and Position objects, each Account is represented by an instance of an object conforming to the
Updating & Deleting Accounts
Account instances now feature
delete() methods, which do what it says on the tin. Here’s an example of an update operation:
Delete operations require a bit of thought. Deleting an Account does not delete any Transactions with Entries party to that Account. As such, you must supply an Account you wish to transfer any Entries to upon deletion. Here’s an example: