Adds pin guard and reset states and transitions.

This commit is contained in:
PhilipWafula 2021-11-28 15:48:49 +03:00
parent 7929645bc8
commit c4eeaf682e
Signed by untrusted user: mango-habanero
GPG Key ID: B00CE9034DA19FB7
3 changed files with 127 additions and 1 deletions

View File

@ -11,5 +11,7 @@
"account_creation_prompt", "account_creation_prompt",
"exit_successful_transaction", "exit_successful_transaction",
"exit_insufficient_balance", "exit_insufficient_balance",
"exit_invalid_guardian_addition",
"exit_invalid_guardian_removal",
"complete" "complete"
] ]

View File

@ -23,6 +23,35 @@
"dest": "add_guardian", "dest": "add_guardian",
"conditions": "cic_ussd.state_machine.logic.menu.menu_two_selected" "conditions": "cic_ussd.state_machine.logic.menu.menu_two_selected"
}, },
{
"trigger": "scan_data",
"source": "add_guardian",
"dest": "add_guardian_pin_authorization",
"after": [
"cic_ussd.state_machine.logic.pin_guard.save_guardian_to_session_data",
"cic_ussd.state_machine.logic.pin_guard.retrieve_person_metadata"
],
"conditions": "cic_ussd.state_machine.logic.pin_guard.is_valid_guardian_addition"
},
{
"trigger": "scan_data",
"source": "add_guardian",
"dest": "exit_invalid_guardian_addition",
"unless": "cic_ussd.state_machine.logic.pin_guard.is_valid_guardian_addition"
},
{
"trigger": "scan_data",
"source": "add_guardian_pin_authorization",
"dest": "exit_guardian_addition_success",
"after": "cic_ussd.state_machine.logic.pin_guard.add_pin_guardian",
"conditions": "cic_ussd.state_machine.logic.pin.is_authorized_pin"
},
{
"trigger": "scan_data",
"source": "add_guardian_pin_authorization",
"dest": "exit_pin_blocked",
"conditions": "cic_ussd.state_machine.logic.pin.is_locked_account"
},
{ {
"trigger": "scan_data", "trigger": "scan_data",
"source": "guard_pin", "source": "guard_pin",
@ -31,8 +60,60 @@
}, },
{ {
"trigger": "scan_data", "trigger": "scan_data",
"source": "guard_pin", "source": "remove_guardian",
"dest": "remove_guardian_pin_authorization",
"after": [
"cic_ussd.state_machine.logic.pin_guard.save_guardian_to_session_data",
"cic_ussd.state_machine.logic.pin_guard.retrieve_person_metadata"
],
"conditions": "cic_ussd.state_machine.logic.pin_guard.is_dialers_pin_guardian"
},
{
"trigger": "scan_data",
"source": "remove_guardian",
"dest": "exit_invalid_guardian_removal",
"unless": "cic_ussd.state_machine.logic.pin_guard.is_dialers_pin_guardian"
},
{
"trigger": "scan_data",
"source": "remove_guardian_pin_authorization",
"dest": "exit_guardian_removal_success",
"after": "cic_ussd.state_machine.logic.pin_guard.remove_pin_guardian",
"conditions": "cic_ussd.state_machine.logic.pin.is_authorized_pin"
},
{
"trigger": "scan_data",
"source": "remove_guardian_pin_authorization",
"dest": "exit_pin_blocked",
"conditions": "cic_ussd.state_machine.logic.pin.is_locked_account"
},
{
"trigger": "scan_data",
"source": "exit_guardian_removal_success",
"dest": "exit", "dest": "exit",
"conditions": "cic_ussd.state_machine.logic.menu.menu_nine_selected" "conditions": "cic_ussd.state_machine.logic.menu.menu_nine_selected"
},
{
"trigger": "scan_data",
"source": "exit_invalid_guardian_addition",
"dest": "exit",
"conditions": "cic_ussd.state_machine.logic.menu.menu_nine_selected"
},
{
"trigger": "scan_data",
"source": "exit_invalid_guardian_removal",
"dest": "exit",
"conditions": "cic_ussd.state_machine.logic.menu.menu_nine_selected"
},
{
"trigger": "scan_data",
"source": "guardian_list",
"dest": "exit",
"conditions": "cic_ussd.state_machine.logic.menu.menu_nine_selected"
},
{
"trigger": "scan_data",
"source": "guard_pin",
"dest": "exit_invalid_menu_option"
} }
] ]

View File

@ -0,0 +1,43 @@
[
{
"trigger": "scan_data",
"source": "reset_guarded_pin",
"dest": "reset_guarded_pin_authorization",
"after": [
"cic_ussd.state_machine.logic.pin_guard.save_guarded_account_session_data",
"cic_ussd.state_machine.logic.pin_guard.retrieve_person_metadata"
],
"conditions": "cic_ussd.state_machine.logic.pin_guard.is_others_pin_guardian"
},
{
"trigger": "scan_data",
"source": "reset_guarded_pin_authorization",
"dest": "exit_pin_reset_initiated_success",
"after": "cic_ussd.state_machine.logic.pin_guard.initiate_pin_reset",
"conditions": "cic_ussd.state_machine.logic.pin.is_authorized_pin"
},
{
"trigger": "scan_data",
"source": "exit_pin_reset_initiated_success",
"dest": "exit",
"conditions": "cic_ussd.state_machine.logic.menu.menu_nine_selected"
},
{
"trigger": "scan_data",
"source": "reset_guarded_pin_authorization",
"dest": "exit_pin_blocked",
"conditions": "cic_ussd.state_machine.logic.pin.is_locked_account"
},
{
"trigger": "scan_data",
"source": "reset_guarded_pin",
"dest": "exit_not_authorized_for_pin_reset",
"unless": "cic_ussd.state_machine.logic.pin_guard.is_others_pin_guardian"
},
{
"trigger": "scan_data",
"source": "exit_not_authorized_for_pin_reset",
"dest": "exit",
"conditions": "cic_ussd.state_machine.logic.menu.menu_nine_selected"
}
]