Browse Source

Before checking agent id's null value in validator

master
Preyea Regmi 5 years ago
parent
commit
4aa24713fb
  1. 39
      app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/presenter/recipientaddeditV3/RecipientDetailValidatorV3.java
  2. 4
      app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/presenter/recipientaddeditV3/edit/RecipientEditV3Presenter.java

39
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);
}
}

4
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;
}
}

Loading…
Cancel
Save