Browse Source

Account decoupled from bank

master
Preyea Regmi 5 years ago
parent
commit
c4b4c5bc31
  1. 35
      app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/model/recipientlistingV3/ReceiverInfoV3Model.java
  2. 4
      app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/presenter/recipientaddeditV3/RecipientDetailValidatorV3.java

35
app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/model/recipientlistingV3/ReceiverInfoV3Model.java

@ -4,7 +4,6 @@ import android.os.Parcel;
import android.os.Parcelable; import android.os.Parcelable;
import android.util.Log; import android.util.Log;
import com.gmeremit.online.gmeremittance_native.recipientV3.model.recipientaddeditV3.countryservice.CountryServiceModel;
import com.gmeremit.online.gmeremittance_native.recipientV3.model.recipientaddeditV3.countryservice.ServiceTypeModel; import com.gmeremit.online.gmeremittance_native.recipientV3.model.recipientaddeditV3.countryservice.ServiceTypeModel;
import com.gmeremit.online.gmeremittance_native.recipientV3.model.recipientaddeditV3.dynamicvalidation.DropDownDTO; import com.gmeremit.online.gmeremittance_native.recipientV3.model.recipientaddeditV3.dynamicvalidation.DropDownDTO;
import com.gmeremit.online.gmeremittance_native.recipientV3.model.recipientaddeditV3.dynamicvalidation.PaymentBankModel; import com.gmeremit.online.gmeremittance_native.recipientV3.model.recipientaddeditV3.dynamicvalidation.PaymentBankModel;
@ -381,13 +380,12 @@ public class ReceiverInfoV3Model implements Parcelable {
} }
public void updateSelectedServiceTypeData(ServiceTypeModel selectedServiceType) { public void updateSelectedServiceTypeData(ServiceTypeModel selectedServiceType) {
this.agent=new AgentV3Model(selectedServiceType.getId(),selectedServiceType.getDescription(),"",null,"");
this.agent = new AgentV3Model(selectedServiceType.getId(), selectedServiceType.getDescription(), "", null, "");
printLog(); printLog();
} }
public void printLog()
{
Log.d(ReceiverInfoV3Model.class.getSimpleName(),this.toString());
public void printLog() {
Log.d(ReceiverInfoV3Model.class.getSimpleName(), this.toString());
} }
@ -396,21 +394,25 @@ public class ReceiverInfoV3Model implements Parcelable {
} }
public void updateSelectedBank(PaymentBankModel selectedBank) { public void updateSelectedBank(PaymentBankModel selectedBank) {
AgentV3Model agentV3Model=new AgentV3Model();
AgentV3Model agentV3Model = new AgentV3Model();
agentV3Model.setId(selectedBank.getId()); agentV3Model.setId(selectedBank.getId());
//If current agent if not null, bind existing account number with new Bank data
if (agent != null)
agentV3Model.setAccountNo(agent.getAccountNo());
setAgent(agentV3Model); setAgent(agentV3Model);
} }
public boolean updateBranch(BranchList selectedBranch) { public boolean updateBranch(BranchList selectedBranch) {
AgentV3Model selectedAgent=getAgent();
if(selectedAgent!=null)
{
BranchV3Model branchV3Model=new BranchV3Model();
branchV3Model.setId(selectedBranch.getBranchId());
selectedAgent.setBranch(branchV3Model);
return true;
}
return false;
AgentV3Model selectedAgent = getAgent();
if (selectedAgent != null) {
BranchV3Model branchV3Model = new BranchV3Model();
branchV3Model.setId(selectedBranch.getBranchId());
selectedAgent.setBranch(branchV3Model);
return true;
}
return false;
} }
public void updateProvince(PayoutProvincesModel selectedProvinces) { public void updateProvince(PayoutProvincesModel selectedProvinces) {
@ -437,8 +439,7 @@ public class ReceiverInfoV3Model implements Parcelable {
} }
public boolean hasPartnerChanged()
{
public boolean hasPartnerChanged() {
return "1".equalsIgnoreCase(isPartnerChanged); return "1".equalsIgnoreCase(isPartnerChanged);
} }

4
app/src/main/java/com/gmeremit/online/gmeremittance_native/recipientV3/presenter/recipientaddeditV3/RecipientDetailValidatorV3.java

@ -450,10 +450,6 @@ public class RecipientDetailValidatorV3 {
//After successfull update of selected bank, determine weather it has corresponding dependency or not. //After successfull update of selected bank, determine weather it has corresponding dependency or not.
// If dependency are there, override thee validation rule and manage the data // If dependency are there, override thee validation rule and manage the data
// view.updateValueToWidgetAccountNo(recipientInfo.getAgent().getAccountNo());
//If any of the condition match, reset branch data
ValidationRuleModel branchValidationRule = validationRuleModelMap.get(FIELD_BRANCH_NAME); ValidationRuleModel branchValidationRule = validationRuleModelMap.get(FIELD_BRANCH_NAME);
if (branchValidationRule != null && branchValidationRule.isFieldRequired() && "True".equalsIgnoreCase(selectedBank.getBranchRequired())) { if (branchValidationRule != null && branchValidationRule.isFieldRequired() && "True".equalsIgnoreCase(selectedBank.getBranchRequired())) {
view.updateValueToWidgetBranchName(null); view.updateValueToWidgetBranchName(null);

Loading…
Cancel
Save