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' } } })