Class SplitTransactionProcessor
Inheritance
SplitTransactionProcessor
Assembly: LemonEdge.API.Core.FinancialServices.dll
Syntax
[ServerTask("Recalculate Split Transaction", "D59BA82B-3E8F-42BC-BD98-BE68E4B5595A", typeof(SplitProcessParameter), DefaultForHasSaveProcessingTask = typeof(ISplitTransaction))]
public class SplitTransactionProcessor : BaseTransactionProcessor, ICanBeRevertedTransactionProcessor, ISplitTransactionProcessor, IBaseDataSetProcessorWithDBSave, IBaseDataSetProcessor, ITaskProcessor, IProcessor, IDisposable, ILockable
Constructors
SplitTransactionProcessor(IEntityUpdater, IReadOnlyCache, UserInfo, IServiceContext, IPathSplitIdProvider, IRuleAmountUpdaterFactory)
Declaration
public SplitTransactionProcessor(IEntityUpdater updater, IReadOnlyCache cache, UserInfo user, IServiceContext services, IPathSplitIdProvider pathSplitProvider, IRuleAmountUpdaterFactory ruleAmountUpdaterFactory)
Parameters
SplitTransactionProcessor(IServiceContext)
Declaration
public SplitTransactionProcessor(IServiceContext services)
Parameters
Fields
AUTO_BLEND_TRANSACTION_DESC_PREFIX
Declaration
public const string AUTO_BLEND_TRANSACTION_DESC_PREFIX = "Auto: "
Field Value
Properties
AnyChangeRequiresTaskRecalc
If this root transaction item implements IHasSaveProcessingTask then the system will
automatically create a task for any existing SavedTaskParam configured for
the root transaction
It will modify this task if performing a cancel, cancel/correct or moving to finalized depending on
CommitToFinalizeRequiresTask
This indicates that any normal change not against this root entity should not result in it recreating a task stored
against
SavedTaskParam. By default this is false so it only recreates the
task when the root item itself has changed and thus SavedTaskParam will have too.
Declaration
protected override bool AnyChangeRequiresTaskRecalc { get; }
Property Value
Overrides
Lines
The set of lines for dictating how to split the transaction
Declaration
public IEnumerable<ISplitTransactionLine> Lines { get; }
Property Value
Loaded
Flag to indicate if the processor has been fully loaded
Declaration
public override bool Loaded { get; }
Property Value
Overrides
RootTransactionEntity
The root transaction entity for this transaction processor
Declaration
public override IHeaderTransactionalEntity RootTransactionEntity { get; }
Property Value
Overrides
SourceTransactionProcessor
The processor for the source transaction
Declaration
public ITransactionProcessor SourceTransactionProcessor { get; }
Property Value
SplitTransaction
The split transaction that is being processed by this processor
Declaration
public ISplitTransaction SplitTransaction { get; }
Property Value
SplitTransactionsProccessor
The transaction processor for the split transactions
Declaration
public ITransactionProcessor SplitTransactionsProccessor { 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
Switches
Declaration
public IEnumerable<ISplitTransactionSwitch> Switches { get; }
Property Value
Methods
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
DisposeManagedState()
Declaration
protected override void DisposeManagedState()
Overrides
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
GetAllPaths()
Declaration
public Task<IEnumerable<IAllocationPath>> GetAllPaths()
Returns
GetSplitQueryPaths(SQLWrapperExecuter)
Declaration
public Task<IEnumerable<IAllocationPath>> GetSplitQueryPaths(SQLWrapperExecuter queryExecutor)
Parameters
Returns
GetSplitQueryWithReprocessedPaths()
Declaration
public Task<SQLWrapperExecuter> GetSplitQueryWithReprocessedPaths()
Returns
GetTransactionInfo(ITransaction)
Declaration
public static (bool IsTransferTransactionType, Guid TrnsactionSourceID) GetTransactionInfo(ITransaction splitTransaction)
Parameters
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
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
RegisterDeleteLine(ISplitTransactionLine)
registers removing a transaction line
Declaration
public void RegisterDeleteLine(ISplitTransactionLine line)
Parameters
RegisterDeleteSwitch(ISplitTransactionSwitch)
Declaration
public void RegisterDeleteSwitch(ISplitTransactionSwitch splitSwitch)
Parameters
RegisterNewLine(ISplitTransactionLine)
Registers a new split transaction line
Declaration
public void RegisterNewLine(ISplitTransactionLine line)
Parameters
RegisterNewSwitch(ISplitTransactionSwitch)
Declaration
public void RegisterNewSwitch(ISplitTransactionSwitch splitSwitch)
Parameters
SetLock(IBaseEntity, bool)
Declaration
public override void SetLock(IBaseEntity baseEntity, bool value)
Parameters
Overrides
Validate()
Performs custom validation to validate this processor and all transactional entities within it
Throws an error for any validation failure
Declaration
public override Task Validate()
Returns
Type |
Description |
Task |
A task indicating the completion of this operation
|
Overrides
Implements
Extension Methods