From 127b705161958325f0711f8018a790c4f68d8182 Mon Sep 17 00:00:00 2001 From: Preyea Regmi Date: Thu, 5 Sep 2019 18:22:59 +0900 Subject: [PATCH] has partner changed flag updated --- .../ReceiverInfoV3Model.java | 55 ++++++------------- .../RecipientListingV3Presenter.java | 12 ++-- .../RecipientListingV3Activity.java | 2 + app/src/main/res/values/strings.xml | 2 + 4 files changed, 30 insertions(+), 41 deletions(-) diff --git a/app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/model/recipientlistingV3/ReceiverInfoV3Model.java b/app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/model/recipientlistingV3/ReceiverInfoV3Model.java index 6bb25a5a..9912c00e 100644 --- a/app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/model/recipientlistingV3/ReceiverInfoV3Model.java +++ b/app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/model/recipientlistingV3/ReceiverInfoV3Model.java @@ -112,6 +112,9 @@ public class ReceiverInfoV3Model implements Parcelable { @SerializedName("nativeCountryCode") @Expose private String nativeCountryCode; + @SerializedName("isPartnerChanged") + @Expose + private String isPartnerChanged; public String getFirstName() { return firstName; @@ -369,6 +372,14 @@ public class ReceiverInfoV3Model implements Parcelable { this.nativeCountryCode = nativeCountryCode; } + public String getIsPartnerChanged() { + return isPartnerChanged; + } + + public void setIsPartnerChanged(String isPartnerChanged) { + this.isPartnerChanged = isPartnerChanged; + } + public void updateSelectedServiceTypeData(ServiceTypeModel selectedServiceType) { this.agent=new AgentV3Model(selectedServiceType.getId(),selectedServiceType.getDescription(),"",null,""); printLog(); @@ -380,43 +391,6 @@ public class ReceiverInfoV3Model implements Parcelable { } - @Override - public String toString() { - return "ReceiverInfoV3Model{" + - "firstName='" + firstName + '\'' + - ", middleName='" + middleName + '\'' + - ", lastName='" + lastName + '\'' + - ", localFirstName='" + localFirstName + '\'' + - ", localMiddleName='" + localMiddleName + '\'' + - ", localLastName='" + localLastName + '\'' + - ", fullName='" + fullName + '\'' + - ", localFullName='" + localFullName + '\'' + - ", paymentMethod=" + paymentMethod + - ", agent=" + agent + - ", receiverId='" + receiverId + '\'' + - ", country='" + country + '\'' + - ", countryId='" + countryId + '\'' + - ", countryCode='" + countryCode + '\'' + - ", address='" + address + '\'' + - ", state='" + state + '\'' + - ", stateId='" + stateId + '\'' + - ", city='" + city + '\'' + - ", email='" + email + '\'' + - ", mobile='" + mobile + '\'' + - ", relationship='" + relationship + '\'' + - ", relationshipId='" + relationshipId + '\'' + - ", district='" + district + '\'' + - ", districtId='" + districtId + '\'' + - ", purposeOfRemit='" + purposeOfRemit + '\'' + - ", purposeOfRemitId='" + purposeOfRemitId + '\'' + - ", idType='" + idType + '\'' + - ", idNumber='" + idNumber + '\'' + - ", payoutPartner='" + payoutPartner + '\'' + - ", nativeCountry='" + nativeCountry + '\'' + - ", nativeCountryId='" + nativeCountryId + '\'' + - ", nativeCountryCode='" + nativeCountryCode + '\'' + - '}'; - } public ReceiverInfoV3Model() { } @@ -463,6 +437,11 @@ public class ReceiverInfoV3Model implements Parcelable { } + public boolean hasPartnerChanged() + { + return "1".equalsIgnoreCase(isPartnerChanged); + } + @Override public int describeContents() { @@ -503,6 +482,7 @@ public class ReceiverInfoV3Model implements Parcelable { dest.writeString(this.nativeCountry); dest.writeString(this.nativeCountryId); dest.writeString(this.nativeCountryCode); + dest.writeString(this.isPartnerChanged); } protected ReceiverInfoV3Model(Parcel in) { @@ -538,6 +518,7 @@ public class ReceiverInfoV3Model implements Parcelable { this.nativeCountry = in.readString(); this.nativeCountryId = in.readString(); this.nativeCountryCode = in.readString(); + this.isPartnerChanged = in.readString(); } public static final Creator CREATOR = new Creator() { diff --git a/app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/presenter/recipientlistingV3/RecipientListingV3Presenter.java b/app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/presenter/recipientlistingV3/RecipientListingV3Presenter.java index abf387f7..e3a063bc 100644 --- a/app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/presenter/recipientlistingV3/RecipientListingV3Presenter.java +++ b/app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/presenter/recipientlistingV3/RecipientListingV3Presenter.java @@ -101,7 +101,12 @@ public class RecipientListingV3Presenter extends BasePresenter implements Recipi @Override public void saveSelectedRecipientInfomation(ReceiverInfoV3Model recipientInfoModel) { - if (recipientInfoModel.getPaymentMethod() == null) { + if (recipientInfoModel.getPaymentMethod() == null || recipientInfoModel.hasPartnerChanged()) { + String message = ""; + if (recipientInfoModel.getPaymentMethod() == null) + message=getStringfromStringId(R.string.recipient_profile_update_prompt_text); + else + message=getStringfromStringId(R.string.recipient_bank_update_prompt_text); view.promptToEditRecipient(new GenericPromptDialog.GenericDialogPromptListener() { @Override @@ -113,7 +118,7 @@ public class RecipientListingV3Presenter extends BasePresenter implements Recipi public void onPositiveBtnPressed() { view.proceedToEditRecipient(recipientInfoModel); } - }, "Recipient profile update is necessary inorder to proceed. Do you want to update it now?"); + }, message); } else { this.selectedRecipientInfoModel = recipientInfoModel; this.view.showPaymentSourceSelection(availablePaymentSources); @@ -125,7 +130,6 @@ public class RecipientListingV3Presenter extends BasePresenter implements Recipi for (ReceiverInfoV3Model receiverInfoV3Model : availableRecipientList) { if (reciverId.equalsIgnoreCase(receiverInfoV3Model.getReceiverId())) { selectedRecipientInfoModel = receiverInfoV3Model; - String reciverName = getReceiverName(receiverInfoV3Model); view.promptToSendMoney(new GenericPromptDialog.GenericDialogPromptListener() { @Override public void onNegativeBtnPressed() { @@ -136,7 +140,7 @@ public class RecipientListingV3Presenter extends BasePresenter implements Recipi public void onPositiveBtnPressed() { view.showPaymentSourceSelection(availablePaymentSources); } - }, "Do you want to send money to "+getReceiverName(receiverInfoV3Model)+"?"); + }, "Do you want to send money to " + getReceiverName(receiverInfoV3Model) + "?"); return; } } diff --git a/app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/view/recipientlistingV3/RecipientListingV3Activity.java b/app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/view/recipientlistingV3/RecipientListingV3Activity.java index 8ba83de8..f2e3bb68 100644 --- a/app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/view/recipientlistingV3/RecipientListingV3Activity.java +++ b/app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/view/recipientlistingV3/RecipientListingV3Activity.java @@ -223,6 +223,8 @@ public class RecipientListingV3Activity extends BaseActivity implements Recipien @Override public void onRecipientSelected(ReceiverInfoV3Model recipientInfoModel) { + + //TODO this.presenter.saveSelectedRecipientInfomation(recipientInfoModel); } diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 07479427..dd7c7da9 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -582,6 +582,8 @@ Middle Name In Your Language First Name In Your Language Middle Name + Your recipient information is not up-to-date. Do you want to update it now? + Your selected bank is not currently available at moment. Please select another bank inorder to proceed.