From b2156170cec0f69845f477e75435ef37213cf8f6 Mon Sep 17 00:00:00 2001 From: Rajan Maurya Date: Sat, 17 Feb 2024 11:29:25 -0500 Subject: [PATCH] fix: manage network related code logic in core:network module --- core/data/build.gradle.kts | 1 + .../core/data/fineract/api/ApiEndPoints.kt | 23 ---- .../core/data/fineract/api/ApiInterceptor.kt | 30 ----- .../core/data/fineract/api/BaseURL.kt | 21 --- .../core/data/fineract/api/GenericResponse.kt | 13 -- .../fineract/api/MifosWalletOkHttpClient.kt | 75 ----------- .../data/fineract/local/PreferencesHelper.kt | 125 ------------------ .../fineract/repository/FineractRepository.kt | 20 +-- .../mifos/mobilewallet/core/di/DataModule.kt | 33 +++++ .../mifos/mobilewallet/core/di/Qualifier.kt | 11 -- .../usecase/account/BlockUnblockCommand.java | 2 +- .../domain/usecase/client/CreateClient.kt | 3 +- .../domain/usecase/client/UpdateClient.kt | 2 +- .../usecase/kyc/UpdateKYCLevel1Details.kt | 2 +- .../core/domain/usecase/kyc/UploadKYCDocs.kt | 2 +- .../usecase/kyc/UploadKYCLevel1Details.kt | 2 +- .../core/domain/usecase/savedcards/AddCard.kt | 2 +- .../domain/usecase/savedcards/DeleteCard.kt | 2 +- .../domain/usecase/savedcards/EditCard.kt | 2 +- .../DeleteStandingInstruction.kt | 2 +- .../UpdateStandingInstruction.kt | 2 +- .../core/domain/usecase/user/DeleteUser.java | 2 +- .../core/domain/usecase/user/UpdateUser.java | 2 +- .../core/utils/ErrorJsonMessageHelper.kt | 2 +- .../datastore/di/DataStoreModule.kt | 19 ++- core/network/build.gradle.kts | 10 ++ .../mifospay/network}/FineractApiManager.kt | 39 +++--- .../network}/SelfServiceApiManager.kt | 17 +-- .../mifospay/network}/di/NetworkModule.kt | 104 +++++++++++---- .../services/AccountTransfersService.kt | 4 +- .../services/AuthenticationService.kt | 7 +- .../network}/services/BeneficiaryService.kt | 4 +- .../network}/services/ClientService.kt | 9 +- .../network}/services/DocumentService.kt | 6 +- .../network}/services/InvoiceService.kt | 6 +- .../network}/services/KYCLevel1Service.kt | 9 +- .../network}/services/NotificationService.kt | 4 +- .../network}/services/RegistrationService.kt | 4 +- .../network}/services/RunReportService.kt | 4 +- .../network}/services/SavedCardService.kt | 6 +- .../services/SavingsAccountsService.kt | 6 +- .../network}/services/SearchService.kt | 7 +- .../services/StandingInstructionService.kt | 6 +- .../services/ThirdPartyTransferService.kt | 4 +- .../network}/services/TwoFactorAuthService.kt | 4 +- .../mifospay/network}/services/UserService.kt | 9 +- .../feature/auth/login/LoginViewModel.kt | 2 +- .../mifospay/auth/presenter/LoginPresenter.kt | 2 +- .../mifospay/data/local/LocalRepository.kt | 8 +- .../mifospay/di/ApplicationModule.kt | 111 +--------------- .../presenter/EditProfilePresenter.kt | 2 +- .../mifospay/home/presenter/HomeViewModel.kt | 2 +- .../home/presenter/ProfilePresenter.kt | 2 +- .../invoice/presenter/InvoicePresenter.kt | 2 +- .../invoice/presenter/InvoicesPresenter.kt | 2 +- .../kyc/presenter/KYCLevel2Presenter.kt | 2 +- .../presenter/MerchantTransferPresenter.kt | 2 +- .../passcode/presenter/PassCodePresenter.kt | 4 +- .../presenter/EditPasswordPresenter.kt | 2 +- .../receipt/presenter/ReceiptPresenter.kt | 2 +- .../registration/presenter/SignupPresenter.kt | 2 +- .../presenter/NewSIPresenter.kt | 2 +- 62 files changed, 255 insertions(+), 563 deletions(-) delete mode 100644 core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/ApiEndPoints.kt delete mode 100644 core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/ApiInterceptor.kt delete mode 100644 core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/BaseURL.kt delete mode 100644 core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/GenericResponse.kt delete mode 100644 core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/MifosWalletOkHttpClient.kt delete mode 100644 core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/local/PreferencesHelper.kt create mode 100644 core/data/src/main/java/org/mifos/mobilewallet/core/di/DataModule.kt delete mode 100644 core/data/src/main/java/org/mifos/mobilewallet/core/di/Qualifier.kt rename core/{data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api => network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network}/FineractApiManager.kt (61%) rename core/{data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api => network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network}/SelfServiceApiManager.kt (61%) rename {mifospay/src/main/java/org/mifos/mobilewallet/mifospay => core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network}/di/NetworkModule.kt (59%) rename core/{data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api => network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network}/services/AccountTransfersService.kt (74%) rename core/{data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api => network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network}/services/AuthenticationService.kt (68%) rename core/{data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api => network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network}/services/BeneficiaryService.kt (91%) rename core/{data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api => network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network}/services/ClientService.kt (80%) rename core/{data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api => network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network}/services/DocumentService.kt (95%) rename core/{data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api => network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network}/services/InvoiceService.kt (87%) rename core/{data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api => network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network}/services/KYCLevel1Service.kt (78%) rename core/{data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api => network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network}/services/NotificationService.kt (74%) rename core/{data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api => network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network}/services/RegistrationService.kt (80%) rename core/{data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api => network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network}/services/RunReportService.kt (76%) rename core/{data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api => network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network}/services/SavedCardService.kt (84%) rename core/{data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api => network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network}/services/SavingsAccountsService.kt (89%) rename core/{data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api => network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network}/services/SearchService.kt (69%) rename core/{data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api => network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network}/services/StandingInstructionService.kt (91%) rename core/{data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api => network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network}/services/ThirdPartyTransferService.kt (83%) rename core/{data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api => network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network}/services/TwoFactorAuthService.kt (83%) rename core/{data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api => network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network}/services/UserService.kt (72%) diff --git a/core/data/build.gradle.kts b/core/data/build.gradle.kts index db2ccc32f..036850185 100644 --- a/core/data/build.gradle.kts +++ b/core/data/build.gradle.kts @@ -22,6 +22,7 @@ android { dependencies { api(projects.core.common) api(projects.core.model) + api(projects.core.network) implementation(libs.squareup.retrofit2) { // exclude Retrofit’s OkHttp peer-dependency module and define your own module import diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/ApiEndPoints.kt b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/ApiEndPoints.kt deleted file mode 100644 index b88720f97..000000000 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/ApiEndPoints.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.mifos.mobilewallet.core.data.fineract.api - -/** - * Created by naman on 17/6/17. - */ -object ApiEndPoints { - //This class contains all the Constants for API End Points - const val AUTHENTICATION = "authentication" - const val REGISTRATION = "registration" - const val CLIENTS = "clients" - const val SAVINGS_ACCOUNTS = "savingsaccounts" - const val TRANSACTIONS = "transactions" - const val RECURRING_ACCOUNTS = "recurringdepositaccounts" - const val SEARCH = "search" - const val BENEFICIARIES = "beneficiaries" - const val ACCOUNT_TRANSFER = "accounttransfers" - const val DOCUMENTS = "documents" - const val DATATABLES = "datatables" - const val TWOFACTOR = "twofactor" - const val RUN_REPORT = "runreports" - const val USER = "users" - const val STANDING_INSTRUCTION = "standinginstructions" -} diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/ApiInterceptor.kt b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/ApiInterceptor.kt deleted file mode 100644 index c142810e3..000000000 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/ApiInterceptor.kt +++ /dev/null @@ -1,30 +0,0 @@ -package org.mifos.mobilewallet.core.data.fineract.api - -import android.text.TextUtils -import okhttp3.Interceptor -import okhttp3.Response -import org.mifos.mobilewallet.core.data.fineract.local.PreferencesHelper -import java.io.IOException - -/** - * Created by naman on 17/6/17. - */ -class ApiInterceptor(val preferencesHelper: PreferencesHelper) : Interceptor { - @Throws(IOException::class) - override fun intercept(chain: Interceptor.Chain): Response { - val chainRequest = chain.request() - val builder = chainRequest.newBuilder().header(HEADER_TENANT, DEFAULT) - val authToken = preferencesHelper.token - if (!authToken.isNullOrEmpty()) { - builder.header(HEADER_AUTH, authToken) - } - val request = builder.build() - return chain.proceed(request) - } - - companion object { - const val HEADER_TENANT = "Fineract-Platform-TenantId" - const val HEADER_AUTH = "Authorization" - const val DEFAULT = "default" - } -} diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/BaseURL.kt b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/BaseURL.kt deleted file mode 100644 index 82921ad88..000000000 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/BaseURL.kt +++ /dev/null @@ -1,21 +0,0 @@ -package org.mifos.mobilewallet.core.data.fineract.api - -/** - * Created by naman on 17/6/17. - */ -class BaseURL { - val url: String - get() = PROTOCOL_HTTPS + API_ENDPOINT + API_PATH - val selfServiceUrl: String - get() = PROTOCOL_HTTPS + API_ENDPOINT_SELF + API_PATH_SELF - - companion object { - const val PROTOCOL_HTTPS = "https://" - const val API_ENDPOINT = "venus.mifos.community" - const val API_PATH = "/fineract-provider/api/v1/" - - //self service url - const val API_ENDPOINT_SELF = "venus.mifos.community" - const val API_PATH_SELF = "/fineract-provider/api/v1/self/" - } -} diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/GenericResponse.kt b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/GenericResponse.kt deleted file mode 100644 index ba9aa0b37..000000000 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/GenericResponse.kt +++ /dev/null @@ -1,13 +0,0 @@ -package org.mifos.mobilewallet.core.data.fineract.api - -/** - * Created by ankur on 21/May/2018 - */ -class GenericResponse { - var responseFields = HashMap() - override fun toString(): String { - return "GenericResponse{" + - "responseFields=" + responseFields + - '}' - } -} diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/MifosWalletOkHttpClient.kt b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/MifosWalletOkHttpClient.kt deleted file mode 100644 index 35ba2a48f..000000000 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/MifosWalletOkHttpClient.kt +++ /dev/null @@ -1,75 +0,0 @@ -package org.mifos.mobilewallet.core.data.fineract.api - -import okhttp3.OkHttpClient -import okhttp3.logging.HttpLoggingInterceptor -import org.mifos.mobilewallet.core.data.fineract.local.PreferencesHelper -import java.security.SecureRandom -import java.security.cert.CertificateException -import java.security.cert.X509Certificate -import java.util.concurrent.TimeUnit -import javax.net.ssl.SSLContext -import javax.net.ssl.TrustManager -import javax.net.ssl.X509TrustManager - -class MifosWalletOkHttpClient(private val preferences: PreferencesHelper) { - // Create a trust manager that does not validate certificate chains - val mifosOkHttpClient: OkHttpClient - //Interceptor :> Full Body Logger and ApiRequest Header - get() { - val builder = OkHttpClient.Builder() - try { - // Create a trust manager that does not validate certificate chains - val trustAllCerts = arrayOf( - object : X509TrustManager { - @Throws(CertificateException::class) - override fun checkClientTrusted( - chain: Array, - authType: String - ) { - } - - @Throws(CertificateException::class) - override fun checkServerTrusted( - chain: Array, - authType: String - ) { - } - - override fun getAcceptedIssuers(): Array { - return emptyArray() - } - } - ) - - // Install the all-trusting trust manager - val sslContext = SSLContext.getInstance("SSL") - sslContext.init(null, trustAllCerts, SecureRandom()) - // Create an ssl socket factory with our all-trusting manager - val sslSocketFactory = sslContext.socketFactory - - //Enable Full Body Logging - val logger = HttpLoggingInterceptor() - logger.level = HttpLoggingInterceptor.Level.BODY - - //Set SSL certificate to OkHttpClient Builder -// builder.sslSocketFactory(sslSocketFactory) - builder.sslSocketFactory(sslSocketFactory, trustAllCerts[0] as X509TrustManager) - builder.hostnameVerifier { hostname, session -> true } - } catch (e: Exception) { - throw RuntimeException(e) - } - - // Enable Full Body Logging - val logger = HttpLoggingInterceptor() - logger.level = HttpLoggingInterceptor.Level.BODY - - // Setting Timeout 30 Seconds - builder.connectTimeout(60, TimeUnit.SECONDS) - builder.readTimeout(60, TimeUnit.SECONDS) - - // Interceptor :> Full Body Logger and ApiRequest Header - builder.addInterceptor(logger) - builder.addInterceptor(ApiInterceptor(preferences)) - return builder.build() - } -} diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/local/PreferencesHelper.kt b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/local/PreferencesHelper.kt deleted file mode 100644 index 5d6dcf957..000000000 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/local/PreferencesHelper.kt +++ /dev/null @@ -1,125 +0,0 @@ -package org.mifos.mobilewallet.core.data.fineract.local - -import android.content.Context -import android.content.SharedPreferences -import android.preference.PreferenceManager -import dagger.hilt.android.qualifiers.ApplicationContext -import javax.inject.Inject -import javax.inject.Singleton - -/** - * Created by naman on 17/6/17. - */ -@Singleton -class PreferencesHelper @Inject constructor(@ApplicationContext context: Context?) { - private val sharedPreferences: SharedPreferences - - init { - sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context) - } - - fun clear() { - sharedPreferences.edit().clear().apply() - } - - fun getInt(preferenceKey: String?, preferenceDefaultValue: Int): Int { - return sharedPreferences.getInt(preferenceKey, preferenceDefaultValue) - } - - fun putInt(preferenceKey: String?, preferenceValue: Int) { - sharedPreferences.edit().putInt(preferenceKey, preferenceValue).apply() - } - - fun getLong(preferenceKey: String?, preferenceDefaultValue: Long): Long { - return sharedPreferences.getLong(preferenceKey, preferenceDefaultValue) - } - - fun putLong(preferenceKey: String?, preferenceValue: Long) { - sharedPreferences.edit().putLong(preferenceKey, preferenceValue).apply() - } - - fun getString(preferenceKey: String?, preferenceDefaultValue: String?): String? { - return sharedPreferences.getString(preferenceKey, preferenceDefaultValue) - } - - fun putString(preferenceKey: String?, preferenceValue: String?) { - sharedPreferences.edit().putString(preferenceKey, preferenceValue).apply() - } - - fun saveToken(token: String?) { - putString(TOKEN, token) - } - - fun clearToken() { - putString(TOKEN, "") - } - - val token: String? - get() = getString(TOKEN, "") - - fun saveFullName(name: String?) { - putString(NAME, name) - } - - val fullName: String? - get() = getString(NAME, "") - - fun saveUsername(name: String?) { - putString(USERNAME, name) - } - - val username: String? - get() = getString(USERNAME, "") - - fun saveEmail(email: String?) { - putString(EMAIL, email) - } - - val email: String? - get() = getString(EMAIL, "") - - fun saveMobile(mobile: String?) { - putString(MOBILE_NO, mobile) - } - - val mobile: String? - get() = getString(MOBILE_NO, "") - var userId: Long - get() = getLong(USER_ID, -1) - set(id) { - putLong(USER_ID, id) - } - var clientId: Long - get() = getLong(CLIENT_ID, 1) - set(clientId) { - putLong(CLIENT_ID, clientId) - } - var clientVpa: String? - get() = getString(CLIENT_VPA, "") - set(vpa) { - putString(CLIENT_VPA, vpa) - } - var accountId: Long - get() = getLong(ACCOUNT_ID, 0) - set(accountId) { - putLong(ACCOUNT_ID, accountId) - } - var firebaseRegId: String? - get() = getString(FIREBASE_REG_ID, "") - set(firebaseRegId) { - putString(FIREBASE_REG_ID, firebaseRegId) - } - - companion object { - private const val TOKEN = "preferences_token" - private const val NAME = "preferences_name" - private const val USERNAME = "preferences_user_name" - private const val EMAIL = "preferences_email" - private const val CLIENT_ID = "preferences_client" - private const val USER_ID = "preferences_user_id" - private const val CLIENT_VPA = "preferences_client_vpa" - private const val MOBILE_NO = "preferences_mobile_no" - private const val FIREBASE_REG_ID = "preferences_firebase_reg_id" - private const val ACCOUNT_ID = "preferences_account_id" - } -} \ No newline at end of file diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/repository/FineractRepository.kt b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/repository/FineractRepository.kt index c26727b8e..9775b072c 100644 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/repository/FineractRepository.kt +++ b/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/repository/FineractRepository.kt @@ -1,10 +1,10 @@ package org.mifos.mobilewallet.core.data.fineract.repository -import okhttp3.MultipartBody -import okhttp3.ResponseBody -import org.mifos.mobilewallet.core.data.fineract.api.FineractApiManager -import org.mifos.mobilewallet.core.data.fineract.api.GenericResponse -import org.mifos.mobilewallet.core.data.fineract.api.SelfServiceApiManager +import com.mifos.mobilewallet.model.domain.NewAccount +import com.mifos.mobilewallet.model.domain.NotificationPayload +import com.mifos.mobilewallet.model.domain.twofactor.AccessToken +import com.mifos.mobilewallet.model.domain.twofactor.DeliveryMethod +import com.mifos.mobilewallet.model.domain.user.NewUser import com.mifos.mobilewallet.model.entity.Invoice import com.mifos.mobilewallet.model.entity.Page import com.mifos.mobilewallet.model.entity.SearchedEntity @@ -28,14 +28,14 @@ import com.mifos.mobilewallet.model.entity.register.UserVerify import com.mifos.mobilewallet.model.entity.savedcards.Card import com.mifos.mobilewallet.model.entity.standinginstruction.SDIResponse import com.mifos.mobilewallet.model.entity.standinginstruction.StandingInstruction -import com.mifos.mobilewallet.model.domain.NewAccount -import com.mifos.mobilewallet.model.domain.NotificationPayload -import com.mifos.mobilewallet.model.domain.twofactor.AccessToken -import com.mifos.mobilewallet.model.domain.twofactor.DeliveryMethod -import com.mifos.mobilewallet.model.domain.user.NewUser +import okhttp3.MultipartBody +import okhttp3.ResponseBody import org.mifos.mobilewallet.core.domain.usecase.client.CreateClient import org.mifos.mobilewallet.core.domain.usecase.user.CreateUser import org.mifos.mobilewallet.core.utils.Constants +import org.mifos.mobilewallet.mifospay.network.FineractApiManager +import org.mifos.mobilewallet.mifospay.network.GenericResponse +import org.mifos.mobilewallet.mifospay.network.SelfServiceApiManager import rx.Observable import javax.inject.Inject import javax.inject.Singleton diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/di/DataModule.kt b/core/data/src/main/java/org/mifos/mobilewallet/core/di/DataModule.kt new file mode 100644 index 000000000..cf47c8675 --- /dev/null +++ b/core/data/src/main/java/org/mifos/mobilewallet/core/di/DataModule.kt @@ -0,0 +1,33 @@ +package org.mifos.mobilewallet.core.di + +import dagger.Module +import dagger.Provides +import dagger.hilt.InstallIn +import dagger.hilt.components.SingletonComponent +import org.mifos.mobilewallet.core.base.UseCaseHandler +import org.mifos.mobilewallet.core.base.UseCaseThreadPoolScheduler +import org.mifos.mobilewallet.core.data.fineract.repository.FineractRepository +import org.mifos.mobilewallet.mifospay.network.FineractApiManager +import org.mifos.mobilewallet.mifospay.network.SelfServiceApiManager + +@Module +@InstallIn(SingletonComponent::class) +class DataModule { + + @Provides + fun provideUseCaseThreadPoolScheduler(): UseCaseThreadPoolScheduler = + UseCaseThreadPoolScheduler() + + @Provides + fun providesUseCaseHandler(useCaseThreadPoolScheduler: UseCaseThreadPoolScheduler): UseCaseHandler { + return UseCaseHandler(useCaseThreadPoolScheduler) + } + + @Provides + fun providesFineractRepository( + fineractApiManager: FineractApiManager, + selfServiceApiManager: SelfServiceApiManager + ): FineractRepository { + return FineractRepository(fineractApiManager, selfServiceApiManager) + } +} diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/di/Qualifier.kt b/core/data/src/main/java/org/mifos/mobilewallet/core/di/Qualifier.kt deleted file mode 100644 index c74d26a18..000000000 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/di/Qualifier.kt +++ /dev/null @@ -1,11 +0,0 @@ -package org.mifos.mobilewallet.core.di - -import javax.inject.Qualifier - -@Qualifier -@Retention(AnnotationRetention.BINARY) -annotation class SelfServiceApi - -@Qualifier -@Retention(AnnotationRetention.BINARY) -annotation class FineractApi diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/account/BlockUnblockCommand.java b/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/account/BlockUnblockCommand.java index 78172847c..0ead6103f 100644 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/account/BlockUnblockCommand.java +++ b/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/account/BlockUnblockCommand.java @@ -1,8 +1,8 @@ package org.mifos.mobilewallet.core.domain.usecase.account; import org.mifos.mobilewallet.core.base.UseCase; -import org.mifos.mobilewallet.core.data.fineract.api.GenericResponse; import org.mifos.mobilewallet.core.data.fineract.repository.FineractRepository; +import org.mifos.mobilewallet.mifospay.network.GenericResponse; import javax.inject.Inject; diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/client/CreateClient.kt b/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/client/CreateClient.kt index 5b395c01d..09d538cc9 100644 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/client/CreateClient.kt +++ b/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/client/CreateClient.kt @@ -2,7 +2,6 @@ package org.mifos.mobilewallet.core.domain.usecase.client import org.mifos.mobilewallet.core.base.UseCase import org.mifos.mobilewallet.core.data.fineract.repository.FineractRepository -import com.mifos.mobilewallet.model.domain.client.NewClient import org.mifos.mobilewallet.core.utils.ErrorJsonMessageHelper.getUserMessage import retrofit2.HttpException import rx.Subscriber @@ -28,7 +27,7 @@ class CreateClient @Inject constructor(private val apiRepository: FineractReposi override fun onError(e: Throwable) { var message: String try { - message = (e as HttpException).response().errorBody().string() + message = (e as HttpException).response()?.errorBody()?.string().toString() message = getUserMessage(message) } catch (e1: Exception) { message = "Error" diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/client/UpdateClient.kt b/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/client/UpdateClient.kt index 41843123e..5a8ac0a8c 100644 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/client/UpdateClient.kt +++ b/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/client/UpdateClient.kt @@ -30,7 +30,7 @@ class UpdateClient @Inject constructor(private val fineractRepository: FineractR override fun onError(e: Throwable) { var message: String try { - message = (e as HttpException).response().errorBody().string() + message = (e as HttpException).response()?.errorBody()?.string().toString() message = getUserMessage(message) } catch (e1: Exception) { message = "Error" diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/kyc/UpdateKYCLevel1Details.kt b/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/kyc/UpdateKYCLevel1Details.kt index b46c8eb7f..b985ff060 100644 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/kyc/UpdateKYCLevel1Details.kt +++ b/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/kyc/UpdateKYCLevel1Details.kt @@ -1,9 +1,9 @@ package org.mifos.mobilewallet.core.domain.usecase.kyc import org.mifos.mobilewallet.core.base.UseCase -import org.mifos.mobilewallet.core.data.fineract.api.GenericResponse import com.mifos.mobilewallet.model.entity.kyc.KYCLevel1Details import org.mifos.mobilewallet.core.data.fineract.repository.FineractRepository +import org.mifos.mobilewallet.mifospay.network.GenericResponse import rx.Subscriber import rx.android.schedulers.AndroidSchedulers import rx.schedulers.Schedulers diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/kyc/UploadKYCDocs.kt b/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/kyc/UploadKYCDocs.kt index 62aeafac3..fba6ec991 100644 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/kyc/UploadKYCDocs.kt +++ b/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/kyc/UploadKYCDocs.kt @@ -2,8 +2,8 @@ package org.mifos.mobilewallet.core.domain.usecase.kyc import okhttp3.MultipartBody import org.mifos.mobilewallet.core.base.UseCase -import org.mifos.mobilewallet.core.data.fineract.api.GenericResponse import org.mifos.mobilewallet.core.data.fineract.repository.FineractRepository +import org.mifos.mobilewallet.mifospay.network.GenericResponse import rx.Subscriber import rx.android.schedulers.AndroidSchedulers import rx.schedulers.Schedulers diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/kyc/UploadKYCLevel1Details.kt b/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/kyc/UploadKYCLevel1Details.kt index e05e88e18..1325cd92e 100644 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/kyc/UploadKYCLevel1Details.kt +++ b/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/kyc/UploadKYCLevel1Details.kt @@ -1,9 +1,9 @@ package org.mifos.mobilewallet.core.domain.usecase.kyc import org.mifos.mobilewallet.core.base.UseCase -import org.mifos.mobilewallet.core.data.fineract.api.GenericResponse import com.mifos.mobilewallet.model.entity.kyc.KYCLevel1Details import org.mifos.mobilewallet.core.data.fineract.repository.FineractRepository +import org.mifos.mobilewallet.mifospay.network.GenericResponse import rx.Subscriber import rx.android.schedulers.AndroidSchedulers import rx.schedulers.Schedulers diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/savedcards/AddCard.kt b/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/savedcards/AddCard.kt index 1c7dbc593..ad8f8d29e 100644 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/savedcards/AddCard.kt +++ b/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/savedcards/AddCard.kt @@ -1,9 +1,9 @@ package org.mifos.mobilewallet.core.domain.usecase.savedcards import org.mifos.mobilewallet.core.base.UseCase -import org.mifos.mobilewallet.core.data.fineract.api.GenericResponse import com.mifos.mobilewallet.model.entity.savedcards.Card import org.mifos.mobilewallet.core.data.fineract.repository.FineractRepository +import org.mifos.mobilewallet.mifospay.network.GenericResponse import rx.Subscriber import rx.android.schedulers.AndroidSchedulers import rx.schedulers.Schedulers diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/savedcards/DeleteCard.kt b/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/savedcards/DeleteCard.kt index 7070ce81b..3c5808b0a 100644 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/savedcards/DeleteCard.kt +++ b/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/savedcards/DeleteCard.kt @@ -1,8 +1,8 @@ package org.mifos.mobilewallet.core.domain.usecase.savedcards import org.mifos.mobilewallet.core.base.UseCase -import org.mifos.mobilewallet.core.data.fineract.api.GenericResponse import org.mifos.mobilewallet.core.data.fineract.repository.FineractRepository +import org.mifos.mobilewallet.mifospay.network.GenericResponse import rx.Subscriber import rx.android.schedulers.AndroidSchedulers import rx.schedulers.Schedulers diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/savedcards/EditCard.kt b/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/savedcards/EditCard.kt index 189517638..4f571a39a 100644 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/savedcards/EditCard.kt +++ b/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/savedcards/EditCard.kt @@ -1,9 +1,9 @@ package org.mifos.mobilewallet.core.domain.usecase.savedcards import org.mifos.mobilewallet.core.base.UseCase -import org.mifos.mobilewallet.core.data.fineract.api.GenericResponse import com.mifos.mobilewallet.model.entity.savedcards.Card import org.mifos.mobilewallet.core.data.fineract.repository.FineractRepository +import org.mifos.mobilewallet.mifospay.network.GenericResponse import rx.Subscriber import rx.android.schedulers.AndroidSchedulers import rx.schedulers.Schedulers diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/standinginstruction/DeleteStandingInstruction.kt b/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/standinginstruction/DeleteStandingInstruction.kt index 20f99642e..5cfc484e7 100644 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/standinginstruction/DeleteStandingInstruction.kt +++ b/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/standinginstruction/DeleteStandingInstruction.kt @@ -1,8 +1,8 @@ package org.mifos.mobilewallet.core.domain.usecase.standinginstruction import org.mifos.mobilewallet.core.base.UseCase -import org.mifos.mobilewallet.core.data.fineract.api.GenericResponse import org.mifos.mobilewallet.core.data.fineract.repository.FineractRepository +import org.mifos.mobilewallet.mifospay.network.GenericResponse import rx.Subscriber import rx.android.schedulers.AndroidSchedulers import rx.schedulers.Schedulers diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/standinginstruction/UpdateStandingInstruction.kt b/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/standinginstruction/UpdateStandingInstruction.kt index 78c6f1df0..d4d77fd1c 100644 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/standinginstruction/UpdateStandingInstruction.kt +++ b/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/standinginstruction/UpdateStandingInstruction.kt @@ -1,10 +1,10 @@ package org.mifos.mobilewallet.core.domain.usecase.standinginstruction import org.mifos.mobilewallet.core.base.UseCase -import org.mifos.mobilewallet.core.data.fineract.api.GenericResponse import com.mifos.mobilewallet.model.entity.payload.StandingInstructionPayload import com.mifos.mobilewallet.model.entity.standinginstruction.StandingInstruction import org.mifos.mobilewallet.core.data.fineract.repository.FineractRepository +import org.mifos.mobilewallet.mifospay.network.GenericResponse import rx.Subscriber import rx.android.schedulers.AndroidSchedulers import rx.schedulers.Schedulers diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/user/DeleteUser.java b/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/user/DeleteUser.java index 1174c25b3..1d502b4a7 100644 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/user/DeleteUser.java +++ b/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/user/DeleteUser.java @@ -1,8 +1,8 @@ package org.mifos.mobilewallet.core.domain.usecase.user; import org.mifos.mobilewallet.core.base.UseCase; -import org.mifos.mobilewallet.core.data.fineract.api.GenericResponse; import org.mifos.mobilewallet.core.data.fineract.repository.FineractRepository; +import org.mifos.mobilewallet.mifospay.network.GenericResponse; import javax.inject.Inject; diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/user/UpdateUser.java b/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/user/UpdateUser.java index 74165f770..dcfed9186 100644 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/user/UpdateUser.java +++ b/core/data/src/main/java/org/mifos/mobilewallet/core/domain/usecase/user/UpdateUser.java @@ -1,9 +1,9 @@ package org.mifos.mobilewallet.core.domain.usecase.user; import org.mifos.mobilewallet.core.base.UseCase; -import org.mifos.mobilewallet.core.data.fineract.api.GenericResponse; import org.mifos.mobilewallet.core.data.fineract.repository.FineractRepository; import org.mifos.mobilewallet.core.utils.ErrorJsonMessageHelper; +import org.mifos.mobilewallet.mifospay.network.GenericResponse; import javax.inject.Inject; diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/utils/ErrorJsonMessageHelper.kt b/core/data/src/main/java/org/mifos/mobilewallet/core/utils/ErrorJsonMessageHelper.kt index 94160a56f..c4d902804 100644 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/utils/ErrorJsonMessageHelper.kt +++ b/core/data/src/main/java/org/mifos/mobilewallet/core/utils/ErrorJsonMessageHelper.kt @@ -20,7 +20,7 @@ object ErrorJsonMessageHelper { fun getUserMessage(e: Throwable): String? { var message: String? = "Error" try { - message = (e as HttpException).response().errorBody().string() + message = (e as HttpException).response()?.errorBody()?.string().toString() message = getUserMessage(message) } catch (e1: Exception) { message = "Error" diff --git a/core/datastore/src/main/java/org/mifos/mobilewallet/datastore/di/DataStoreModule.kt b/core/datastore/src/main/java/org/mifos/mobilewallet/datastore/di/DataStoreModule.kt index 826c6f1f2..0b2375a69 100644 --- a/core/datastore/src/main/java/org/mifos/mobilewallet/datastore/di/DataStoreModule.kt +++ b/core/datastore/src/main/java/org/mifos/mobilewallet/datastore/di/DataStoreModule.kt @@ -1,4 +1,21 @@ package org.mifos.mobilewallet.datastore.di -class DataStoreModule { +import android.content.Context +import dagger.Module +import dagger.Provides +import dagger.hilt.InstallIn +import dagger.hilt.android.qualifiers.ApplicationContext +import dagger.hilt.components.SingletonComponent +import org.mifos.mobilewallet.datastore.PreferencesHelper +import javax.inject.Singleton + +@Module +@InstallIn(SingletonComponent::class) +object DataStoreModule { + + @Provides + @Singleton + fun prefManager(@ApplicationContext context: Context): PreferencesHelper { + return PreferencesHelper(context) + } } \ No newline at end of file diff --git a/core/network/build.gradle.kts b/core/network/build.gradle.kts index 0f415ece0..6ced80f8e 100644 --- a/core/network/build.gradle.kts +++ b/core/network/build.gradle.kts @@ -24,10 +24,20 @@ dependencies { api(projects.core.datastore) implementation(libs.kotlinx.serialization.json) + implementation(libs.squareup.okhttp) implementation(libs.squareup.logging.interceptor) + implementation(libs.squareup.retrofit2) implementation(libs.retrofit.kotlin.serialization) + implementation(libs.squareup.retrofit.adapter.rxjava) + implementation(libs.squareup.retrofit.converter.gson) + + implementation(libs.reactivex.rxjava.android) + implementation(libs.reactivex.rxjava) + + implementation(libs.jetbrains.kotlin.jdk7) + testImplementation(libs.kotlinx.coroutines.test) } diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/FineractApiManager.kt b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/FineractApiManager.kt similarity index 61% rename from core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/FineractApiManager.kt rename to core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/FineractApiManager.kt index 6cb0fba33..28e50fa6d 100644 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/FineractApiManager.kt +++ b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/FineractApiManager.kt @@ -1,26 +1,23 @@ -package org.mifos.mobilewallet.core.data.fineract.api - -import org.mifos.mobilewallet.core.data.fineract.api.services.AccountTransfersService -import org.mifos.mobilewallet.core.data.fineract.api.services.AuthenticationService -import org.mifos.mobilewallet.core.data.fineract.api.services.ClientService -import org.mifos.mobilewallet.core.data.fineract.api.services.DocumentService -import org.mifos.mobilewallet.core.data.fineract.api.services.InvoiceService -import org.mifos.mobilewallet.core.data.fineract.api.services.KYCLevel1Service -import org.mifos.mobilewallet.core.data.fineract.api.services.NotificationService -import org.mifos.mobilewallet.core.data.fineract.api.services.RegistrationService -import org.mifos.mobilewallet.core.data.fineract.api.services.RunReportService -import org.mifos.mobilewallet.core.data.fineract.api.services.SavedCardService -import org.mifos.mobilewallet.core.data.fineract.api.services.SavingsAccountsService -import org.mifos.mobilewallet.core.data.fineract.api.services.SearchService -import org.mifos.mobilewallet.core.data.fineract.api.services.StandingInstructionService -import org.mifos.mobilewallet.core.data.fineract.api.services.ThirdPartyTransferService -import org.mifos.mobilewallet.core.data.fineract.api.services.TwoFactorAuthService -import org.mifos.mobilewallet.core.data.fineract.api.services.UserService +package org.mifos.mobilewallet.mifospay.network + +import org.mifos.mobilewallet.mifospay.network.services.AccountTransfersService +import org.mifos.mobilewallet.mifospay.network.services.AuthenticationService +import org.mifos.mobilewallet.mifospay.network.services.ClientService +import org.mifos.mobilewallet.mifospay.network.services.DocumentService +import org.mifos.mobilewallet.mifospay.network.services.InvoiceService +import org.mifos.mobilewallet.mifospay.network.services.KYCLevel1Service +import org.mifos.mobilewallet.mifospay.network.services.NotificationService +import org.mifos.mobilewallet.mifospay.network.services.RegistrationService +import org.mifos.mobilewallet.mifospay.network.services.RunReportService +import org.mifos.mobilewallet.mifospay.network.services.SavedCardService +import org.mifos.mobilewallet.mifospay.network.services.SavingsAccountsService +import org.mifos.mobilewallet.mifospay.network.services.SearchService +import org.mifos.mobilewallet.mifospay.network.services.StandingInstructionService +import org.mifos.mobilewallet.mifospay.network.services.ThirdPartyTransferService +import org.mifos.mobilewallet.mifospay.network.services.TwoFactorAuthService +import org.mifos.mobilewallet.mifospay.network.services.UserService import javax.inject.Inject -/** - * Created by naman on 17/6/17. - */ class FineractApiManager @Inject constructor( private val authenticationService: AuthenticationService, private val clientService: ClientService, diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/SelfServiceApiManager.kt b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/SelfServiceApiManager.kt similarity index 61% rename from core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/SelfServiceApiManager.kt rename to core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/SelfServiceApiManager.kt index 562fadb8a..f9d9cfee2 100644 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/SelfServiceApiManager.kt +++ b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/SelfServiceApiManager.kt @@ -1,16 +1,13 @@ -package org.mifos.mobilewallet.core.data.fineract.api +package org.mifos.mobilewallet.mifospay.network -import org.mifos.mobilewallet.core.data.fineract.api.services.AuthenticationService -import org.mifos.mobilewallet.core.data.fineract.api.services.BeneficiaryService -import org.mifos.mobilewallet.core.data.fineract.api.services.ClientService -import org.mifos.mobilewallet.core.data.fineract.api.services.RegistrationService -import org.mifos.mobilewallet.core.data.fineract.api.services.SavingsAccountsService -import org.mifos.mobilewallet.core.data.fineract.api.services.ThirdPartyTransferService +import org.mifos.mobilewallet.mifospay.network.services.AuthenticationService +import org.mifos.mobilewallet.mifospay.network.services.BeneficiaryService +import org.mifos.mobilewallet.mifospay.network.services.ClientService +import org.mifos.mobilewallet.mifospay.network.services.RegistrationService +import org.mifos.mobilewallet.mifospay.network.services.SavingsAccountsService +import org.mifos.mobilewallet.mifospay.network.services.ThirdPartyTransferService import javax.inject.Inject -/** - * Created by naman on 20/8/17. - */ class SelfServiceApiManager @Inject constructor( private val authenticationService: AuthenticationService, private val clientService: ClientService, diff --git a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/di/NetworkModule.kt b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/di/NetworkModule.kt similarity index 59% rename from mifospay/src/main/java/org/mifos/mobilewallet/mifospay/di/NetworkModule.kt rename to core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/di/NetworkModule.kt index 250d0b53c..26db82ed8 100644 --- a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/di/NetworkModule.kt +++ b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/di/NetworkModule.kt @@ -1,31 +1,29 @@ -package org.mifos.mobilewallet.mifospay.di +package org.mifos.mobilewallet.mifospay.network.di import dagger.Module import dagger.Provides import dagger.hilt.InstallIn import dagger.hilt.components.SingletonComponent -import org.mifos.mobilewallet.core.data.fineract.api.BaseURL -import org.mifos.mobilewallet.core.data.fineract.api.MifosWalletOkHttpClient -import org.mifos.mobilewallet.core.data.fineract.api.services.AccountTransfersService -import org.mifos.mobilewallet.core.data.fineract.api.services.AuthenticationService -import org.mifos.mobilewallet.core.data.fineract.api.services.BeneficiaryService -import org.mifos.mobilewallet.core.data.fineract.api.services.ClientService -import org.mifos.mobilewallet.core.data.fineract.api.services.DocumentService -import org.mifos.mobilewallet.core.data.fineract.api.services.InvoiceService -import org.mifos.mobilewallet.core.data.fineract.api.services.KYCLevel1Service -import org.mifos.mobilewallet.core.data.fineract.api.services.NotificationService -import org.mifos.mobilewallet.core.data.fineract.api.services.RegistrationService -import org.mifos.mobilewallet.core.data.fineract.api.services.RunReportService -import org.mifos.mobilewallet.core.data.fineract.api.services.SavedCardService -import org.mifos.mobilewallet.core.data.fineract.api.services.SavingsAccountsService -import org.mifos.mobilewallet.core.data.fineract.api.services.SearchService -import org.mifos.mobilewallet.core.data.fineract.api.services.StandingInstructionService -import org.mifos.mobilewallet.core.data.fineract.api.services.ThirdPartyTransferService -import org.mifos.mobilewallet.core.data.fineract.api.services.TwoFactorAuthService -import org.mifos.mobilewallet.core.data.fineract.api.services.UserService -import org.mifos.mobilewallet.core.data.fineract.local.PreferencesHelper -import org.mifos.mobilewallet.core.di.FineractApi -import org.mifos.mobilewallet.core.di.SelfServiceApi +import org.mifos.mobilewallet.datastore.PreferencesHelper +import org.mifos.mobilewallet.mifospay.network.BaseURL +import org.mifos.mobilewallet.mifospay.network.MifosWalletOkHttpClient +import org.mifos.mobilewallet.mifospay.network.services.AccountTransfersService +import org.mifos.mobilewallet.mifospay.network.services.AuthenticationService +import org.mifos.mobilewallet.mifospay.network.services.BeneficiaryService +import org.mifos.mobilewallet.mifospay.network.services.ClientService +import org.mifos.mobilewallet.mifospay.network.services.DocumentService +import org.mifos.mobilewallet.mifospay.network.services.InvoiceService +import org.mifos.mobilewallet.mifospay.network.services.KYCLevel1Service +import org.mifos.mobilewallet.mifospay.network.services.NotificationService +import org.mifos.mobilewallet.mifospay.network.services.RegistrationService +import org.mifos.mobilewallet.mifospay.network.services.RunReportService +import org.mifos.mobilewallet.mifospay.network.services.SavedCardService +import org.mifos.mobilewallet.mifospay.network.services.SavingsAccountsService +import org.mifos.mobilewallet.mifospay.network.services.SearchService +import org.mifos.mobilewallet.mifospay.network.services.StandingInstructionService +import org.mifos.mobilewallet.mifospay.network.services.ThirdPartyTransferService +import org.mifos.mobilewallet.mifospay.network.services.TwoFactorAuthService +import org.mifos.mobilewallet.mifospay.network.services.UserService import retrofit2.Retrofit import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory import retrofit2.converter.gson.GsonConverterFactory @@ -60,6 +58,66 @@ class NetworkModule { .build() } + @Provides + @Singleton + fun providesFineractApiManager( + @Named("FineractAuthenticationService") authenticationService: AuthenticationService, + @Named("FineractClientService") clientService: ClientService, + @Named("FineractSavingsAccountsService") savingsAccountsService: SavingsAccountsService, + @Named("FineractRegistrationService") registrationService: RegistrationService, + searchService: SearchService, + documentService: DocumentService, + runReportService: RunReportService, + twoFactorAuthService: TwoFactorAuthService, + accountTransfersService: AccountTransfersService, + savedCardService: SavedCardService, + kYCLevel1Service: KYCLevel1Service, + invoiceService: InvoiceService, + userService: UserService, + @Named("FineractThirdPartyTransferService") thirdPartyTransferService: ThirdPartyTransferService, + standingInstructionService: StandingInstructionService, + notificationService: NotificationService, + ): org.mifos.mobilewallet.mifospay.network.FineractApiManager { + return org.mifos.mobilewallet.mifospay.network.FineractApiManager( + authenticationService, + clientService, + savingsAccountsService, + registrationService, + searchService, + documentService, + runReportService, + twoFactorAuthService, + accountTransfersService, + savedCardService, + kYCLevel1Service, + invoiceService, + userService, + thirdPartyTransferService, + standingInstructionService, + notificationService + ) + } + + @Provides + @Singleton + fun providesSelfServiceApiManager( + @Named("SelfServiceAuthenticationService") authenticationService: AuthenticationService, + @Named("SelfServiceClientService") clientService: ClientService, + @Named("SelfServiceSavingsAccountsService") savingsAccountsService: SavingsAccountsService, + @Named("SelfServiceRegistrationService") registrationService: RegistrationService, + beneficiaryService: BeneficiaryService, + @Named("SelfServiceThirdPartyTransferService") thirdPartyTransferService: ThirdPartyTransferService, + ): org.mifos.mobilewallet.mifospay.network.SelfServiceApiManager { + return org.mifos.mobilewallet.mifospay.network.SelfServiceApiManager( + authenticationService, + clientService, + savingsAccountsService, + registrationService, + beneficiaryService, + thirdPartyTransferService + ) + } + //-----Fineract API Service---------// @Provides diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/AccountTransfersService.kt b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/AccountTransfersService.kt similarity index 74% rename from core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/AccountTransfersService.kt rename to core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/AccountTransfersService.kt index 4687246b3..acd464ddb 100644 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/AccountTransfersService.kt +++ b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/AccountTransfersService.kt @@ -1,7 +1,7 @@ -package org.mifos.mobilewallet.core.data.fineract.api.services +package org.mifos.mobilewallet.mifospay.network.services -import org.mifos.mobilewallet.core.data.fineract.api.ApiEndPoints import com.mifos.mobilewallet.model.entity.accounts.savings.TransferDetail +import org.mifos.mobilewallet.mifospay.network.ApiEndPoints import retrofit2.http.GET import retrofit2.http.Path import rx.Observable diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/AuthenticationService.kt b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/AuthenticationService.kt similarity index 68% rename from core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/AuthenticationService.kt rename to core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/AuthenticationService.kt index a37bac338..d20be6177 100644 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/AuthenticationService.kt +++ b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/AuthenticationService.kt @@ -1,15 +1,12 @@ -package org.mifos.mobilewallet.core.data.fineract.api.services +package org.mifos.mobilewallet.mifospay.network.services -import org.mifos.mobilewallet.core.data.fineract.api.ApiEndPoints import com.mifos.mobilewallet.model.entity.UserEntity import com.mifos.mobilewallet.model.entity.authentication.AuthenticationPayload +import org.mifos.mobilewallet.mifospay.network.ApiEndPoints import retrofit2.http.Body import retrofit2.http.POST import rx.Observable -/** - * Created by naman on 17/6/17. - */ interface AuthenticationService { @POST(ApiEndPoints.AUTHENTICATION) fun authenticate(@Body authPayload: AuthenticationPayload): Observable diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/BeneficiaryService.kt b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/BeneficiaryService.kt similarity index 91% rename from core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/BeneficiaryService.kt rename to core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/BeneficiaryService.kt index 28b7bf2d9..f879647f5 100644 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/BeneficiaryService.kt +++ b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/BeneficiaryService.kt @@ -1,11 +1,11 @@ -package org.mifos.mobilewallet.core.data.fineract.api.services +package org.mifos.mobilewallet.mifospay.network.services import okhttp3.ResponseBody -import org.mifos.mobilewallet.core.data.fineract.api.ApiEndPoints import com.mifos.mobilewallet.model.entity.beneficary.Beneficiary import com.mifos.mobilewallet.model.entity.beneficary.BeneficiaryPayload import com.mifos.mobilewallet.model.entity.beneficary.BeneficiaryUpdatePayload import com.mifos.mobilewallet.model.entity.templates.beneficiary.BeneficiaryTemplate +import org.mifos.mobilewallet.mifospay.network.ApiEndPoints import retrofit2.http.Body import retrofit2.http.DELETE import retrofit2.http.GET diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/ClientService.kt b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/ClientService.kt similarity index 80% rename from core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/ClientService.kt rename to core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/ClientService.kt index e85fb8240..1ad73b5c0 100644 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/ClientService.kt +++ b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/ClientService.kt @@ -1,14 +1,13 @@ -package org.mifos.mobilewallet.core.data.fineract.api.services +package org.mifos.mobilewallet.mifospay.network.services import okhttp3.MultipartBody import okhttp3.ResponseBody -import org.mifos.mobilewallet.core.data.fineract.api.ApiEndPoints -import org.mifos.mobilewallet.core.data.fineract.api.GenericResponse import com.mifos.mobilewallet.model.entity.Page import com.mifos.mobilewallet.model.entity.client.Client import com.mifos.mobilewallet.model.entity.client.ClientAccounts import com.mifos.mobilewallet.model.domain.NewAccount -import org.mifos.mobilewallet.core.domain.usecase.client.CreateClient +import org.mifos.mobilewallet.mifospay.network.ApiEndPoints +import org.mifos.mobilewallet.mifospay.network.GenericResponse import retrofit2.http.Body import retrofit2.http.GET import retrofit2.http.POST @@ -50,7 +49,7 @@ interface ClientService { ): Observable @POST(ApiEndPoints.CLIENTS) - fun createClient(@Body newClient: com.mifos.mobilewallet.model.domain.client.NewClient): Observable + fun createClient(@Body newClient: com.mifos.mobilewallet.model.domain.client.NewClient): Observable @POST fun createAccount(@Body newAccount: NewAccount?): Observable diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/DocumentService.kt b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/DocumentService.kt similarity index 95% rename from core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/DocumentService.kt rename to core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/DocumentService.kt index 1f6aa38b9..7f31c841f 100644 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/DocumentService.kt +++ b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/DocumentService.kt @@ -1,10 +1,10 @@ -package org.mifos.mobilewallet.core.data.fineract.api.services +package org.mifos.mobilewallet.mifospay.network.services import okhttp3.MultipartBody import okhttp3.ResponseBody -import org.mifos.mobilewallet.core.data.fineract.api.ApiEndPoints -import org.mifos.mobilewallet.core.data.fineract.api.GenericResponse import com.mifos.mobilewallet.model.entity.noncore.Document +import org.mifos.mobilewallet.mifospay.network.ApiEndPoints +import org.mifos.mobilewallet.mifospay.network.GenericResponse import retrofit2.http.DELETE import retrofit2.http.GET import retrofit2.http.Multipart diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/InvoiceService.kt b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/InvoiceService.kt similarity index 87% rename from core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/InvoiceService.kt rename to core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/InvoiceService.kt index 08d455c5c..5198768ba 100644 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/InvoiceService.kt +++ b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/InvoiceService.kt @@ -1,8 +1,8 @@ -package org.mifos.mobilewallet.core.data.fineract.api.services +package org.mifos.mobilewallet.mifospay.network.services -import org.mifos.mobilewallet.core.data.fineract.api.ApiEndPoints -import org.mifos.mobilewallet.core.data.fineract.api.GenericResponse import com.mifos.mobilewallet.model.entity.Invoice +import org.mifos.mobilewallet.mifospay.network.ApiEndPoints +import org.mifos.mobilewallet.mifospay.network.GenericResponse import retrofit2.http.Body import retrofit2.http.DELETE import retrofit2.http.GET diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/KYCLevel1Service.kt b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/KYCLevel1Service.kt similarity index 78% rename from core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/KYCLevel1Service.kt rename to core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/KYCLevel1Service.kt index 89bb2a0b8..4543b1146 100644 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/KYCLevel1Service.kt +++ b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/KYCLevel1Service.kt @@ -1,8 +1,8 @@ -package org.mifos.mobilewallet.core.data.fineract.api.services +package org.mifos.mobilewallet.mifospay.network.services -import org.mifos.mobilewallet.core.data.fineract.api.ApiEndPoints -import org.mifos.mobilewallet.core.data.fineract.api.GenericResponse import com.mifos.mobilewallet.model.entity.kyc.KYCLevel1Details +import org.mifos.mobilewallet.mifospay.network.ApiEndPoints +import org.mifos.mobilewallet.mifospay.network.GenericResponse import retrofit2.http.Body import retrofit2.http.GET import retrofit2.http.POST @@ -10,9 +10,6 @@ import retrofit2.http.PUT import retrofit2.http.Path import rx.Observable -/** - * Created by ankur on 07/June/2018 - */ interface KYCLevel1Service { @POST(ApiEndPoints.DATATABLES + "/kyc_level1_details/{clientId}") fun addKYCLevel1Details( diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/NotificationService.kt b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/NotificationService.kt similarity index 74% rename from core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/NotificationService.kt rename to core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/NotificationService.kt index f5ff6f824..c8a6e96cf 100644 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/NotificationService.kt +++ b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/NotificationService.kt @@ -1,7 +1,7 @@ -package org.mifos.mobilewallet.core.data.fineract.api.services +package org.mifos.mobilewallet.mifospay.network.services -import org.mifos.mobilewallet.core.data.fineract.api.ApiEndPoints import com.mifos.mobilewallet.model.domain.NotificationPayload +import org.mifos.mobilewallet.mifospay.network.ApiEndPoints import retrofit2.http.GET import retrofit2.http.Path import rx.Observable diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/RegistrationService.kt b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/RegistrationService.kt similarity index 80% rename from core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/RegistrationService.kt rename to core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/RegistrationService.kt index 9863f1559..db3cb02e0 100644 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/RegistrationService.kt +++ b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/RegistrationService.kt @@ -1,9 +1,9 @@ -package org.mifos.mobilewallet.core.data.fineract.api.services +package org.mifos.mobilewallet.mifospay.network.services import okhttp3.ResponseBody -import org.mifos.mobilewallet.core.data.fineract.api.ApiEndPoints import com.mifos.mobilewallet.model.entity.register.RegisterPayload import com.mifos.mobilewallet.model.entity.register.UserVerify +import org.mifos.mobilewallet.mifospay.network.ApiEndPoints import retrofit2.http.Body import retrofit2.http.POST import rx.Observable diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/RunReportService.kt b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/RunReportService.kt similarity index 76% rename from core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/RunReportService.kt rename to core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/RunReportService.kt index a1a73b664..92b41ade3 100644 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/RunReportService.kt +++ b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/RunReportService.kt @@ -1,7 +1,7 @@ -package org.mifos.mobilewallet.core.data.fineract.api.services +package org.mifos.mobilewallet.mifospay.network.services import okhttp3.ResponseBody -import org.mifos.mobilewallet.core.data.fineract.api.ApiEndPoints +import org.mifos.mobilewallet.mifospay.network.ApiEndPoints import retrofit2.http.GET import retrofit2.http.Query import rx.Observable diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/SavedCardService.kt b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/SavedCardService.kt similarity index 84% rename from core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/SavedCardService.kt rename to core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/SavedCardService.kt index 5b5904848..2e30adcd3 100644 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/SavedCardService.kt +++ b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/SavedCardService.kt @@ -1,8 +1,8 @@ -package org.mifos.mobilewallet.core.data.fineract.api.services +package org.mifos.mobilewallet.mifospay.network.services -import org.mifos.mobilewallet.core.data.fineract.api.ApiEndPoints -import org.mifos.mobilewallet.core.data.fineract.api.GenericResponse import com.mifos.mobilewallet.model.entity.savedcards.Card +import org.mifos.mobilewallet.mifospay.network.ApiEndPoints +import org.mifos.mobilewallet.mifospay.network.GenericResponse import retrofit2.http.Body import retrofit2.http.DELETE import retrofit2.http.GET diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/SavingsAccountsService.kt b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/SavingsAccountsService.kt similarity index 89% rename from core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/SavingsAccountsService.kt rename to core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/SavingsAccountsService.kt index 067d47d2a..efb0a7d11 100644 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/SavingsAccountsService.kt +++ b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/SavingsAccountsService.kt @@ -1,11 +1,11 @@ -package org.mifos.mobilewallet.core.data.fineract.api.services +package org.mifos.mobilewallet.mifospay.network.services -import org.mifos.mobilewallet.core.data.fineract.api.ApiEndPoints -import org.mifos.mobilewallet.core.data.fineract.api.GenericResponse import com.mifos.mobilewallet.model.entity.Page import com.mifos.mobilewallet.model.entity.accounts.savings.SavingAccount import com.mifos.mobilewallet.model.entity.accounts.savings.SavingsWithAssociations import com.mifos.mobilewallet.model.entity.accounts.savings.Transactions +import org.mifos.mobilewallet.mifospay.network.ApiEndPoints +import org.mifos.mobilewallet.mifospay.network.GenericResponse import retrofit2.http.Body import retrofit2.http.GET import retrofit2.http.POST diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/SearchService.kt b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/SearchService.kt similarity index 69% rename from core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/SearchService.kt rename to core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/SearchService.kt index ff6a0574d..9b706eb6c 100644 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/SearchService.kt +++ b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/SearchService.kt @@ -1,14 +1,11 @@ -package org.mifos.mobilewallet.core.data.fineract.api.services +package org.mifos.mobilewallet.mifospay.network.services -import org.mifos.mobilewallet.core.data.fineract.api.ApiEndPoints import com.mifos.mobilewallet.model.entity.SearchedEntity +import org.mifos.mobilewallet.mifospay.network.ApiEndPoints import retrofit2.http.GET import retrofit2.http.Query import rx.Observable -/** - * Created by naman on 19/8/17. - */ interface SearchService { @GET(ApiEndPoints.SEARCH) fun searchResources( diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/StandingInstructionService.kt b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/StandingInstructionService.kt similarity index 91% rename from core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/StandingInstructionService.kt rename to core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/StandingInstructionService.kt index 7fa9269d1..c9c7fb1f4 100644 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/StandingInstructionService.kt +++ b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/StandingInstructionService.kt @@ -1,11 +1,11 @@ -package org.mifos.mobilewallet.core.data.fineract.api.services +package org.mifos.mobilewallet.mifospay.network.services -import org.mifos.mobilewallet.core.data.fineract.api.ApiEndPoints -import org.mifos.mobilewallet.core.data.fineract.api.GenericResponse import com.mifos.mobilewallet.model.entity.Page import com.mifos.mobilewallet.model.entity.standinginstruction.SDIResponse import com.mifos.mobilewallet.model.entity.payload.StandingInstructionPayload import com.mifos.mobilewallet.model.entity.standinginstruction.StandingInstruction +import org.mifos.mobilewallet.mifospay.network.ApiEndPoints +import org.mifos.mobilewallet.mifospay.network.GenericResponse import retrofit2.http.Body import retrofit2.http.GET import retrofit2.http.POST diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/ThirdPartyTransferService.kt b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/ThirdPartyTransferService.kt similarity index 83% rename from core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/ThirdPartyTransferService.kt rename to core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/ThirdPartyTransferService.kt index 31b88fe53..f5273419f 100644 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/ThirdPartyTransferService.kt +++ b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/ThirdPartyTransferService.kt @@ -1,9 +1,9 @@ -package org.mifos.mobilewallet.core.data.fineract.api.services +package org.mifos.mobilewallet.mifospay.network.services -import org.mifos.mobilewallet.core.data.fineract.api.ApiEndPoints import com.mifos.mobilewallet.model.entity.TPTResponse import com.mifos.mobilewallet.model.entity.payload.TransferPayload import com.mifos.mobilewallet.model.entity.templates.account.AccountOptionsTemplate +import org.mifos.mobilewallet.mifospay.network.ApiEndPoints import retrofit2.http.Body import retrofit2.http.GET import retrofit2.http.POST diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/TwoFactorAuthService.kt b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/TwoFactorAuthService.kt similarity index 83% rename from core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/TwoFactorAuthService.kt rename to core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/TwoFactorAuthService.kt index 02b1472cc..4995cbc8a 100644 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/TwoFactorAuthService.kt +++ b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/TwoFactorAuthService.kt @@ -1,8 +1,8 @@ -package org.mifos.mobilewallet.core.data.fineract.api.services +package org.mifos.mobilewallet.mifospay.network.services -import org.mifos.mobilewallet.core.data.fineract.api.ApiEndPoints import com.mifos.mobilewallet.model.domain.twofactor.AccessToken import com.mifos.mobilewallet.model.domain.twofactor.DeliveryMethod +import org.mifos.mobilewallet.mifospay.network.ApiEndPoints import retrofit2.http.GET import retrofit2.http.POST import retrofit2.http.Query diff --git a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/UserService.kt b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/UserService.kt similarity index 72% rename from core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/UserService.kt rename to core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/UserService.kt index 4dda18b0b..bdaa489dc 100644 --- a/core/data/src/main/java/org/mifos/mobilewallet/core/data/fineract/api/services/UserService.kt +++ b/core/network/src/main/kotlin/org/mifos/mobilewallet/mifospay/network/services/UserService.kt @@ -1,10 +1,9 @@ -package org.mifos.mobilewallet.core.data.fineract.api.services +package org.mifos.mobilewallet.mifospay.network.services -import org.mifos.mobilewallet.core.data.fineract.api.ApiEndPoints -import org.mifos.mobilewallet.core.data.fineract.api.GenericResponse import com.mifos.mobilewallet.model.entity.UserWithRole import com.mifos.mobilewallet.model.domain.user.NewUser -import org.mifos.mobilewallet.core.domain.usecase.user.CreateUser +import org.mifos.mobilewallet.mifospay.network.ApiEndPoints +import org.mifos.mobilewallet.mifospay.network.GenericResponse import retrofit2.http.Body import retrofit2.http.DELETE import retrofit2.http.GET @@ -21,7 +20,7 @@ interface UserService { val users: Observable> @POST(ApiEndPoints.USER) - fun createUser(@Body user: NewUser): Observable + fun createUser(@Body user: NewUser): Observable @PUT(ApiEndPoints.USER + "/{userId}") fun updateUser( diff --git a/feature/auth/src/main/kotlin/org/mifos/mobilewallet/mifospay/feature/auth/login/LoginViewModel.kt b/feature/auth/src/main/kotlin/org/mifos/mobilewallet/mifospay/feature/auth/login/LoginViewModel.kt index ba827f5ec..a9b8e79ef 100644 --- a/feature/auth/src/main/kotlin/org/mifos/mobilewallet/mifospay/feature/auth/login/LoginViewModel.kt +++ b/feature/auth/src/main/kotlin/org/mifos/mobilewallet/mifospay/feature/auth/login/LoginViewModel.kt @@ -8,7 +8,7 @@ import kotlinx.coroutines.flow.StateFlow import org.mifos.mobilewallet.core.base.UseCase import org.mifos.mobilewallet.core.base.UseCaseHandler import com.mifos.mobilewallet.model.entity.UserWithRole -import org.mifos.mobilewallet.core.data.fineract.local.PreferencesHelper +import org.mifos.mobilewallet.datastore.PreferencesHelper import com.mifos.mobilewallet.model.domain.user.User import org.mifos.mobilewallet.core.domain.usecase.client.FetchClientData import org.mifos.mobilewallet.core.domain.usecase.user.AuthenticateUser diff --git a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/auth/presenter/LoginPresenter.kt b/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/auth/presenter/LoginPresenter.kt index 6780714e0..5dd5fa9a3 100644 --- a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/auth/presenter/LoginPresenter.kt +++ b/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/auth/presenter/LoginPresenter.kt @@ -10,7 +10,7 @@ import org.mifos.mobilewallet.core.domain.usecase.user.FetchUserDetails import org.mifos.mobilewallet.mifospay.auth.AuthContract import org.mifos.mobilewallet.mifospay.auth.AuthContract.LoginView import org.mifos.mobilewallet.mifospay.base.BaseView -import org.mifos.mobilewallet.core.data.fineract.local.PreferencesHelper +import org.mifos.mobilewallet.datastore.PreferencesHelper import org.mifos.mobilewallet.mifospay.utils.Constants import org.mifos.mobilewallet.mifospay.utils.DebugUtil import javax.inject.Inject diff --git a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/data/local/LocalRepository.kt b/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/data/local/LocalRepository.kt index bc54dc94f..31b704447 100644 --- a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/data/local/LocalRepository.kt +++ b/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/data/local/LocalRepository.kt @@ -1,6 +1,6 @@ package org.mifos.mobilewallet.mifospay.data.local -import org.mifos.mobilewallet.core.data.fineract.local.PreferencesHelper +import org.mifos.mobilewallet.datastore.PreferencesHelper import com.mifos.mobilewallet.model.domain.client.Client import javax.inject.Inject import javax.inject.Singleton @@ -11,16 +11,16 @@ import javax.inject.Singleton @Singleton class LocalRepository @Inject constructor(val preferencesHelper: PreferencesHelper) { - val clientDetails: com.mifos.mobilewallet.model.domain.client.Client + val clientDetails: Client get() { - val details = com.mifos.mobilewallet.model.domain.client.Client() + val details = Client() details.name = preferencesHelper.fullName details.clientId = preferencesHelper.clientId details.externalId = preferencesHelper.clientVpa return details } - fun saveClientData(client: com.mifos.mobilewallet.model.domain.client.Client) { + fun saveClientData(client: Client) { preferencesHelper.saveFullName(client.name) preferencesHelper.clientId = client.clientId preferencesHelper.clientVpa = client.externalId diff --git a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/di/ApplicationModule.kt b/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/di/ApplicationModule.kt index df4439500..57e4f30fc 100644 --- a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/di/ApplicationModule.kt +++ b/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/di/ApplicationModule.kt @@ -1,125 +1,16 @@ package org.mifos.mobilewallet.mifospay.di -import android.content.Context import dagger.Module import dagger.Provides import dagger.hilt.InstallIn -import dagger.hilt.android.qualifiers.ApplicationContext import dagger.hilt.components.SingletonComponent -import org.mifos.mobilewallet.core.base.UseCaseHandler -import org.mifos.mobilewallet.core.base.UseCaseThreadPoolScheduler -import org.mifos.mobilewallet.core.data.fineract.api.FineractApiManager -import org.mifos.mobilewallet.core.data.fineract.api.SelfServiceApiManager -import org.mifos.mobilewallet.core.data.fineract.api.services.AccountTransfersService -import org.mifos.mobilewallet.core.data.fineract.api.services.AuthenticationService -import org.mifos.mobilewallet.core.data.fineract.api.services.BeneficiaryService -import org.mifos.mobilewallet.core.data.fineract.api.services.ClientService -import org.mifos.mobilewallet.core.data.fineract.api.services.DocumentService -import org.mifos.mobilewallet.core.data.fineract.api.services.InvoiceService -import org.mifos.mobilewallet.core.data.fineract.api.services.KYCLevel1Service -import org.mifos.mobilewallet.core.data.fineract.api.services.NotificationService -import org.mifos.mobilewallet.core.data.fineract.api.services.RegistrationService -import org.mifos.mobilewallet.core.data.fineract.api.services.RunReportService -import org.mifos.mobilewallet.core.data.fineract.api.services.SavedCardService -import org.mifos.mobilewallet.core.data.fineract.api.services.SavingsAccountsService -import org.mifos.mobilewallet.core.data.fineract.api.services.SearchService -import org.mifos.mobilewallet.core.data.fineract.api.services.StandingInstructionService -import org.mifos.mobilewallet.core.data.fineract.api.services.ThirdPartyTransferService -import org.mifos.mobilewallet.core.data.fineract.api.services.TwoFactorAuthService -import org.mifos.mobilewallet.core.data.fineract.api.services.UserService -import org.mifos.mobilewallet.core.data.fineract.repository.FineractRepository import org.mifos.mobilewallet.mifospay.data.local.LocalRepository -import org.mifos.mobilewallet.core.data.fineract.local.PreferencesHelper -import javax.inject.Named -import javax.inject.Singleton +import org.mifos.mobilewallet.datastore.PreferencesHelper @Module @InstallIn(SingletonComponent::class) class ApplicationModule { - @Provides - fun provideUseCaseThreadPoolScheduler(): UseCaseThreadPoolScheduler = - UseCaseThreadPoolScheduler() - - @Provides - fun providesUseCaseHandler(useCaseThreadPoolScheduler: UseCaseThreadPoolScheduler): UseCaseHandler { - return UseCaseHandler(useCaseThreadPoolScheduler) - } - - @Provides - @Singleton - fun providesFineractApiManager( - @Named("FineractAuthenticationService") authenticationService: AuthenticationService, - @Named("FineractClientService") clientService: ClientService, - @Named("FineractSavingsAccountsService") savingsAccountsService: SavingsAccountsService, - @Named("FineractRegistrationService") registrationService: RegistrationService, - searchService: SearchService, - documentService: DocumentService, - runReportService: RunReportService, - twoFactorAuthService: TwoFactorAuthService, - accountTransfersService: AccountTransfersService, - savedCardService: SavedCardService, - kYCLevel1Service: KYCLevel1Service, - invoiceService: InvoiceService, - userService: UserService, - @Named("FineractThirdPartyTransferService") thirdPartyTransferService: ThirdPartyTransferService, - standingInstructionService: StandingInstructionService, - notificationService: NotificationService, - ): FineractApiManager { - return FineractApiManager( - authenticationService, - clientService, - savingsAccountsService, - registrationService, - searchService, - documentService, - runReportService, - twoFactorAuthService, - accountTransfersService, - savedCardService, - kYCLevel1Service, - invoiceService, - userService, - thirdPartyTransferService, - standingInstructionService, - notificationService - ) - } - - @Provides - @Singleton - fun providesSelfServiceApiManager( - @Named("SelfServiceAuthenticationService") authenticationService: AuthenticationService, - @Named("SelfServiceClientService") clientService: ClientService, - @Named("SelfServiceSavingsAccountsService") savingsAccountsService: SavingsAccountsService, - @Named("SelfServiceRegistrationService") registrationService: RegistrationService, - beneficiaryService: BeneficiaryService, - @Named("SelfServiceThirdPartyTransferService") thirdPartyTransferService: ThirdPartyTransferService, - ): SelfServiceApiManager { - return SelfServiceApiManager( - authenticationService, - clientService, - savingsAccountsService, - registrationService, - beneficiaryService, - thirdPartyTransferService - ) - } - - @Provides - fun providesFineractRepository( - fineractApiManager: FineractApiManager, - selfServiceApiManager: SelfServiceApiManager - ): FineractRepository { - return FineractRepository(fineractApiManager, selfServiceApiManager) - } - - @Provides - @Singleton - fun prefManager(@ApplicationContext context: Context): PreferencesHelper { - return PreferencesHelper(context) - } - @Provides fun providesLocalRepository(preferencesHelper: PreferencesHelper): LocalRepository { return LocalRepository(preferencesHelper) diff --git a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/editprofile/presenter/EditProfilePresenter.kt b/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/editprofile/presenter/EditProfilePresenter.kt index 4786fbf4f..9343901c3 100644 --- a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/editprofile/presenter/EditProfilePresenter.kt +++ b/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/editprofile/presenter/EditProfilePresenter.kt @@ -8,7 +8,7 @@ import org.mifos.mobilewallet.core.domain.usecase.user.AuthenticateUser import org.mifos.mobilewallet.core.domain.usecase.user.UpdateUser import org.mifos.mobilewallet.mifospay.R import org.mifos.mobilewallet.mifospay.base.BaseView -import org.mifos.mobilewallet.core.data.fineract.local.PreferencesHelper +import org.mifos.mobilewallet.datastore.PreferencesHelper import org.mifos.mobilewallet.mifospay.editprofile.EditProfileContract import org.mifos.mobilewallet.mifospay.editprofile.EditProfileContract.EditProfileView import javax.inject.Inject diff --git a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/home/presenter/HomeViewModel.kt b/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/home/presenter/HomeViewModel.kt index a5da41636..bf8149081 100644 --- a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/home/presenter/HomeViewModel.kt +++ b/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/home/presenter/HomeViewModel.kt @@ -16,7 +16,7 @@ import org.mifos.mobilewallet.core.domain.usecase.account.FetchAccount import org.mifos.mobilewallet.core.domain.usecase.account.FetchAccountTransactions import org.mifos.mobilewallet.mifospay.base.BaseView import org.mifos.mobilewallet.mifospay.data.local.LocalRepository -import org.mifos.mobilewallet.core.data.fineract.local.PreferencesHelper +import org.mifos.mobilewallet.datastore.PreferencesHelper import org.mifos.mobilewallet.mifospay.history.HistoryContract.TransactionsHistoryAsync import org.mifos.mobilewallet.mifospay.history.TransactionsHistory import org.mifos.mobilewallet.mifospay.home.BaseHomeContract diff --git a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/home/presenter/ProfilePresenter.kt b/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/home/presenter/ProfilePresenter.kt index 5ab079acf..2f9dbf5fb 100644 --- a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/home/presenter/ProfilePresenter.kt +++ b/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/home/presenter/ProfilePresenter.kt @@ -5,7 +5,7 @@ import org.mifos.mobilewallet.core.base.UseCaseHandler import org.mifos.mobilewallet.core.domain.usecase.client.FetchClientImage import org.mifos.mobilewallet.mifospay.base.BaseView import org.mifos.mobilewallet.mifospay.data.local.LocalRepository -import org.mifos.mobilewallet.core.data.fineract.local.PreferencesHelper +import org.mifos.mobilewallet.datastore.PreferencesHelper import org.mifos.mobilewallet.mifospay.home.BaseHomeContract import org.mifos.mobilewallet.mifospay.home.BaseHomeContract.ProfileView import org.mifos.mobilewallet.mifospay.utils.DebugUtil diff --git a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/invoice/presenter/InvoicePresenter.kt b/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/invoice/presenter/InvoicePresenter.kt index 2b99992b9..86c952d7a 100644 --- a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/invoice/presenter/InvoicePresenter.kt +++ b/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/invoice/presenter/InvoicePresenter.kt @@ -5,7 +5,7 @@ import org.mifos.mobilewallet.core.base.UseCase.UseCaseCallback import org.mifos.mobilewallet.core.base.UseCaseHandler import org.mifos.mobilewallet.core.domain.usecase.invoice.FetchInvoice import org.mifos.mobilewallet.mifospay.base.BaseView -import org.mifos.mobilewallet.core.data.fineract.local.PreferencesHelper +import org.mifos.mobilewallet.datastore.PreferencesHelper import org.mifos.mobilewallet.mifospay.invoice.InvoiceContract import org.mifos.mobilewallet.mifospay.invoice.InvoiceContract.InvoiceView import javax.inject.Inject diff --git a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/invoice/presenter/InvoicesPresenter.kt b/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/invoice/presenter/InvoicesPresenter.kt index 36b8a4995..54ed8ec92 100644 --- a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/invoice/presenter/InvoicesPresenter.kt +++ b/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/invoice/presenter/InvoicesPresenter.kt @@ -6,7 +6,7 @@ import org.mifos.mobilewallet.core.base.UseCaseHandler import org.mifos.mobilewallet.core.domain.usecase.invoice.FetchInvoices import org.mifos.mobilewallet.mifospay.R import org.mifos.mobilewallet.mifospay.base.BaseView -import org.mifos.mobilewallet.core.data.fineract.local.PreferencesHelper +import org.mifos.mobilewallet.datastore.PreferencesHelper import org.mifos.mobilewallet.mifospay.invoice.InvoiceContract import org.mifos.mobilewallet.mifospay.invoice.InvoiceContract.InvoicesView import org.mifos.mobilewallet.mifospay.utils.Constants diff --git a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/kyc/presenter/KYCLevel2Presenter.kt b/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/kyc/presenter/KYCLevel2Presenter.kt index 466ce3e91..8369d1aa0 100644 --- a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/kyc/presenter/KYCLevel2Presenter.kt +++ b/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/kyc/presenter/KYCLevel2Presenter.kt @@ -12,7 +12,7 @@ import org.mifos.mobilewallet.core.base.UseCaseHandler import org.mifos.mobilewallet.core.domain.usecase.kyc.UploadKYCDocs import org.mifos.mobilewallet.mifospay.MifosPayApp import org.mifos.mobilewallet.mifospay.base.BaseView -import org.mifos.mobilewallet.core.data.fineract.local.PreferencesHelper +import org.mifos.mobilewallet.datastore.PreferencesHelper import org.mifos.mobilewallet.mifospay.kyc.KYCContract import org.mifos.mobilewallet.mifospay.kyc.KYCContract.KYCLevel2View import org.mifos.mobilewallet.mifospay.utils.Constants diff --git a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/merchants/presenter/MerchantTransferPresenter.kt b/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/merchants/presenter/MerchantTransferPresenter.kt index e9167ee69..029a808f5 100644 --- a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/merchants/presenter/MerchantTransferPresenter.kt +++ b/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/merchants/presenter/MerchantTransferPresenter.kt @@ -12,7 +12,7 @@ import org.mifos.mobilewallet.core.domain.usecase.account.FetchAccountTransfer import org.mifos.mobilewallet.mifospay.R import org.mifos.mobilewallet.mifospay.base.BaseView import org.mifos.mobilewallet.mifospay.data.local.LocalRepository -import org.mifos.mobilewallet.core.data.fineract.local.PreferencesHelper +import org.mifos.mobilewallet.datastore.PreferencesHelper import org.mifos.mobilewallet.mifospay.history.HistoryContract.TransactionsHistoryAsync import org.mifos.mobilewallet.mifospay.history.TransactionsHistory import org.mifos.mobilewallet.mifospay.home.BaseHomeContract diff --git a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/passcode/presenter/PassCodePresenter.kt b/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/passcode/presenter/PassCodePresenter.kt index d752ed4fa..530860097 100644 --- a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/passcode/presenter/PassCodePresenter.kt +++ b/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/passcode/presenter/PassCodePresenter.kt @@ -5,15 +5,13 @@ package org.mifos.mobilewallet.mifospay.passcode.presenter import org.mifos.mobilewallet.core.base.UseCaseHandler -import org.mifos.mobilewallet.core.data.fineract.api.FineractApiManager - import org.mifos.mobilewallet.core.domain.usecase.client.FetchClientData import org.mifos.mobilewallet.core.domain.usecase.user.AuthenticateUser import org.mifos.mobilewallet.mifospay.base.BaseView -import org.mifos.mobilewallet.core.data.fineract.local.PreferencesHelper +import org.mifos.mobilewallet.datastore.PreferencesHelper import org.mifos.mobilewallet.mifospay.passcode.PassCodeContract diff --git a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/password/presenter/EditPasswordPresenter.kt b/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/password/presenter/EditPasswordPresenter.kt index 18300b372..616566e98 100644 --- a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/password/presenter/EditPasswordPresenter.kt +++ b/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/password/presenter/EditPasswordPresenter.kt @@ -6,7 +6,7 @@ import com.mifos.mobilewallet.model.domain.user.UpdateUserEntityPassword import org.mifos.mobilewallet.core.domain.usecase.user.AuthenticateUser import org.mifos.mobilewallet.core.domain.usecase.user.UpdateUser import org.mifos.mobilewallet.mifospay.base.BaseView -import org.mifos.mobilewallet.core.data.fineract.local.PreferencesHelper +import org.mifos.mobilewallet.datastore.PreferencesHelper import org.mifos.mobilewallet.mifospay.password.EditPasswordContract import org.mifos.mobilewallet.mifospay.password.EditPasswordContract.EditPasswordView import org.mifos.mobilewallet.mifospay.utils.Constants diff --git a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/receipt/presenter/ReceiptPresenter.kt b/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/receipt/presenter/ReceiptPresenter.kt index 7af65c992..e3f4e534e 100644 --- a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/receipt/presenter/ReceiptPresenter.kt +++ b/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/receipt/presenter/ReceiptPresenter.kt @@ -6,7 +6,7 @@ import org.mifos.mobilewallet.core.domain.usecase.account.DownloadTransactionRec import org.mifos.mobilewallet.core.domain.usecase.account.FetchAccountTransaction import org.mifos.mobilewallet.core.domain.usecase.account.FetchAccountTransfer import org.mifos.mobilewallet.mifospay.base.BaseView -import org.mifos.mobilewallet.core.data.fineract.local.PreferencesHelper +import org.mifos.mobilewallet.datastore.PreferencesHelper import org.mifos.mobilewallet.mifospay.receipt.ReceiptContract import org.mifos.mobilewallet.mifospay.receipt.ReceiptContract.ReceiptView import org.mifos.mobilewallet.mifospay.utils.Constants diff --git a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/registration/presenter/SignupPresenter.kt b/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/registration/presenter/SignupPresenter.kt index 17a5e6b70..b9130ebb3 100644 --- a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/registration/presenter/SignupPresenter.kt +++ b/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/registration/presenter/SignupPresenter.kt @@ -15,7 +15,7 @@ import org.mifos.mobilewallet.core.domain.usecase.user.DeleteUser import org.mifos.mobilewallet.core.domain.usecase.user.FetchUserDetails import org.mifos.mobilewallet.core.domain.usecase.user.UpdateUser import org.mifos.mobilewallet.mifospay.base.BaseView -import org.mifos.mobilewallet.core.data.fineract.local.PreferencesHelper +import org.mifos.mobilewallet.datastore.PreferencesHelper import org.mifos.mobilewallet.mifospay.registration.RegistrationContract import org.mifos.mobilewallet.mifospay.registration.RegistrationContract.SignupView import org.mifos.mobilewallet.mifospay.utils.Constants diff --git a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/standinginstruction/presenter/NewSIPresenter.kt b/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/standinginstruction/presenter/NewSIPresenter.kt index 2767e469e..ace3b5cc1 100644 --- a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/standinginstruction/presenter/NewSIPresenter.kt +++ b/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/standinginstruction/presenter/NewSIPresenter.kt @@ -6,7 +6,7 @@ import com.mifos.mobilewallet.model.domain.SearchResult import org.mifos.mobilewallet.core.domain.usecase.client.SearchClient import org.mifos.mobilewallet.core.domain.usecase.standinginstruction.CreateStandingTransaction import org.mifos.mobilewallet.mifospay.base.BaseView -import org.mifos.mobilewallet.core.data.fineract.local.PreferencesHelper +import org.mifos.mobilewallet.datastore.PreferencesHelper import org.mifos.mobilewallet.mifospay.standinginstruction.StandingInstructionContract import java.text.SimpleDateFormat import java.util.*