Created
July 20, 2020 15:11
-
-
Save runeh/e6c2dfa6addc04a139e1cd42eef20885 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
const stiftemaskinenMachine = Machine({ | |
id: 'stiftemaskinen', | |
initial: 'pristine', | |
states: { | |
pristine: { | |
on: { | |
TOUCH_FORM: { | |
target: 'open', | |
}, | |
}, | |
exit: 'assignFoundingId', | |
}, | |
reopened: { | |
on: { | |
'': { | |
target: 'open', | |
actions: ['resetSignatures', 'deleteDocuments'], | |
}, | |
}, | |
}, | |
open: { | |
on: { | |
CONFIRM: { target: 'confirmed', cond: 'foundingIsComplete' }, | |
SAVE: 'saving', | |
}, | |
}, | |
saving: { | |
on: { | |
'': 'open', | |
}, | |
}, | |
confirmed: { | |
entry: ['createDocuments'], | |
on: { | |
REOPEN: 'reopened', | |
FOUNDER_SIGNED: { | |
target: 'awaitingSignatures', | |
actions: ['addSignatureToFounding'], | |
}, | |
}, | |
}, | |
awaitingSignatures: { | |
on: { | |
REOPEN_BY_SUPPORT: 'reopened', | |
SIGN: { | |
target: '', | |
actions: ['addSignatureToFounding'], | |
}, | |
ALL_SIGNED: 'signed', | |
}, | |
}, | |
signed: { | |
on: { | |
REOPEN_BY_SUPPORT: 'reopened', | |
CREATE_FOLIO_ACCOUNT: 'folioOnbarding', | |
USE_OTHER_BANK: 'awaitingBankReceipt', | |
}, | |
}, | |
awaitingBankReceipt: { | |
on: { | |
REOPEN_BY_SUPPORT: 'reopened', | |
REQUEST_FOLIO_ACCOUNT: 'folioOnbarding', | |
UPLOAD_RECEIPT: 'awaitingAltinnSignature', | |
}, | |
}, | |
awaitingAltinnSignature: { | |
on: { | |
APPROVED_BY_BRREG: 'founded', | |
}, | |
}, | |
founded: { type: 'final' }, | |
folioOnbarding: { type: 'final' }, | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment