commit 977c2b2d2427ea28a5ef6a7a3df93828b83f236f
parent 9fc70f32548fd28667ee80e7be07d42ba513fd08
Author: Marc Stibane <marc@taler.net>
Date: Mon, 15 Apr 2024 20:23:31 +0200
DenomLossEventType
Diffstat:
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/TalerWallet1/Model/Transaction.swift b/TalerWallet1/Model/Transaction.swift
@@ -478,9 +478,14 @@ struct RecoupTransaction : Sendable {
var details: RecoupTransactionDetails
}
+enum DenomLossEventType: String, Decodable {
+ case denomExpired = "denom-expired"
+ case denomVanished = "denom-vanished"
+ case denomUnoffered = "denom-unoffered"
+}
struct DenomLossTransactionDetails: Decodable {
var exchangeBaseUrl: String
- var lossEventType: String
+ var lossEventType: DenomLossEventType
}
struct DenomLossTransaction : Sendable {
var common: TransactionCommon
@@ -660,7 +665,7 @@ enum Transaction: Decodable, Hashable, Identifiable, Sendable {
result["reason"] = recoupTransaction.details.recoupReason
case .denomLoss(let denomLossTransaction):
result[EXCHANGEBASEURL] = denomLossTransaction.details.exchangeBaseUrl
- result["reason"] = denomLossTransaction.details.lossEventType
+ result["reason"] = denomLossTransaction.details.lossEventType.rawValue
}
return result
}
diff --git a/TalerWallet1/Views/Transactions/TransactionSummaryV.swift b/TalerWallet1/Views/Transactions/TransactionSummaryV.swift
@@ -435,7 +435,7 @@ struct TransactionSummaryV: View {
common: common, topAbbrev: String(localized: "Lost:", comment: "mini"),
topTitle: String(localized: "Money lost:"),
baseURL: details.exchangeBaseUrl, noFees: nil, large: true, // TODO: baseURL, noFees
- summary: details.lossEventType,
+ summary: details.lossEventType.rawValue,
merchant: nil)
}
} // switch