Updated on 2026-08-14

This commit is contained in:
Tangem 2025-12-04 18:46:38 +04:00
parent b210d3b7fd
commit c9804fa0ed
16 changed files with 166 additions and 51 deletions

View file

@ -72,5 +72,11 @@ sealed interface FeedbackEmailType {
val item: TangemPayTxHistoryItem,
override val walletMetaInfo: WalletMetaInfo,
) : Visa()
data class Withdrawal(
override val walletMetaInfo: WalletMetaInfo,
val providerName: String,
val txId: String,
) : Visa()
}
}

View file

@ -74,6 +74,7 @@ class SendFeedbackEmailUseCase(
is FeedbackEmailType.Visa.Activation,
is FeedbackEmailType.Visa.DirectUserRequest,
is FeedbackEmailType.Visa.FailedIssueCard,
is FeedbackEmailType.Visa.Withdrawal,
-> {
append(resources.getStringSafe(R.string.feedback_data_collection_message))
skipLine()

View file

@ -37,6 +37,7 @@ internal class EmailMessageBodyResolver(
is FeedbackEmailType.Visa.FailedIssueCard -> addUserRequestBody(type.walletMetaInfo)
is FeedbackEmailType.Visa.Dispute -> addVisaRequestBody(type.walletMetaInfo, type.visaTxDetails)
is FeedbackEmailType.Visa.DisputeV2 -> addTangemPayRequestBody(type.walletMetaInfo, type.item)
is FeedbackEmailType.Visa.Withdrawal -> addTangemPayWithdrawalRequestBody(type)
}
return build()
@ -51,6 +52,33 @@ internal class EmailMessageBodyResolver(
addTangemPayTxInfo(item)
}
private suspend fun FeedbackDataBuilder.addTangemPayWithdrawalRequestBody(
type: FeedbackEmailType.Visa.Withdrawal,
) {
addUserWalletMetaInfo(type.walletMetaInfo)
addDelimiter()
val userWalletId = requireNotNull(type.walletMetaInfo.userWalletId) { "UserWalletId must be not null" }
val blockchainError = feedbackRepository.getBlockchainErrorInfo(userWalletId = userWalletId)
val blockchainInfo = blockchainError?.let {
feedbackRepository.getBlockchainInfo(
userWalletId = userWalletId,
blockchainId = blockchainError.blockchainId,
derivationPath = blockchainError.derivationPath,
)
}
if (blockchainInfo != null) {
addBlockchainError(blockchainInfo, blockchainError)
addDelimiter()
}
addSwapInfo(providerName = type.providerName, txId = type.txId)
addDelimiter()
addPhoneInfo(phoneInfo = feedbackRepository.getPhoneInfo())
}
private suspend fun FeedbackDataBuilder.addVisaRequestBody(
walletMetaInfo: WalletMetaInfo,
visaTxDetails: VisaTxDetails,

View file

@ -25,6 +25,7 @@ internal class EmailMessageTitleResolver(private val resources: Resources) {
is FeedbackEmailType.Visa.Dispute,
is FeedbackEmailType.Visa.DisputeV2,
is FeedbackEmailType.Visa.FailedIssueCard,
is FeedbackEmailType.Visa.Withdrawal,
-> R.string.feedback_preface_support
is FeedbackEmailType.RateCanBeBetter -> R.string.feedback_preface_rate_negative
is FeedbackEmailType.ScanningProblem -> R.string.feedback_preface_scan_failed

View file

@ -43,6 +43,8 @@ internal class EmailSubjectResolver(private val resources: Resources) {
is FeedbackEmailType.Visa.Dispute,
is FeedbackEmailType.Visa.DisputeV2,
-> "[Visa] [DISPUTE] {auto-filled subject}"
is FeedbackEmailType.Visa.Withdrawal,
-> "[Visa] [WITHDRAWAL] {auto-filled subject}"
}
}
}