Updated on 2026-08-14
This commit is contained in:
parent
40c611efea
commit
a006a87f9d
27 changed files with 524 additions and 16 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue