Skip to content

Instantly share code, notes, and snippets.

@RafalFilipek
Last active March 2, 2020 15:03
Show Gist options
  • Save RafalFilipek/48a9cc3c5a8710931ea8e8274ca8ca34 to your computer and use it in GitHub Desktop.
Save RafalFilipek/48a9cc3c5a8710931ea8e8274ca8ca34 to your computer and use it in GitHub Desktop.
# Wyrazy rozpoczynające się od małej litery są stanami.
# Wyrazy rozpoczynające się od małej litery są stanami.
# Wyrazy pisane wielkimi literami są akcjami.
#
# `_entry` - akcja wykonyana na wejściu do danego stanu
# `_entry_[suffix]` - akcja w wykonywana na wejściu do danego podstanu. Sufix jest niezbędny aby uniknąć kolizji nazw
# `_entry - condition? [value]` -> akcja wykonywana tylko gdy `condition [value]` jest spełniona
Sufler
Resolve*
_entry -> offerGroups
offerGroups
SELECT_OFFER_GROUP -> offers
offers
_entry - isMaintenance? -> maintenance
_entry - isSingleOfferInGroup? -> offerActionResolver
SELECT_OFFER -> offerActionResolver
offerActionResolver
_entry - isFix? -> fix
_entry -> mobile
fix
_entry_fix - isLoggedIn? -> adresses
_entry_fix - isExistingCustomer? -> authorization
_entry_fix -> localization
mobile
_entry_mobile -> processes
processes
SELECT_PROCESS -> processActionResolver
processActionResolver
_entry - isRetentionProcess? -> retention
_entry -> other
retention
_entry_retention - isNotLoggedIn? -> authorization
_entry_retention - validNumberOfContracts? 0 -> error
_entry_retention - validNumberOfContracts? 1 -> contracts
_entry_retention -> numbersList
other
_entry_other - isActivationProcess? -> contracts
_entry_other -> authorization
adresses
_entry validAddressesCount? 0 -> localization
_entry validServicesCount? 0 -> error
SELECT_ADDRESS -> migration
SELECT_NEW_ADDRESS -> localization
localization
SELECT_LOCALIZATION -> contracts
migration
SELECT_PROCESS -> contracts
authorization
SUCCESS isFix? -> adresses
SUCCESS -> contracts
FAIL -> error
verification
SUCCESS -> contracts
FAIL -> error
contracts
ADD_DEVICE -> redirect
ADD_TO_CART -> redirect
CONTINUE - withDiscounts? -> verification
CONTINUE -> summary
numbersList
NUMBER_SELECT -> contracts
summary
ADD_CONTRACT -> processes
SHOW_CART -> redirect
maintenance
error
redirect
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