Last active
July 20, 2021 14:27
-
-
Save aditya2337/abca13d7f9f4263c606ee38dcf6ab56f 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: '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