Last active
May 6, 2021 12:58
-
-
Save lifedraft/74ca4a5b3d757d0b3fbcad75345b4880 to your computer and use it in GitHub Desktop.
Billing
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
Billing | |
FetchBilling | |
# context: | |
# addresses: (filtered for tenant) | |
# isFilterd: if empty addresses | |
# billingAddress (prefill: registrationData | profile | cart billingAddress) | |
# selection: uuid | new billing address | |
done -> Guard | |
Guard | |
withoutAddresses -> WithoutAddresses | |
withAddresses -> WithAddresses | |
WithoutAddresses | |
Idle* | |
# billingAddress = billingAddress | |
# selection: billingAddress | |
submit -> UpdateBillingService | |
UpdateBillingService | |
# => arguments: | |
# selection: uuid | new billing address; | |
# addressUUID: uuid; | |
# billingAddress: CartAddress | |
# => formValidation!!! | |
# * different validators per tenant | |
# * logged in state | |
# * email not overrideable => should be taken from profile | |
# * city, zip, country should be validated for shipping required. | |
# => error on unavailable uuid. | |
# => setPayment with in the mutation | |
done -> Success | |
fail -> Idle | |
WithAddresses | |
IdleWithAddress* | |
# addressUUID = uuid | |
# selection: uuid | |
selectAddress -> UpdateBillingServiceWithAddress | |
# billingAddress = billingAddress | |
# selection: billingAddress | |
updateBillingAddres -> UpdateBillingServiceWithAddress | |
UpdateBillingServiceWithAddress | |
done -> Success | |
fail -> IdleWithAddress | |
Success |
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