Updated on 2026-08-14

This commit is contained in:
Tangem 2026-05-26 16:57:29 +05:00
parent 39aa3b744d
commit 4ff0a8c7ac
2 changed files with 41 additions and 16 deletions

View file

@ -33,10 +33,15 @@ internal class TangemPayTxHistoryItemConverter(moshi: Moshi) :
}
private fun convertSpend(id: String, spend: TangemPayTxHistoryResponse.Spend): TangemPayTxHistoryItem.Spend {
val rawDate = if (spend.amount.signum() < 0) {
spend.postedAt ?: spend.authorizedAt
} else {
spend.authorizedAt
}
return TangemPayTxHistoryItem.Spend(
id = id,
jsonRepresentation = spendAdapter.toJson(spend),
date = spend.authorizedAt.withLocalZone(),
date = rawDate.withLocalZone(),
amount = spend.amount,
currency = Currency.getInstance(spend.currency),
authorizedAmount = spend.authorizedAmount.orZero(),