diff --git a/app/src/androidTest/java/in/projecteka/jataayu/consent/ui/fragment/ConsentDetailsFragmentTest.kt b/app/src/androidTest/java/in/projecteka/jataayu/consent/ui/fragment/ConsentDetailsFragmentTest.kt index b7301eed..e5d10164 100644 --- a/app/src/androidTest/java/in/projecteka/jataayu/consent/ui/fragment/ConsentDetailsFragmentTest.kt +++ b/app/src/androidTest/java/in/projecteka/jataayu/consent/ui/fragment/ConsentDetailsFragmentTest.kt @@ -18,8 +18,6 @@ import org.junit.Rule import org.junit.Test import org.junit.runner.RunWith - - @LargeTest @RunWith(AndroidJUnit4::class) class ConsentDetailsFragmentTest{ diff --git a/app/src/main/java/in/projecteka/jataayu/module/Modules.kt b/app/src/main/java/in/projecteka/jataayu/module/Modules.kt index 64e08c8a..2fee13fd 100644 --- a/app/src/main/java/in/projecteka/jataayu/module/Modules.kt +++ b/app/src/main/java/in/projecteka/jataayu/module/Modules.kt @@ -26,7 +26,6 @@ import `in`.projecteka.jataayu.user.account.repository.UserAccountsRepositoryImp import `in`.projecteka.jataayu.user.account.viewmodel.UserAccountsViewModel import okhttp3.ResponseBody import org.koin.androidx.viewmodel.dsl.viewModel -import org.koin.core.qualifier.named import org.koin.dsl.module import retrofit2.Converter import retrofit2.Retrofit diff --git a/commons/network/src/main/java/in/projecteka/jataayu/network/utils/NetworkExtensions.kt b/commons/network/src/main/java/in/projecteka/jataayu/network/utils/NetworkExtensions.kt index 702cc45e..e971b3a3 100644 --- a/commons/network/src/main/java/in/projecteka/jataayu/network/utils/NetworkExtensions.kt +++ b/commons/network/src/main/java/in/projecteka/jataayu/network/utils/NetworkExtensions.kt @@ -3,17 +3,17 @@ package `in`.projecteka.jataayu.network.utils import androidx.lifecycle.MutableLiveData import retrofit2.Call -fun Call.observeOn(mutableLiveData: MutableLiveData, responseCallback: ResponseCallback) { +fun Call.observeOn(mutableLiveData: MutableLiveData, responseCallback: ResponseCallback) { enqueue(object : RetrofitCallback(responseCallback) { - override fun observableLiveData(): MutableLiveData { + override fun observableLiveData(): MutableLiveData { return mutableLiveData } }) } -fun Call.observeOn(mutableLiveData: MutableLiveData) { +fun Call.observeOn(mutableLiveData: MutableLiveData) { enqueue(object : RetrofitCallback() { - override fun observableLiveData(): MutableLiveData { + override fun observableLiveData(): MutableLiveData { return mutableLiveData } }) diff --git a/commons/network/src/main/java/in/projecteka/jataayu/network/utils/RetrofitCallback.java b/commons/network/src/main/java/in/projecteka/jataayu/network/utils/RetrofitCallback.java deleted file mode 100644 index 541b14f8..00000000 --- a/commons/network/src/main/java/in/projecteka/jataayu/network/utils/RetrofitCallback.java +++ /dev/null @@ -1,60 +0,0 @@ -package in.projecteka.jataayu.network.utils; - -import androidx.lifecycle.MutableLiveData; - -import com.google.gson.Gson; - -import org.jetbrains.annotations.NotNull; - -import java.net.HttpURLConnection; - -import in.projecteka.jataayu.network.model.Error; -import in.projecteka.jataayu.network.model.ErrorResponse; -import retrofit2.Call; -import retrofit2.Callback; -import retrofit2.Response; - -public abstract class RetrofitCallback implements Callback { - - private ResponseCallback responseCallback; - private int DEFAULT_ERROR_CODE = -1; - private int ERROR_CODE_UNAUTHORIZED = 1017; - - public RetrofitCallback() { - } - - public RetrofitCallback(ResponseCallback responseCallback) { - this.responseCallback = responseCallback; - } - - abstract protected MutableLiveData observableLiveData(); - - @Override - public void onResponse(@NotNull Call call, Response response) { - if (response.isSuccessful()) { - if (responseCallback != null) responseCallback.onSuccess(response.body()); - if (response.body() != null) { - observableLiveData().setValue(response.body()); - } - } else { - if (response.errorBody() != null && responseCallback != null) { - try { - ErrorResponse errorResponse = new Gson().fromJson(response.errorBody().string(), ErrorResponse.class); - responseCallback.onFailure(errorResponse); - } catch (Exception e) { - e.printStackTrace(); - int errorCode = DEFAULT_ERROR_CODE; - if(response.code() == HttpURLConnection.HTTP_FORBIDDEN || response.code() == HttpURLConnection.HTTP_UNAUTHORIZED){ - errorCode = ERROR_CODE_UNAUTHORIZED; - } - responseCallback.onFailure(new ErrorResponse(new Error(errorCode, e.getMessage()))); - } - } - } - } - - @Override - public void onFailure(@NotNull Call call, @NotNull Throwable t) { - if (responseCallback != null) responseCallback.onFailure(t); - } -} diff --git a/commons/network/src/main/java/in/projecteka/jataayu/network/utils/RetrofitCallback.kt b/commons/network/src/main/java/in/projecteka/jataayu/network/utils/RetrofitCallback.kt new file mode 100644 index 00000000..b30c7fbc --- /dev/null +++ b/commons/network/src/main/java/in/projecteka/jataayu/network/utils/RetrofitCallback.kt @@ -0,0 +1,53 @@ +package `in`.projecteka.jataayu.network.utils + +import `in`.projecteka.jataayu.network.model.Error +import `in`.projecteka.jataayu.network.model.ErrorResponse +import androidx.lifecycle.MutableLiveData +import com.google.gson.Gson +import retrofit2.Call +import retrofit2.Callback +import retrofit2.Response +import java.net.HttpURLConnection.HTTP_FORBIDDEN +import java.net.HttpURLConnection.HTTP_UNAUTHORIZED + +private const val DEFAULT_ERROR_CODE = -1 +private const val ERROR_CODE_UNAUTHORIZED = 1017 + +abstract class RetrofitCallback : Callback { + private var responseCallback: ResponseCallback? = null + + constructor() + + constructor(responseCallback: ResponseCallback?) { + this.responseCallback = responseCallback + } + + protected abstract fun observableLiveData(): MutableLiveData + override fun onResponse(call: Call, response: Response) { + if (response.isSuccessful) { + if (responseCallback != null) responseCallback!!.onSuccess(response.body()) + if (response.body() != null) { + observableLiveData().value = response.body() + } + } else { + if (response.errorBody() != null && responseCallback != null) { + try { + val errorResponse: ErrorResponse = Gson() + .fromJson(response.errorBody()!!.string(), ErrorResponse::class.java) + responseCallback!!.onFailure(errorResponse) + } catch (e: Exception) { + e.printStackTrace() + var errorCode = DEFAULT_ERROR_CODE + if (response.code() in arrayOf(HTTP_FORBIDDEN, HTTP_UNAUTHORIZED)) { + errorCode = ERROR_CODE_UNAUTHORIZED + } + responseCallback!!.onFailure(ErrorResponse(Error(errorCode, e.message!!))) + } + } + } + } + + override fun onFailure(call: Call, t: Throwable) { + if (responseCallback != null) responseCallback!!.onFailure(t) + } +} \ No newline at end of file diff --git a/commons/network/src/test/java/in/projecteka/jataayu/network/RedirectInterceptorTest.kt b/commons/network/src/test/java/in/projecteka/jataayu/network/RedirectInterceptorTest.kt index 4b58160f..ee1d63ff 100644 --- a/commons/network/src/test/java/in/projecteka/jataayu/network/RedirectInterceptorTest.kt +++ b/commons/network/src/test/java/in/projecteka/jataayu/network/RedirectInterceptorTest.kt @@ -2,7 +2,6 @@ package `in`.projecteka.jataayu.network import `in`.projecteka.jataayu.network.interceptor.UnauthorisedUserRedirectInterceptor import android.content.Context -import android.content.Intent import com.google.gson.JsonObject import okhttp3.OkHttpClient import okhttp3.mockwebserver.MockResponse diff --git a/features/consent/src/main/java/in/projecteka/jataayu/consent/ui/activity/ConsentDetailsActivity.kt b/features/consent/src/main/java/in/projecteka/jataayu/consent/ui/activity/ConsentDetailsActivity.kt index 2ab020c7..7997de54 100644 --- a/features/consent/src/main/java/in/projecteka/jataayu/consent/ui/activity/ConsentDetailsActivity.kt +++ b/features/consent/src/main/java/in/projecteka/jataayu/consent/ui/activity/ConsentDetailsActivity.kt @@ -15,7 +15,8 @@ import `in`.projecteka.jataayu.presentation.showErrorDialog import `in`.projecteka.jataayu.presentation.ui.BaseActivity import `in`.projecteka.jataayu.presentation.ui.fragment.BaseFragment import `in`.projecteka.jataayu.util.extension.startActivityForResult -import `in`.projecteka.jataayu.util.sharedPref.* +import `in`.projecteka.jataayu.util.sharedPref.getPinCreated +import `in`.projecteka.jataayu.util.sharedPref.setPinCreated import android.app.Activity import android.content.Intent import android.net.Uri diff --git a/features/consent/src/main/java/in/projecteka/jataayu/consent/ui/fragment/ConfirmPinFragment.kt b/features/consent/src/main/java/in/projecteka/jataayu/consent/ui/fragment/ConfirmPinFragment.kt index 275fd51b..229f7402 100644 --- a/features/consent/src/main/java/in/projecteka/jataayu/consent/ui/fragment/ConfirmPinFragment.kt +++ b/features/consent/src/main/java/in/projecteka/jataayu/consent/ui/fragment/ConfirmPinFragment.kt @@ -81,34 +81,40 @@ class ConfirmPinFragment : BaseDialogFragment(), OtpSubmissionClickHandler, OtpC bundle.getString(PIN)?.let { pin -> if (confirmedPin == pin) { showProgressBar(true) - viewModel.createPinResponse.observe(this, Observer { + viewModel.createPinResponse.observe(this, Observer { payloadResource -> - when (it) { - is Loading -> showProgressBar(it.isLoading, getString(R.string.creating_pin)) + when (payloadResource) { + is Loading -> showProgressBar(payloadResource.isLoading, getString(R.string.creating_pin)) is Success -> { - activity?.let { - it.setPinCreated(true) + activity?.let { fragmentActivity -> + fragmentActivity.setPinCreated(true) showProgressBar(true) - viewModel.userVerificationResponse.observe(this, Observer { userVerificationResponse -> - activity?.setConsentTempToken(userVerificationResponse.temporaryToken) - EventBus.getDefault().post(MessageEventType.USER_VERIFIED) - it.setResult(Activity.RESULT_OK) - it.finish() - }) + viewModel.userVerificationResponse.observe( + this, + Observer { userVerificationResponse -> + userVerificationResponse?.temporaryToken?.let { + activity?.setConsentTempToken(it) + EventBus.getDefault().post(MessageEventType.USER_VERIFIED) + fragmentActivity.setResult(Activity.RESULT_OK) + fragmentActivity.finish() + } + }) viewModel.verifyUser(pin, this) } } is PartialFailure -> { - context?.showAlertDialog(getString(R.string.failure), it.error?.message, - getString(android.R.string.ok)) + context?.showAlertDialog( + getString(R.string.failure), payloadResource.error?.message, + getString(android.R.string.ok) + ) } } }) - if (context?.getConsentPinCreationAPIintegrationStatus()!!){ + if (context?.getConsentPinCreationAPIintegrationStatus()!!) { showProgressBar(true) viewModel.createPin(confirmedPin) - } else{ + } else { activity?.let { it.setResult(Activity.RESULT_OK) it.finish() diff --git a/features/consent/src/main/java/in/projecteka/jataayu/consent/ui/fragment/UserVerificationFragment.kt b/features/consent/src/main/java/in/projecteka/jataayu/consent/ui/fragment/UserVerificationFragment.kt index 6eb32b7b..fa96b120 100644 --- a/features/consent/src/main/java/in/projecteka/jataayu/consent/ui/fragment/UserVerificationFragment.kt +++ b/features/consent/src/main/java/in/projecteka/jataayu/consent/ui/fragment/UserVerificationFragment.kt @@ -55,8 +55,10 @@ class UserVerificationFragment : BaseDialogFragment(), OtpSubmissionClickHandler private fun initObservers() { viewModel.userVerificationResponse.observe(this, Observer { it -> - context?.setConsentTempToken(it.temporaryToken) - EventBus.getDefault().post(MessageEventType.USER_VERIFIED) + it?.temporaryToken?.let { + context?.setConsentTempToken(it) + EventBus.getDefault().post(MessageEventType.USER_VERIFIED) + } }) } diff --git a/features/consent/src/main/java/in/projecteka/jataayu/consent/viewmodel/UserVerificationViewModel.kt b/features/consent/src/main/java/in/projecteka/jataayu/consent/viewmodel/UserVerificationViewModel.kt index f9887bdb..bb97a03c 100644 --- a/features/consent/src/main/java/in/projecteka/jataayu/consent/viewmodel/UserVerificationViewModel.kt +++ b/features/consent/src/main/java/in/projecteka/jataayu/consent/viewmodel/UserVerificationViewModel.kt @@ -11,7 +11,7 @@ import androidx.lifecycle.ViewModel class UserVerificationViewModel(private val userVerificationRepository: UserVerificationRepository) : ViewModel() { internal var createPinResponse = PayloadLiveData() - internal var userVerificationResponse = liveDataOf() + internal var userVerificationResponse = liveDataOf() fun createPin(pin: String) { createPinResponse.fetch(userVerificationRepository.createPin(pin)) diff --git a/features/provider/src/main/java/in/projecteka/jataayu/provider/ui/fragment/PatientAccountsFragment.kt b/features/provider/src/main/java/in/projecteka/jataayu/provider/ui/fragment/PatientAccountsFragment.kt index 22c05f20..e9e2a6ff 100644 --- a/features/provider/src/main/java/in/projecteka/jataayu/provider/ui/fragment/PatientAccountsFragment.kt +++ b/features/provider/src/main/java/in/projecteka/jataayu/provider/ui/fragment/PatientAccountsFragment.kt @@ -102,7 +102,7 @@ class PatientAccountsFragment : BaseFragment(), ItemClickCallback, PatientAccoun viewModel.linkAccountsResponse.observe(this, linkAccountsObserver) } - private val linkAccountsObserver = Observer { _ -> + private val linkAccountsObserver = Observer { _ -> (activity as ProviderActivity).showVerifyOtpScreen() } diff --git a/features/provider/src/main/java/in/projecteka/jataayu/provider/ui/fragment/ProviderSearchFragment.kt b/features/provider/src/main/java/in/projecteka/jataayu/provider/ui/fragment/ProviderSearchFragment.kt index a9a4ba6c..ef5a92e5 100644 --- a/features/provider/src/main/java/in/projecteka/jataayu/provider/ui/fragment/ProviderSearchFragment.kt +++ b/features/provider/src/main/java/in/projecteka/jataayu/provider/ui/fragment/ProviderSearchFragment.kt @@ -49,9 +49,11 @@ class ProviderSearchFragment : BaseFragment(), ItemClickCallback, TextWatcherCal private lateinit var selectedProvider : ProviderInfo private lateinit var providersList: ProviderSearchAdapter - private val providersObserver = Observer> { providerNames -> - providersList.updateData(lastQuery, providerNames) - showNoResultsFoundView(providerNames.isEmpty()) + private val providersObserver = Observer?> { providerNames -> + providerNames?.let { + providersList.updateData(lastQuery, it) + showNoResultsFoundView(it.isEmpty()) + } } private val patientAccountsObserver = diff --git a/features/provider/src/main/java/in/projecteka/jataayu/provider/ui/fragment/VerifyOtpFragment.kt b/features/provider/src/main/java/in/projecteka/jataayu/provider/ui/fragment/VerifyOtpFragment.kt index 1f84d642..39530ae4 100644 --- a/features/provider/src/main/java/in/projecteka/jataayu/provider/ui/fragment/VerifyOtpFragment.kt +++ b/features/provider/src/main/java/in/projecteka/jataayu/provider/ui/fragment/VerifyOtpFragment.kt @@ -66,7 +66,7 @@ class VerifyOtpFragment : BaseFragment(), setTitle(R.string.verification) } - private val observer = Observer { + private val observer = Observer { eventBus.post(MessageEventType.ACCOUNT_LINKED) activity?.setResult(RESULT_OK) activity?.finish() diff --git a/features/provider/src/main/java/in/projecteka/jataayu/provider/viewmodel/ProviderSearchViewModel.kt b/features/provider/src/main/java/in/projecteka/jataayu/provider/viewmodel/ProviderSearchViewModel.kt index b0be783c..e0e654dd 100644 --- a/features/provider/src/main/java/in/projecteka/jataayu/provider/viewmodel/ProviderSearchViewModel.kt +++ b/features/provider/src/main/java/in/projecteka/jataayu/provider/viewmodel/ProviderSearchViewModel.kt @@ -16,11 +16,11 @@ import `in`.projecteka.jataayu.util.extension.liveDataOf import androidx.lifecycle.ViewModel class ProviderSearchViewModel(private val providerRepository: ProviderRepository) : ViewModel() { - val providers = liveDataOf>() + val providers = liveDataOf?>() var providersList = emptyList() - val patientDiscoveryResponse = liveDataOf() - val linkAccountsResponse = liveDataOf() - val successfulLinkingResponse = liveDataOf() + val patientDiscoveryResponse = liveDataOf() + val linkAccountsResponse = liveDataOf() + val successfulLinkingResponse = liveDataOf() internal var selectedProviderName = String.EMPTY @@ -35,7 +35,7 @@ class ProviderSearchViewModel(private val providerRepository: ProviderRepository fun linkPatientAccounts(listCareContexts: List, responseCallback: ResponseCallback) { - var linkedAccounts = ArrayList() + val linkedAccounts = ArrayList() listCareContexts.forEach { if (it.contextChecked){ @@ -45,11 +45,11 @@ class ProviderSearchViewModel(private val providerRepository: ProviderRepository val discoveryResponse = patientDiscoveryResponse.value val selectedAccountsResponse = PatientDiscoveryResponse(Patient(discoveryResponse?.patient?.referenceNumber!!, - discoveryResponse.patient.display, linkedAccounts, discoveryResponse.patient?.matchedBy!!), + discoveryResponse.patient.display, linkedAccounts, discoveryResponse.patient.matchedBy), discoveryResponse.transactionId) - providerRepository.linkPatientAccounts(selectedAccountsResponse!!).observeOn(linkAccountsResponse, responseCallback) + providerRepository.linkPatientAccounts(selectedAccountsResponse).observeOn(linkAccountsResponse, responseCallback) } fun verifyOtp(referenceNumber: String, otp: Otp, responseCallback: ResponseCallback) { diff --git a/user/account/src/main/java/in/projecteka/jataayu/user/account/ui/fragment/CreateAccountFragment.kt b/user/account/src/main/java/in/projecteka/jataayu/user/account/ui/fragment/CreateAccountFragment.kt index 987151d3..ec5f51fa 100644 --- a/user/account/src/main/java/in/projecteka/jataayu/user/account/ui/fragment/CreateAccountFragment.kt +++ b/user/account/src/main/java/in/projecteka/jataayu/user/account/ui/fragment/CreateAccountFragment.kt @@ -2,7 +2,6 @@ package `in`.projecteka.jataayu.user.account.ui.fragment import `in`.projecteka.jataayu.core.model.CreateAccountRequest -import `in`.projecteka.jataayu.core.model.CreateAccountResponse import `in`.projecteka.jataayu.network.model.ErrorResponse import `in`.projecteka.jataayu.network.utils.ResponseCallback import `in`.projecteka.jataayu.presentation.callback.DateTimeSelectionCallback @@ -88,10 +87,12 @@ class CreateAccountFragment : BaseFragment(), if (validateFields()) { showProgressBar(true) viewModel.createAccountResponse.observe(this, - Observer { - context?.setAuthToken(viewModel.getAuthTokenWithTokenType(it)) - activity?.setResult(Activity.RESULT_OK) - activity?.finish() + Observer { + it?.let { + context?.setAuthToken(viewModel.getAuthTokenWithTokenType(it)) + activity?.setResult(Activity.RESULT_OK) + activity?.finish() + } }) viewModel.createAccount(this, getCreateAccountRequest()) } diff --git a/user/account/src/main/java/in/projecteka/jataayu/user/account/ui/fragment/UserAccountsFragment.kt b/user/account/src/main/java/in/projecteka/jataayu/user/account/ui/fragment/UserAccountsFragment.kt index 022ea316..5b7ef416 100644 --- a/user/account/src/main/java/in/projecteka/jataayu/user/account/ui/fragment/UserAccountsFragment.kt +++ b/user/account/src/main/java/in/projecteka/jataayu/user/account/ui/fragment/UserAccountsFragment.kt @@ -38,23 +38,25 @@ class UserAccountsFragment : BaseFragment(), ItemClickCallback, ResponseCallback private var compositeDisposable = CompositeDisposable() private val eventBusInstance = EventBus.getDefault() - private val observer = Observer { - binding.linkedPatient = it.linkedPatient + private val observer = Observer { + it?.let { binding.linkedPatient = it.linkedPatient } getUserAccounts() } - private val profileObserver = Observer { - context?.setPinCreated(it.hasTransactionPin) - it.verifiedIdentifiers.forEach { identifier -> - if (identifier.type == VERIFIED_IDENTIFIER_MOBILE) { - activity?.setMobileIdentifier(identifier.value) + private val profileObserver = Observer { + it?.let { + context?.setPinCreated(it.hasTransactionPin) + it.verifiedIdentifiers.forEach { identifier -> + if (identifier.type == VERIFIED_IDENTIFIER_MOBILE) { + activity?.setMobileIdentifier(identifier.value) + } } } } companion object { fun newInstance() = UserAccountsFragment() - private val VERIFIED_IDENTIFIER_MOBILE = "MOBILE" + private const val VERIFIED_IDENTIFIER_MOBILE = "MOBILE" } override fun onCreateView( diff --git a/user/account/src/main/java/in/projecteka/jataayu/user/account/viewmodel/UserAccountsViewModel.kt b/user/account/src/main/java/in/projecteka/jataayu/user/account/viewmodel/UserAccountsViewModel.kt index c1c1bba3..0e219098 100644 --- a/user/account/src/main/java/in/projecteka/jataayu/user/account/viewmodel/UserAccountsViewModel.kt +++ b/user/account/src/main/java/in/projecteka/jataayu/user/account/viewmodel/UserAccountsViewModel.kt @@ -12,9 +12,9 @@ import androidx.lifecycle.ViewModel import java.util.regex.Pattern class UserAccountsViewModel(private val repository: UserAccountsRepository) : ViewModel() { - var linkedAccountsResponse = liveDataOf() - var createAccountResponse = liveDataOf() - var myProfileResponse = liveDataOf() + var linkedAccountsResponse = liveDataOf() + var createAccountResponse = liveDataOf() + var myProfileResponse = liveDataOf() fun getUserAccounts(responseCallback: ResponseCallback) { repository.getUserAccounts().observeOn(linkedAccountsResponse, responseCallback) diff --git a/user/registration/src/main/java/in/projecteka/jataayu/registration/ui/fragment/RegistrationFragment.kt b/user/registration/src/main/java/in/projecteka/jataayu/registration/ui/fragment/RegistrationFragment.kt index 7cf149ed..eaf0a8bd 100644 --- a/user/registration/src/main/java/in/projecteka/jataayu/registration/ui/fragment/RegistrationFragment.kt +++ b/user/registration/src/main/java/in/projecteka/jataayu/registration/ui/fragment/RegistrationFragment.kt @@ -28,7 +28,7 @@ class RegistrationFragment : BaseFragment(), ContinueClickHandler, MobileNumberC private lateinit var binding: FragmentRegistrationBinding private val viewModel: RegistrationViewModel by sharedViewModel() - private val registrationObserver = Observer { + private val registrationObserver = Observer { (activity as? RegistrationActivity)?.redirectToOtpScreen() EventBus.getDefault().postSticky(et_mobile_number.text.toString()) EventBus.getDefault().postSticky(it) diff --git a/user/registration/src/main/java/in/projecteka/jataayu/registration/viewmodel/RegistrationViewModel.kt b/user/registration/src/main/java/in/projecteka/jataayu/registration/viewmodel/RegistrationViewModel.kt index a34950f2..7828f681 100644 --- a/user/registration/src/main/java/in/projecteka/jataayu/registration/viewmodel/RegistrationViewModel.kt +++ b/user/registration/src/main/java/in/projecteka/jataayu/registration/viewmodel/RegistrationViewModel.kt @@ -18,9 +18,9 @@ class RegistrationViewModel(private val repository: AuthenticationRepository) : const val MOBILE_IDENTIFIER_TYPE = "mobile" } - var requestVerificationResponse = liveDataOf() + var requestVerificationResponse = liveDataOf() - private var verifyIdentifierResponse = liveDataOf() + private var verifyIdentifierResponse = liveDataOf() fun requestVerification(identifierType: String, identifier: String, responseCallback: ResponseCallback) { repository.requestVerification(RequestVerificationRequest(identifierType, identifier)).observeOn(requestVerificationResponse, responseCallback)