mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-28 20:53:24 +10:00
txIsCanceled check for transaction state
This commit is contained in:
parent
321a23c07d
commit
055d58568c
1 changed files with 6 additions and 0 deletions
|
|
@ -152,6 +152,9 @@ export const TX_TRANSITION_REJECT = 'transition/reject';
|
|||
// transitioned with the auto-reject transition.
|
||||
export const TX_TRANSITION_AUTO_REJECT = 'transition/auto-reject';
|
||||
|
||||
// Admin can also cancel the transition.
|
||||
export const TX_TRANSITION_CANCEL = 'transition/cancel';
|
||||
|
||||
// If the is marked as delivered in the backend, it is transitioned
|
||||
// with the mark-delivered transition.
|
||||
export const TX_TRANSITION_MARK_DELIVERED = 'transition/mark-delivered';
|
||||
|
|
@ -161,6 +164,7 @@ export const TX_TRANSITIONS = [
|
|||
TX_TRANSITION_ACCEPT,
|
||||
TX_TRANSITION_REJECT,
|
||||
TX_TRANSITION_AUTO_REJECT,
|
||||
TX_TRANSITION_CANCEL,
|
||||
TX_TRANSITION_MARK_DELIVERED,
|
||||
];
|
||||
|
||||
|
|
@ -176,6 +180,8 @@ export const txIsAutorejected = tx => txLastTransition(tx) === TX_TRANSITION_AUT
|
|||
|
||||
export const txIsRejectedOrAutorejected = tx => txIsRejected(tx) || txIsAutorejected(tx);
|
||||
|
||||
export const txIsCanceled = tx => txLastTransition(tx) === TX_TRANSITION_CANCEL;
|
||||
|
||||
export const txIsDelivered = tx => txLastTransition(tx) === TX_TRANSITION_MARK_DELIVERED;
|
||||
|
||||
// Denormalised transaction object
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue