Updated on 2026-08-14
This commit is contained in:
commit
76393d2fae
13 changed files with 90 additions and 13 deletions
|
|
@ -3,6 +3,7 @@ package com.tangem.domain.feedback
|
|||
import com.tangem.domain.feedback.models.BlockchainInfo
|
||||
import com.tangem.domain.feedback.models.CardInfo
|
||||
import com.tangem.domain.feedback.models.PhoneInfo
|
||||
import com.tangem.domain.feedback.models.UserWalletsInfo
|
||||
import com.tangem.domain.feedback.utils.breakLine
|
||||
import com.tangem.domain.feedback.models.BlockchainInfo.Addresses as BlockchainAddresses
|
||||
|
||||
|
|
@ -10,12 +11,17 @@ internal class FeedbackDataBuilder {
|
|||
|
||||
private val builder = StringBuilder()
|
||||
|
||||
fun addUserWalletsInfo(userWalletsInfo: UserWalletsInfo) {
|
||||
builder.appendKeyValue("User Wallet ID", userWalletsInfo.selectedUserWalletId)
|
||||
builder.appendKeyValue("Total saved wallets", userWalletsInfo.totalUserWallets.toString())
|
||||
}
|
||||
|
||||
fun addCardInfo(cardInfo: CardInfo) {
|
||||
builder.appendKeyValue("Card ID", cardInfo.cardId)
|
||||
builder.appendKeyValue("Firmware version", cardInfo.firmwareVersion)
|
||||
builder.appendKeyValue("Imported wallet", if (cardInfo.isImported) "yes" else "no")
|
||||
builder.appendKeyValue("Card Blockchain", cardInfo.cardBlockchain)
|
||||
builder.appendSignedHashes(cardInfo.signedHashesList)
|
||||
builder.appendKeyValue("User Wallet ID", cardInfo.userWalletId)
|
||||
}
|
||||
|
||||
fun addBlockchainInfoList(blockchainInfoList: List<BlockchainInfo>) {
|
||||
|
|
|
|||
|
|
@ -71,6 +71,8 @@ class GetSupportFeedbackEmailUseCase(
|
|||
skipLine()
|
||||
append(
|
||||
FeedbackDataBuilder().apply {
|
||||
addUserWalletsInfo(userWalletsInfo = feedbackRepository.getUserWalletsInfo())
|
||||
addDelimiter()
|
||||
addCardInfo(cardInfo)
|
||||
addDelimiter()
|
||||
addBlockchainInfoList(blockchainInfoList = feedbackRepository.getBlockchainInfoList())
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
package com.tangem.domain.feedback.models
|
||||
|
||||
data class CardInfo(
|
||||
val userWalletId: String,
|
||||
val cardId: String,
|
||||
val firmwareVersion: String,
|
||||
val cardBlockchain: String?,
|
||||
val signedHashesList: List<SignedHashes>,
|
||||
val isImported: Boolean,
|
||||
val isStart2Coin: Boolean,
|
||||
) {
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
package com.tangem.domain.feedback.models
|
||||
|
||||
data class UserWalletsInfo(
|
||||
val selectedUserWalletId: String,
|
||||
val totalUserWallets: Int,
|
||||
)
|
||||
|
|
@ -1,13 +1,12 @@
|
|||
package com.tangem.domain.feedback.repository
|
||||
|
||||
import com.tangem.domain.feedback.models.AppLogModel
|
||||
import com.tangem.domain.feedback.models.BlockchainInfo
|
||||
import com.tangem.domain.feedback.models.CardInfo
|
||||
import com.tangem.domain.feedback.models.PhoneInfo
|
||||
import com.tangem.domain.feedback.models.*
|
||||
import java.io.File
|
||||
|
||||
interface FeedbackRepository {
|
||||
|
||||
suspend fun getUserWalletsInfo(): UserWalletsInfo
|
||||
|
||||
suspend fun getCardInfo(): CardInfo
|
||||
|
||||
suspend fun getBlockchainInfoList(): List<BlockchainInfo>
|
||||
|
|
|
|||
|
|
@ -97,6 +97,7 @@ fun Blockchain.Companion.fromNetworkId(networkId: String): Blockchain? {
|
|||
"nexa/testnet" -> Blockchain.NexaTestnet // FIXME
|
||||
"zksync" -> Blockchain.ZkSyncEra // FIXME
|
||||
"zksync/testnet" -> Blockchain.ZkSyncEraTestnet // FIXME
|
||||
"radiant" -> Blockchain.Radiant
|
||||
else -> null
|
||||
}
|
||||
}
|
||||
|
|
@ -195,7 +196,7 @@ fun Blockchain.toNetworkId(): String {
|
|||
Blockchain.ZkSyncEraTestnet -> "zksync/testnet" // FIXME
|
||||
Blockchain.Nexa -> "nexa" // FIXME
|
||||
Blockchain.NexaTestnet -> "nexa/testnet" // FIXME
|
||||
Blockchain.Radiant -> "TODO() add" // FIXME
|
||||
Blockchain.Radiant -> "radiant"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -262,7 +263,7 @@ fun Blockchain.toCoinId(): String {
|
|||
Blockchain.ZkSyncEraTestnet -> "zksync/testnet" // FIXME
|
||||
Blockchain.Nexa -> "nexa" // FIXME
|
||||
Blockchain.NexaTestnet -> "nexa/testnet" // FIXME
|
||||
Blockchain.Radiant -> "TODO() add" // FIXME
|
||||
Blockchain.Radiant -> "radiant"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -294,4 +295,5 @@ private val excludedBlockchains = listOf(
|
|||
Blockchain.ZkSyncEraTestnet,
|
||||
Blockchain.Nexa,
|
||||
Blockchain.NexaTestnet,
|
||||
Blockchain.Radiant,
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue