Compare commits
4 Commits
91cd6077ce
...
ed632248c5
| Author | SHA1 | Date | |
|---|---|---|---|
| ed632248c5 | |||
| 5c202741d6 | |||
| c5ebdbf85b | |||
| c4282a870e |
@ -122,6 +122,7 @@ func (ls *LocalHandlerService) GetHandler(accountService remote.AccountServiceIn
|
|||||||
ls.DbRs.AddLocalFunc("get_transactions", ussdHandlers.GetTransactionsList)
|
ls.DbRs.AddLocalFunc("get_transactions", ussdHandlers.GetTransactionsList)
|
||||||
ls.DbRs.AddLocalFunc("view_statement", ussdHandlers.ViewTransactionStatement)
|
ls.DbRs.AddLocalFunc("view_statement", ussdHandlers.ViewTransactionStatement)
|
||||||
ls.DbRs.AddLocalFunc("update_all_profile_items", ussdHandlers.UpdateAllProfileItems)
|
ls.DbRs.AddLocalFunc("update_all_profile_items", ussdHandlers.UpdateAllProfileItems)
|
||||||
|
ls.DbRs.AddLocalFunc("set_back", ussdHandlers.SetBack)
|
||||||
|
|
||||||
return ussdHandlers, nil
|
return ussdHandlers, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@ -726,6 +726,18 @@ func (h *Handlers) ResetIncorrectPin(ctx context.Context, sym string, input []by
|
|||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Setback sets the flag_back_set flag when the navigation is back
|
||||||
|
func (h *Handlers) SetBack(ctx context.Context, sym string, input []byte) (resource.Result, error) {
|
||||||
|
var res resource.Result
|
||||||
|
//TODO:
|
||||||
|
//Add check if the navigation is lateral nav instead of checking the input.
|
||||||
|
if string(input) == "0" {
|
||||||
|
flag_back_set, _ := h.flagManager.GetFlag("flag_back_set")
|
||||||
|
res.FlagSet = append(res.FlagSet, flag_back_set)
|
||||||
|
}
|
||||||
|
return res, nil
|
||||||
|
}
|
||||||
|
|
||||||
// CheckAccountStatus queries the API using the TrackingId and sets flags
|
// CheckAccountStatus queries the API using the TrackingId and sets flags
|
||||||
// based on the account status
|
// based on the account status
|
||||||
func (h *Handlers) CheckAccountStatus(ctx context.Context, sym string, input []byte) (resource.Result, error) {
|
func (h *Handlers) CheckAccountStatus(ctx context.Context, sym string, input []byte) (resource.Result, error) {
|
||||||
@ -1332,6 +1344,9 @@ func (h *Handlers) GetCurrentProfileInfo(ctx context.Context, sym string, input
|
|||||||
flag_gender_set, _ := h.flagManager.GetFlag("flag_gender_set")
|
flag_gender_set, _ := h.flagManager.GetFlag("flag_gender_set")
|
||||||
flag_location_set, _ := h.flagManager.GetFlag("flag_location_set")
|
flag_location_set, _ := h.flagManager.GetFlag("flag_location_set")
|
||||||
flag_offerings_set, _ := h.flagManager.GetFlag("flag_offerings_set")
|
flag_offerings_set, _ := h.flagManager.GetFlag("flag_offerings_set")
|
||||||
|
flag_back_set, _ := h.flagManager.GetFlag("flag_back_set")
|
||||||
|
|
||||||
|
res.FlagReset = append(res.FlagReset, flag_back_set)
|
||||||
|
|
||||||
sessionId, ok := ctx.Value("SessionId").(string)
|
sessionId, ok := ctx.Value("SessionId").(string)
|
||||||
if !ok {
|
if !ok {
|
||||||
@ -2017,6 +2032,7 @@ func (h *Handlers) insertProfileItems(ctx context.Context, sessionId string, res
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// UpdateAllProfileItems is used to persist all the new profile information and setup the required profile flags
|
||||||
func (h *Handlers) UpdateAllProfileItems(ctx context.Context, sym string, input []byte) (resource.Result, error) {
|
func (h *Handlers) UpdateAllProfileItems(ctx context.Context, sym string, input []byte) (resource.Result, error) {
|
||||||
var res resource.Result
|
var res resource.Result
|
||||||
sessionId, ok := ctx.Value("SessionId").(string)
|
sessionId, ok := ctx.Value("SessionId").(string)
|
||||||
|
|||||||
@ -5,9 +5,10 @@ RELOAD get_current_profile_info
|
|||||||
MAP get_current_profile_info
|
MAP get_current_profile_info
|
||||||
MOUT back 0
|
MOUT back 0
|
||||||
HALT
|
HALT
|
||||||
|
RELOAD set_back
|
||||||
|
CATCH _ flag_back_set 1
|
||||||
LOAD save_familyname 64
|
LOAD save_familyname 64
|
||||||
RELOAD save_familyname
|
RELOAD save_familyname
|
||||||
INCMP _ 0
|
|
||||||
CATCH pin_entry flag_familyname_set 1
|
CATCH pin_entry flag_familyname_set 1
|
||||||
CATCH select_gender flag_gender_set 0
|
CATCH select_gender flag_gender_set 0
|
||||||
CATCH edit_yob flag_yob_set 0
|
CATCH edit_yob flag_yob_set 0
|
||||||
|
|||||||
@ -5,7 +5,8 @@ RELOAD get_current_profile_info
|
|||||||
MAP get_current_profile_info
|
MAP get_current_profile_info
|
||||||
MOUT back 0
|
MOUT back 0
|
||||||
HALT
|
HALT
|
||||||
INCMP _ 0
|
RELOAD set_back
|
||||||
|
CATCH _ flag_back_set 1
|
||||||
LOAD save_firstname 128
|
LOAD save_firstname 128
|
||||||
RELOAD save_firstname
|
RELOAD save_firstname
|
||||||
CATCH pin_entry flag_firstname_set 1
|
CATCH pin_entry flag_firstname_set 1
|
||||||
@ -15,4 +16,3 @@ CATCH edit_yob flag_yob_set 0
|
|||||||
CATCH edit_location flag_location_set 0
|
CATCH edit_location flag_location_set 0
|
||||||
CATCH edit_offerings flag_offerings_set 0
|
CATCH edit_offerings flag_offerings_set 0
|
||||||
CATCH pin_entry flag_firstname_set 0
|
CATCH pin_entry flag_firstname_set 0
|
||||||
INCMP edit_family_name *
|
|
||||||
|
|||||||
@ -5,6 +5,8 @@ RELOAD get_current_profile_info
|
|||||||
LOAD save_location 16
|
LOAD save_location 16
|
||||||
MOUT back 0
|
MOUT back 0
|
||||||
HALT
|
HALT
|
||||||
|
RELOAD set_back
|
||||||
|
CATCH _ flag_back_set 1
|
||||||
RELOAD save_location
|
RELOAD save_location
|
||||||
INCMP _ 0
|
INCMP _ 0
|
||||||
CATCH pin_entry flag_location_set 1
|
CATCH pin_entry flag_location_set 1
|
||||||
|
|||||||
@ -5,6 +5,8 @@ RELOAD get_current_profile_info
|
|||||||
LOAD save_offerings 8
|
LOAD save_offerings 8
|
||||||
MOUT back 0
|
MOUT back 0
|
||||||
HALT
|
HALT
|
||||||
|
RELOAD set_back
|
||||||
|
CATCH _ flag_back_set 1
|
||||||
RELOAD save_offerings
|
RELOAD save_offerings
|
||||||
INCMP _ 0
|
INCMP _ 0
|
||||||
CATCH pin_entry flag_offerings_set 1
|
CATCH pin_entry flag_offerings_set 1
|
||||||
|
|||||||
@ -11,6 +11,7 @@ MOUT edit_offerings 6
|
|||||||
MOUT view 7
|
MOUT view 7
|
||||||
MOUT back 0
|
MOUT back 0
|
||||||
HALT
|
HALT
|
||||||
|
LOAD set_back 6
|
||||||
INCMP ^ 0
|
INCMP ^ 0
|
||||||
INCMP edit_first_name 1
|
INCMP edit_first_name 1
|
||||||
INCMP edit_family_name 2
|
INCMP edit_family_name 2
|
||||||
|
|||||||
@ -5,12 +5,13 @@ RELOAD get_current_profile_info
|
|||||||
MAP get_current_profile_info
|
MAP get_current_profile_info
|
||||||
MOUT back 0
|
MOUT back 0
|
||||||
HALT
|
HALT
|
||||||
|
RELOAD set_back
|
||||||
|
CATCH _ flag_back_set 1
|
||||||
LOAD verify_yob 6
|
LOAD verify_yob 6
|
||||||
RELOAD verify_yob
|
RELOAD verify_yob
|
||||||
CATCH incorrect_date_format flag_incorrect_date_format 1
|
CATCH incorrect_date_format flag_incorrect_date_format 1
|
||||||
LOAD save_yob 32
|
LOAD save_yob 32
|
||||||
RELOAD save_yob
|
RELOAD save_yob
|
||||||
INCMP _ 0
|
|
||||||
CATCH pin_entry flag_yob_set 1
|
CATCH pin_entry flag_yob_set 1
|
||||||
CATCH edit_location flag_location_set 0
|
CATCH edit_location flag_location_set 0
|
||||||
CATCH edit_offerings flag_offerings_set 0
|
CATCH edit_offerings flag_offerings_set 0
|
||||||
|
|||||||
@ -27,3 +27,4 @@ flag,flag_yob_set,33,this is set when the yob of the profile is set
|
|||||||
flag,flag_gender_set,34,this is set when the gender of the profile is set
|
flag,flag_gender_set,34,this is set when the gender of the profile is set
|
||||||
flag,flag_location_set,35,this is set when the location of the profile is set
|
flag,flag_location_set,35,this is set when the location of the profile is set
|
||||||
flag,flag_offerings_set,36,this is set when the offerings of the profile is set
|
flag,flag_offerings_set,36,this is set when the offerings of the profile is set
|
||||||
|
flag,flag_back_set,37,this is set when it is a back navigation
|
||||||
|
|||||||
|
Loading…
Reference in New Issue
Block a user