Updated on 2026-08-14
This commit is contained in:
parent
5d8461a4f2
commit
7504fe1822
5 changed files with 46 additions and 2 deletions
|
|
@ -95,6 +95,11 @@ internal class FeedbackDataBuilder {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun addSwapInfo(providerName: String, txId: String) {
|
||||||
|
builder.appendKeyValue("Provider", providerName)
|
||||||
|
builder.appendKeyValue("Transaction ID", txId)
|
||||||
|
}
|
||||||
|
|
||||||
fun addDelimiter(): StringBuilder = builder.appendDelimiter()
|
fun addDelimiter(): StringBuilder = builder.appendDelimiter()
|
||||||
|
|
||||||
fun build(): String = builder.trimEnd().toString()
|
fun build(): String = builder.trimEnd().toString()
|
||||||
|
|
|
||||||
|
|
@ -30,4 +30,10 @@ sealed interface FeedbackEmailType {
|
||||||
val transactionTypes: List<String>,
|
val transactionTypes: List<String>,
|
||||||
val unsignedTransactions: List<String?>,
|
val unsignedTransactions: List<String?>,
|
||||||
) : FeedbackEmailType
|
) : FeedbackEmailType
|
||||||
|
|
||||||
|
data class SwapProblem(
|
||||||
|
override val cardInfo: CardInfo,
|
||||||
|
val providerName: String,
|
||||||
|
val txId: String,
|
||||||
|
) : FeedbackEmailType
|
||||||
}
|
}
|
||||||
|
|
@ -29,6 +29,7 @@ internal class EmailMessageBodyResolver(
|
||||||
type.transactionTypes,
|
type.transactionTypes,
|
||||||
type.unsignedTransactions,
|
type.unsignedTransactions,
|
||||||
)
|
)
|
||||||
|
is FeedbackEmailType.SwapProblem -> addSwapProblemBody(type.cardInfo, type.providerName, type.txId)
|
||||||
}
|
}
|
||||||
|
|
||||||
return build()
|
return build()
|
||||||
|
|
@ -108,6 +109,35 @@ internal class EmailMessageBodyResolver(
|
||||||
addPhoneInfo(phoneInfo = feedbackRepository.getPhoneInfo())
|
addPhoneInfo(phoneInfo = feedbackRepository.getPhoneInfo())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private suspend fun FeedbackDataBuilder.addSwapProblemBody(
|
||||||
|
cardInfo: CardInfo,
|
||||||
|
providerName: String,
|
||||||
|
txId: String,
|
||||||
|
) {
|
||||||
|
addCardInfo(cardInfo)
|
||||||
|
addDelimiter()
|
||||||
|
|
||||||
|
val userWalletId = requireNotNull(cardInfo.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, txId)
|
||||||
|
addDelimiter()
|
||||||
|
|
||||||
|
addPhoneInfo(phoneInfo = feedbackRepository.getPhoneInfo())
|
||||||
|
}
|
||||||
|
|
||||||
private fun FeedbackDataBuilder.addCardAndPhoneInfo(cardInfo: CardInfo) {
|
private fun FeedbackDataBuilder.addCardAndPhoneInfo(cardInfo: CardInfo) {
|
||||||
addCardInfo(cardInfo)
|
addCardInfo(cardInfo)
|
||||||
addDelimiter()
|
addDelimiter()
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ internal class EmailMessageTitleResolver(private val resources: Resources) {
|
||||||
is FeedbackEmailType.ScanningProblem -> R.string.feedback_preface_scan_failed
|
is FeedbackEmailType.ScanningProblem -> R.string.feedback_preface_scan_failed
|
||||||
is FeedbackEmailType.TransactionSendingProblem,
|
is FeedbackEmailType.TransactionSendingProblem,
|
||||||
is FeedbackEmailType.StakingProblem,
|
is FeedbackEmailType.StakingProblem,
|
||||||
|
is FeedbackEmailType.SwapProblem,
|
||||||
-> R.string.feedback_preface_tx_failed
|
-> R.string.feedback_preface_tx_failed
|
||||||
}
|
}
|
||||||
.let(resources::getString)
|
.let(resources::getString)
|
||||||
|
|
|
||||||
|
|
@ -25,8 +25,10 @@ internal class EmailSubjectResolver(private val resources: Resources) {
|
||||||
}
|
}
|
||||||
is FeedbackEmailType.RateCanBeBetter -> R.string.feedback_subject_rate_negative
|
is FeedbackEmailType.RateCanBeBetter -> R.string.feedback_subject_rate_negative
|
||||||
is FeedbackEmailType.ScanningProblem -> R.string.feedback_subject_scan_failed
|
is FeedbackEmailType.ScanningProblem -> R.string.feedback_subject_scan_failed
|
||||||
is FeedbackEmailType.TransactionSendingProblem -> R.string.feedback_subject_tx_failed
|
is FeedbackEmailType.TransactionSendingProblem,
|
||||||
is FeedbackEmailType.StakingProblem -> R.string.feedback_subject_tx_failed
|
is FeedbackEmailType.StakingProblem,
|
||||||
|
is FeedbackEmailType.SwapProblem,
|
||||||
|
-> R.string.feedback_subject_tx_failed
|
||||||
}
|
}
|
||||||
.let(resources::getString)
|
.let(resources::getString)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue