diff --git a/app/src/main/java/com/swifttech/remit/android/features/changepassNPin/presenter/ChangePassNPinViewModel.java b/app/src/main/java/com/swifttech/remit/android/features/changepassNPin/presenter/ChangePassNPinViewModel.java index 3cadb514..779b4e70 100644 --- a/app/src/main/java/com/swifttech/remit/android/features/changepassNPin/presenter/ChangePassNPinViewModel.java +++ b/app/src/main/java/com/swifttech/remit/android/features/changepassNPin/presenter/ChangePassNPinViewModel.java @@ -163,41 +163,40 @@ public class ChangePassNPinViewModel extends BaseViewModel implements ChangePass boolean isCurrentPasswordValid(CharSequence password) { - if (password != null && password.length() > 0) { + if(password!=null && password.toString().trim().matches("^(?=.*[A-Z])(?=.*[0-9])(?=.*[a-z]).{8,24}$")){ this.currentPassword = password.toString(); changePassNPinLiveData.setCurrentPasswordInputLiveData(new FormInputStateDTO<>(true, null)); return true; - } else { + }else{ this.currentPassword = null; - changePassNPinLiveData.setCurrentPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_empty_error))); + changePassNPinLiveData.setCurrentPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_error_text))); return false; } - } boolean isNewPasswordValid(CharSequence password) { - if (password != null && password.length() > 0) { + if (password!=null && password.toString().trim().matches("^(?=.*[A-Z])(?=.*[0-9])(?=.*[a-z]).{8,24}$")) { this.newPassword = password.toString(); changePassNPinLiveData.setNewPasswordInputLiveData(new FormInputStateDTO<>(true, null)); return true; } else { this.newPassword = null; - changePassNPinLiveData.setNewPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_empty_error))); + changePassNPinLiveData.setNewPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_error_text))); return false; } } boolean isConfirmPasswordValid(CharSequence password) { - if (password != null && password.length() > 0) { + if (password!=null && password.toString().trim().matches("^(?=.*[A-Z])(?=.*[0-9])(?=.*[a-z]).{8,24}$")) { this.confirmPassword = password.toString(); changePassNPinLiveData.setConfirmPasswordInputLiveData(new FormInputStateDTO<>(true, null)); return true; } else { this.confirmPassword = null; - changePassNPinLiveData.setConfirmPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_empty_error))); + changePassNPinLiveData.setConfirmPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_error_text))); return false; } diff --git a/app/src/main/java/com/swifttech/remit/android/features/changepassword/presenter/ChangePasswordV2Presenter.java b/app/src/main/java/com/swifttech/remit/android/features/changepassword/presenter/ChangePasswordV2Presenter.java index 655c15c6..cfdb2882 100644 --- a/app/src/main/java/com/swifttech/remit/android/features/changepassword/presenter/ChangePasswordV2Presenter.java +++ b/app/src/main/java/com/swifttech/remit/android/features/changepassword/presenter/ChangePasswordV2Presenter.java @@ -103,13 +103,13 @@ public class ChangePasswordV2Presenter extends BaseViewModel implements ChangePa private String confirmPassword; boolean isCurrentPasswordValid(CharSequence password) { - if (password != null && password.length() > 0) { + if (password!=null && password.toString().trim().matches("^(?=.*[A-Z])(?=.*[0-9])(?=.*[a-z]).{8,24}$")) { this.currentPassword = password.toString(); changePasswordLiveData.setCurrentPasswordInputLiveData(new FormInputStateDTO<>(true, null)); return true; } else { this.currentPassword = null; - changePasswordLiveData.setCurrentPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_empty_error))); + changePasswordLiveData.setCurrentPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_error_text))); return false; } @@ -117,27 +117,27 @@ public class ChangePasswordV2Presenter extends BaseViewModel implements ChangePa boolean isNewPasswordValid(CharSequence password) { - if (password != null && password.length() > 0) { + if (password!=null && password.toString().trim().matches("^(?=.*[A-Z])(?=.*[0-9])(?=.*[a-z]).{8,24}$")) { this.newPassword = password.toString(); changePasswordLiveData.setNewPasswordInputLiveData(new FormInputStateDTO<>(true, null)); return true; } else { this.newPassword = null; - changePasswordLiveData.setNewPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_empty_error))); + changePasswordLiveData.setNewPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_error_text))); return false; } } boolean isConfirmPasswordValid(CharSequence password) { - if (password != null && password.length() > 0) { + if (password!=null && password.toString().trim().matches("^(?=.*[A-Z])(?=.*[0-9])(?=.*[a-z]).{8,24}$")) { this.confirmPassword = password.toString(); changePasswordLiveData.setConfirmPasswordInputLiveData(new FormInputStateDTO<>(true, null)); return true; } else { this.confirmPassword = null; - changePasswordLiveData.setConfirmPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_empty_error))); + changePasswordLiveData.setConfirmPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_error_text))); return false; } diff --git a/app/src/main/java/com/swifttech/remit/android/features/kyc/newCustomer/presenter/KYCV3ViewModel.java b/app/src/main/java/com/swifttech/remit/android/features/kyc/newCustomer/presenter/KYCV3ViewModel.java index cbd5be3f..b6854c4b 100644 --- a/app/src/main/java/com/swifttech/remit/android/features/kyc/newCustomer/presenter/KYCV3ViewModel.java +++ b/app/src/main/java/com/swifttech/remit/android/features/kyc/newCustomer/presenter/KYCV3ViewModel.java @@ -62,6 +62,7 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter private PublishSubject form1ValidationSubject; private PublishSubject form2ValidationSubject; private CustomerDetailViewLiveData.CustomerDetailViewBinding viewBindings; + private Boolean isBackAdditionalRequired; public KYCV3ViewModel(KYCV3ViewContractInterface view, KYCV3GatewayInterface gatewayInterface, FileDownloadGateway fileDownloadGateway, LoginV2InteractorInterface.Login2GatewayInterface loginGateway, String userId, String userPwd) { this.compositeDisposable = new CompositeDisposable(); @@ -232,6 +233,7 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter purposeOfRegistration=new IDTextDTO(purposeOfRegisterId,purposeOfRegisterId); } + IDTextDTO additionalId= data.getAdditionalIdTypeFromId(personalInfoDTO.getAdditionalIdType()); customerDetailLiveData.getEmployerNameLiveData().postValue(new FormInputStateDTO<>(true, null, personalInfoDTO.getEmployeerName())); customerDetailLiveData.getOccupationsLiveData().postValue(new FormInputStateDTO<>(true, null, occupation)); customerDetailLiveData.getSourceOfFundLiveData().postValue(new FormInputStateDTO<>(true, null,sourceOfFund )); @@ -239,7 +241,7 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter customerDetailLiveData.getMonthlyIncomeLiveData().postValue(new FormInputStateDTO<>(true, null, data.getMonthlyIncomeFromId(personalInfoDTO.getMonthlyIncome()))); customerDetailLiveData.getBusinessTypeLiveData().postValue(new FormInputStateDTO<>(true, null, data.getBusinessTypeFromId(personalInfoDTO.getBusinessType()))); customerDetailLiveData.getIdTypeLiveData().postValue(new FormInputStateDTO<>(true, null, data.getIDypeFromId(personalInfoDTO.getIdType()))); - customerDetailLiveData.getAdditionalIdTypeLiveData().postValue(new FormInputStateDTO<>(true, null, data.getAdditionalIdTypeFromId(personalInfoDTO.getAdditionalIdType()))); + customerDetailLiveData.getAdditionalIdTypeLiveData().postValue(new FormInputStateDTO<>(true, null,additionalId) ); customerDetailLiveData.getMobileNumberLiveData().postValue(new FormInputStateDTO<>(true, null, mobileNumber)); customerDetailLiveData.getEmailLiveData().postValue(new FormInputStateDTO<>(true, null, personalInfoDTO.getEmail())); @@ -1069,5 +1071,11 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter } } + public Boolean getBackAdditionalRequired() { + return isBackAdditionalRequired; + } + public void setBackAdditionalRequired(Boolean backAdditionalRequired) { + isBackAdditionalRequired = backAdditionalRequired; + } } diff --git a/app/src/main/java/com/swifttech/remit/android/features/kyc/newCustomer/view/documents/KYCIDTypeFragment.java b/app/src/main/java/com/swifttech/remit/android/features/kyc/newCustomer/view/documents/KYCIDTypeFragment.java index be340b35..10ad657e 100644 --- a/app/src/main/java/com/swifttech/remit/android/features/kyc/newCustomer/view/documents/KYCIDTypeFragment.java +++ b/app/src/main/java/com/swifttech/remit/android/features/kyc/newCustomer/view/documents/KYCIDTypeFragment.java @@ -81,7 +81,6 @@ public class KYCIDTypeFragment extends BaseFragment { LinearLayout rootView; -// @BindView(R.id.scrollView) NestedScrollView scrollView; diff --git a/app/src/main/java/com/swifttech/remit/android/features/login/presenter/LoginV2Presenter.java b/app/src/main/java/com/swifttech/remit/android/features/login/presenter/LoginV2Presenter.java index 9c8d2ac5..8f1ed6a4 100644 --- a/app/src/main/java/com/swifttech/remit/android/features/login/presenter/LoginV2Presenter.java +++ b/app/src/main/java/com/swifttech/remit/android/features/login/presenter/LoginV2Presenter.java @@ -198,18 +198,16 @@ public class LoginV2Presenter extends BaseViewModel implements LoginV2PresenterI } private boolean validatePassword(CharSequence password) { - - if (password == null || password.length() < 1) { - loginViewLiveData.setPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_empty_error))); - this.password = null; - return false; - } else { + if(password!=null && password.toString().trim().matches("^(?=.*[A-Z])(?=.*[0-9])(?=.*[a-z]).{8,24}$")){ loginViewLiveData.setPasswordInputLiveData(new FormInputStateDTO<>(true, "")); this.password = password.toString(); return true; + }else{ + loginViewLiveData.setPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_error_text))); + this.password = null; + return false; } - } } diff --git a/app/src/main/java/com/swifttech/remit/android/features/registerv2/existingcustomer/presenter/ExistingCustomerRegisterV2Presenter.java b/app/src/main/java/com/swifttech/remit/android/features/registerv2/existingcustomer/presenter/ExistingCustomerRegisterV2Presenter.java index 838d2655..c7a87973 100644 --- a/app/src/main/java/com/swifttech/remit/android/features/registerv2/existingcustomer/presenter/ExistingCustomerRegisterV2Presenter.java +++ b/app/src/main/java/com/swifttech/remit/android/features/registerv2/existingcustomer/presenter/ExistingCustomerRegisterV2Presenter.java @@ -351,26 +351,26 @@ public class ExistingCustomerRegisterV2Presenter extends BaseViewModel implement } public boolean validatePassword(CharSequence password) { - if (password == null || password.length() < 6 || Utility.trim(password).length()<1) { - existingRegisterSubmitViewLiveData.setNewPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_policy_text))); - this.password = null; - return false; - } else { + if(password!=null && password.toString().trim().matches("^(?=.*[A-Z])(?=.*[0-9])(?=.*[a-z]).{8,24}$")) { existingRegisterSubmitViewLiveData.setNewPasswordInputLiveData(new FormInputStateDTO<>(true, "")); this.password = password.toString(); return true; + }else{ + existingRegisterSubmitViewLiveData.setNewPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_error_text))); + this.password = null; + return false; } } - public boolean validateConfirmPassword(CharSequence confirmPassword) { - if (confirmPassword == null || confirmPassword.length() < 6 || Utility.trim(confirmPassword).length()<1) { - existingRegisterSubmitViewLiveData.setConfirmPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.confirm_password_policy_text))); - this.confirmPassword = null; - return false; - } else { + public boolean validateConfirmPassword(CharSequence password) { + if(password!=null && password.toString().trim().matches("^(?=.*[A-Z])(?=.*[0-9])(?=.*[a-z]).{8,24}$")) { existingRegisterSubmitViewLiveData.setConfirmPasswordInputLiveData(new FormInputStateDTO<>(true, "")); - this.confirmPassword = confirmPassword.toString(); + this.confirmPassword = password.toString(); return true; + }else{ + existingRegisterSubmitViewLiveData.setConfirmPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_error_text))); + this.confirmPassword = null; + return false; } } diff --git a/app/src/main/java/com/swifttech/remit/android/features/registerv2/newcustomer/presenter/NewRegisterV2Presenter.java b/app/src/main/java/com/swifttech/remit/android/features/registerv2/newcustomer/presenter/NewRegisterV2Presenter.java index 4201c172..827bcc5d 100644 --- a/app/src/main/java/com/swifttech/remit/android/features/registerv2/newcustomer/presenter/NewRegisterV2Presenter.java +++ b/app/src/main/java/com/swifttech/remit/android/features/registerv2/newcustomer/presenter/NewRegisterV2Presenter.java @@ -289,29 +289,26 @@ public class NewRegisterV2Presenter extends BaseViewModel implements NewRegister } private boolean validatePassword(CharSequence password) { - if (password == null || password.length() < 6|| Utility.trim(password).length()<1) { - newExistingRegisterViewLiveData.setPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_policy_text))); - this.password = null; - return false; - } else { + if(password!=null && password.toString().trim().matches("^(?=.*[A-Z])(?=.*[0-9])(?=.*[a-z]).{8,24}$")) { newExistingRegisterViewLiveData.setPasswordInputLiveData(new FormInputStateDTO<>(true, "")); this.password = password.toString(); return true; + }else{ + newExistingRegisterViewLiveData.setPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_error_text))); + this.password = null; + return false; } - - } - public boolean validateConfirmPassword(CharSequence confirmPassWord) { - - if (confirmPassWord == null || confirmPassWord.length() < 6 || Utility.trim(confirmPassWord).length()<1) { - newExistingRegisterViewLiveData.setConfirmPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.confirm_password_policy_text))); - this.confirmPassword = null; - return false; - } else { + public boolean validateConfirmPassword(CharSequence password) { + if(password!=null && password.toString().trim().matches("^(?=.*[A-Z])(?=.*[0-9])(?=.*[a-z]).{8,24}$")) { newExistingRegisterViewLiveData.setConfirmPasswordInputLiveData(new FormInputStateDTO<>(true, "")); - this.confirmPassword = confirmPassWord.toString(); + this.confirmPassword = password.toString(); return true; + }else{ + newExistingRegisterViewLiveData.setConfirmPasswordInputLiveData(new FormInputStateDTO<>(false, getStringfromStringId(R.string.password_error_text))); + this.confirmPassword = null; + return false; } } } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 7085fded..7a16b830 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1019,4 +1019,5 @@ All the configurations are done from backend web application system which allows to JME within next working day to transmit this request.\nAfter payment please check notices to get JME Number for this transfer. REQUEST SUMMARY Payout Agent/Bank + Password should contain atleast one number,one uppercase letter, one lowercase letter and minimum 8 Characters