Last active
June 30, 2022 22:04
-
-
Save favila/2e42c698c86c70060d57449736a9dae7 to your computer and use it in GitHub Desktop.
States
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
States | |
# No Signup uuid is known. | |
# These requests are parameterized by email address. | |
No Signup* | |
Create Signup request -> Create Signup Response? | |
Get Redirect to Google OAuth Signup -> TODO | |
Create Signup via Google OAuth -> TODO | |
# A Signup uuid is known. An Incomplete Signup satisfies `find-active-signup-id` | |
Incomplete Signup | |
Complete Signup request -> Complete Signup Response? | |
Delete Signup request -> No Signup | |
Get Signup request -> Get Signup Response? | |
# Update Signup only updates :signup/generic-qas (question-and-answer) data (no effect on state) | |
Update Signup -> Incomplete Signup | |
Completed Signup | |
# Update Signup only updates :signup/generic-qas (question-and-answer) data (no effect on state) | |
Update Signup request -> Completed Signup | |
TODO | |
Decisions? | |
Get Signup Response? | |
# Error response: Logout Required | |
# (Get Signup can only be accessed while not authenticated.) | |
authenticated? -> Incomplete Signup | |
# Error response: Signup email already in use. | |
user has signup email? -> Incomplete Signup | |
# Emits App Event scope/signup-verify | |
verify signup? -> Completed Signup | |
Create Signup Response? | |
bad request? -> Create Signup Error? | |
# Side effects: Update :signup/sent-at, resend email | |
signup exists for email and no email sent in last 24 hours? -> Update Signup sent-at? | |
no signup exists for email and no user owns email? -> Create Signup Record? | |
# Check conditions *in this order* | |
Create Signup Error? | |
banned email domain? -> No Signup | |
email has user already? -> TODO | |
completed signup for email already? -> Completed Signup | |
unusable legacy referral code? -> No Signup | |
unknown Saasquatch referral code? -> No Signup | |
signup exists for email and email sent in last 24 hours? -> Incomplete Signup | |
Update Signup sent-at? | |
sent-at updated? -> Send Signup Email? | |
Send Signup Email? | |
# A signup email contains a link like http://app.shortcut.com/signup/${signup-uuid} | |
# The frontend page at that link will post to the Complete Signup REST endpoint | |
email sent? -> Incomplete Signup | |
Create Signup Record? | |
# See https://www.notion.so/useshortcut/Signup-Flow-Notes-087de916ed7f444e98a147691ea6702e#89149f041fe64d3a9535da6c0500a985 | |
signup created? -> Send Signup Email? | |
Complete Signup Response? | |
bad request? -> Complete Signup Error? | |
# Check conditions *in this order* | |
Complete Signup Error? | |
oauth signup with password? -> Incomplete Signup | |
password does not conform to policy? -> Incomplete Signup | |
user exists already for requested username -> Incomplete Signup | |
terms of service not accepted? -> Incomplete Signup | |
requested org slug is reserved? -> Incomplete Signup | |
requested org slug in use by an org -> Incomplete Signup | |
requested org slug in use by a workspace -> Incomplete Signup | |
## Signup REST operations: | |
# Signup Check Parameter | |
# Delete Signup | |
# Get Signup | |
# Get auto-join workspaces | |
# Complete Signup | |
# Get Signup Invites | |
# Join workspaces via invite and/or domain | |
# Join SSO workspaces via invite and/or domain | |
# Update Signup | |
# Create Signup | |
# Signup Check Parameter | |
# Verify signup code | |
# /oauth/signup(-return) routes: | |
# Get Redirect to Google OAuth Signup | |
# Create Signup via Google OAuth |
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
function render(model){ | |
let current_state_name = model.active_states[0].name; | |
return $("h1", | |
{style: {color: "darkBlue"}}, | |
`The current state is: ${current_state_name}`); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment