Skip to content

Instantly share code, notes, and snippets.

@sandbochs
Created March 19, 2020 22:14
Show Gist options
  • Save sandbochs/fa6f19e1ab9ada27be5336e64935641f to your computer and use it in GitHub Desktop.
Save sandbochs/fa6f19e1ab9ada27be5336e64935641f to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const stepIdentity = Machine({
id: 'identity',
initial: 'not_started',
states: {
'not_started': {
on: {
'iss_country_submitted': 'in_progress',
'document_submitted': 'in_progress',
'address_submitted': 'in_progress',
}
},
'in_progress': {
on: {
'check_submitted': 'waiting_vendor',
}
},
'waiting_vendor': {
on: {
'check_cleared': 'approved',
'document_breakdown_image_quality': 'recreated',
'document_breakdown_visual_authenticity': 'under_review',
'document_breakdown_police_record': 'blocked'
},
},
'under_review': {
on: {
// waiting_vendor
'document_breakdown_police_record': 'blocked',
// under_review
'authenticity_invalid': 'blocked'
}
},
'recreated': {
on: {
// waiting_vendor
'document_breakdown_police_record': 'blocked',
// under_review
'authenticity_invalid': 'blocked'
}
},
'approved': {
type: 'final'
},
'blocked': {
type: 'final'
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment