commit dafbcc394297613c24693786663151900ee704a0
parent c420e3c5399f0b59fa9b80a4da5e904cb5603734
Author: Marc Stibane <marc@taler.net>
Date: Fri, 27 Nov 2026 16:16:43 +0100
helper
Diffstat:
1 file changed, 14 insertions(+), 0 deletions(-)
diff --git a/TalerWallet1/Model/Model+Payment.swift b/TalerWallet1/Model/Model+Payment.swift
@@ -69,6 +69,13 @@ struct ContractTokenDetails: Codable {
case trustedDomains = "trusted_domains"
case expectedDomains = "expected_domains"
}
+
+ var isDiscount: Bool {
+ clazz.lowercased() == "discount"
+ }
+ var isSubscription: Bool {
+ clazz.lowercased() == "subscription"
+ }
}
struct ContractTokenFamily: Codable {
@@ -96,6 +103,13 @@ struct ContractTokenFamily: Codable {
case descriptionI18n = "description_i18n"
case keys, details, critical
}
+
+ var isDiscount: Bool {
+ details.isDiscount
+ }
+ var isSubscription: Bool {
+ details.isSubscription
+ }
}
struct ContractInput: Codable, Hashable {