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. 100
      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() {
employerNameLiveData = new MutableLiveData<>();
sourceOfFundLiveData = new MutableLiveData<>();
occupationsLiveData = new MutableLiveData<>();
sourceOfFundLiveData = new MutableLiveData<>();
monthlyIncomeLiveData = new MutableLiveData<>();
mobileNumberLiveData = 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.SharedPreferences;
import com.google.gson.JsonObject;
import com.google.gson.reflect.TypeToken;
import com.swifttech.remit.android.RemitApplication;
import com.swifttech.remit.android.base.PrefKeys;
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.presenter.KYCV3GatewayInterface;
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.util.ArrayList;
@ -62,6 +62,7 @@ public class KYCV3Gateway extends PrivilegedGateway implements KYCV3GatewayInter
if (personalInfoDTO != null) {
map.put("employeerName", createStringUploadValue(personalInfoDTO.getEmployeerName()));
map.put("occupation", createStringUploadValue(personalInfoDTO.getOccupation()));
map.put("sourceOfFund", createStringUploadValue(personalInfoDTO.getSourceOfFund()));
map.put("monthlyIncome", createStringUploadValue(personalInfoDTO.getMonthlyIncome()));
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"));
kycRelatedDataDTO.setAdditionalIdType(mockedDAta);
kycRelatedDataDTO.setOccupationList(mockedDAta);
kycRelatedDataDTO.setBusniessType(mockedDAta);
kycRelatedDataDTO.setIdType(mockedDAta);
kycRelatedDataDTO.setSourceOfFund(mockedDAta);
@ -145,6 +147,7 @@ public class KYCV3Gateway extends PrivilegedGateway implements KYCV3GatewayInter
"John Doe",
"2",
"3",
"3",
"123134123",
"asdf@asd.com",
"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.SerializedName;
import com.swifttech.remit.android.features.kyc.existingCustomer.model.ExistingIDTextDTO;
import java.util.List;
@ -9,6 +10,10 @@ public class KYCRelatedDataDTO {
@SerializedName("MonthlyIncome")
@Expose
private List<IDTextDTO> monthlyIncome = null;
@SerializedName("OccupationList")
@Expose
private List<IDTextDTO> occupationList = null;
@SerializedName("SourceOfFund")
@Expose
private List<IDTextDTO> sourceOfFund = null;
@ -72,7 +77,13 @@ public class KYCRelatedDataDTO {
this.additionalIdType = additionalIdType;
}
public List<IDTextDTO> getOccupationList() {
return occupationList;
}
public void setOccupationList(List<IDTextDTO> occupationList) {
this.occupationList = occupationList;
}
public PersonalInfoDTO getPersonalInformation() {
return personalInformation;
@ -139,7 +150,15 @@ public class KYCRelatedDataDTO {
}
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) {

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

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

100
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.util.Log;
import com.google.gson.reflect.TypeToken;
import com.swifttech.remit.android.R;
import com.swifttech.remit.android.base.BaseViewModel;
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.PersonalInfoDTO;
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.KYCIDTypeViewLiveData;
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.presenter.LoginV2InteractorInterface;
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.GenericResponseDataModel;
import com.swifttech.remit.android.utils.https.MessageResponseDataModel;
import com.google.gson.reflect.TypeToken;
import java.io.File;
import java.lang.reflect.Type;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.TimeUnit;
@ -44,34 +44,22 @@ import static android.app.Activity.RESULT_OK;
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_WIDTH = 150;
private final KYCV3PresenterInterface.KYCV3ViewContractInterface view;
private final KYCV3GatewayInterface gateway;
private final FileDownloadGateway fileDownloadGateway;
private final LoginV2InteractorInterface.Login2GatewayInterface loginGateway;
private CustomerDetailViewValidator validator;
private PublishSubject<Boolean> form1ValidationSubject;
private PublishSubject<Boolean> form2ValidationSubject;
private final CompositeDisposable viewSubscriptions;
private final CustomerDetailViewLiveData customerDetailLiveData;
private final KYCIDTypeViewLiveData idTypeLiveData;
private final CompositeDisposable compositeDisposable;
public static final String TAG = "KYCV3Process";
private final String userId;
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) {
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
public void onViewReady() {
@ -121,9 +113,9 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
}
private void bindCustomerDetailView(CustomerDetailViewLiveData.CustomerDetailViewBinding viewBindings) {
viewSubscriptions.add(
Observable.combineLatest(
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),
@ -131,11 +123,16 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
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>() {
viewBindings.getEmployerNameObservable().map(validator::validateEmployerName)
);
viewSubscriptions.add(
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
public void onNext(Boolean form1ValidationResult) {
@ -216,6 +213,7 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
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())));
@ -453,6 +451,7 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
}
}
}
@Override
public void checkImageStatus(int requestCode, int resultCode, File data) {
if (data == null) {
@ -564,6 +563,10 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
);
}
@Override
public List<IDTextDTO> getOccupationList() {
return validator.getKycRelatedDataDTO().getOccupationList();
}
@Override
@ -618,8 +621,18 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
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> {
@Override
@ -630,9 +643,14 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
@Override
protected void onSuccess(GenericResponseDataModel<KYCRelatedDataDTO> t) {
if (t.getErrorCode().equalsIgnoreCase(Constants.SUCCESS_CODE_V2)) {
onReceivingKycRelatedData(t.getData());
/* onReceivingKycRelatedData(t.getData());
view.lazyLoadForms();
if (t.getData().areAnyPicturesAvailableFromServer())
view.showDocumentDetailForm();*/
onReceivingKycRelatedData(gateway.getMockedData());
view.lazyLoadForms();
if (true)
view.showDocumentDetailForm();
} else
@ -657,7 +675,6 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
}
}
public class CustomerDetailViewValidator {
/**
@ -693,6 +710,19 @@ public class KYCV3ViewModel extends BaseViewModel implements KYCV3PresenterInter
}
}
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)
kycRelatedDataDTO.setPersonalInformation(new PersonalInfoDTO());
@ -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> {
Runnable task;

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.common.model.FormInputStateDTO;
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.presenter.KYCV3PresenterInterface;
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)
EditText ed_employerName;
@BindView(R.id.ed_occupation)
EditText ed_occupation;
@BindView(R.id.ed_sourceOfFund)
EditText ed_sourceOfFund;
@ -98,14 +102,14 @@ public class CustomerDetailFragment extends BaseFragment implements KYCV3Present
@BindView(R.id.btn_submit1)
Button btnSubmit1;
private GenericTextListingDialog<IDTextDTO> occupationSelectionDialog;
private GenericTextListingDialog<IDTextDTO> sourceOfFundSelectionDialog;
private GenericTextListingDialog<IDTextDTO> monthlyIncomeSelectionDialog;
private GenericTextListingDialog<IDTextDTO> busineessTypeSelectionDialog;
private GenericTextListingDialog<IDTextDTO> idTypeSelectionDialog;
private GenericTextListingDialog<IDTextDTO> additionalIdTypeSelectionDialog;
private PublishSubject<IDTextDTO> occupationSelectSubject;
private PublishSubject<IDTextDTO> sourceOfFundSelectSubject;
private PublishSubject<IDTextDTO> monthlyIncomeSelectSubject;
private PublishSubject<IDTextDTO> businessTypeSelectSubject;
@ -132,6 +136,7 @@ public class CustomerDetailFragment extends BaseFragment implements KYCV3Present
private void init() {
occupationSelectSubject = PublishSubject.create();
sourceOfFundSelectSubject = PublishSubject.create();
monthlyIncomeSelectSubject = PublishSubject.create();
businessTypeSelectSubject = PublishSubject.create();
@ -142,6 +147,7 @@ public class CustomerDetailFragment extends BaseFragment implements KYCV3Present
customerDetailViewBinding = new CustomerDetailViewLiveData.CustomerDetailViewBinding(
RxTextView.textChanges(ed_employerName).skipInitialValue(),
occupationSelectSubject,
sourceOfFundSelectSubject,
monthlyIncomeSelectSubject,
RxTextView.textChanges(ed_mobileNumber).skipInitialValue(),
@ -167,12 +173,22 @@ public class CustomerDetailFragment extends BaseFragment implements KYCV3Present
customerDetailViewLiveData.getMobileNumberLiveData().observe(getViewLifecycleOwner(), this::onMobileNumberSelected);
customerDetailViewLiveData.getMonthlyIncomeLiveData().observe(getViewLifecycleOwner(), this::onMonthlyIncomeSelected);
customerDetailViewLiveData.getEmployerNameLiveData().observe(getViewLifecycleOwner(), this::onEmployerNameSelected);
customerDetailViewLiveData.getOccupationsLiveData().observe(getViewLifecycleOwner(), this::onOccupationSelected);
customerDetailViewLiveData.getSourceOfFundLiveData().observe(getViewLifecycleOwner(), this::onSourceOfFundSelected);
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) {
if (data.isValid()) {
if (data.hasData()) {
@ -389,8 +405,27 @@ public class CustomerDetailFragment extends BaseFragment implements KYCV3Present
if (!additionalIdTypeSelectionDialog.isAdded())
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)
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 {
private MutableLiveData<FormInputStateDTO<String>> employerNameLiveData;
private MutableLiveData<FormInputStateDTO<IDTextDTO>> occupationsLiveData;
private MutableLiveData<FormInputStateDTO<IDTextDTO>> sourceOfFundLiveData;
private MutableLiveData<FormInputStateDTO<IDTextDTO>> monthlyIncomeLiveData;
private MutableLiveData<FormInputStateDTO<String>> mobileNumberLiveData;
@ -23,6 +24,7 @@ public class CustomerDetailViewLiveData {
public CustomerDetailViewLiveData() {
employerNameLiveData = new MutableLiveData<>();
occupationsLiveData = new MutableLiveData<>();
sourceOfFundLiveData = new MutableLiveData<>();
monthlyIncomeLiveData = new MutableLiveData<>();
mobileNumberLiveData = new MutableLiveData<>();
@ -54,6 +56,14 @@ public class CustomerDetailViewLiveData {
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() {
return sourceOfFundLiveData;
}
@ -132,9 +142,11 @@ public class CustomerDetailViewLiveData {
private Observable<CharSequence> addressObservable;
private Observable<IDTextDTO> idTypeObservable;
private Observable<IDTextDTO> additionalIdTypeObservable;
private Observable<IDTextDTO> occupationObservable;
public CustomerDetailViewBinding(
Observable<CharSequence> employerNameObservable,
Observable<IDTextDTO> occupationObservable,
Observable<IDTextDTO> sourceOfFundObservable,
Observable<IDTextDTO> monthlyIncomeObservable,
Observable<CharSequence> mobileNumberObservable,
@ -145,6 +157,7 @@ public class CustomerDetailViewLiveData {
Observable<IDTextDTO> additionalIdTypeObservable) {
this.employerNameObservable = employerNameObservable;
this.occupationObservable = occupationObservable;
this.sourceOfFundObservable = sourceOfFundObservable;
this.monthlyIncomeObservable = monthlyIncomeObservable;
this.mobileNumberObservable = mobileNumberObservable;
@ -190,5 +203,9 @@ public class CustomerDetailViewLiveData {
public Observable<IDTextDTO> getAdditionalIdTypeObservable() {
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
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
android:id="@+id/sourceOfFundSelectionWrapper"
android:hint="@string/select_source_of_fund_text"

Loading…
Cancel
Save