Class StepChangeProcessor
Inheritance
StepChangeProcessor
Assembly: LemonEdge.API.Core.FinancialServices.dll
Syntax
[ServerTask("Recalculate Step Change", "8F80D832-906B-4FC8-B0DE-F4662A18183D", typeof(StepChangeProcessParameter), DefaultForHasSaveProcessingTask = typeof(IStepChange))]
public class StepChangeProcessor : BaseTransactionProcessor, IStepChangeProcessor, ILockable, ITaskProcessor, ICanBeRevertedTransactionProcessor, IBaseDataSetProcessorWithDBSave, IBaseDataSetProcessor, IProcessor, IDisposable
Constructors
StepChangeProcessor(IEntityUpdater, IReadOnlyCache, UserInfo, TransactionProcessorFactory, IServiceContext, IPathSplitIdProvider, IRuleAmountUpdaterFactory)
Declaration
public StepChangeProcessor(IEntityUpdater updater, IReadOnlyCache cache, UserInfo user, TransactionProcessorFactory transactionProcessorFactory, IServiceContext services, IPathSplitIdProvider pathSplitProvider, IRuleAmountUpdaterFactory ruleAmountUpdaterFactory)
Parameters
StepChangeProcessor(IServiceContext, IPathSplitIdProvider, IRuleAmountUpdaterFactory)
Declaration
public StepChangeProcessor(IServiceContext services, IPathSplitIdProvider pathSplitProvider, IRuleAmountUpdaterFactory ruleAmountUpdaterFactory)
Parameters
Properties
Algorithms
Declaration
public IEnumerable<IStepChangeAlgorithm> Algorithms { get; }
Property Value
Loaded
Flag to indicate if the processor has been fully loaded
Declaration
public override bool Loaded { get; }
Property Value
Overrides
Movements
The movements loaded from the StepChange entity for this operation
Declaration
public IEnumerable<IStepChangeMovement> Movements { get; }
Property Value
Rebalances
Declaration
public IEnumerable<IStepChangeRebalance> Rebalances { get; }
Property Value
RootTransactionEntity
The root transaction entity for this transaction processor
Declaration
public override IHeaderTransactionalEntity RootTransactionEntity { get; }
Property Value
Overrides
StepChange
The root step change record this processor is responsible for
Declaration
public IStepChange StepChange { get; }
Property Value
StepChangeTransactions
Declaration
public ITransactionProcessor StepChangeTransactions { get; }
Property Value
SubProcessors
An enumeration of all sub processors for this processor
For instance the IBlendTransactionProcessor will have sub processors for processing each
transaction it creates
Declaration
public override IEnumerable<BaseTransactionProcessor> SubProcessors { get; }
Property Value
Overrides
Methods
AddAlgorithm(IStepChangeAlgorithm)
Declaration
public void AddAlgorithm(IStepChangeAlgorithm algorithm)
Parameters
AddMovement(IStepChangeMovement)
Declaration
public void AddMovement(IStepChangeMovement movement)
Parameters
AddRebalance(IStepChangeRebalance)
Declaration
public void AddRebalance(IStepChangeRebalance rebalance)
Parameters
AddToDataSetToProcess(IBaseEntity, EntityOperation)
Declaration
public override void AddToDataSetToProcess(IBaseEntity item, EntityOperation operationType)
Parameters
Type |
Name |
Description |
IBaseEntity |
item |
The item to add to the processor
|
EntityOperation |
operationType |
The type of operation that modified the item. Useful as deleted items can often be treated
differently in a processor.
|
Overrides
Calculate()
Declaration
Returns
CanWrite(IBaseEntity)
Indicates if the processor allows items to be written to depending on the users permission and transaction status
Declaration
public override bool CanWrite(IBaseEntity baseEntity)
Parameters
Returns
Overrides
CustomUpdateCancelCorrectedItem(EntityDescriptor, ITransactionalEntity, ITransactionalEntity, bool)
Provides the implementing class an opportunity to update the cancel, or corrected record generated automatically by
the processor
Declaration
protected override Task CustomUpdateCancelCorrectedItem(EntityDescriptor type, ITransactionalEntity original, ITransactionalEntity cancelCorrected, bool isCorrectionRecord)
Parameters
Type |
Name |
Description |
EntityDescriptor |
type |
The type of the entity being cancelled or corrected
|
ITransactionalEntity |
original |
The original entity record that has a cancel or corrected record generated for it
|
ITransactionalEntity |
cancelCorrected |
The cancel or corrected record, indicated by isCorrectionRecord
|
bool |
isCorrectionRecord |
Indicates cancelCorrected is a correction record. It is a
cancelling record otherwise.
|
Returns
Overrides
DeleteAlgorithmTransactions()
Before running a step change, existing transactions generated from algorithms should be deleted.
Declaration
protected Task DeleteAlgorithmTransactions()
Returns
DisposeManagedState()
Declaration
protected override void DisposeManagedState()
Overrides
EqualizeParallelSplitTransaction(ITransaction, ITransaction, ITransactionProcessor, ISplitTransaction, (IEnumerable<ITransaction>, IEnumerable<ITransactionAllocated>), bool)
Declaration
public Task<ITransaction> EqualizeParallelSplitTransaction(ITransaction original, ITransaction updated, ITransactionProcessor updatedProcessor, ISplitTransaction split, (IEnumerable<ITransaction>, IEnumerable<ITransactionAllocated>) priorAllocations, bool updateDates)
Parameters
Returns
EqualizeParallelSplitTransaction(Guid, IEnumerable<ISplitTransactionLine>, bool)
Declaration
public Task<IEnumerable<ITransaction>> EqualizeParallelSplitTransaction(Guid splitTransactionID, IEnumerable<ISplitTransactionLine> lines, bool updateDates)
Parameters
Returns
EqualizeParallelSplitTransactions(bool, bool)
Declaration
public Task<IEnumerable<ITransaction>> EqualizeParallelSplitTransactions(bool includeCommitted, bool updateDates)
Parameters
Type |
Name |
Description |
bool |
includeCommitted |
|
bool |
updateDates |
|
Returns
EqualizeRootTransaction(ITransaction, List<Guid>, decimal, decimal, bool)
Declaration
public Task<IEnumerable<ITransaction>> EqualizeRootTransaction(ITransaction rootTransaction, List<Guid> processedAlgorithms, decimal progress, decimal progressInc, bool updateDates)
Parameters
Returns
EqualizeTransaction(TransactionProcessor, ITransaction, ITransaction, (IEnumerable<ITransaction>, IEnumerable<ITransactionAllocated>), bool)
Declaration
public Task<ITransaction> EqualizeTransaction(TransactionProcessor processor, ITransaction sourceTransaction, ITransaction header, (IEnumerable<ITransaction>, IEnumerable<ITransactionAllocated>) priorAllocations, bool updateDates)
Parameters
Returns
EqualizeTransactions(IEnumerable<ITransaction>, bool, bool)
Declaration
public Task EqualizeTransactions(IEnumerable<ITransaction> sourceTransactions, bool includeCommitted, bool updateDates)
Parameters
Returns
GetAllItemsInThisProcessorExcludingSubProcessors()
Returns all items in this base processor - Used by the system when reverting the status of a finalized transaction
back to in progress
Declaration
public override IEnumerable<IBaseEntity> GetAllItemsInThisProcessorExcludingSubProcessors()
Returns
Overrides
GetTransactionToEqualize(bool)
Declaration
public Task<IList<ITransaction>> GetTransactionToEqualize(bool includeCommitted)
Parameters
Type |
Name |
Description |
bool |
includeCommitted |
|
Returns
Init(ITaskRunner, ServerTaskParameter)
Initializes the task processor with the parameters for processing the task
Declaration
public Task Init(ITaskRunner runner, ServerTaskParameter ProcessTaskParameter)
Parameters
Type |
Name |
Description |
ITaskRunner |
runner |
The context within which the task is being processed
|
ServerTaskParameter |
ProcessTaskParameter |
The parameter for running this task
|
Returns
Type |
Description |
Task |
A task indicating the completion of the operationn
|
IsChangedItemPartOfDataSet(IBaseEntity)
This function returns true if the specified modified item belongs in this processor.
Non modified items will just automatically be loaded by the processor anyway, this is more to keep track of
items as they are changed and should be added to the processor without having to reload
Declaration
public override bool IsChangedItemPartOfDataSet(IBaseEntity item)
Parameters
Type |
Name |
Description |
IBaseEntity |
item |
The item to check if it belongs in this processor
|
Returns
Type |
Description |
bool |
True if the specified item belongs in this processor
|
Overrides
IsLocked(IBaseEntity)
Indicates if this item is currently locked. True if status is finalized or cancelled. Can be changed by the user in
the UI to modify finalized transactions which this will process as a cancel/correct
Declaration
public override bool IsLocked(IBaseEntity baseEntity)
Parameters
Returns
Type |
Description |
bool |
true if it can be unlocked to enable updates, otherwise false
|
Overrides
KeepTransactionDateConsistent()
Declaration
protected override bool KeepTransactionDateConsistent()
Returns
Overrides
Load()
A thread safe implementation to load all required data for the processor
Once completed Loaded should return true.
Declaration
public override Task Load()
Returns
Type |
Description |
Task |
A task indicating the completion of the load operation
|
Overrides
LoadLight()
loads enough for ui interaction
Declaration
Returns
ProcessTask(CancellationToken)
Declaration
public Task<object> ProcessTask(CancellationToken cancel)
Parameters
Type |
Name |
Description |
CancellationToken |
cancel |
A cancellation token for cancelling any long running task
|
Returns
RecreateAlgorithm(IAlgorithmRun, ITransaction, decimal, decimal)
Declaration
public Task<IEnumerable<ITransaction>> RecreateAlgorithm(IAlgorithmRun originalAlgorithm, ITransaction transaction, decimal toPct, decimal currentPct)
Parameters
Returns
RemoveAlgorithm(IStepChangeAlgorithm)
Declaration
public void RemoveAlgorithm(IStepChangeAlgorithm algorithm)
Parameters
RemoveMovement(IStepChangeMovement)
Declaration
public void RemoveMovement(IStepChangeMovement movement)
Parameters
RemoveRebalance(IStepChangeRebalance)
Declaration
public void RemoveRebalance(IStepChangeRebalance rebalance)
Parameters
SetLock(IBaseEntity, bool)
Declaration
public override void SetLock(IBaseEntity baseEntity, bool value)
Parameters
Overrides
UpdateCalculatedProperties(ITransactionalEntity)
Updates calculated properties on the entity (and presumably sub affected entities) such as financial date
Declaration
protected override Task UpdateCalculatedProperties(ITransactionalEntity tranEntity)
Parameters
Returns
Overrides
Implements
Extension Methods