diff --git a/domain/common/.gitignore b/domain/common/.gitignore new file mode 100644 index 0000000000..42afabfd2a --- /dev/null +++ b/domain/common/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/domain/common/build.gradle.kts b/domain/common/build.gradle.kts new file mode 100644 index 0000000000..20e637a0a5 --- /dev/null +++ b/domain/common/build.gradle.kts @@ -0,0 +1,19 @@ +plugins { + alias(deps.plugins.kotlin.jvm) + alias(deps.plugins.kotlin.serialization) + id("configuration") +} + +dependencies { + api(deps.kotlin.coroutines) + api(deps.arrow.core) + api(deps.arrow.fx) + api(projects.domain.models) + + implementation(deps.kotlin.serialization) + + testImplementation(deps.test.coroutine) + testImplementation(deps.test.junit) + testImplementation(deps.test.mockk) + testImplementation(deps.test.truth) +} \ No newline at end of file diff --git a/domain/core/src/main/kotlin/com/tangem/domain/core/wallets/UserWalletsListRepository.kt b/domain/common/src/main/java/com/tangem/domain/common/wallets/UserWalletsListRepository.kt similarity index 91% rename from domain/core/src/main/kotlin/com/tangem/domain/core/wallets/UserWalletsListRepository.kt rename to domain/common/src/main/java/com/tangem/domain/common/wallets/UserWalletsListRepository.kt index c3704524c2..7a07b10402 100644 --- a/domain/core/src/main/kotlin/com/tangem/domain/core/wallets/UserWalletsListRepository.kt +++ b/domain/common/src/main/java/com/tangem/domain/common/wallets/UserWalletsListRepository.kt @@ -1,12 +1,7 @@ -package com.tangem.domain.core.wallets +package com.tangem.domain.common.wallets import arrow.core.Either -import com.tangem.domain.core.wallets.error.DeleteWalletError -import com.tangem.domain.core.wallets.error.LockWalletsError -import com.tangem.domain.core.wallets.error.SaveWalletError -import com.tangem.domain.core.wallets.error.SelectWalletError -import com.tangem.domain.core.wallets.error.SetLockError -import com.tangem.domain.core.wallets.error.UnlockWalletError +import com.tangem.domain.common.wallets.error.* import com.tangem.domain.models.scan.ScanResponse import com.tangem.domain.models.wallet.UserWallet import com.tangem.domain.models.wallet.UserWalletId @@ -18,8 +13,8 @@ import kotlinx.coroutines.flow.StateFlow * * TODO tests [REDACTED_TASK_KEY] * - * @see com.tangem.domain.models.wallet.UserWallet - * @see com.tangem.domain.models.wallet.UserWalletId + * @see UserWallet + * @see UserWalletId */ interface UserWalletsListRepository { diff --git a/domain/core/src/main/kotlin/com/tangem/domain/core/wallets/error/DeleteWalletError.kt b/domain/common/src/main/java/com/tangem/domain/common/wallets/error/DeleteWalletError.kt similarity index 65% rename from domain/core/src/main/kotlin/com/tangem/domain/core/wallets/error/DeleteWalletError.kt rename to domain/common/src/main/java/com/tangem/domain/common/wallets/error/DeleteWalletError.kt index 91b685a84c..3fb51ef8cc 100644 --- a/domain/core/src/main/kotlin/com/tangem/domain/core/wallets/error/DeleteWalletError.kt +++ b/domain/common/src/main/java/com/tangem/domain/common/wallets/error/DeleteWalletError.kt @@ -1,4 +1,4 @@ -package com.tangem.domain.core.wallets.error +package com.tangem.domain.common.wallets.error sealed interface DeleteWalletError { diff --git a/domain/core/src/main/kotlin/com/tangem/domain/core/wallets/error/LockWalletsError.kt b/domain/common/src/main/java/com/tangem/domain/common/wallets/error/LockWalletsError.kt similarity index 63% rename from domain/core/src/main/kotlin/com/tangem/domain/core/wallets/error/LockWalletsError.kt rename to domain/common/src/main/java/com/tangem/domain/common/wallets/error/LockWalletsError.kt index abedc5aa4a..529b47abf5 100644 --- a/domain/core/src/main/kotlin/com/tangem/domain/core/wallets/error/LockWalletsError.kt +++ b/domain/common/src/main/java/com/tangem/domain/common/wallets/error/LockWalletsError.kt @@ -1,4 +1,4 @@ -package com.tangem.domain.core.wallets.error +package com.tangem.domain.common.wallets.error interface LockWalletsError { diff --git a/domain/core/src/main/kotlin/com/tangem/domain/core/wallets/error/SaveFirstColdWalletError.kt b/domain/common/src/main/java/com/tangem/domain/common/wallets/error/SaveFirstColdWalletError.kt similarity index 85% rename from domain/core/src/main/kotlin/com/tangem/domain/core/wallets/error/SaveFirstColdWalletError.kt rename to domain/common/src/main/java/com/tangem/domain/common/wallets/error/SaveFirstColdWalletError.kt index 24c29fd411..22f840c315 100644 --- a/domain/core/src/main/kotlin/com/tangem/domain/core/wallets/error/SaveFirstColdWalletError.kt +++ b/domain/common/src/main/java/com/tangem/domain/common/wallets/error/SaveFirstColdWalletError.kt @@ -1,4 +1,4 @@ -package com.tangem.domain.core.wallets.error +package com.tangem.domain.common.wallets.error sealed interface SaveFirstColdWalletError { data object CreateWalletError : SaveFirstColdWalletError diff --git a/domain/core/src/main/kotlin/com/tangem/domain/core/wallets/error/SaveWalletError.kt b/domain/common/src/main/java/com/tangem/domain/common/wallets/error/SaveWalletError.kt similarity index 83% rename from domain/core/src/main/kotlin/com/tangem/domain/core/wallets/error/SaveWalletError.kt rename to domain/common/src/main/java/com/tangem/domain/common/wallets/error/SaveWalletError.kt index 30fc8a743b..4a988ed353 100644 --- a/domain/core/src/main/kotlin/com/tangem/domain/core/wallets/error/SaveWalletError.kt +++ b/domain/common/src/main/java/com/tangem/domain/common/wallets/error/SaveWalletError.kt @@ -1,4 +1,4 @@ -package com.tangem.domain.core.wallets.error +package com.tangem.domain.common.wallets.error /** [REDACTED_AUTHOR] diff --git a/domain/core/src/main/kotlin/com/tangem/domain/core/wallets/error/SelectWalletError.kt b/domain/common/src/main/java/com/tangem/domain/common/wallets/error/SelectWalletError.kt similarity index 68% rename from domain/core/src/main/kotlin/com/tangem/domain/core/wallets/error/SelectWalletError.kt rename to domain/common/src/main/java/com/tangem/domain/common/wallets/error/SelectWalletError.kt index 05b07e53d0..98fab266b1 100644 --- a/domain/core/src/main/kotlin/com/tangem/domain/core/wallets/error/SelectWalletError.kt +++ b/domain/common/src/main/java/com/tangem/domain/common/wallets/error/SelectWalletError.kt @@ -1,4 +1,4 @@ -package com.tangem.domain.core.wallets.error +package com.tangem.domain.common.wallets.error sealed interface SelectWalletError { diff --git a/domain/core/src/main/kotlin/com/tangem/domain/core/wallets/error/SetLockError.kt b/domain/common/src/main/java/com/tangem/domain/common/wallets/error/SetLockError.kt similarity index 81% rename from domain/core/src/main/kotlin/com/tangem/domain/core/wallets/error/SetLockError.kt rename to domain/common/src/main/java/com/tangem/domain/common/wallets/error/SetLockError.kt index 688f618c74..3eab7da5e0 100644 --- a/domain/core/src/main/kotlin/com/tangem/domain/core/wallets/error/SetLockError.kt +++ b/domain/common/src/main/java/com/tangem/domain/common/wallets/error/SetLockError.kt @@ -1,4 +1,4 @@ -package com.tangem.domain.core.wallets.error +package com.tangem.domain.common.wallets.error sealed interface SetLockError { diff --git a/domain/core/src/main/kotlin/com/tangem/domain/core/wallets/error/UnlockWalletError.kt b/domain/common/src/main/java/com/tangem/domain/common/wallets/error/UnlockWalletError.kt similarity index 87% rename from domain/core/src/main/kotlin/com/tangem/domain/core/wallets/error/UnlockWalletError.kt rename to domain/common/src/main/java/com/tangem/domain/common/wallets/error/UnlockWalletError.kt index 8bed3120a7..c1f6e1fe89 100644 --- a/domain/core/src/main/kotlin/com/tangem/domain/core/wallets/error/UnlockWalletError.kt +++ b/domain/common/src/main/java/com/tangem/domain/common/wallets/error/UnlockWalletError.kt @@ -1,4 +1,4 @@ -package com.tangem.domain.core.wallets.error +package com.tangem.domain.common.wallets.error sealed interface UnlockWalletError { diff --git a/domain/core/build.gradle.kts b/domain/core/build.gradle.kts index 20e637a0a5..f153e89d62 100644 --- a/domain/core/build.gradle.kts +++ b/domain/core/build.gradle.kts @@ -5,10 +5,9 @@ plugins { } dependencies { - api(deps.kotlin.coroutines) api(deps.arrow.core) api(deps.arrow.fx) - api(projects.domain.models) + api(deps.kotlin.coroutines) implementation(deps.kotlin.serialization) diff --git a/settings.gradle.kts b/settings.gradle.kts index fe9ddfd50d..e565300fa1 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -300,6 +300,7 @@ include(":domain:legacy") include(":domain:account") include(":domain:account:status") include(":domain:card") +include(":domain:common") include(":domain:core") include(":domain:demo") include(":domain:demo:models")