Skip to content

Instantly share code, notes, and snippets.

@aditya2337
Last active July 22, 2021 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aditya2337/9b135a40827e37415c3d4c783038f6ea to your computer and use it in GitHub Desktop.
Save aditya2337/9b135a40827e37415c3d4c783038f6ea to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
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