Skip to content

Commit

Permalink
fix: manage network related code logic in core:network module
Browse files Browse the repository at this point in the history
  • Loading branch information
therajanmaurya committed Feb 17, 2024
1 parent 4967bb0 commit b215617
Show file tree
Hide file tree
Showing 62 changed files with 255 additions and 563 deletions.
1 change: 1 addition & 0 deletions core/data/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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)
}
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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;

Expand Down
Loading

0 comments on commit b215617

Please sign in to comment.