Last active
July 22, 2021 14:04
-
-
Save aditya2337/9b135a40827e37415c3d4c783038f6ea to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Machine({ | |
id: 'Booking new', | |
initial: 'open', | |
states: { | |
initiated: { | |
}, | |
open: { | |
on: { | |
NOTIFY_LOGEX: 'sanityCheckDestination' | |
}, | |
exit: ['click save by shipper'], | |
// entry: send({ type: 'NOTIFY_LOGEX' }), | |
}, | |
sanityCheckDestination: { | |
on: { | |
PASS: 'allocation', | |
FAIL: 'open' | |
}, | |
}, | |
// sanityCheckDestination: { | |
// on: { | |
// PASS: { | |
// target: 'allocation', | |
// }, | |
// FAIL: 'open' | |
// }, | |
// exit: [ | |
// 'assign allocation desk person'] | |
// }, | |
// sanityCheckPassed: { | |
// on: { | |
// NON_GREENLIGHT: 'forwarderApproval', | |
// GREENLIGHT: 'allocation' | |
// } | |
// }, | |
// forwarderApproval: { | |
// on: { | |
// APPROVE: 'allocation', | |
// REJECT: 'discard' | |
// } | |
// }, | |
allocation: { | |
on: { | |
// REQUIRE_APPROVAL: 'allocationApproval', | |
SELECT_SCHEDULE: 'carrierContacted' | |
}, | |
entry: ['create quote sheet'], | |
exit: ['select quote option'] | |
}, | |
// allocationApproval: { | |
// on: { | |
// SELECT_SCHEDULE: 'carrierContacted', | |
// REJECT: 'allocation' | |
// } | |
// }, | |
carrierContacted: { | |
on: { | |
CARRIER_BOOKED: 'carrierConfirmed', | |
CARRIER_REJECTED: 'allocation' | |
} | |
}, | |
carrierConfirmed: { | |
on: { | |
BOOK_CARRIER: 'bookingComplete' | |
} | |
}, | |
bookingComplete: { | |
type: 'final' | |
}, | |
discard: { | |
type: 'final' | |
} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment