Updated on 2026-08-14

This commit is contained in:
Tangem 2025-02-18 12:55:55 +03:00
parent 930693b301
commit 5bdb9513aa
18 changed files with 249 additions and 44 deletions

View file

@ -0,0 +1,8 @@
package com.tangem.domain.wallets.models
enum class SeedPhraseNotificationsStatus {
SHOW_FIRST,
SHOW_SECOND,
NOT_NEEDED,
}

View file

@ -1,5 +1,6 @@
package com.tangem.domain.wallets.repository
import com.tangem.domain.wallets.models.SeedPhraseNotificationsStatus
import com.tangem.domain.wallets.models.UserWalletId
import kotlinx.coroutines.flow.Flow
@ -15,7 +16,7 @@ interface WalletsRepository {
suspend fun setHasWalletsWithRing(userWalletId: UserWalletId)
fun seedPhraseNotificationStatus(userWalletId: UserWalletId): Flow<Boolean>
fun seedPhraseNotificationStatus(userWalletId: UserWalletId): Flow<SeedPhraseNotificationsStatus>
suspend fun notifiedSeedPhraseNotification(userWalletId: UserWalletId)
@ -23,5 +24,9 @@ interface WalletsRepository {
suspend fun declineSeedPhraseNotification(userWalletId: UserWalletId)
suspend fun rejectSeedPhraseSecondNotification(userWalletId: UserWalletId)
suspend fun acceptSeedPhraseSecondNotification(userWalletId: UserWalletId)
suspend fun markWallet2WasCreated(userWalletId: UserWalletId)
}

View file

@ -1,5 +1,6 @@
package com.tangem.domain.wallets.usecase
import com.tangem.domain.wallets.models.SeedPhraseNotificationsStatus
import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.domain.wallets.repository.WalletsRepository
import kotlinx.coroutines.flow.Flow
@ -8,7 +9,7 @@ class SeedPhraseNotificationUseCase(
private val walletsRepository: WalletsRepository,
) {
operator fun invoke(userWalletId: UserWalletId): Flow<Boolean> {
operator fun invoke(userWalletId: UserWalletId): Flow<SeedPhraseNotificationsStatus> {
return walletsRepository.seedPhraseNotificationStatus(userWalletId)
}
@ -23,4 +24,12 @@ class SeedPhraseNotificationUseCase(
suspend fun decline(userWalletId: UserWalletId) {
walletsRepository.declineSeedPhraseNotification(userWalletId)
}
suspend fun acceptSecond(userWalletId: UserWalletId) {
walletsRepository.acceptSeedPhraseSecondNotification(userWalletId)
}
suspend fun rejectSecond(userWalletId: UserWalletId) {
walletsRepository.rejectSeedPhraseSecondNotification(userWalletId)
}
}