Updated on 2026-08-14
This commit is contained in:
parent
579b3cba32
commit
f74c37a080
25 changed files with 154 additions and 40 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package com.tangem.domain.models.pay
|
||||
|
||||
import com.tangem.domain.models.account.CardDisplayName
|
||||
import com.tangem.domain.models.account.TangemPayTariffPlan
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
|
|
@ -16,6 +17,7 @@ import kotlinx.serialization.Serializable
|
|||
* @property limit spending limit configuration for the card; `null` if not configured or not yet loaded.
|
||||
* @property frozenState whether the card is currently frozen (blocked for payments).
|
||||
* @property lastDigits The last four digits of the card number.
|
||||
* @property images card artwork images provided by the backend, keyed by [TangemPayTariffPlan.Image.Type].
|
||||
* @property state current lifecycle state of the card (reissuing / closing / active).
|
||||
*/
|
||||
@Serializable
|
||||
|
|
@ -28,10 +30,9 @@ data class TangemPayCard(
|
|||
@SerialName("limit") val limit: TangemPayCardLimitData?,
|
||||
@SerialName("frozen_state") val frozenState: TangemPayCardFrozenState,
|
||||
@SerialName("last_digits") val lastDigits: String,
|
||||
@SerialName("images") val images: List<TangemPayTariffPlan.Image>,
|
||||
@SerialName("state") val state: TangemPayCardState,
|
||||
) {
|
||||
|
||||
/** Backend card status — unknown values map to [UNDEFINED] without crashing. */
|
||||
@Serializable
|
||||
enum class Status {
|
||||
@SerialName("ACTIVE")
|
||||
|
|
@ -65,4 +66,10 @@ data class TangemPayCard(
|
|||
}
|
||||
|
||||
val TangemPayCard.isFrozen
|
||||
get() = frozenState == TangemPayCardFrozenState.Frozen
|
||||
get() = frozenState == TangemPayCardFrozenState.Frozen
|
||||
|
||||
val TangemPayCard.thumbnailUrl: String?
|
||||
get() = images.firstOrNull { it.type == TangemPayTariffPlan.Image.Type.THUMBNAIL }?.url
|
||||
|
||||
val TangemPayCard.mainImageUrl: String?
|
||||
get() = images.firstOrNull { it.type == TangemPayTariffPlan.Image.Type.MAIN }?.url
|
||||
|
|
@ -3,6 +3,7 @@ package com.tangem.domain.pay.model
|
|||
import com.tangem.domain.models.account.CardDisplayName
|
||||
import com.tangem.domain.models.account.PaymentAccountStatusValue
|
||||
import com.tangem.domain.models.account.TangemPayCustomerTariffPlan
|
||||
import com.tangem.domain.models.account.TangemPayTariffPlan
|
||||
import com.tangem.domain.models.kyc.KycStatus
|
||||
import com.tangem.domain.models.pay.TangemPayCard
|
||||
import com.tangem.domain.models.pay.TangemPayCardFrozenState
|
||||
|
|
@ -103,5 +104,6 @@ data class CustomerInfo(
|
|||
val cardStatus: TangemPayCard.Status,
|
||||
val lastFourDigits: String,
|
||||
val isPinSet: Boolean,
|
||||
val images: List<TangemPayTariffPlan.Image>,
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue