|
|
@ -18,6 +18,8 @@ import com.swifttech.remit.jmecustomer.features.kyc.existingCustomer.model.Exist |
|
|
|
import com.swifttech.remit.jmecustomer.features.kyc.existingCustomer.view.documents.ExistingKYCIDTypeFragment; |
|
|
|
import com.swifttech.remit.jmecustomer.features.kyc.existingCustomer.view.documents.ExistingKYCIDTypeViewLiveData; |
|
|
|
import com.swifttech.remit.jmecustomer.features.kyc.existingCustomer.view.personal.ExistingCustomerDetailViewLiveData; |
|
|
|
import com.swifttech.remit.jmecustomer.features.kyc.newCustomer.model.IDTextDTO; |
|
|
|
import com.swifttech.remit.jmecustomer.features.kyc.newCustomer.model.PersonalInfoDTO; |
|
|
|
import com.swifttech.remit.jmecustomer.features.login.model.LoginV2DataApiResponse; |
|
|
|
import com.swifttech.remit.jmecustomer.features.login.presenter.LoginV2InteractorInterface; |
|
|
|
import com.swifttech.remit.jmecustomer.utils.Constants; |
|
|
@ -58,10 +60,10 @@ public class ExistingKYCV3ViewModel extends BaseViewModel implements ExistingKYC |
|
|
|
private final CompositeDisposable compositeDisposable; |
|
|
|
private final String userId; |
|
|
|
private final String userPwd; |
|
|
|
ExistingCustomerDetailViewLiveData.CustomerDetailViewBinding viewBindings; |
|
|
|
private CustomerDetailViewValidator validator; |
|
|
|
private final PublishSubject<Boolean> form1ValidationSubject; |
|
|
|
private final PublishSubject<Boolean> form2ValidationSubject; |
|
|
|
ExistingCustomerDetailViewLiveData.CustomerDetailViewBinding viewBindings; |
|
|
|
private CustomerDetailViewValidator validator; |
|
|
|
private String newToken; |
|
|
|
|
|
|
|
public ExistingKYCV3ViewModel(KYCV3ViewContractInterface view, ExistingKYCV3GatewayInterface gatewayInterface, ExistingFileDownloadGateway existingFileDownloadGateway, LoginV2InteractorInterface.Login2GatewayInterface loginGateway, String userId, String userPwd) { |
|
|
@ -214,10 +216,10 @@ public class ExistingKYCV3ViewModel extends BaseViewModel implements ExistingKYC |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
String selectedIdTypeText=existingPersonalInfoDTO.getIdType(); |
|
|
|
ExistingIDTextDTO selectedIdType=data.getIDTypeFromId(selectedIdTypeText); |
|
|
|
if(selectedIdType==null && selectedIdTypeText!=null){ |
|
|
|
selectedIdType = new ExistingIDTextDTO(selectedIdTypeText,selectedIdTypeText); |
|
|
|
String selectedIdTypeText = existingPersonalInfoDTO.getIdType(); |
|
|
|
ExistingIDTextDTO selectedIdType = data.getIDTypeFromId(selectedIdTypeText); |
|
|
|
if (selectedIdType == null && selectedIdTypeText != null) { |
|
|
|
selectedIdType = new ExistingIDTextDTO(selectedIdTypeText, selectedIdTypeText); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -238,7 +240,7 @@ public class ExistingKYCV3ViewModel extends BaseViewModel implements ExistingKYC |
|
|
|
customerDetailLiveData.getPurposeOfRegistrationLiveData().postValue(new FormInputStateDTO<>(true, null, purposeOfRegistration)); |
|
|
|
customerDetailLiveData.getMonthlyIncomeLiveData().postValue(new FormInputStateDTO<>(true, null, existingPersonalInfoDTO.getMonthlyIncome())); |
|
|
|
customerDetailLiveData.getBusinessTypeLiveData().postValue(new FormInputStateDTO<>(true, null, data.getBusinessTypeFromId(existingPersonalInfoDTO.getBusinessType()))); |
|
|
|
customerDetailLiveData.getIdTypeLiveData().postValue(new FormInputStateDTO<>(true, null,selectedIdType)); |
|
|
|
customerDetailLiveData.getIdTypeLiveData().postValue(new FormInputStateDTO<>(true, null, selectedIdType)); |
|
|
|
customerDetailLiveData.getMobileNumberLiveData().postValue(new FormInputStateDTO<>(true, null, mobileNumber)); |
|
|
|
customerDetailLiveData.getAddressLiveData().postValue(new FormInputStateDTO<>(true, null, existingPersonalInfoDTO.getAdditionalAddress())); |
|
|
|
customerDetailLiveData.getVisaStatusLiveData().postValue(new FormInputStateDTO<>(true, null, data.getVisaStatusFromId(existingPersonalInfoDTO.getVisaStatus()))); |
|
|
@ -448,7 +450,7 @@ public class ExistingKYCV3ViewModel extends BaseViewModel implements ExistingKYC |
|
|
|
@Override |
|
|
|
public void termsAndConditionAccept() { |
|
|
|
this.compositeDisposable.add( |
|
|
|
this.gateway.agreeToUserTermsAndConditions(this.gateway.getBasicAuth(view.getContext()), this.gateway.getUserID(),"Y") |
|
|
|
this.gateway.agreeToUserTermsAndConditions(this.gateway.getBasicAuth(view.getContext()), this.gateway.getUserID(), "Y") |
|
|
|
.doOnSubscribe(sub -> view.showProgressBar(true, "")) |
|
|
|
.subscribeOn(Schedulers.io()) |
|
|
|
.observeOn(AndroidSchedulers.mainThread()) |
|
|
@ -463,6 +465,39 @@ public class ExistingKYCV3ViewModel extends BaseViewModel implements ExistingKYC |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public boolean validateAllDetailForm() { |
|
|
|
ExistingKYCRelatedDataDTO existingKYCRelatedDataDTO = validator.getExistingKycRelatedDataDTO(); |
|
|
|
ExistingIDTextDTO visaStatus = existingKYCRelatedDataDTO.getVisaStatusFromId(existingKYCRelatedDataDTO.getPersonalInformation().getVisaStatus()); |
|
|
|
ExistingIDTextDTO occupation = existingKYCRelatedDataDTO.getOccupationFromId(existingKYCRelatedDataDTO.getPersonalInformation().getOccupation()); |
|
|
|
ExistingIDTextDTO purposeOfRegistration = existingKYCRelatedDataDTO.getPurposeOfRegistrationFromId(existingKYCRelatedDataDTO.getPersonalInformation().getPurposeOfRegistration()); |
|
|
|
CharSequence address = existingKYCRelatedDataDTO.getPersonalInformation().getAdditionalAddress(); |
|
|
|
ExistingIDTextDTO businessType = existingKYCRelatedDataDTO.getBusinessTypeFromId(existingKYCRelatedDataDTO.getPersonalInformation().getBusinessType()); |
|
|
|
ExistingIDTextDTO selectedIdType = existingKYCRelatedDataDTO.getIDTypeFromId(existingKYCRelatedDataDTO.getPersonalInformation().getIdType()); |
|
|
|
CharSequence mobileNumber = existingKYCRelatedDataDTO.getPersonalInformation().getMobile(); |
|
|
|
CharSequence monthlyIncome = existingKYCRelatedDataDTO.getPersonalInformation().getMonthlyIncome(); |
|
|
|
CharSequence employerName = existingKYCRelatedDataDTO.getPersonalInformation().getEmployeerName(); |
|
|
|
|
|
|
|
if ( |
|
|
|
validator.validateEmployerName(employerName) && |
|
|
|
validator.validateOccupation(occupation) && |
|
|
|
validator.validateMonthlyIncome(monthlyIncome) && |
|
|
|
validator.validateMobileNumber(mobileNumber) && |
|
|
|
validator.validateBusinessType(businessType) && |
|
|
|
validator.validateAddress(address) && |
|
|
|
validator.validatePurposeOfRegistration(purposeOfRegistration) && |
|
|
|
validator.validateSelectedIDType(selectedIdType) && |
|
|
|
validator.validateVisaStatus(visaStatus) |
|
|
|
|
|
|
|
) { |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<ExistingIDTextDTO> getOccupationList() { |
|
|
|
return validator.getExistingKycRelatedDataDTO().getOccupationList(); |
|
|
@ -614,31 +649,37 @@ public class ExistingKYCV3ViewModel extends BaseViewModel implements ExistingKYC |
|
|
|
} |
|
|
|
|
|
|
|
boolean validateOccupation(ExistingIDTextDTO data) { |
|
|
|
if (existingKycRelatedDataDTO.getPersonalInformation() == null) |
|
|
|
existingKycRelatedDataDTO.setPersonalInformation(new ExistingPersonalInfoDTO()); |
|
|
|
|
|
|
|
if (shouldPromptToInputAnswer(data)) { |
|
|
|
view.promptToInputAnswer(view.getContext().getResources().getString(R.string.specifyOccupation_text), new AnswerInputDialog.AnswerInputDialogListener() { |
|
|
|
@Override |
|
|
|
public void onAnswerSubmitted(String answer) { |
|
|
|
if (data != null) { |
|
|
|
if (existingKycRelatedDataDTO.getPersonalInformation() == null) |
|
|
|
existingKycRelatedDataDTO.setPersonalInformation(new ExistingPersonalInfoDTO()); |
|
|
|
|
|
|
|
if (shouldPromptToInputAnswer(data)) { |
|
|
|
view.promptToInputAnswer(view.getContext().getResources().getString(R.string.specifyOccupation_text), new AnswerInputDialog.AnswerInputDialogListener() { |
|
|
|
@Override |
|
|
|
public void onAnswerSubmitted(String answer) { |
|
|
|
existingKycRelatedDataDTO.getPersonalInformation().setOccupation(""); |
|
|
|
existingKycRelatedDataDTO.getPersonalInformation().setOtherOccupation(answer); |
|
|
|
customerDetailLiveData.getOccupationsLiveData().postValue(new FormInputStateDTO<>(true, null, ExistingIDTextDTO.createFromUserAnswerInput(answer))); |
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
if (!data.getId().equalsIgnoreCase(data.getText())) { |
|
|
|
existingKycRelatedDataDTO.getPersonalInformation().setOccupation(data.getId()); |
|
|
|
existingKycRelatedDataDTO.getPersonalInformation().setOtherOccupation(""); |
|
|
|
} else { |
|
|
|
existingKycRelatedDataDTO.getPersonalInformation().setOccupation(""); |
|
|
|
existingKycRelatedDataDTO.getPersonalInformation().setOtherOccupation(answer); |
|
|
|
customerDetailLiveData.getOccupationsLiveData().postValue(new FormInputStateDTO<>(true, null, ExistingIDTextDTO.createFromUserAnswerInput(answer))); |
|
|
|
existingKycRelatedDataDTO.getPersonalInformation().setOtherOccupation(data.getId()); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
} else { |
|
|
|
if(!data.getId().equalsIgnoreCase(data.getText())){ |
|
|
|
existingKycRelatedDataDTO.getPersonalInformation().setOccupation(data.getId()); |
|
|
|
existingKycRelatedDataDTO.getPersonalInformation().setOtherOccupation(""); |
|
|
|
}else{ |
|
|
|
existingKycRelatedDataDTO.getPersonalInformation().setOccupation(""); |
|
|
|
existingKycRelatedDataDTO.getPersonalInformation().setOtherOccupation(data.getId()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (existingKycRelatedDataDTO.getPersonalInformation().isOccupationValid()||existingKycRelatedDataDTO.getPersonalInformation().isOtherOccupationValid()) { |
|
|
|
return true; |
|
|
|
if (existingKycRelatedDataDTO.getPersonalInformation().isOccupationValid() || existingKycRelatedDataDTO.getPersonalInformation().isOtherOccupationValid()) { |
|
|
|
customerDetailLiveData.getOccupationsLiveData().setValue(new FormInputStateDTO<>(true, null, null)); |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
customerDetailLiveData.getOccupationsLiveData().setValue(new FormInputStateDTO<>(false, view.getContext().getResources().getString(R.string.invalidOccupation_text), null)); |
|
|
|
return false; |
|
|
|
} |
|
|
|
} else { |
|
|
|
customerDetailLiveData.getOccupationsLiveData().setValue(new FormInputStateDTO<>(false, view.getContext().getResources().getString(R.string.invalidOccupation_text), null)); |
|
|
|
return false; |
|
|
@ -647,13 +688,18 @@ public class ExistingKYCV3ViewModel extends BaseViewModel implements ExistingKYC |
|
|
|
|
|
|
|
|
|
|
|
boolean validateAddress(CharSequence data) { |
|
|
|
if (existingKycRelatedDataDTO.getPersonalInformation() == null) |
|
|
|
existingKycRelatedDataDTO.setPersonalInformation(new ExistingPersonalInfoDTO()); |
|
|
|
if (data != null) { |
|
|
|
if (existingKycRelatedDataDTO.getPersonalInformation() == null) |
|
|
|
existingKycRelatedDataDTO.setPersonalInformation(new ExistingPersonalInfoDTO()); |
|
|
|
|
|
|
|
existingKycRelatedDataDTO.getPersonalInformation().setAdditionalAddress(data != null ? data.toString() : null); |
|
|
|
if (existingKycRelatedDataDTO.getPersonalInformation().isAdditionalAddressValid()) { |
|
|
|
customerDetailLiveData.getAddressLiveData().setValue(new FormInputStateDTO<>(true, null, null)); |
|
|
|
return true; |
|
|
|
existingKycRelatedDataDTO.getPersonalInformation().setAdditionalAddress(data != null ? data.toString() : null); |
|
|
|
if (existingKycRelatedDataDTO.getPersonalInformation().isAdditionalAddressValid()) { |
|
|
|
customerDetailLiveData.getAddressLiveData().setValue(new FormInputStateDTO<>(true, null, null)); |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
customerDetailLiveData.getAddressLiveData().setValue(new FormInputStateDTO<>(false, view.getContext().getResources().getString(R.string.InvalidAddress_text), null)); |
|
|
|
return false; |
|
|
|
} |
|
|
|
} else { |
|
|
|
customerDetailLiveData.getAddressLiveData().setValue(new FormInputStateDTO<>(false, view.getContext().getResources().getString(R.string.InvalidAddress_text), null)); |
|
|
|
return false; |
|
|
@ -661,12 +707,18 @@ public class ExistingKYCV3ViewModel extends BaseViewModel implements ExistingKYC |
|
|
|
} |
|
|
|
|
|
|
|
boolean validateBusinessType(ExistingIDTextDTO data) { |
|
|
|
if (existingKycRelatedDataDTO.getPersonalInformation() == null) |
|
|
|
existingKycRelatedDataDTO.setPersonalInformation(new ExistingPersonalInfoDTO()); |
|
|
|
if (data != null) { |
|
|
|
if (existingKycRelatedDataDTO.getPersonalInformation() == null) |
|
|
|
existingKycRelatedDataDTO.setPersonalInformation(new ExistingPersonalInfoDTO()); |
|
|
|
|
|
|
|
existingKycRelatedDataDTO.getPersonalInformation().setBusinessType(data.getId()); |
|
|
|
if (existingKycRelatedDataDTO.getPersonalInformation().isBusinessTypeValid()) { |
|
|
|
return true; |
|
|
|
existingKycRelatedDataDTO.getPersonalInformation().setBusinessType(data.getId()); |
|
|
|
if (existingKycRelatedDataDTO.getPersonalInformation().isBusinessTypeValid()) { |
|
|
|
customerDetailLiveData.getBusinessTypeLiveData().setValue(new FormInputStateDTO<>(true, null, null)); |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
customerDetailLiveData.getBusinessTypeLiveData().setValue(new FormInputStateDTO<>(false, view.getContext().getResources().getString(R.string.invalidBusinessType_text), null)); |
|
|
|
return false; |
|
|
|
} |
|
|
|
} else { |
|
|
|
customerDetailLiveData.getBusinessTypeLiveData().setValue(new FormInputStateDTO<>(false, view.getContext().getResources().getString(R.string.invalidBusinessType_text), null)); |
|
|
|
return false; |
|
|
@ -675,53 +727,75 @@ public class ExistingKYCV3ViewModel extends BaseViewModel implements ExistingKYC |
|
|
|
|
|
|
|
|
|
|
|
boolean validateSelectedIDType(ExistingIDTextDTO data) { |
|
|
|
if (existingKycRelatedDataDTO.getPersonalInformation() == null) |
|
|
|
existingKycRelatedDataDTO.setPersonalInformation(new ExistingPersonalInfoDTO()); |
|
|
|
if (data != null) { |
|
|
|
if (existingKycRelatedDataDTO.getPersonalInformation() == null) |
|
|
|
existingKycRelatedDataDTO.setPersonalInformation(new ExistingPersonalInfoDTO()); |
|
|
|
|
|
|
|
if (shouldPromptToInputAnswer(data)) { |
|
|
|
view.promptToInputAnswer(view.getContext().getResources().getString(R.string.specifyIdType), answer -> { |
|
|
|
existingKycRelatedDataDTO.getPersonalInformation().setIdType(""); |
|
|
|
existingKycRelatedDataDTO.getPersonalInformation().setOtherIdType(answer); |
|
|
|
customerDetailLiveData.getIdTypeLiveData().postValue(new FormInputStateDTO<>(true, null, ExistingIDTextDTO.createFromUserAnswerInput(answer))); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
if (!data.getId().equalsIgnoreCase(data.getText())) { |
|
|
|
existingKycRelatedDataDTO.getPersonalInformation().setIdType(data.getId()); |
|
|
|
existingKycRelatedDataDTO.getPersonalInformation().setOtherIdType(""); |
|
|
|
} else { |
|
|
|
existingKycRelatedDataDTO.getPersonalInformation().setIdType(""); |
|
|
|
existingKycRelatedDataDTO.getPersonalInformation().setOtherIdType(data.getId()); |
|
|
|
} |
|
|
|
|
|
|
|
if (shouldPromptToInputAnswer(data)) { |
|
|
|
view.promptToInputAnswer(view.getContext().getResources().getString(R.string.specifyIdType), answer -> { |
|
|
|
existingKycRelatedDataDTO.getPersonalInformation().setIdType(""); |
|
|
|
existingKycRelatedDataDTO.getPersonalInformation().setOtherIdType(answer); |
|
|
|
customerDetailLiveData.getIdTypeLiveData().postValue(new FormInputStateDTO<>(true, null, ExistingIDTextDTO.createFromUserAnswerInput(answer))); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
if(!data.getId().equalsIgnoreCase(data.getText())){ |
|
|
|
existingKycRelatedDataDTO.getPersonalInformation().setIdType(data.getId()); |
|
|
|
existingKycRelatedDataDTO.getPersonalInformation().setOtherIdType(""); |
|
|
|
}else{ |
|
|
|
existingKycRelatedDataDTO.getPersonalInformation().setIdType(""); |
|
|
|
existingKycRelatedDataDTO.getPersonalInformation().setOtherIdType(data.getId()); |
|
|
|
} |
|
|
|
} |
|
|
|
if (existingKycRelatedDataDTO.getPersonalInformation().isIdTypeValid()||existingKycRelatedDataDTO.getPersonalInformation().isOtherIdTypeValid()) { |
|
|
|
return true; |
|
|
|
|
|
|
|
|
|
|
|
if (existingKycRelatedDataDTO.getPersonalInformation().isIdTypeValid() || existingKycRelatedDataDTO.getPersonalInformation().isOtherIdTypeValid()) { |
|
|
|
customerDetailLiveData.getIdTypeLiveData().setValue(new FormInputStateDTO<>(true, null, null)); |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
customerDetailLiveData.getIdTypeLiveData().setValue(new FormInputStateDTO<>(false, view.getContext().getResources().getString(R.string.invalidIdType_text), null)); |
|
|
|
return false; |
|
|
|
} |
|
|
|
} else { |
|
|
|
customerDetailLiveData.getIdTypeLiveData().setValue(new FormInputStateDTO<>(false, view.getContext().getResources().getString(R.string.invalidIdType_text), null)); |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
boolean validateVisaStatus(ExistingIDTextDTO data) { |
|
|
|
if (existingKycRelatedDataDTO.getPersonalInformation() == null) |
|
|
|
existingKycRelatedDataDTO.setPersonalInformation(new ExistingPersonalInfoDTO()); |
|
|
|
if(data!=null){ |
|
|
|
if (existingKycRelatedDataDTO.getPersonalInformation() == null) |
|
|
|
existingKycRelatedDataDTO.setPersonalInformation(new ExistingPersonalInfoDTO()); |
|
|
|
|
|
|
|
existingKycRelatedDataDTO.getPersonalInformation().setVisaStatus(data.getId()); |
|
|
|
if (existingKycRelatedDataDTO.getPersonalInformation().isVisaStatusValid()) { |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
existingKycRelatedDataDTO.getPersonalInformation().setVisaStatus(data.getId()); |
|
|
|
if (existingKycRelatedDataDTO.getPersonalInformation().isVisaStatusValid()) { |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
customerDetailLiveData.getVisaStatusLiveData().setValue(new FormInputStateDTO<>(false, view.getContext().getResources().getString(R.string.invalidVisaStatus_text), null)); |
|
|
|
return false; |
|
|
|
} |
|
|
|
}else{ |
|
|
|
customerDetailLiveData.getVisaStatusLiveData().setValue(new FormInputStateDTO<>(false, view.getContext().getResources().getString(R.string.invalidVisaStatus_text), null)); |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
boolean validatePurposeOfRegistration(ExistingIDTextDTO data) { |
|
|
|
if (existingKycRelatedDataDTO.getPersonalInformation() == null) |
|
|
|
existingKycRelatedDataDTO.setPersonalInformation(new ExistingPersonalInfoDTO()); |
|
|
|
if(data!=null){ |
|
|
|
if (existingKycRelatedDataDTO.getPersonalInformation() == null) |
|
|
|
existingKycRelatedDataDTO.setPersonalInformation(new ExistingPersonalInfoDTO()); |
|
|
|
|
|
|
|
existingKycRelatedDataDTO.getPersonalInformation().setPurposeOfRegistration(data.getId()); |
|
|
|
if (existingKycRelatedDataDTO.getPersonalInformation().isPurposeOfRegistrationValid()) { |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
existingKycRelatedDataDTO.getPersonalInformation().setPurposeOfRegistration(data.getId()); |
|
|
|
if (existingKycRelatedDataDTO.getPersonalInformation().isPurposeOfRegistrationValid()) { |
|
|
|
customerDetailLiveData.getPurposeOfRegistrationLiveData().setValue(new FormInputStateDTO<>(true, null, null)); |
|
|
|
return true; |
|
|
|
} else { |
|
|
|
customerDetailLiveData.getPurposeOfRegistrationLiveData().setValue(new FormInputStateDTO<>(false, view.getContext().getResources().getString(R.string.invalidPuropseOfReg_text), null)); |
|
|
|
return false; |
|
|
|
} |
|
|
|
}else{ |
|
|
|
customerDetailLiveData.getPurposeOfRegistrationLiveData().setValue(new FormInputStateDTO<>(false, view.getContext().getResources().getString(R.string.invalidPuropseOfReg_text), null)); |
|
|
|
return false; |
|
|
|
} |
|
|
@ -904,32 +978,31 @@ public class ExistingKYCV3ViewModel extends BaseViewModel implements ExistingKYC |
|
|
|
task.run(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public class TermsAndConditionResultObserver extends GenericApiObserverResponseV2<MessageResponseDataModel> { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
protected void onSuccess(GenericResponseDataModel<MessageResponseDataModel> t) { |
|
|
|
if(t.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2)) |
|
|
|
{ |
|
|
|
if (t.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2)) { |
|
|
|
view.onTermsPostSuccess(); |
|
|
|
} |
|
|
|
else |
|
|
|
view.showPopUpMessage(t.getMsg(), CustomAlertDialog.AlertType.FAILED,null); |
|
|
|
} else |
|
|
|
view.showPopUpMessage(t.getMsg(), CustomAlertDialog.AlertType.FAILED, null); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void onFailed(String message) { |
|
|
|
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED,null); |
|
|
|
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED, null); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
protected void onConnectionNotEstablished(String message) { |
|
|
|
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED,null); |
|
|
|
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED, null); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
protected void unauthorizedAccess(String message) { |
|
|
|
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED,null); |
|
|
|
view.showPopUpMessage(message, CustomAlertDialog.AlertType.FAILED, null); |
|
|
|
} |
|
|
|
} |
|
|
|
} |