Skip to main content

Module inventory

Module inventory 

Source
Expand description

Inventory type representing a collection of positions.

An Inventory tracks the holdings of an account as a collection of Positions. It provides methods for adding and reducing positions using different booking methods (FIFO, LIFO, STRICT, NONE).

Structs§

AccountedBookingError
A BookingError paired with the account that produced it.
BookingResult
Result of a booking operation.
Inventory
An inventory is a collection of positions.

Enums§

ArchivedBookingMethod
An archived BookingMethod
BookingError
Error that can occur during booking.
BookingMethod
Booking method determines how lots are matched when reducing positions.
BookingMethodResolver
The resolver for an archived BookingMethod
ReductionScope
Controls which positions are considered when checking whether incoming units reduce (i.e. have the opposite sign of) an existing inventory.

Functions§

sum_account_and_subaccounts
Sum the units of currency across account AND all of its sub-accounts, over a map of per-account inventories.