Updated on 2026-08-14

This commit is contained in:
Tangem 2026-07-14 15:25:28 +03:00
parent 25444c3a2d
commit 2ee2edeeef
18 changed files with 255 additions and 14 deletions

View file

@ -0,0 +1,8 @@
package com.tangem.domain.pay.model
/** Cashback program document, from `GET v1/customer/cashback/accruals/docs`. */
data class CashbackDocument(
val id: String,
val title: String,
val url: String,
)

View file

@ -0,0 +1,17 @@
package com.tangem.domain.pay.model
import java.math.BigDecimal
/** Cashback program configuration for the customer, from `GET v1/customer/cashback/promotions`. */
data class CashbackPromotions(
val cardTiers: List<CardTier>,
) {
data class CardTier(
val tier: String,
val label: String,
val scope: String,
val minTransactionAmount: BigDecimal?,
val monthlyCapAmount: BigDecimal?,
)
}

View file

@ -1,7 +1,5 @@
package com.tangem.domain.pay.model
import java.math.BigDecimal
/**
* Customer cashback summary from `GET /v1/customer/cashback/summary`.
*
@ -13,7 +11,6 @@ sealed interface CashbackSummary {
data class Enabled(
val displayMode: CashbackDisplayMode,
val cashback: TangemPayCashback,
val pendingAmount: BigDecimal,
) : CashbackSummary
/** Customer blocked due to fraud; client shows the "Cashback deactivated" banner. */

View file

@ -5,7 +5,10 @@ import java.math.BigDecimal
data class TangemPayCashback(
val confirmedAmount: BigDecimal,
val pendingAmount: BigDecimal,
val currency: String,
val payoutCurrency: String,
val payoutNetwork: String,
val period: Period,
) {
data class Period(

View file

@ -2,6 +2,8 @@ package com.tangem.domain.pay.repository
import arrow.core.Either
import com.tangem.domain.models.wallet.UserWalletId
import com.tangem.domain.pay.model.CashbackDocument
import com.tangem.domain.pay.model.CashbackPromotions
import com.tangem.domain.pay.model.CashbackSummary
import com.tangem.domain.visa.error.VisaApiError
@ -13,6 +15,10 @@ interface CashbackRepository {
/** Loads the cashback summary for the customer of [userWalletId]. */
suspend fun getCashbackSummary(userWalletId: UserWalletId): Either<VisaApiError, CashbackSummary>
suspend fun getCashbackPromotions(userWalletId: UserWalletId): Either<VisaApiError, CashbackPromotions>
suspend fun getCashbackAccrualDocs(userWalletId: UserWalletId): Either<VisaApiError, List<CashbackDocument>>
/** Whether the "Cashback deactivated" banner was permanently dismissed for [userWalletId]. */
suspend fun isDeactivationBannerDismissed(userWalletId: UserWalletId): Boolean