Browse Source

Occupation post and get added occupation in New Customer Kyc Screen

new_design
Santosh Bhandary 4 years ago
parent
commit
dbb902b1b6
  1. 2
      app/src/main/java/com/swifttech/remit/android/features/kyc/existingCustomer/view/personal/ExistingCustomerDetailViewLiveData.java
  2. 7
      app/src/main/java/com/swifttech/remit/android/features/kyc/newCustomer/gateway/KYCV3Gateway.java
  3. 21
      app/src/main/java/com/swifttech/remit/android/features/kyc/newCustomer/model/KYCRelatedDataDTO.java
  4. 18
      app/src/main/java/com/swifttech/remit/android/features/kyc/newCustomer/model/PersonalInfoDTO.java
  5. 1
      app/src/main/java/com/swifttech/remit/android/features/kyc/newCustomer/presenter/KYCV3PresenterInterface.java
  6. 192
      app/src/main/java/com/swifttech/remit/android/features/kyc/newCustomer/presenter/KYCV3ViewModel.java
  7. 39
      app/src/main/java/com/swifttech/remit/android/features/kyc/newCustomer/view/personal/CustomerDetailFragment.java
  8. 17
      app/src/main/java/com/swifttech/remit/android/features/kyc/newCustomer/view/personal/CustomerDetailViewLiveData.java
  9. 15
      app/src/main/res/layout/fragment_kyc_customer_detail.xml

2
app/src/main/java/com/swifttech/remit/android/features/kyc/existingCustomer/view/personal/ExistingCustomerDetailViewLiveData.java

@ -24,8 +24,8 @@ public class ExistingCustomerDetailViewLiveData {
public ExistingCustomerDetailViewLiveData() { public ExistingCustomerDetailViewLiveData() {
employerNameLiveData = new MutableLiveData<>(); employerNameLiveData = new MutableLiveData<>();
sourceOfFundLiveData = new MutableLiveData<>();
occupationsLiveData = new MutableLiveData<>(); occupationsLiveData = new MutableLiveData<>();
sourceOfFundLiveData = new MutableLiveData<>();
monthlyIncomeLiveData = new MutableLiveData<>(); monthlyIncomeLiveData = new MutableLiveData<>();
mobileNumberLiveData = new MutableLiveData<>(); mobileNumberLiveData = new MutableLiveData<>();
businessTypeLiveData = new MutableLiveData<>(); businessTypeLiveData = new MutableLiveData<>();

7
app/src/main/java/com/swifttech/remit/android/features/kyc/newCustomer/gateway/KYCV3Gateway.java

@ -3,6 +3,8 @@ package com.swifttech.remit.android.features.kyc.newCustomer.gateway;
import android.content.Context; import android.content.Context;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import com.google.gson.JsonObject;
import com.google.gson.reflect.TypeToken;
import com.swifttech.remit.android.RemitApplication; import com.swifttech.remit.android.RemitApplication;
import com.swifttech.remit.android.base.PrefKeys; import com.swifttech.remit.android.base.PrefKeys;
import com.swifttech.remit.android.base.PrivilegedGateway; import com.swifttech.remit.android.base.PrivilegedGateway;
@ -14,8 +16,6 @@ import com.swifttech.remit.android.features.kyc.newCustomer.model.PersonalInfoDT
import com.swifttech.remit.android.features.kyc.newCustomer.model.PicturesDTO; import com.swifttech.remit.android.features.kyc.newCustomer.model.PicturesDTO;
import com.swifttech.remit.android.features.kyc.newCustomer.presenter.KYCV3GatewayInterface; import com.swifttech.remit.android.features.kyc.newCustomer.presenter.KYCV3GatewayInterface;
import com.swifttech.remit.android.utils.https.HttpClientV2; import com.swifttech.remit.android.utils.https.HttpClientV2;
import com.google.gson.JsonObject;
import com.google.gson.reflect.TypeToken;
import java.io.File; import java.io.File;
import java.util.ArrayList; import java.util.ArrayList;
@ -62,6 +62,7 @@ public class KYCV3Gateway extends PrivilegedGateway implements KYCV3GatewayInter
if (personalInfoDTO != null) { if (personalInfoDTO != null) {
map.put("employeerName", createStringUploadValue(personalInfoDTO.getEmployeerName())); map.put("employeerName", createStringUploadValue(personalInfoDTO.getEmployeerName()));
map.put("occupation", createStringUploadValue(personalInfoDTO.getOccupation()));
map.put("sourceOfFund", createStringUploadValue(personalInfoDTO.getSourceOfFund())); map.put("sourceOfFund", createStringUploadValue(personalInfoDTO.getSourceOfFund()));
map.put("monthlyIncome", createStringUploadValue(personalInfoDTO.getMonthlyIncome())); map.put("monthlyIncome", createStringUploadValue(personalInfoDTO.getMonthlyIncome()));
map.put("businessType", createStringUploadValue(personalInfoDTO.getBusinessType())); map.put("businessType", createStringUploadValue(personalInfoDTO.getBusinessType()));
@ -135,6 +136,7 @@ public class KYCV3Gateway extends PrivilegedGateway implements KYCV3GatewayInter
mockedDAta.add(new IDTextDTO("5", "Mocked Data 5")); mockedDAta.add(new IDTextDTO("5", "Mocked Data 5"));
kycRelatedDataDTO.setAdditionalIdType(mockedDAta); kycRelatedDataDTO.setAdditionalIdType(mockedDAta);
kycRelatedDataDTO.setOccupationList(mockedDAta);
kycRelatedDataDTO.setBusniessType(mockedDAta); kycRelatedDataDTO.setBusniessType(mockedDAta);
kycRelatedDataDTO.setIdType(mockedDAta); kycRelatedDataDTO.setIdType(mockedDAta);
kycRelatedDataDTO.setSourceOfFund(mockedDAta); kycRelatedDataDTO.setSourceOfFund(mockedDAta);
@ -145,6 +147,7 @@ public class KYCV3Gateway extends PrivilegedGateway implements KYCV3GatewayInter
"John Doe", "John Doe",
"2", "2",
"3", "3",
"3",
"123134123", "123134123",
"asdf@asd.com", "asdf@asd.com",
"NP", "NP",

21
app/src/main/java/com/swifttech/remit/android/features/kyc/newCustomer/model/KYCRelatedDataDTO.java

@ -2,6 +2,7 @@ package com.swifttech.remit.android.features.kyc.newCustomer.model;
import com.google.gson.annotations.Expose; import com.google.gson.annotations.Expose;
import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.SerializedName;
import com.swifttech.remit.android.features.kyc.existingCustomer.model.ExistingIDTextDTO;
import java.util.List; import java.util.List;
@ -9,6 +10,10 @@ public class KYCRelatedDataDTO {
@SerializedName("MonthlyIncome") @SerializedName("MonthlyIncome")
@Expose @Expose
private List<IDTextDTO> monthlyIncome = null; private List<IDTextDTO> monthlyIncome = null;
@SerializedName("OccupationList")
@Expose
private List<IDTextDTO> occupationList = null;
@SerializedName("SourceOfFund") @SerializedName("SourceOfFund")
@Expose @Expose
private List<IDTextDTO> sourceOfFund = null; private List<IDTextDTO> sourceOfFund = null;
@ -72,7 +77,13 @@ public class KYCRelatedDataDTO {
this.additionalIdType = additionalIdType; this.additionalIdType = additionalIdType;
} }
public List<IDTextDTO> getOccupationList() {
return occupationList;
}
public void setOccupationList(List<IDTextDTO> occupationList) {
this.occupationList = occupationList;
}
public PersonalInfoDTO getPersonalInformation() { public PersonalInfoDTO getPersonalInformation() {
return personalInformation; return personalInformation;
@ -139,7 +150,15 @@ public class KYCRelatedDataDTO {
} }
return null; return null;
} }
public IDTextDTO getOccupationFromId(String id) {
if (id == null || id.length() < 1)
return null;
for (IDTextDTO item : occupationList) {
if (id.equalsIgnoreCase(item.getId()))
return item;
}
return null;
}
public IDTextDTO getSourceOfFundFromId(String id) { public IDTextDTO getSourceOfFundFromId(String id) {

18
app/src/main/java/com/swifttech/remit/android/features/kyc/newCustomer/model/PersonalInfoDTO.java

@ -9,6 +9,9 @@ public class PersonalInfoDTO {
@SerializedName("employeerName") @SerializedName("employeerName")
@Expose @Expose
private String employeerName; private String employeerName;
@SerializedName("occupation")
@Expose
private String occupation;
@SerializedName("sourceOfFund") @SerializedName("sourceOfFund")
@Expose @Expose
@ -42,6 +45,7 @@ public class PersonalInfoDTO {
} }
public PersonalInfoDTO(String employeerName, public PersonalInfoDTO(String employeerName,
String occupation,
String sourceOfFund, String sourceOfFund,
String monthlyIncome, String monthlyIncome,
String mobile, String mobile,
@ -52,6 +56,7 @@ public class PersonalInfoDTO {
String additionalIdType, String additionalIdType,
String businessType) { String businessType) {
this.employeerName = employeerName; this.employeerName = employeerName;
this.occupation = occupation;
this.sourceOfFund = sourceOfFund; this.sourceOfFund = sourceOfFund;
this.monthlyIncome = monthlyIncome; this.monthlyIncome = monthlyIncome;
this.mobile = mobile; this.mobile = mobile;
@ -135,6 +140,14 @@ public class PersonalInfoDTO {
this.additionalIdType = additionalIdType; this.additionalIdType = additionalIdType;
} }
public String getOccupation() {
return occupation;
}
public void setOccupation(String occupation) {
this.occupation = occupation;
}
public String getBusinessType() { public String getBusinessType() {
return businessType; return businessType;
} }
@ -158,6 +171,7 @@ public class PersonalInfoDTO {
public PersonalInfoDTO clone() { public PersonalInfoDTO clone() {
return new PersonalInfoDTO( return new PersonalInfoDTO(
this.employeerName, this.employeerName,
this.occupation,
this.sourceOfFund, this.sourceOfFund,
this.monthlyIncome, this.monthlyIncome,
this.mobile, this.mobile,
@ -174,6 +188,7 @@ public class PersonalInfoDTO {
return new PersonalInfoDTO( return new PersonalInfoDTO(
Utils.formatToUpperCaseSafely(this.employeerName), Utils.formatToUpperCaseSafely(this.employeerName),
this.occupation,
this.sourceOfFund, this.sourceOfFund,
this.monthlyIncome, this.monthlyIncome,
Utils.formatToUpperCaseSafely(this.mobile), Utils.formatToUpperCaseSafely(this.mobile),
@ -194,6 +209,9 @@ public class PersonalInfoDTO {
public boolean isSourceOfFundValid() { public boolean isSourceOfFundValid() {
return Utils.isStringNotNullOrEmpty(this.sourceOfFund); return Utils.isStringNotNullOrEmpty(this.sourceOfFund);
} }
public boolean isOccupationValid() {
return Utils.isStringNotNullOrEmpty(this.occupation);
}
public boolean isMonthlyIncomeValid() { public boolean isMonthlyIncomeValid() {
return Utils.isStringNotNullOrEmpty(this.monthlyIncome); return Utils.isStringNotNullOrEmpty(this.monthlyIncome);

1
app/src/main/java/com/swifttech/remit/android/features/kyc/newCustomer/presenter/KYCV3PresenterInterface.java

@ -21,6 +21,7 @@ public interface KYCV3PresenterInterface extends BasePresenterInterface {
void getKycRelatedData(); void getKycRelatedData();
List<IDTextDTO> getOccupationList();
List<IDTextDTO> getSourceOfFundList(); List<IDTextDTO> getSourceOfFundList();
List<IDTextDTO> getMonthlyIncomeList(); List<IDTextDTO> getMonthlyIncomeList();
List<IDTextDTO> getBusinessTypeList(); List<IDTextDTO> getBusinessTypeList();

192
app/src/main/java/com/swifttech/remit/android/features/kyc/newCustomer/presenter/KYCV3ViewModel.java

@ -3,6 +3,7 @@ package com.swifttech.remit.android.features.kyc.newCustomer.presenter;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.util.Log; import android.util.Log;
import com.google.gson.reflect.TypeToken;
import com.swifttech.remit.android.R; import com.swifttech.remit.android.R;
import com.swifttech.remit.android.base.BaseViewModel; import com.swifttech.remit.android.base.BaseViewModel;
import com.swifttech.remit.android.common.customwidgets.CustomAlertDialog; import com.swifttech.remit.android.common.customwidgets.CustomAlertDialog;
@ -13,10 +14,9 @@ import com.swifttech.remit.android.features.kyc.newCustomer.model.KYCRelatedData
import com.swifttech.remit.android.features.kyc.newCustomer.model.KYCRequestDataDTO; import com.swifttech.remit.android.features.kyc.newCustomer.model.KYCRequestDataDTO;
import com.swifttech.remit.android.features.kyc.newCustomer.model.PersonalInfoDTO; import com.swifttech.remit.android.features.kyc.newCustomer.model.PersonalInfoDTO;
import com.swifttech.remit.android.features.kyc.newCustomer.model.PicturesDTO; import com.swifttech.remit.android.features.kyc.newCustomer.model.PicturesDTO;
import com.swifttech.remit.android.features.kyc.newCustomer.view.documents.KYCIDTypeViewLiveData;
import com.swifttech.remit.android.features.kyc.newCustomer.view.documents.KYCIDTypeFragment; import com.swifttech.remit.android.features.kyc.newCustomer.view.documents.KYCIDTypeFragment;
import com.swifttech.remit.android.features.kyc.newCustomer.view.documents.KYCIDTypeViewLiveData;
import com.swifttech.remit.android.features.kyc.newCustomer.view.personal.CustomerDetailViewLiveData; import com.swifttech.remit.android.features.kyc.newCustomer.view.personal.CustomerDetailViewLiveData;
import com.swifttech.remit.android.features.login.model.LoginV2DataApiResponse; import com.swifttech.remit.android.features.login.model.LoginV2DataApiResponse;
import com.swifttech.remit.android.features.login.presenter.LoginV2InteractorInterface; import com.swifttech.remit.android.features.login.presenter.LoginV2InteractorInterface;
import com.swifttech.remit.android.utils.Constants; import com.swifttech.remit.android.utils.Constants;
@ -25,10 +25,10 @@ import com.swifttech.remit.android.utils.https.GenericApiObserverResponse;
import com.swifttech.remit.android.utils.https.GenericApiObserverResponseV2; import com.swifttech.remit.android.utils.https.GenericApiObserverResponseV2;
import com.swifttech.remit.android.utils.https.GenericResponseDataModel; import com.swifttech.remit.android.utils.https.GenericResponseDataModel;
import com.swifttech.remit.android.utils.https.MessageResponseDataModel; import com.swifttech.remit.android.utils.https.MessageResponseDataModel;
import com.google.gson.reflect.TypeToken;
import java.io.File; import java.io.File;
import java.lang.reflect.Type; import java.lang.reflect.Type;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@ -44,34 +44,22 @@ import static android.app.Activity.RESULT_OK;
public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInterface { public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInterface {
public static final String TAG = "KYCV3Process";
private static final int THUMBNAIL_HEIGHT = 150; private static final int THUMBNAIL_HEIGHT = 150;
private static final int THUMBNAIL_WIDTH = 150; private static final int THUMBNAIL_WIDTH = 150;
private final KYCV3PresenterInterface.KYCV3ViewContractInterface view; private final KYCV3PresenterInterface.KYCV3ViewContractInterface view;
private final KYCV3GatewayInterface gateway; private final KYCV3GatewayInterface gateway;
private final FileDownloadGateway fileDownloadGateway; private final FileDownloadGateway fileDownloadGateway;
private final LoginV2InteractorInterface.Login2GatewayInterface loginGateway; private final LoginV2InteractorInterface.Login2GatewayInterface loginGateway;
private CustomerDetailViewValidator validator;
private PublishSubject<Boolean> form1ValidationSubject;
private PublishSubject<Boolean> form2ValidationSubject;
private final CompositeDisposable viewSubscriptions; private final CompositeDisposable viewSubscriptions;
private final CustomerDetailViewLiveData customerDetailLiveData; private final CustomerDetailViewLiveData customerDetailLiveData;
private final KYCIDTypeViewLiveData idTypeLiveData; private final KYCIDTypeViewLiveData idTypeLiveData;
private final CompositeDisposable compositeDisposable; private final CompositeDisposable compositeDisposable;
public static final String TAG = "KYCV3Process";
private final String userId; private final String userId;
private final String userPwd; private final String userPwd;
public static void log(String message) {
Log.d(TAG, message);
}
private CustomerDetailViewValidator validator;
private PublishSubject<Boolean> form1ValidationSubject;
private PublishSubject<Boolean> form2ValidationSubject;
public KYCV3ViewModel(KYCV3ViewContractInterface view, KYCV3GatewayInterface gatewayInterface, FileDownloadGateway fileDownloadGateway, LoginV2InteractorInterface.Login2GatewayInterface loginGateway, String userId, String userPwd) { public KYCV3ViewModel(KYCV3ViewContractInterface view, KYCV3GatewayInterface gatewayInterface, FileDownloadGateway fileDownloadGateway, LoginV2InteractorInterface.Login2GatewayInterface loginGateway, String userId, String userPwd) {
this.compositeDisposable = new CompositeDisposable(); this.compositeDisposable = new CompositeDisposable();
@ -95,6 +83,10 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
} }
public static void log(String message) {
Log.d(TAG, message);
}
@Override @Override
public void onViewReady() { public void onViewReady() {
@ -121,21 +113,26 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
} }
private void bindCustomerDetailView(CustomerDetailViewLiveData.CustomerDetailViewBinding viewBindings) { private void bindCustomerDetailView(CustomerDetailViewLiveData.CustomerDetailViewBinding viewBindings) {
List<Observable<Boolean>> list = Arrays.asList(
viewBindings.getAdditionalIdTypeObservable().map(validator::validateAdditionalIdType),
viewBindings.getOccupationObservable().map(validator::validateOccupation),
viewBindings.getSourceOfFundObservable().map(validator::validateSourceOfFund),
viewBindings.getAddressObservable().map(validator::validateAddress),
viewBindings.getBusinessTypeObservable().map(validator::validateBusineesType),
viewBindings.getEmailObservable().map(validator::validateEmail),
viewBindings.getIdTypeObservable().map(validator::validateSelectedIDType),
viewBindings.getMobileNumberObservable().map(validator::validateMobileNumber),
viewBindings.getMonthlyIncomeObservable().map(validator::validateMonthlyIncome),
viewBindings.getEmployerNameObservable().map(validator::validateEmployerName)
);
viewSubscriptions.add( viewSubscriptions.add(
Observable.combineLatest(
viewBindings.getAdditionalIdTypeObservable().map(validator::validateAdditionalIdType),
viewBindings.getSourceOfFundObservable().map(validator::validateSourceOfFund),
viewBindings.getAddressObservable().map(validator::validateAddress),
viewBindings.getBusinessTypeObservable().map(validator::validateBusineesType),
viewBindings.getEmailObservable().map(validator::validateEmail),
viewBindings.getIdTypeObservable().map(validator::validateSelectedIDType),
viewBindings.getMobileNumberObservable().map(validator::validateMobileNumber),
viewBindings.getMonthlyIncomeObservable().map(validator::validateMonthlyIncome),
viewBindings.getEmployerNameObservable().map(validator::validateEmployerName),
(isAdditionalTypeValid, isSourceOfFundValid, isAddressValid, isBusinessTypeValid, isEmailValid, isIdTypeValid, isMobileNumberValid, isMonthlyIncomeValid, isEmployerNameValid) ->
isAdditionalTypeValid && isSourceOfFundValid && isAddressValid && isBusinessTypeValid && isEmailValid && isIdTypeValid && isMobileNumberValid && isMonthlyIncomeValid && isEmployerNameValid
).subscribeWith(new DisposableObserver<Boolean>() {
Observable.combineLatest(list, objects -> {
for (Object value : objects) {
if (!(value instanceof Boolean)) return false;
if (!((Boolean) value)) return false;
}
return true;
}).subscribeWith(new DisposableObserver<Boolean>() {
@Override @Override
public void onNext(Boolean form1ValidationResult) { public void onNext(Boolean form1ValidationResult) {
@ -172,7 +169,7 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
viewBindings.getIdTypeSideDocImageLoadedResultObservable(), viewBindings.getIdTypeSideDocImageLoadedResultObservable(),
viewBindings.getAdditionalidTypeDocImageLoadedResultObservable(), viewBindings.getAdditionalidTypeDocImageLoadedResultObservable(),
viewBindings.getAdditionalidBackTypeDocImageLoadedResultObservable(), viewBindings.getAdditionalidBackTypeDocImageLoadedResultObservable(),
(isFacePictureValid, isFrontIdPictureValid, isBackIdPictureValid, isSideIdPictureValid, isAdditionalIdValid,isAdditionalIdBackValid) ->
(isFacePictureValid, isFrontIdPictureValid, isBackIdPictureValid, isSideIdPictureValid, isAdditionalIdValid, isAdditionalIdBackValid) ->
isFacePictureValid && isFrontIdPictureValid && isBackIdPictureValid && isSideIdPictureValid && isAdditionalIdValid && isAdditionalIdBackValid isFacePictureValid && isFrontIdPictureValid && isBackIdPictureValid && isSideIdPictureValid && isAdditionalIdValid && isAdditionalIdBackValid
).subscribeWith(new DisposableObserver<Boolean>() { ).subscribeWith(new DisposableObserver<Boolean>() {
@ -208,24 +205,25 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
} }
private void updateCustomerDetailData(KYCRelatedDataDTO data) { private void updateCustomerDetailData(KYCRelatedDataDTO data) {
PersonalInfoDTO personalInfoDTO=data.getPersonalInformation();
if(personalInfoDTO!=null){
String mobileNumber=personalInfoDTO.getMobile();
if(mobileNumber!=null &&mobileNumber.startsWith(view.getContext().getResources().getString(R.string.mobile_prefix))){
mobileNumber=mobileNumber.substring(3);
}
customerDetailLiveData.getEmployerNameLiveData().postValue(new FormInputStateDTO<>(true,null, personalInfoDTO.getEmployeerName()));
customerDetailLiveData.getSourceOfFundLiveData().postValue(new FormInputStateDTO<>(true,null, data.getSourceOfFundFromId(personalInfoDTO.getSourceOfFund())));
customerDetailLiveData.getMonthlyIncomeLiveData().postValue(new FormInputStateDTO<>(true,null, data.getMonthlyIncomeFromId(personalInfoDTO.getMonthlyIncome())));
customerDetailLiveData.getBusinessTypeLiveData().postValue(new FormInputStateDTO<>(true,null, data.getBusinessTypeFromId(personalInfoDTO.getBusinessType())));
customerDetailLiveData.getIdTypeLiveData().postValue(new FormInputStateDTO<>(true,null, data.getIDypeFromId(personalInfoDTO.getIdType())));
customerDetailLiveData.getAdditionalIdTypeLiveData().postValue(new FormInputStateDTO<>(true,null, data.getAdditionalIdTypeFromId(personalInfoDTO.getAdditionalIdType())));
customerDetailLiveData.getMobileNumberLiveData().postValue(new FormInputStateDTO<>(true,null, mobileNumber));
customerDetailLiveData.getEmailLiveData().postValue(new FormInputStateDTO<>(true,null, personalInfoDTO.getEmail()));
customerDetailLiveData.getAddressLiveData().postValue(new FormInputStateDTO<>(true,null, personalInfoDTO.getAdditionalAddress()));
}
PersonalInfoDTO personalInfoDTO = data.getPersonalInformation();
if (personalInfoDTO != null) {
String mobileNumber = personalInfoDTO.getMobile();
if (mobileNumber != null && mobileNumber.startsWith(view.getContext().getResources().getString(R.string.mobile_prefix))) {
mobileNumber = mobileNumber.substring(3);
}
customerDetailLiveData.getEmployerNameLiveData().postValue(new FormInputStateDTO<>(true, null, personalInfoDTO.getEmployeerName()));
customerDetailLiveData.getOccupationsLiveData().postValue(new FormInputStateDTO<>(true, null, data.getOccupationFromId(personalInfoDTO.getOccupation())));
customerDetailLiveData.getSourceOfFundLiveData().postValue(new FormInputStateDTO<>(true, null, data.getSourceOfFundFromId(personalInfoDTO.getSourceOfFund())));
customerDetailLiveData.getMonthlyIncomeLiveData().postValue(new FormInputStateDTO<>(true, null, data.getMonthlyIncomeFromId(personalInfoDTO.getMonthlyIncome())));
customerDetailLiveData.getBusinessTypeLiveData().postValue(new FormInputStateDTO<>(true, null, data.getBusinessTypeFromId(personalInfoDTO.getBusinessType())));
customerDetailLiveData.getIdTypeLiveData().postValue(new FormInputStateDTO<>(true, null, data.getIDypeFromId(personalInfoDTO.getIdType())));
customerDetailLiveData.getAdditionalIdTypeLiveData().postValue(new FormInputStateDTO<>(true, null, data.getAdditionalIdTypeFromId(personalInfoDTO.getAdditionalIdType())));
customerDetailLiveData.getMobileNumberLiveData().postValue(new FormInputStateDTO<>(true, null, mobileNumber));
customerDetailLiveData.getEmailLiveData().postValue(new FormInputStateDTO<>(true, null, personalInfoDTO.getEmail()));
customerDetailLiveData.getAddressLiveData().postValue(new FormInputStateDTO<>(true, null, personalInfoDTO.getAdditionalAddress()));
}
} }
@ -453,6 +451,7 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
} }
} }
} }
@Override @Override
public void checkImageStatus(int requestCode, int resultCode, File data) { public void checkImageStatus(int requestCode, int resultCode, File data) {
if (data == null) { if (data == null) {
@ -564,6 +563,10 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
); );
} }
@Override
public List<IDTextDTO> getOccupationList() {
return validator.getKycRelatedDataDTO().getOccupationList();
}
@Override @Override
@ -618,8 +621,18 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
postKYCFormToServer(validator.getKycRelatedDataDTO().getForm1PostData(gateway.getUserID()), view::showDocumentDetailForm); postKYCFormToServer(validator.getKycRelatedDataDTO().getForm1PostData(gateway.getUserID()), view::showDocumentDetailForm);
} }
private void getNewAccessToken(Runnable task) {
compositeDisposable.add(
loginGateway.loginUser(loginGateway.getBasicAuth(view.getContext()), this.userId, this.userPwd)
.doOnSubscribe(sub -> view.showProgressBar(true, ""))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.doFinally(() -> view.showProgressBar(false, ""))
.subscribeWith(new AccessTokenGenerationObserver(task)));
}
public class KycRelatedDataObserver extends GenericApiObserverResponseV2<KYCRelatedDataDTO> { public class KycRelatedDataObserver extends GenericApiObserverResponseV2<KYCRelatedDataDTO> {
@Override @Override
@ -630,9 +643,14 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
@Override @Override
protected void onSuccess(GenericResponseDataModel<KYCRelatedDataDTO> t) { protected void onSuccess(GenericResponseDataModel<KYCRelatedDataDTO> t) {
if (t.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2)) { if (t.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2)) {
onReceivingKycRelatedData(t.getData());
/* onReceivingKycRelatedData(t.getData());
view.lazyLoadForms(); view.lazyLoadForms();
if (t.getData().areAnyPicturesAvailableFromServer()) if (t.getData().areAnyPicturesAvailableFromServer())
view.showDocumentDetailForm();*/
onReceivingKycRelatedData(gateway.getMockedData());
view.lazyLoadForms();
if (true)
view.showDocumentDetailForm(); view.showDocumentDetailForm();
} else } else
@ -657,7 +675,6 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
} }
} }
public class CustomerDetailViewValidator { public class CustomerDetailViewValidator {
/** /**
@ -693,7 +710,20 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
} }
} }
boolean validateSourceOfFund(IDTextDTO data) {
boolean validateOccupation(IDTextDTO data) {
if (kycRelatedDataDTO.getPersonalInformation() == null)
kycRelatedDataDTO.setPersonalInformation(new PersonalInfoDTO());
kycRelatedDataDTO.getPersonalInformation().setOccupation(data.getId());
if (kycRelatedDataDTO.getPersonalInformation().isOccupationValid()) {
return true;
} else {
customerDetailLiveData.getOccupationsLiveData().setValue(new FormInputStateDTO<>(false, view.getContext().getString(R.string.invalidOccupation), null));
return false;
}
}
boolean validateSourceOfFund(IDTextDTO data) {
if (kycRelatedDataDTO.getPersonalInformation() == null) if (kycRelatedDataDTO.getPersonalInformation() == null)
kycRelatedDataDTO.setPersonalInformation(new PersonalInfoDTO()); kycRelatedDataDTO.setPersonalInformation(new PersonalInfoDTO());
@ -706,11 +736,11 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
} }
} }
boolean validateAddress(CharSequence data) {
boolean validateAddress(CharSequence data) {
if (kycRelatedDataDTO.getPersonalInformation() == null) if (kycRelatedDataDTO.getPersonalInformation() == null)
kycRelatedDataDTO.setPersonalInformation(new PersonalInfoDTO()); kycRelatedDataDTO.setPersonalInformation(new PersonalInfoDTO());
kycRelatedDataDTO.getPersonalInformation().setAdditionalAddress(data!=null?data.toString():null);
kycRelatedDataDTO.getPersonalInformation().setAdditionalAddress(data != null ? data.toString() : null);
if (kycRelatedDataDTO.getPersonalInformation().isAdditionalAddressValid()) { if (kycRelatedDataDTO.getPersonalInformation().isAdditionalAddressValid()) {
customerDetailLiveData.getAddressLiveData().setValue(new FormInputStateDTO<>(true, null, null)); customerDetailLiveData.getAddressLiveData().setValue(new FormInputStateDTO<>(true, null, null));
return true; return true;
@ -720,7 +750,7 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
} }
} }
boolean validateBusineesType(IDTextDTO data) {
boolean validateBusineesType(IDTextDTO data) {
if (kycRelatedDataDTO.getPersonalInformation() == null) if (kycRelatedDataDTO.getPersonalInformation() == null)
kycRelatedDataDTO.setPersonalInformation(new PersonalInfoDTO()); kycRelatedDataDTO.setPersonalInformation(new PersonalInfoDTO());
@ -733,11 +763,11 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
} }
} }
boolean validateEmail(CharSequence data) {
boolean validateEmail(CharSequence data) {
if (kycRelatedDataDTO.getPersonalInformation() == null) if (kycRelatedDataDTO.getPersonalInformation() == null)
kycRelatedDataDTO.setPersonalInformation(new PersonalInfoDTO()); kycRelatedDataDTO.setPersonalInformation(new PersonalInfoDTO());
kycRelatedDataDTO.getPersonalInformation().setEmail(data!=null?data.toString():null);
kycRelatedDataDTO.getPersonalInformation().setEmail(data != null ? data.toString() : null);
if (kycRelatedDataDTO.getPersonalInformation().isEmailValid()) { if (kycRelatedDataDTO.getPersonalInformation().isEmailValid()) {
customerDetailLiveData.getEmailLiveData().setValue(new FormInputStateDTO<>(true, null, null)); customerDetailLiveData.getEmailLiveData().setValue(new FormInputStateDTO<>(true, null, null));
return true; return true;
@ -747,7 +777,7 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
} }
} }
boolean validateSelectedIDType(IDTextDTO data) {
boolean validateSelectedIDType(IDTextDTO data) {
if (kycRelatedDataDTO.getPersonalInformation() == null) if (kycRelatedDataDTO.getPersonalInformation() == null)
kycRelatedDataDTO.setPersonalInformation(new PersonalInfoDTO()); kycRelatedDataDTO.setPersonalInformation(new PersonalInfoDTO());
@ -760,11 +790,11 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
} }
} }
boolean validateMobileNumber(CharSequence data) {
boolean validateMobileNumber(CharSequence data) {
if (kycRelatedDataDTO.getPersonalInformation() == null) if (kycRelatedDataDTO.getPersonalInformation() == null)
kycRelatedDataDTO.setPersonalInformation(new PersonalInfoDTO()); kycRelatedDataDTO.setPersonalInformation(new PersonalInfoDTO());
kycRelatedDataDTO.getPersonalInformation().setMobile(data!=null?data.toString():null);
kycRelatedDataDTO.getPersonalInformation().setMobile(data != null ? data.toString() : null);
if (kycRelatedDataDTO.getPersonalInformation().isMobileNumberValid()) { if (kycRelatedDataDTO.getPersonalInformation().isMobileNumberValid()) {
customerDetailLiveData.getMobileNumberLiveData().setValue(new FormInputStateDTO<>(true, null, null)); customerDetailLiveData.getMobileNumberLiveData().setValue(new FormInputStateDTO<>(true, null, null));
return true; return true;
@ -774,7 +804,7 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
} }
} }
boolean validateMonthlyIncome(IDTextDTO data) {
boolean validateMonthlyIncome(IDTextDTO data) {
if (kycRelatedDataDTO.getPersonalInformation() == null) if (kycRelatedDataDTO.getPersonalInformation() == null)
kycRelatedDataDTO.setPersonalInformation(new PersonalInfoDTO()); kycRelatedDataDTO.setPersonalInformation(new PersonalInfoDTO());
@ -787,11 +817,11 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
} }
} }
boolean validateEmployerName(CharSequence data) {
boolean validateEmployerName(CharSequence data) {
if (kycRelatedDataDTO.getPersonalInformation() == null) if (kycRelatedDataDTO.getPersonalInformation() == null)
kycRelatedDataDTO.setPersonalInformation(new PersonalInfoDTO()); kycRelatedDataDTO.setPersonalInformation(new PersonalInfoDTO());
kycRelatedDataDTO.getPersonalInformation().setEmployeerName(data!=null?data.toString():null);
kycRelatedDataDTO.getPersonalInformation().setEmployeerName(data != null ? data.toString() : null);
if (kycRelatedDataDTO.getPersonalInformation().isEmployerNameValid()) { if (kycRelatedDataDTO.getPersonalInformation().isEmployerNameValid()) {
customerDetailLiveData.getEmployerNameLiveData().setValue(new FormInputStateDTO<>(true, null, null)); customerDetailLiveData.getEmployerNameLiveData().setValue(new FormInputStateDTO<>(true, null, null));
return true; return true;
@ -801,7 +831,7 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
} }
} }
boolean validateFacePicture(File data) {
boolean validateFacePicture(File data) {
if (kycRelatedDataDTO.getPictures() == null) if (kycRelatedDataDTO.getPictures() == null)
kycRelatedDataDTO.setPictures(new PicturesDTO()); kycRelatedDataDTO.setPictures(new PicturesDTO());
@ -816,7 +846,7 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
} }
boolean validateFrontIdTypePicture(File data) {
boolean validateFrontIdTypePicture(File data) {
if (kycRelatedDataDTO.getPictures() == null) if (kycRelatedDataDTO.getPictures() == null)
kycRelatedDataDTO.setPictures(new PicturesDTO()); kycRelatedDataDTO.setPictures(new PicturesDTO());
@ -830,7 +860,7 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
} }
boolean validateBackIdTypePicture(File data) {
boolean validateBackIdTypePicture(File data) {
if (kycRelatedDataDTO.getPictures() == null) if (kycRelatedDataDTO.getPictures() == null)
kycRelatedDataDTO.setPictures(new PicturesDTO()); kycRelatedDataDTO.setPictures(new PicturesDTO());
@ -844,7 +874,7 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
} }
boolean validateSideIdTypePicture(File data) {
boolean validateSideIdTypePicture(File data) {
if (kycRelatedDataDTO.getPictures() == null) if (kycRelatedDataDTO.getPictures() == null)
kycRelatedDataDTO.setPictures(new PicturesDTO()); kycRelatedDataDTO.setPictures(new PicturesDTO());
@ -884,20 +914,6 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
} }
} }
private void getNewAccessToken(Runnable task) {
compositeDisposable.add(
loginGateway.loginUser(loginGateway.getBasicAuth(view.getContext()), this.userId, this.userPwd)
.doOnSubscribe(sub -> view.showProgressBar(true, ""))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.doFinally(() -> view.showProgressBar(false, ""))
.subscribeWith(new AccessTokenGenerationObserver(task)));
}
public class KYCFormUploadObserver extends GenericApiObserverResponseV2<MessageResponseDataModel> { public class KYCFormUploadObserver extends GenericApiObserverResponseV2<MessageResponseDataModel> {
Runnable task; Runnable task;
@ -917,15 +933,15 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
if ((userId != null && userId.length() > 0) && userPwd != null && userPwd.length() > 0) if ((userId != null && userId.length() > 0) && userPwd != null && userPwd.length() > 0)
getNewAccessToken(task); getNewAccessToken(task);
else if (task != null) else if (task != null)
view.showPopUpMessage(t.getMsg(), CustomAlertDialog.AlertType.SUCCESS,alertType -> {
if(task!=null)
view.showPopUpMessage(t.getMsg(), CustomAlertDialog.AlertType.SUCCESS, alertType -> {
if (task != null)
task.run(); task.run();
}); });
} else if(task!=null)
} else if (task != null)
task.run(); task.run();
} else } else
view.showPopUpMessage(t.getMsg(), CustomAlertDialog.AlertType.FAILED,null);
view.showPopUpMessage(t.getMsg(), CustomAlertDialog.AlertType.FAILED, null);
} }
@Override @Override

39
app/src/main/java/com/swifttech/remit/android/features/kyc/newCustomer/view/personal/CustomerDetailFragment.java

@ -21,6 +21,7 @@ import com.swifttech.remit.android.R;
import com.swifttech.remit.android.base.BaseFragment; import com.swifttech.remit.android.base.BaseFragment;
import com.swifttech.remit.android.common.model.FormInputStateDTO; import com.swifttech.remit.android.common.model.FormInputStateDTO;
import com.swifttech.remit.android.common.customwidgets.common.GenericTextListingDialog; import com.swifttech.remit.android.common.customwidgets.common.GenericTextListingDialog;
import com.swifttech.remit.android.features.kyc.existingCustomer.model.ExistingIDTextDTO;
import com.swifttech.remit.android.features.kyc.newCustomer.model.IDTextDTO; import com.swifttech.remit.android.features.kyc.newCustomer.model.IDTextDTO;
import com.swifttech.remit.android.features.kyc.newCustomer.presenter.KYCV3PresenterInterface; import com.swifttech.remit.android.features.kyc.newCustomer.presenter.KYCV3PresenterInterface;
import com.swifttech.remit.android.features.kyc.newCustomer.presenter.KYCV3ViewModel; import com.swifttech.remit.android.features.kyc.newCustomer.presenter.KYCV3ViewModel;
@ -57,6 +58,9 @@ public class CustomerDetailFragment extends BaseFragment implements KYCV3Present
@BindView(R.id.ed_employerName) @BindView(R.id.ed_employerName)
EditText ed_employerName; EditText ed_employerName;
@BindView(R.id.ed_occupation)
EditText ed_occupation;
@BindView(R.id.ed_sourceOfFund) @BindView(R.id.ed_sourceOfFund)
EditText ed_sourceOfFund; EditText ed_sourceOfFund;
@ -98,14 +102,14 @@ public class CustomerDetailFragment extends BaseFragment implements KYCV3Present
@BindView(R.id.btn_submit1) @BindView(R.id.btn_submit1)
Button btnSubmit1; Button btnSubmit1;
private GenericTextListingDialog<IDTextDTO> occupationSelectionDialog;
private GenericTextListingDialog<IDTextDTO> sourceOfFundSelectionDialog; private GenericTextListingDialog<IDTextDTO> sourceOfFundSelectionDialog;
private GenericTextListingDialog<IDTextDTO> monthlyIncomeSelectionDialog; private GenericTextListingDialog<IDTextDTO> monthlyIncomeSelectionDialog;
private GenericTextListingDialog<IDTextDTO> busineessTypeSelectionDialog; private GenericTextListingDialog<IDTextDTO> busineessTypeSelectionDialog;
private GenericTextListingDialog<IDTextDTO> idTypeSelectionDialog; private GenericTextListingDialog<IDTextDTO> idTypeSelectionDialog;
private GenericTextListingDialog<IDTextDTO> additionalIdTypeSelectionDialog; private GenericTextListingDialog<IDTextDTO> additionalIdTypeSelectionDialog;
private PublishSubject<IDTextDTO> occupationSelectSubject;
private PublishSubject<IDTextDTO> sourceOfFundSelectSubject; private PublishSubject<IDTextDTO> sourceOfFundSelectSubject;
private PublishSubject<IDTextDTO> monthlyIncomeSelectSubject; private PublishSubject<IDTextDTO> monthlyIncomeSelectSubject;
private PublishSubject<IDTextDTO> businessTypeSelectSubject; private PublishSubject<IDTextDTO> businessTypeSelectSubject;
@ -132,6 +136,7 @@ public class CustomerDetailFragment extends BaseFragment implements KYCV3Present
private void init() { private void init() {
occupationSelectSubject = PublishSubject.create();
sourceOfFundSelectSubject = PublishSubject.create(); sourceOfFundSelectSubject = PublishSubject.create();
monthlyIncomeSelectSubject = PublishSubject.create(); monthlyIncomeSelectSubject = PublishSubject.create();
businessTypeSelectSubject = PublishSubject.create(); businessTypeSelectSubject = PublishSubject.create();
@ -142,6 +147,7 @@ public class CustomerDetailFragment extends BaseFragment implements KYCV3Present
customerDetailViewBinding = new CustomerDetailViewLiveData.CustomerDetailViewBinding( customerDetailViewBinding = new CustomerDetailViewLiveData.CustomerDetailViewBinding(
RxTextView.textChanges(ed_employerName).skipInitialValue(), RxTextView.textChanges(ed_employerName).skipInitialValue(),
occupationSelectSubject,
sourceOfFundSelectSubject, sourceOfFundSelectSubject,
monthlyIncomeSelectSubject, monthlyIncomeSelectSubject,
RxTextView.textChanges(ed_mobileNumber).skipInitialValue(), RxTextView.textChanges(ed_mobileNumber).skipInitialValue(),
@ -167,12 +173,22 @@ public class CustomerDetailFragment extends BaseFragment implements KYCV3Present
customerDetailViewLiveData.getMobileNumberLiveData().observe(getViewLifecycleOwner(), this::onMobileNumberSelected); customerDetailViewLiveData.getMobileNumberLiveData().observe(getViewLifecycleOwner(), this::onMobileNumberSelected);
customerDetailViewLiveData.getMonthlyIncomeLiveData().observe(getViewLifecycleOwner(), this::onMonthlyIncomeSelected); customerDetailViewLiveData.getMonthlyIncomeLiveData().observe(getViewLifecycleOwner(), this::onMonthlyIncomeSelected);
customerDetailViewLiveData.getEmployerNameLiveData().observe(getViewLifecycleOwner(), this::onEmployerNameSelected); customerDetailViewLiveData.getEmployerNameLiveData().observe(getViewLifecycleOwner(), this::onEmployerNameSelected);
customerDetailViewLiveData.getOccupationsLiveData().observe(getViewLifecycleOwner(), this::onOccupationSelected);
customerDetailViewLiveData.getSourceOfFundLiveData().observe(getViewLifecycleOwner(), this::onSourceOfFundSelected); customerDetailViewLiveData.getSourceOfFundLiveData().observe(getViewLifecycleOwner(), this::onSourceOfFundSelected);
customerDetailViewLiveData.getAllFieldsValidLiveData().observe(getViewLifecycleOwner(), areAllFieldsValid -> btnSubmit1.setEnabled(areAllFieldsValid)); customerDetailViewLiveData.getAllFieldsValidLiveData().observe(getViewLifecycleOwner(), areAllFieldsValid -> btnSubmit1.setEnabled(areAllFieldsValid));
} }
private void onOccupationSelected(FormInputStateDTO<IDTextDTO> data) {
if (data.isValid()) {
if (data.hasData()) {
ed_occupation.setText(data.getData().getText());
occupationSelectSubject.onNext(data.getData());
}
}
}
private void onSourceOfFundSelected(FormInputStateDTO<IDTextDTO> data) { private void onSourceOfFundSelected(FormInputStateDTO<IDTextDTO> data) {
if (data.isValid()) { if (data.isValid()) {
if (data.hasData()) { if (data.hasData()) {
@ -389,8 +405,27 @@ public class CustomerDetailFragment extends BaseFragment implements KYCV3Present
if (!additionalIdTypeSelectionDialog.isAdded()) if (!additionalIdTypeSelectionDialog.isAdded())
additionalIdTypeSelectionDialog.show(getActivity().getSupportFragmentManager(), "ADDITIONALIDTYPECHOOSER"); additionalIdTypeSelectionDialog.show(getActivity().getSupportFragmentManager(), "ADDITIONALIDTYPECHOOSER");
} }
@OnClick(R.id.ed_occupation)
public void promptOccupation() {
hideKeyBoard();
if (occupationSelectionDialog == null)
occupationSelectionDialog = new GenericTextListingDialog<>();
occupationSelectionDialog.setData(kycv3ViewModel.getOccupationList());
occupationSelectionDialog.disableSearch(true);
occupationSelectionDialog.setListener(occupation ->
{
occupationSelectionDialog.dismiss();
ed_occupation.setText(occupation.toString());
occupationSelectSubject.onNext(occupation);
});
occupationSelectionDialog.setHintAndTitle(getString(R.string.searchOccupation), getString(R.string.selectOccupation), getString(R.string.no_result_found_text));
if (!occupationSelectionDialog.isAdded())
occupationSelectionDialog.show(getActivity().getSupportFragmentManager(), "OCCUPATIONCHOOSER");
}
@OnClick(R.id.ed_sourceOfFund) @OnClick(R.id.ed_sourceOfFund)
public void promptSourceOfFund() { public void promptSourceOfFund() {

17
app/src/main/java/com/swifttech/remit/android/features/kyc/newCustomer/view/personal/CustomerDetailViewLiveData.java

@ -11,6 +11,7 @@ import io.reactivex.Observable;
public class CustomerDetailViewLiveData { public class CustomerDetailViewLiveData {
private MutableLiveData<FormInputStateDTO<String>> employerNameLiveData; private MutableLiveData<FormInputStateDTO<String>> employerNameLiveData;
private MutableLiveData<FormInputStateDTO<IDTextDTO>> occupationsLiveData;
private MutableLiveData<FormInputStateDTO<IDTextDTO>> sourceOfFundLiveData; private MutableLiveData<FormInputStateDTO<IDTextDTO>> sourceOfFundLiveData;
private MutableLiveData<FormInputStateDTO<IDTextDTO>> monthlyIncomeLiveData; private MutableLiveData<FormInputStateDTO<IDTextDTO>> monthlyIncomeLiveData;
private MutableLiveData<FormInputStateDTO<String>> mobileNumberLiveData; private MutableLiveData<FormInputStateDTO<String>> mobileNumberLiveData;
@ -23,6 +24,7 @@ public class CustomerDetailViewLiveData {
public CustomerDetailViewLiveData() { public CustomerDetailViewLiveData() {
employerNameLiveData = new MutableLiveData<>(); employerNameLiveData = new MutableLiveData<>();
occupationsLiveData = new MutableLiveData<>();
sourceOfFundLiveData = new MutableLiveData<>(); sourceOfFundLiveData = new MutableLiveData<>();
monthlyIncomeLiveData = new MutableLiveData<>(); monthlyIncomeLiveData = new MutableLiveData<>();
mobileNumberLiveData = new MutableLiveData<>(); mobileNumberLiveData = new MutableLiveData<>();
@ -54,6 +56,14 @@ public class CustomerDetailViewLiveData {
this.allFieldsValid.setValue(allFieldsValid); this.allFieldsValid.setValue(allFieldsValid);
} }
public MutableLiveData<FormInputStateDTO<IDTextDTO>> getOccupationsLiveData() {
return occupationsLiveData;
}
public void setOccupationsLiveData(MutableLiveData<FormInputStateDTO<IDTextDTO>> occupationsLiveData) {
this.occupationsLiveData = occupationsLiveData;
}
public MutableLiveData<FormInputStateDTO<IDTextDTO>> getSourceOfFundLiveData() { public MutableLiveData<FormInputStateDTO<IDTextDTO>> getSourceOfFundLiveData() {
return sourceOfFundLiveData; return sourceOfFundLiveData;
} }
@ -132,9 +142,11 @@ public class CustomerDetailViewLiveData {
private Observable<CharSequence> addressObservable; private Observable<CharSequence> addressObservable;
private Observable<IDTextDTO> idTypeObservable; private Observable<IDTextDTO> idTypeObservable;
private Observable<IDTextDTO> additionalIdTypeObservable; private Observable<IDTextDTO> additionalIdTypeObservable;
private Observable<IDTextDTO> occupationObservable;
public CustomerDetailViewBinding( public CustomerDetailViewBinding(
Observable<CharSequence> employerNameObservable, Observable<CharSequence> employerNameObservable,
Observable<IDTextDTO> occupationObservable,
Observable<IDTextDTO> sourceOfFundObservable, Observable<IDTextDTO> sourceOfFundObservable,
Observable<IDTextDTO> monthlyIncomeObservable, Observable<IDTextDTO> monthlyIncomeObservable,
Observable<CharSequence> mobileNumberObservable, Observable<CharSequence> mobileNumberObservable,
@ -145,6 +157,7 @@ public class CustomerDetailViewLiveData {
Observable<IDTextDTO> additionalIdTypeObservable) { Observable<IDTextDTO> additionalIdTypeObservable) {
this.employerNameObservable = employerNameObservable; this.employerNameObservable = employerNameObservable;
this.occupationObservable = occupationObservable;
this.sourceOfFundObservable = sourceOfFundObservable; this.sourceOfFundObservable = sourceOfFundObservable;
this.monthlyIncomeObservable = monthlyIncomeObservable; this.monthlyIncomeObservable = monthlyIncomeObservable;
this.mobileNumberObservable = mobileNumberObservable; this.mobileNumberObservable = mobileNumberObservable;
@ -190,5 +203,9 @@ public class CustomerDetailViewLiveData {
public Observable<IDTextDTO> getAdditionalIdTypeObservable() { public Observable<IDTextDTO> getAdditionalIdTypeObservable() {
return additionalIdTypeObservable; return additionalIdTypeObservable;
} }
public Observable<IDTextDTO> getOccupationObservable() {
return occupationObservable;
}
} }
} }

15
app/src/main/res/layout/fragment_kyc_customer_detail.xml

@ -57,6 +57,21 @@
</com.swifttech.remit.android.common.view.MTextInputLayout> </com.swifttech.remit.android.common.view.MTextInputLayout>
<com.swifttech.remit.android.common.view.MTextInputLayout
android:id="@+id/occupationSelectionWrapper"
android:hint="@string/select_occupation_text"
style="@style/MTextInputLayoutFormDropDown"
app:endIconMode="dropdown_menu"
app:errorEnabled="true">
<com.swifttech.remit.android.common.view.MAutoCompleteTextView
android:id="@+id/ed_occupation"
style="@style/MAutoCompleteDropDown"
android:imeOptions="actionDone"
/>
</com.swifttech.remit.android.common.view.MTextInputLayout>
<com.swifttech.remit.android.common.view.MTextInputLayout <com.swifttech.remit.android.common.view.MTextInputLayout
android:id="@+id/sourceOfFundSelectionWrapper" android:id="@+id/sourceOfFundSelectionWrapper"
android:hint="@string/select_source_of_fund_text" android:hint="@string/select_source_of_fund_text"

Loading…
Cancel
Save