Skip to content

Commit

Permalink
Add SubTransactionPrevStates for mongo
Browse files Browse the repository at this point in the history
  • Loading branch information
NV4RE committed May 21, 2020
1 parent 167f9ac commit 21ecfc5
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,29 @@ export const TransactionPrevStates = {
),
};

const subTransactionPrevStateGetter = getPrevState(TransactionNextStates);

export const SubTransactionPrevStates = {
[TransactionStates.Completed]: subTransactionPrevStateGetter(
TransactionStates.Completed,
),
[TransactionStates.Failed]: subTransactionPrevStateGetter(
TransactionStates.Failed,
),
[TransactionStates.Running]: subTransactionPrevStateGetter(
TransactionStates.Running,
),
[TransactionStates.Paused]: subTransactionPrevStateGetter(
TransactionStates.Paused,
),
[TransactionStates.Cancelled]: subTransactionPrevStateGetter(
TransactionStates.Cancelled,
),
[TransactionStates.Compensated]: subTransactionPrevStateGetter(
TransactionStates.Compensated,
),
};

export enum WorkflowStates {
Completed = 'COMPLETED',
Failed = 'FAILED',
Expand Down

0 comments on commit 21ecfc5

Please sign in to comment.