Updated on 2026-08-14
This commit is contained in:
parent
39aa3b744d
commit
4ff0a8c7ac
2 changed files with 41 additions and 16 deletions
|
|
@ -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(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue