Updated on 2026-08-14
This commit is contained in:
parent
2d79953060
commit
b9c541d416
8 changed files with 77 additions and 5 deletions
1
features/kyc/mock/.gitignore
vendored
Normal file
1
features/kyc/mock/.gitignore
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
/build
|
||||
22
features/kyc/mock/build.gradle.kts
Normal file
22
features/kyc/mock/build.gradle.kts
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
plugins {
|
||||
alias(deps.plugins.android.library)
|
||||
alias(deps.plugins.kotlin.android)
|
||||
alias(deps.plugins.kotlin.kapt)
|
||||
alias(deps.plugins.hilt.android)
|
||||
id("configuration")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.tangem.features.kyc.impl"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
/** Api */
|
||||
implementation(projects.features.kyc.api)
|
||||
|
||||
implementation(projects.core.decompose)
|
||||
|
||||
/** DI */
|
||||
implementation(deps.hilt.android)
|
||||
kapt(deps.hilt.kapt)
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
package com.tangem.features.kyc
|
||||
|
||||
import com.tangem.core.decompose.context.AppComponentContext
|
||||
import dagger.assisted.Assisted
|
||||
import dagger.assisted.AssistedFactory
|
||||
import dagger.assisted.AssistedInject
|
||||
|
||||
/**
|
||||
* Mocking it for release/external builds to exclude SumSub dependency
|
||||
*/
|
||||
class MockKycComponent @AssistedInject constructor(
|
||||
@Assisted appComponentContext: AppComponentContext,
|
||||
) : KycComponent, AppComponentContext by appComponentContext {
|
||||
|
||||
override fun launch() {
|
||||
/* no op */
|
||||
}
|
||||
|
||||
@AssistedFactory
|
||||
interface Factory : KycComponent.Factory {
|
||||
override fun create(appComponentContext: AppComponentContext): MockKycComponent
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.tangem.features.kyc.di
|
||||
|
||||
import com.tangem.features.kyc.KycComponent
|
||||
import com.tangem.features.kyc.MockKycComponent
|
||||
import dagger.Binds
|
||||
import dagger.Module
|
||||
import dagger.hilt.InstallIn
|
||||
import dagger.hilt.components.SingletonComponent
|
||||
|
||||
@Module
|
||||
@InstallIn(SingletonComponent::class)
|
||||
internal interface FeatureModule {
|
||||
|
||||
@Binds
|
||||
fun bindComponentFactory(impl: MockKycComponent.Factory): KycComponent.Factory
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue