Skip to content

Instantly share code, notes, and snippets.

@aditya2337
Last active July 20, 2021 14:27
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/abca13d7f9f4263c606ee38dcf6ab56f to your computer and use it in GitHub Desktop.
Save aditya2337/abca13d7f9f4263c606ee38dcf6ab56f 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: 'sanityCheck'
}
},
sanityCheck: {
on: {
PASS: 'sanityCheckPassed',
FAIL: 'open'
}
},
sanityCheckPassed: {
on: {
NON_GREENLIGHT: 'forwarderApproval',
GREENLIGHT: 'allocation'
}
},
forwarderApproval: {
on: {
APPROVE: 'allocation',
REJECT: 'discard'
}
},
allocation: {
on: {
REQUIRE_APPROVAL: 'allocationApproval',
SELECT_SCHEDULE: 'carrierContacted'
}
},
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