Interface IBlendTransactionProcessor
The processor responsible for processing a blended transaction calculation
See https://help.lemonedge.com/blend-transactions/ for more information
Inherited Members
Namespace: LemonEdge.API.Core.FinancialServices.Processors.Transactional
Assembly: LemonEdge.API.Core.FinancialServices.dll
Syntax
public interface IBlendTransactionProcessor : IBaseDataSetProcessorWithDBSave, IBaseDataSetProcessor, ITaskProcessor, IProcessor, IDisposable, ILockable
Properties
BlendTransaction
The blended transaction that is being processed by this processor
Declaration
IBlendTransaction BlendTransaction { get; }
Property Value
| Type | Description |
|---|---|
| IBlendTransaction |
BlendedTransactions
A list of all the ITransaction transactions created automatically by this Blended Transaction
Declaration
ITransactionProcessor BlendedTransactions { get; }
Property Value
| Type | Description |
|---|---|
| ITransactionProcessor |
BlendingTranInstrumentValues
The instrument values the BlendingTransaction configuration can use
Declaration
IEnumerable<IBlendingTransactionInstrumentValue> BlendingTranInstrumentValues { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<IBlendingTransactionInstrumentValue> |
BlendingTranNewValueAggregates
The aggregate values for new transaction values the BlendingTransaction configuration can use
Declaration
IEnumerable<IBlendingTransactionNewValueAggregate> BlendingTranNewValueAggregates { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<IBlendingTransactionNewValueAggregate> |
BlendingTranNewValueAllocations
The allocations to use for new transaction values the BlendingTransaction configuration can use
Declaration
IEnumerable<IBlendingTransactionNewValueAllocation> BlendingTranNewValueAllocations { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<IBlendingTransactionNewValueAllocation> |
BlendingTranNewValues
The new transaction values the BlendingTransaction configuration can use
Declaration
IEnumerable<IBlendingTransactionNewValue> BlendingTranNewValues { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<IBlendingTransactionNewValue> |
BlendingTransaction
The blending transaction holding the configuration and rules for how this blended transaction should be processed
Declaration
IBlendingTransaction BlendingTransaction { get; }
Property Value
| Type | Description |
|---|---|
| IBlendingTransaction |
InstrumentSets
The set of blended transaction instrument sets dictating what instruments/entities to create transactions against
Declaration
IEnumerable<IBlendTransactionInstrumentSet> InstrumentSets { get; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<IBlendTransactionInstrumentSet> |
Methods
GetBlendTransaction(IBlendingTransactionNewValue, IBlendTransactionInstrumentSet, TransactionsHelper, Guid?, Guid?, Guid?, DateTimeOffset, bool)
Retrieves, or creates, the transaction for the specified target values that the blended transaction should automatically be creating
Declaration
Task<ITransaction> GetBlendTransaction(IBlendingTransactionNewValue transactionToCreate, IBlendTransactionInstrumentSet insSet, TransactionsHelper helper, Guid? forInstrumentID, Guid? forEntityID, Guid? forPathID, DateTimeOffset forEffectiveDate, bool forceNew)
Parameters
| Type | Name | Description |
|---|---|---|
| IBlendingTransactionNewValue | transactionToCreate | The defined transaction to create |
| IBlendTransactionInstrumentSet | insSet | The blended transaction target this transaction is being created for |
| TransactionsHelper | helper | A transactions helper class for updating the transaction configuration |
| Guid? | forInstrumentID | An optional instrument this transaction is being created against. If null must supply a
|
| Guid? | forEntityID | An optional entity this transaction is being created against |
| Guid? | forPathID | An optional path this transaction is being created against |
| DateTimeOffset | forEffectiveDate | The transaction date for this transaction. Typically the TransactionDate of the IBlendTransaction unless RepeatDatesEvery is being used |
| bool | forceNew |
Returns
| Type | Description |
|---|---|
| Task<ITransaction> | The transaction for the specified target values that the blended transaction should automatically be creating |
GetDatesForAlgorithmRun()
Returns a list of dates that should be used for creating these transactions.
Depends on the RepeatDatesEvery setting. If None then will just return the IBlendTransaction StartDate, TransactionDate and FinancialDate
If a repetition is configured then it will create a list of dates incrementing from the startdate by the RepeatDatesEveryInterval and RepeatDatesEvery up to the IBlendTransaction TransactionDateDeclaration
IEnumerable<(DateTimeOffset? StartDate, DateTimeOffset EffectiveDate, DateTimeOffset FinancialDate)> GetDatesForAlgorithmRun()
Returns
| Type | Description |
|---|---|
| IEnumerable<(DateTimeOffset? StartDate, DateTimeOffset EffectiveDate, DateTimeOffset FinancialDate)> | A list of dates that should be used for creating these transactions. |
GetInstrumentsToCreateTransactionsAgainst(IBlendingTransactionNewValue, IBlendTransactionInstrumentSet, DateTimeOffset?, DateTimeOffset, DateTimeOffset)
Returns a class indicating how the specified blending transaction to create, should be created for the specified blended transaction instrument source/targets and the specified dates
Declaration
Task<BlendTransactionAllocation> GetInstrumentsToCreateTransactionsAgainst(IBlendingTransactionNewValue transactionToCreate, IBlendTransactionInstrumentSet instrumentSet, DateTimeOffset? startDate, DateTimeOffset effectiveDate, DateTimeOffset financialDate)
Parameters
| Type | Name | Description |
|---|---|---|
| IBlendingTransactionNewValue | transactionToCreate | The configuration against the IBlendingTransaction indicating what type of transaction to create |
| IBlendTransactionInstrumentSet | instrumentSet | The instrument set of source/targets for the transaction that are configured against thie IBlendTransaction |
| DateTimeOffset? | startDate | The optional start date to use for determining values that are applicable for this new transaction |
| DateTimeOffset | effectiveDate | The effective date for the transaction, provided from Transaction date of IBlendTransaction, or incremented from it if RepeatDatesEvery is used |
| DateTimeOffset | financialDate | The financial date for the transaction, provided from FinancialDate, or incremented from it if RepeatDatesEvery is used |
Returns
| Type | Description |
|---|---|
| Task<BlendTransactionAllocation> | A blend Transaction Allocation detailing how to create the transaction with a list of target allocations |
GetSourceTransaction(IBlendTransactionInstrumentSet)
Returns the source transaction from the blended transaction instrument sets ( SourceTransactionID) if one is setup
Declaration
Task<ITransaction> GetSourceTransaction(IBlendTransactionInstrumentSet instSet)
Parameters
| Type | Name | Description |
|---|---|---|
| IBlendTransactionInstrumentSet | instSet | The instrument set against the blended transaction to return the source transaction for |
Returns
| Type | Description |
|---|---|
| Task<ITransaction> | The source transaction from the blended transaction instrument sets ( SourceTransactionID) if one is setup |
GetValueTotals(BlendTransactionAllocation, IBlendingTransactionNewValue, IBlendTransactionInstrumentSet, DateTimeOffset?, DateTimeOffset, DateTimeOffset)
Returns the collection of values that should be allocated to the new transaction by instrument
Declaration
Task<IEnumerable<BlendTransactionValueTotals>> GetValueTotals(BlendTransactionAllocation targets, IBlendingTransactionNewValue transactionToCreate, IBlendTransactionInstrumentSet instrumentSet, DateTimeOffset? startDate, DateTimeOffset effectiveDate, DateTimeOffset financialDate)
Parameters
| Type | Name | Description |
|---|---|---|
| BlendTransactionAllocation | targets | A list of the targets to create the transactions against including their allocation splits. Acquired from GetInstrumentsToCreateTransactionsAgainst(IBlendingTransactionNewValue, IBlendTransactionInstrumentSet, DateTimeOffset?, DateTimeOffset, DateTimeOffset) |
| IBlendingTransactionNewValue | transactionToCreate | The configured transaction to create from the IBlendingTransactionNewValue |
| IBlendTransactionInstrumentSet | instrumentSet | The blended transaction instrument set that we are creating transaction for. Should be the same that GetInstrumentsToCreateTransactionsAgainst(IBlendingTransactionNewValue, IBlendTransactionInstrumentSet, DateTimeOffset?, DateTimeOffset, DateTimeOffset) was called with |
| DateTimeOffset? | startDate | The optional start date to filter the transactions to aggregate by |
| DateTimeOffset | effectiveDate | The transaction date transactions should be filtered up to |
| DateTimeOffset | financialDate | The financial date transactions should be filtered up to |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<BlendTransactionValueTotals>> | A collection of values that should be allocated to the new transaction by instrument |
GetValueTotals(Guid, IBlendingTransactionInstrumentValue, bool, DateTimeOffset?, DateTimeOffset, DateTimeOffset)
Returns the aggregate values for the specified ITransactionAggregator and
ITransactionMatcher defined against the forValue.
The system aggregates these values for the specified instruments and dates, and returns them optionally
byInstrument
Declaration
Task<IEnumerable<ITransactionAggregateResult>> GetValueTotals(Guid instrumentSetID, IBlendingTransactionInstrumentValue forValue, bool byInstrument, DateTimeOffset? startDate, DateTimeOffset effectiveDate, DateTimeOffset financialDate)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | instrumentSetID | The set of instruments that all transactions should be aggregated against |
| IBlendingTransactionInstrumentValue | forValue | The settings of ITransactionMatcher and ITransactionAggregator that define exactly what transactions and values (including gl values) to aggregate |
| bool | byInstrument | Indicates the results should be broken down by the instrument the transactions are against |
| DateTimeOffset? | startDate | The optional start date to filter the transactions to aggregate by |
| DateTimeOffset | effectiveDate | The transaction date transactions should be filtered up to |
| DateTimeOffset | financialDate | The financial date transactions should be filtered up to |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<ITransactionAggregateResult>> | A list of aggregate transaction totals according to the specified instruments, dates and transaction matcher/aggregators |
GetValueTotals(Guid, ITransactionTypeValue, bool, DateTimeOffset?, DateTimeOffset, DateTimeOffset)
Returns the aggregate values for the specified ITransactionTypeValue for the specified
instruments and dates, and returns them optionally byInstrument
Declaration
Task<IEnumerable<ITransactionAggregateResult>> GetValueTotals(Guid instrumentSetID, ITransactionTypeValue forValue, bool byInstrument, DateTimeOffset? startDate, DateTimeOffset effectiveDate, DateTimeOffset financialDate)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | instrumentSetID | The set of instruments that all transactions should be aggregated against |
| ITransactionTypeValue | forValue | The specific transaction value to aggregate |
| bool | byInstrument | Indicates the results should be broken down by the instrument the transactions are against |
| DateTimeOffset? | startDate | The optional start date to filter the transactions to aggregate by |
| DateTimeOffset | effectiveDate | The transaction date transactions should be filtered up to |
| DateTimeOffset | financialDate | The financial date transactions should be filtered up to |
Returns
| Type | Description |
|---|---|
| Task<IEnumerable<ITransactionAggregateResult>> | A list of aggregate transaction totals according to the specified instruments, dates and transaction type value |
LoadBlendingAlgorithm(bool)
Loads the blending transaction algorithm definition for this processor
Declaration
Task LoadBlendingAlgorithm(bool force)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | force | Indicates if the definition should be loaded even if it already has been (incase changes have been made to the defintion) |
Returns
| Type | Description |
|---|---|
| Task | A task indicating the completion of the operation |
LoadLight()
Loads the configuration for this processor, but not the transactions and everything to calculate the algorithm
This is all that is needed to use the processor in the ui
Declaration
Task LoadLight()
Returns
| Type | Description |
|---|---|
| Task | A task indicating the completion of the operation |
RegisterDeleteInstrumentSet(IBlendTransactionInstrumentSet)
Removes a blended transaction instrument set, containing a set of source/target items for transactions to be created against, from this processor
Declaration
void RegisterDeleteInstrumentSet(IBlendTransactionInstrumentSet set)
Parameters
| Type | Name | Description |
|---|---|---|
| IBlendTransactionInstrumentSet | set | The blended transaction instrument set to remove from this processor and stop listening to any changes against it |
RegisterNewInstrumentSet(IBlendTransactionInstrumentSet)
Registers a new blended transaction instrument set containing a set of source/target items for transactions to be created against.
Declaration
void RegisterNewInstrumentSet(IBlendTransactionInstrumentSet set)
Parameters
| Type | Name | Description |
|---|---|---|
| IBlendTransactionInstrumentSet | set | The blended transaction instrument set to register with this processor and listent for changes from |
Events
OnBlendTransactionChanged
The event notifying listeners that changes have been made to the processor
Declaration
event BlendTransactionProcessorEventHandler OnBlendTransactionChanged
Event Type
| Type | Description |
|---|---|
| BlendTransactionProcessorEventHandler |