Updated on 2026-08-14
This commit is contained in:
parent
d77875be51
commit
e45d91b15e
15 changed files with 389 additions and 67 deletions
|
|
@ -4,10 +4,15 @@ import com.tangem.datasource.api.tangemTech.models.CardInfoBody
|
|||
import com.tangem.datasource.api.tangemTech.models.WalletIdBody
|
||||
import com.tangem.datasource.api.tangemTech.models.WalletType
|
||||
import com.tangem.domain.models.wallet.UserWallet
|
||||
import com.tangem.domain.wallets.models.AppsFlyerConversionData
|
||||
|
||||
object WalletIdBodyConverter {
|
||||
|
||||
fun convert(userWallet: UserWallet, publicKeys: Map<String, String>? = null): WalletIdBody {
|
||||
fun convert(
|
||||
userWallet: UserWallet,
|
||||
conversionData: AppsFlyerConversionData? = null,
|
||||
publicKeys: Map<String, String>? = null,
|
||||
): WalletIdBody {
|
||||
return WalletIdBody(
|
||||
walletId = userWallet.walletId.stringValue,
|
||||
name = userWallet.name,
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ data class UserTokensResponse(
|
|||
@Json(name = "notifyStatus") val notifyStatus: Boolean? = null,
|
||||
@Json(name = "name") val walletName: String? = null,
|
||||
@Json(name = "type") val walletType: WalletType? = null,
|
||||
@Json(name = "ref") val refcode: String? = null,
|
||||
@Json(name = "campaign") val campaign: String? = null,
|
||||
) {
|
||||
|
||||
@JsonClass(generateAdapter = true)
|
||||
|
|
|
|||
|
|
@ -9,4 +9,6 @@ data class WalletIdBody(
|
|||
@Json(name = "name") val name: String,
|
||||
@Json(name = "type") val walletType: WalletType? = null,
|
||||
@Json(name = "cards") val cards: List<CardInfoBody>? = null,
|
||||
@Json(name = "ref") val refcode: String? = null,
|
||||
@Json(name = "campaign") val campaign: String? = null,
|
||||
)
|
||||
|
|
@ -30,7 +30,11 @@ class WalletIdBodyConverterTest {
|
|||
)
|
||||
|
||||
// WHEN
|
||||
val result = WalletIdBodyConverter.convert(userWallet, publicKeys)
|
||||
val result = WalletIdBodyConverter.convert(
|
||||
userWallet = userWallet,
|
||||
conversionData = null,
|
||||
publicKeys = publicKeys,
|
||||
)
|
||||
|
||||
// THEN
|
||||
assertThat(result).isEqualTo(
|
||||
|
|
@ -68,7 +72,11 @@ class WalletIdBodyConverterTest {
|
|||
val publicKeys = emptyMap<String, String>()
|
||||
|
||||
// WHEN
|
||||
val result = WalletIdBodyConverter.convert(userWallet, publicKeys)
|
||||
val result = WalletIdBodyConverter.convert(
|
||||
userWallet = userWallet,
|
||||
conversionData = null,
|
||||
publicKeys = publicKeys,
|
||||
)
|
||||
|
||||
// THEN
|
||||
assertThat(result).isEqualTo(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue