gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-taler-ios] 10/28: ExchangeTosStatus


From: gnunet
Subject: [taler-taler-ios] 10/28: ExchangeTosStatus
Date: Tue, 19 Sep 2023 03:44:29 +0200

This is an automated email from the git hooks/post-receive script.

marc-stibane pushed a commit to branch master
in repository taler-ios.

commit 241f614407fa92a3fa3e8447310fa2b2dadcb661
Author: Marc Stibane <marc@taler.net>
AuthorDate: Sun Sep 10 11:32:30 2023 +0200

    ExchangeTosStatus
---
 TalerWallet1/Model/Model+Exchange.swift            | 26 +++++++++++++++++-----
 TalerWallet1/Model/Model+Withdraw.swift            |  8 +++----
 .../Views/Exchange/ExchangeSectionView.swift       | 16 ++++++-------
 TalerWallet1/Views/Exchange/ManualWithdraw.swift   |  8 +++----
 .../Views/Exchange/ManualWithdrawDone.swift        |  8 +++----
 5 files changed, 40 insertions(+), 26 deletions(-)

diff --git a/TalerWallet1/Model/Model+Exchange.swift 
b/TalerWallet1/Model/Model+Exchange.swift
index f52ee75..304ef06 100644
--- a/TalerWallet1/Model/Model+Exchange.swift
+++ b/TalerWallet1/Model/Model+Exchange.swift
@@ -7,22 +7,38 @@ import taler_swift
 import SymLog
 fileprivate let ASYNCDELAY: UInt = 0   //set e.g to 6 or 9 seconds for 
debugging
 
+enum ExchangeEntryStatus: String, Codable {
+    case preset
+    case ephemeral
+    case used
+}
+
+enum ExchangeUpdateStatus: String, Codable {
+    case initial
+    case initialUpdate = "initial(update)"
+    case suspended
+    case failed
+    case outdatedUpdate = "outdated(update)"
+    case ready
+    case readyUpdate = "ready(update)"
+}
 // MARK: -
 /// The result from wallet-core's ListExchanges
 struct Exchange: Codable, Hashable, Identifiable {
     static func == (lhs: Exchange, rhs: Exchange) -> Bool {
         return lhs.exchangeBaseUrl == rhs.exchangeBaseUrl &&
-        lhs.exchangeStatus == rhs.exchangeStatus &&
-        lhs.permanent == rhs.permanent
+        lhs.tosStatus == rhs.tosStatus &&
+        lhs.exchangeEntryStatus == rhs.exchangeEntryStatus &&
+        lhs.exchangeUpdateStatus == rhs.exchangeUpdateStatus
     }
 
     var exchangeBaseUrl: String
     var currency: String?
     var paytoUris: [String]
-    var tosStatus: String
-    var exchangeStatus: String
+    var tosStatus: ExchangeTosStatus
+    var exchangeEntryStatus: ExchangeEntryStatus
+    var exchangeUpdateStatus: ExchangeUpdateStatus
     var ageRestrictionOptions: [Int]
-    var permanent: Bool
     var lastUpdateErrorInfo: ExchangeError?
 
     var id: String {
diff --git a/TalerWallet1/Model/Model+Withdraw.swift 
b/TalerWallet1/Model/Model+Withdraw.swift
index 754c9dd..bff4394 100644
--- a/TalerWallet1/Model/Model+Withdraw.swift
+++ b/TalerWallet1/Model/Model+Withdraw.swift
@@ -67,11 +67,9 @@ fileprivate struct GetWithdrawalDetailsForAmount: 
WalletBackendFormattedRequest
 }
 // MARK: -
 enum ExchangeTosStatus: String, Codable {
-    case new = "new"
-    case accepted = "accepted"
-    case changed = "changed"
-    case notFound = "not-found"
-    case unknown = "unknown"
+    case pending
+    case proposed
+    case accepted
 }
 struct ExchangeTermsOfService: Decodable {
     var currentEtag: String
diff --git a/TalerWallet1/Views/Exchange/ExchangeSectionView.swift 
b/TalerWallet1/Views/Exchange/ExchangeSectionView.swift
index ffe53dc..945e147 100644
--- a/TalerWallet1/Views/Exchange/ExchangeSectionView.swift
+++ b/TalerWallet1/Views/Exchange/ExchangeSectionView.swift
@@ -76,17 +76,17 @@ struct ExchangeRow_Container : View {
         let exchange1 = Exchange(exchangeBaseUrl: ARS_AGE_EXCHANGE,
                                         currency: LONGCURRENCY,
                                        paytoUris: [],
-                                       tosStatus: "tosStatus",
-                                  exchangeStatus: "exchangeStatus",
-                           ageRestrictionOptions: [12,16],
-                                       permanent: true)
+                                       tosStatus: .pending,
+                             exchangeEntryStatus: .preset,
+                            exchangeUpdateStatus: .initial,
+                           ageRestrictionOptions: [12,16])
         let exchange2 = Exchange(exchangeBaseUrl: ARS_EXP_EXCHANGE,
                                         currency: LONGCURRENCY,
                                        paytoUris: [],
-                                       tosStatus: "tosStatus",
-                                  exchangeStatus: "exchangeStatus",
-                           ageRestrictionOptions: [],
-                                       permanent: false)
+                                       tosStatus: .proposed,
+                             exchangeEntryStatus: .ephemeral,
+                            exchangeUpdateStatus: .ready,
+                           ageRestrictionOptions: [])
             ExchangeSectionView(currency: LONGCURRENCY, exchanges: [exchange1, 
exchange2],
                                 centsToTransfer: $centsToTransfer)
     }
diff --git a/TalerWallet1/Views/Exchange/ManualWithdraw.swift 
b/TalerWallet1/Views/Exchange/ManualWithdraw.swift
index 2cf02e8..c15f149 100644
--- a/TalerWallet1/Views/Exchange/ManualWithdraw.swift
+++ b/TalerWallet1/Views/Exchange/ManualWithdraw.swift
@@ -101,10 +101,10 @@ struct ManualWithdraw_Container : View {
         let exchange = Exchange(exchangeBaseUrl: DEMOEXCHANGE,
                                        currency: LONGCURRENCY,
                                       paytoUris: [],
-                                      tosStatus: "tosStatus",
-                                 exchangeStatus: "exchangeStatus",
-                          ageRestrictionOptions: [],
-                                      permanent: false)
+                                      tosStatus: .pending,
+                            exchangeEntryStatus: .preset,
+                           exchangeUpdateStatus: .initial,
+                          ageRestrictionOptions: [])
         ManualWithdraw(exchange: exchange,
                 centsToTransfer: $centsToTransfer,
         withdrawalAmountDetails: details)
diff --git a/TalerWallet1/Views/Exchange/ManualWithdrawDone.swift 
b/TalerWallet1/Views/Exchange/ManualWithdrawDone.swift
index e5d3b20..ff265e5 100644
--- a/TalerWallet1/Views/Exchange/ManualWithdrawDone.swift
+++ b/TalerWallet1/Views/Exchange/ManualWithdrawDone.swift
@@ -71,10 +71,10 @@ struct ManualWithdrawDone_Container : View {
         let exchange = Exchange(exchangeBaseUrl: DEMOEXCHANGE,
                                        currency: LONGCURRENCY,
                                       paytoUris: [],
-                                      tosStatus: "tosStatus",
-                                 exchangeStatus: "exchangeStatus",
-                          ageRestrictionOptions: [],
-                                      permanent: false)
+                                      tosStatus: .pending,
+                            exchangeEntryStatus: .preset,
+                           exchangeUpdateStatus: .initial,
+                          ageRestrictionOptions: [])
         ManualWithdrawDone(exchange: exchange,
                     centsToTransfer: centsToTransfer)
     }

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]