Updated on 2026-08-14

This commit is contained in:
Tangem 2025-07-22 11:19:30 +04:00
parent e40706d5c6
commit 603f522cf9
471 changed files with 556 additions and 502 deletions

View file

@ -21,6 +21,7 @@ dependencies {
/** Domain */
implementation(projects.domain.wallets)
api(projects.domain.models)
/** Domain models */
implementation(projects.domain.wallets.models)

View file

@ -19,9 +19,9 @@ import com.tangem.datasource.local.preferences.utils.getObjectMap
import com.tangem.datasource.local.preferences.utils.getSyncOrDefault
import com.tangem.datasource.local.preferences.utils.store
import com.tangem.datasource.local.userwallet.UserWalletsStore
import com.tangem.domain.models.wallet.UserWalletId
import com.tangem.domain.wallets.models.SeedPhraseNotificationsStatus
import com.tangem.domain.wallets.models.UserWallet
import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.domain.wallets.models.UserWalletRemoteInfo
import com.tangem.domain.wallets.repository.WalletsRepository
import com.tangem.utils.WEEK_MILLIS
@ -250,7 +250,7 @@ internal class DefaultWalletsRepository(
override suspend fun isNotificationsEnabled(userWalletId: UserWalletId): Boolean =
appPreferencesStore.getObjectMap<Boolean>(PreferencesKeys.NOTIFICATIONS_ENABLED_STATES_KEY)
.map { it[userWalletId.stringValue] == true }
.firstOrNull() ?: false
.firstOrNull() == true
override suspend fun setNotificationsEnabled(userWalletId: UserWalletId, isEnabled: Boolean) {
appPreferencesStore.editData {

View file

@ -1,7 +1,7 @@
package com.tangem.data.wallets.converters
import com.tangem.datasource.api.tangemTech.models.WalletResponse
import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.domain.models.wallet.UserWalletId
import com.tangem.domain.wallets.models.UserWalletRemoteInfo
import com.tangem.utils.converter.Converter

View file

@ -2,23 +2,21 @@ package com.tangem.data.wallets
import androidx.datastore.core.DataStore
import androidx.datastore.preferences.core.Preferences
import com.google.common.truth.Truth.assertThat
import com.squareup.moshi.Moshi
import com.tangem.datasource.api.common.AuthProvider
import com.tangem.datasource.api.common.response.ApiResponse
import com.tangem.datasource.api.tangemTech.TangemTechApi
import com.tangem.datasource.api.tangemTech.models.WalletResponse
import com.tangem.datasource.local.preferences.AppPreferencesStore
import com.tangem.datasource.local.preferences.PreferencesKeys
import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.domain.models.wallet.UserWalletId
import com.tangem.domain.wallets.models.UserWallet
import com.tangem.utils.coroutines.CoroutineDispatcherProvider
import com.tangem.utils.coroutines.TestingCoroutineDispatcherProvider
import io.mockk.*
import io.mockk.coEvery
import io.mockk.coVerify
import kotlinx.coroutines.flow.flowOf
import kotlinx.coroutines.test.runTest
import com.google.common.truth.Truth.assertThat
import com.tangem.datasource.api.common.AuthProvider
import com.tangem.domain.wallets.models.UserWallet
import org.junit.Before
import org.junit.Test

View file

@ -1,10 +1,10 @@
package com.tangem.data.wallets.converters
import com.google.common.truth.Truth.assertThat
import com.tangem.datasource.api.tangemTech.models.CardInfoBody
import com.tangem.datasource.api.tangemTech.models.WalletIdBody
import com.tangem.domain.models.wallet.UserWalletId
import com.tangem.domain.wallets.models.UserWallet
import com.tangem.domain.wallets.models.UserWalletId
import com.google.common.truth.Truth.assertThat
import io.mockk.mockk
import org.junit.Test