Updated on 2026-08-14

This commit is contained in:
Tangem 2026-07-13 15:54:09 +05:00
parent 40c611efea
commit a006a87f9d
27 changed files with 524 additions and 16 deletions

View file

@ -12,4 +12,10 @@ interface CashbackRepository {
/** Loads the cashback summary for the customer of [userWalletId]. */
suspend fun getCashbackSummary(userWalletId: UserWalletId): Either<VisaApiError, CashbackSummary>
/** Whether the "Cashback deactivated" banner was permanently dismissed for [userWalletId]. */
suspend fun isDeactivationBannerDismissed(userWalletId: UserWalletId): Boolean
/** Permanently dismisses the "Cashback deactivated" banner for [userWalletId]. */
suspend fun setDeactivationBannerDismissed(userWalletId: UserWalletId)
}

View file

@ -0,0 +1,17 @@
package com.tangem.domain.pay.usecase
import com.tangem.domain.models.wallet.UserWalletId
import com.tangem.domain.pay.repository.CashbackRepository
/**
* Reads whether the "Cashback deactivated" banner was permanently dismissed for the wallet.
*
* Used by the Payment account cashback block to decide whether to show the deactivation banner.
*/
class GetCashbackDeactivationDismissedUseCase(
private val cashbackRepository: CashbackRepository,
) {
suspend operator fun invoke(userWalletId: UserWalletId): Boolean {
return cashbackRepository.isDeactivationBannerDismissed(userWalletId)
}
}

View file

@ -0,0 +1,17 @@
package com.tangem.domain.pay.usecase
import com.tangem.domain.models.wallet.UserWalletId
import com.tangem.domain.pay.repository.CashbackRepository
/**
* Permanently dismisses the "Cashback deactivated" banner for the wallet.
*
* Triggered by the "Got it" button on the Payment account cashback deactivation banner.
*/
class SetCashbackDeactivationDismissedUseCase(
private val cashbackRepository: CashbackRepository,
) {
suspend operator fun invoke(userWalletId: UserWalletId) {
cashbackRepository.setDeactivationBannerDismissed(userWalletId)
}
}