const voteMachine = Machine({ id: "Phone Voting", initial: "idle", context: {}, states: { idle: { on: { CALL_ANSWERED: "greetingMsg" } }, greetingMsg: { on: { GREETING_FINISHED: "pinPromptMsg" } }, pinPromptMsg: { on: { PIN_PROMPT_MSG_FINISHED: "pinPrompt" } }, pinPrompt: { on: { PIN_SUCCESS: "registrationNumberPromptMsg" } }, registrationNumberPromptMsg: { on: { REGISTRATION_PROMPT_MSG_FINISHED: "registrationNumberPrompt" } }, registrationNumberPrompt: { on: { REGISTRATION_NO_SUCCESS: "dobPromptMsg" } }, dobPromptMsg: { on: { DOB_PROMPT_MSG_FINISHED: "dobPrompt" } }, dobPrompt: { on: { DOB_SUCCESS: "voteDisclaimerMessage" } }, voteDisclaimerMessage: { on: { VOTE_DISCLAIMER_MESSAGE_COMPLETE: "ballotFlow" } }, ballotFlow: { on: { CAPTURE_ALL_BALLOT_OPTIONS: "recordBallot" } }, recordBallot: { on: { SERVER_RECORDED_BALLOT: "success" } }, success: {} } });