From 4aa24713fbc94b0002f44b5fc72b5a2922c13f80 Mon Sep 17 00:00:00 2001 From: Preyea Regmi Date: Tue, 10 Sep 2019 14:14:17 +0900 Subject: [PATCH] Before checking agent id's null value in validator --- .../RecipientDetailValidatorV3.java | 39 ++++++++++++++++++- .../edit/RecipientEditV3Presenter.java | 4 +- 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/presenter/recipientaddeditV3/RecipientDetailValidatorV3.java b/app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/presenter/recipientaddeditV3/RecipientDetailValidatorV3.java index 2b48f41e..a8b21df3 100644 --- a/app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/presenter/recipientaddeditV3/RecipientDetailValidatorV3.java +++ b/app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/presenter/recipientaddeditV3/RecipientDetailValidatorV3.java @@ -170,10 +170,41 @@ public class RecipientDetailValidatorV3 { recipientInfo.setPaymentMethod(null); view.updateValueToWidgetSelectedPaymentMethod(null); + view.setSubmitButtonEnabled(false); + + + view.showPaymentSelectionView(true); + + + + //By default we update native country same as selected Country + view.updateValueToWidgetNativeCountry(selectedCountryServiceData.getCountryName()); + view.showNativeCountryFlag(CountryFlagMapper.getFlagFromCountryCode(selectedCountryServiceData.getCountryCode())); + recipientInfo.setNativeCountry(selectedCountryServiceData.getCountryName()); + recipientInfo.setNativeCountryCode(selectedCountryServiceData.getCountryCode()); + recipientInfo.setNativeCountryId(selectedCountryServiceData.getCountryId()); + } + + //TODO Need to refactored + public void updateSelectedCountryWhileEditing(CountryServiceModel selectedCountryServiceData) { + this.selectedCountryService = selectedCountryServiceData; + + recipientInfo.setCountryId(selectedCountryServiceData.getCountryId()); + recipientInfo.setCountryCode(selectedCountryServiceData.getCountryCode()); + recipientInfo.setCountry(selectedCountryServiceData.getCountryName()); + + view.updateValueToWidgetSelectedCountry(selectedCountryServiceData.getCountryName()); + + view.showSelectedCountryFlag(CountryFlagMapper.getFlagFromCountryCode(selectedCountryServiceData.getCountryCode())); + +// +// recipientInfo.setPaymentMethod(null); +// view.updateValueToWidgetSelectedPaymentMethod(null); +// view.setSubmitButtonEnabled(false); +// view.showPaymentSelectionView(true); - view.setSubmitButtonEnabled(false); //By default we update native country same as selected Country @@ -201,6 +232,12 @@ public class RecipientDetailValidatorV3 { view.updateValueToWidgetBankName(null); view.updateValueToWidgetBranchName(null); + view.setSubmitButtonEnabled(false); + + ValidationRuleModel branchValidationRule = validationRuleModelMap.get(FIELD_BANK_NAME); + if (branchValidationRule != null) { + branchValidationRule.updateValidity(false); + } } diff --git a/app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/presenter/recipientaddeditV3/edit/RecipientEditV3Presenter.java b/app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/presenter/recipientaddeditV3/edit/RecipientEditV3Presenter.java index 90b73427..bca33228 100644 --- a/app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/presenter/recipientaddeditV3/edit/RecipientEditV3Presenter.java +++ b/app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/presenter/recipientaddeditV3/edit/RecipientEditV3Presenter.java @@ -73,9 +73,7 @@ public class RecipientEditV3Presenter extends RecipientAddEditBaseV3Presenter { @Override public void onServiceTypeSelected(ServiceTypeModel selectedServiceType) { - validator.updateSelectedServiceType(selectedServiceType); - getDynamicValidationAndDropDownList(validator.getRecipientDetail().getCountryId(), selectedServiceType.getId()); // mockDynamicValidationList(); } @@ -375,7 +373,7 @@ public class RecipientEditV3Presenter extends RecipientAddEditBaseV3Presenter { for (CountryServiceModel countryServiceModel : t.getData()) { if (countryServiceModel.getCountryCode().equalsIgnoreCase(validator.getRecipientDetail().getCountryCode())) { - validator.updateSelectedCountry(countryServiceModel); + validator.updateSelectedCountryWhileEditing(countryServiceModel); break; } }