Module Daml.Finance.Lifecycle.Rule.Util

Data Types

data Pending

Type used to record pending payments.

Pending

Field Type Description
instrument InstrumentKey  
amount Decimal  

instance Eq Pending

instance Show Pending

Functions

mergeConsumedAndProduced

: [InstrumentQuantity] -> [InstrumentQuantity] -> [Pending]

Merge consumed and produced instruments into a list of pending settlements. This will only reproduce instrument and quantity, not tag or time.

splitPending

: [Pending] -> ([InstrumentQuantity], [InstrumentQuantity])

Map pending settlements into corresponding instrument quantities and split them into consumed and produced. Pending items with an amount of 0.0 are discarded.

net

: [Pending] -> [Pending]

Net pending payments on the same instrument (regardless of tags).