Updated on 2026-08-14

This commit is contained in:
Tangem 2026-07-14 17:43:51 +03:00
parent 15a518c576
commit 78cb0fc750
18 changed files with 747 additions and 15 deletions

View file

@ -0,0 +1,24 @@
package com.tangem.domain.pay.model
import java.math.BigDecimal
/**
* Customer cashback history from `GET /v1/customer/cashback/history`.
*
* Confirmed cashback grouped by calendar month. Drives the monthly earnings histogram on the
* Cashback screen.
*/
data class CashbackHistory(
val currency: String,
/** Confirmed cashback per calendar month, ordered oldest to newest. */
val months: List<MonthlyCashback>,
) {
data class MonthlyCashback(
val year: Int,
/** 1-based calendar month (6 = June). */
val month: Int,
/** Total confirmed cashback for this month; negative for refunds. */
val confirmedAmount: BigDecimal,
)
}

View file

@ -3,6 +3,7 @@ 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.CashbackHistory
import com.tangem.domain.pay.model.CashbackPromotions
import com.tangem.domain.pay.model.CashbackSummary
import com.tangem.domain.visa.error.VisaApiError
@ -19,6 +20,13 @@ interface CashbackRepository {
suspend fun getCashbackAccrualDocs(userWalletId: UserWalletId): Either<VisaApiError, List<CashbackDocument>>
/**
* Loads the confirmed cashback history for the customer of [userWalletId], grouped by month.
*
* @param months number of calendar months to return, counting back from and including the current month.
*/
suspend fun getCashbackHistory(userWalletId: UserWalletId, months: Int): Either<VisaApiError, CashbackHistory>
/** Whether the "Cashback deactivated" banner was permanently dismissed for [userWalletId]. */
suspend fun isDeactivationBannerDismissed(userWalletId: UserWalletId): Boolean