Browse Source

has partner changed flag updated

master
Preyea Regmi 5 years ago
parent
commit
127b705161
  1. 55
      app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/model/recipientlistingV3/ReceiverInfoV3Model.java
  2. 12
      app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/presenter/recipientlistingV3/RecipientListingV3Presenter.java
  3. 2
      app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/view/recipientlistingV3/RecipientListingV3Activity.java
  4. 2
      app/src/main/res/values/strings.xml

55
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<ReceiverInfoV3Model> CREATOR = new Creator<ReceiverInfoV3Model>() {

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

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

2
app/src/main/res/values/strings.xml

@ -582,6 +582,8 @@
<string name="middle_name_local_text">Middle Name In Your Language</string>
<string name="first_name_local_text">First Name In Your Language</string>
<string name="middle_name_text">Middle Name</string>
<string name="recipient_profile_update_prompt_text">Your recipient information is not up-to-date. Do you want to update it now?</string>
<string name="recipient_bank_update_prompt_text">Your selected bank is not currently available at moment. Please select another bank inorder to proceed.</string>
</resources>
Loading…
Cancel
Save