data-migration #6

Open
Alfred-mk wants to merge 5 commits from data-migration into master
Showing only changes of commit 799d1a51fa - Show all commits

View File

@ -188,7 +188,14 @@ func (h *MenuHandlers) SetAccountFlags(ctx context.Context, sym string, input []
return res, nil
}
res.Content = string(code)
codeStr := string(code)
Review

The active language is the DATA_SELECTED_LANGUAGE_CODE - the INITAL will only be set once and never looked at again.

Shouldn't the SELECTED_LANGUAGE one be set here too?

The active language is the DATA_SELECTED_LANGUAGE_CODE - the INITAL will only be set once and never looked at again. Shouldn't the SELECTED_LANGUAGE one be set here too?
// fallback for unsupported languages
if codeStr != "eng" && codeStr != "swa" {
Review

I would prefer if this language mapping was an external function. Perhaps this whole thing rather belongs in sarafu-ussd-instance repo since the migration script also should be there? I does not seem right to include code in the application repo that will only be used once by migration.

I would prefer if this language mapping was an external function. Perhaps this whole thing rather belongs in sarafu-ussd-instance repo since the migration script also should be there? I does not seem right to include code in the application repo that will only be used once by migration.
codeStr = "swa"
}
res.Content = codeStr
res.FlagSet = append(res.FlagSet, state.FLAG_LANG)
res.FlagSet = append(res.FlagSet, flag_language_set)
@ -206,7 +213,7 @@ func (h *MenuHandlers) SetAccountFlags(ctx context.Context, sym string, input []
currentWrongPinAttempts, err := store.ReadEntry(ctx, sessionId, storedb.DATA_INCORRECT_PIN_ATTEMPTS)
if err != nil {
if !db.IsNotFound(err) {
return res, err
return res, nil
}
}
pinAttemptsValue, _ := strconv.ParseUint(string(currentWrongPinAttempts), 0, 64)