Last active
January 27, 2020 22:59
-
-
Save bcobb/69ded5a4054ade3ce4873e468033668a 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 membershipMachine = Machine({ | |
id: "membership", | |
initial: "idle", | |
states: { | |
idle: { | |
on: { | |
SIGN_UP: "renewing" | |
} | |
}, | |
renewing: { | |
on: { | |
CX_CANCEL: "terminated", | |
CANCEL: "non_renewing", | |
PROCESS: "processing" | |
} | |
}, | |
processing: { | |
on: { | |
FAILURE: "failed", | |
SCA: "requires_action", | |
SUCCESS: "renewing" | |
} | |
}, | |
non_renewing: { | |
on: { | |
REINSTATE: "renewing", | |
CX_CANCEL: "terminated", | |
PROCESS: "expired" | |
} | |
}, | |
failed: { | |
on: { | |
CX_CANCEL: "terminated", | |
CANCEL: "expired", | |
GRACE_PERIOD_PASSES: "expired", | |
RETRY: "processing" | |
} | |
}, | |
requires_action: { | |
on: { | |
CX_CANCEL: "terminated", | |
CANCEL: "expired", | |
GRACE_PERIOD_PASSES: "expired", | |
PROCESS: "processing" | |
} | |
}, | |
expired: { | |
type: "final" | |
}, | |
terminated: { | |
type: "final" | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment