@@ -111,8 +111,8 @@ class PointOfSaleBarcodeScannerSetupFlow {
111
111
. setupBarcodeHID: PointOfSaleBarcodeScannerSetupStep (
112
112
content: {
113
113
PointOfSaleBarcodeScannerBarcodeView (
114
- title: String ( format: Localization . starSetUpBarcodeStepTitleFormat , scannerType. name) ,
115
- instruction: Localization . setUpBarcodeStepInstruction ,
114
+ title: String ( format: Localization . scannerSetUpBarcodeStepTitleFormat , scannerType. name) ,
115
+ instruction: Localization . setUpBarcodeHIDStepInstruction ,
116
116
barcode: . starBsh20SetupBarcode)
117
117
} ,
118
118
transitions: [
@@ -128,35 +128,51 @@ class PointOfSaleBarcodeScannerSetupFlow {
128
128
. back: . setupBarcodeHID
129
129
]
130
130
) ,
131
- . test: testBarcodeStep ( barcode: . ean13, timerCompleted: false ) ,
132
- . testScanTimedOut: testBarcodeStep ( barcode: . ean13, timerCompleted: true ) ,
133
- . complete: PointOfSaleBarcodeScannerSetupStep (
131
+ . test: testScanStep ( barcode: . ean13) ,
132
+ . testScanTimedOut: testScanTimeOutStep ( barcode: . ean13) ,
133
+ . testScanFailed: testScanFailedStep ( ) ,
134
+ . complete: setupCompleteStep ( ) ,
135
+ . setupInformation: setupInformationStep ( )
136
+ ]
137
+ case . tera12002D:
138
+ return [
139
+ . setupBarcodeHID: PointOfSaleBarcodeScannerSetupStep (
134
140
content: {
135
- PointOfSaleBarcodeScannerSetupCompleteView ( )
141
+ PointOfSaleBarcodeScannerBarcodeView (
142
+ title: Localization . scannerSetUpBarcodeStepTitleFormat,
143
+ instruction: Localization . setUpBarcodeHIDStepInstruction,
144
+ barcode: . tera12002DHIDBarcode)
136
145
} ,
137
- buttonCustomization: PointOfSaleBarcodeScannerOptionalScannerInformationButtonCustomization ( ) ,
138
146
transitions: [
139
- . next: . setupInformation,
140
- ] ) ,
141
- . testScanFailed: PointOfSaleBarcodeScannerSetupStep (
147
+ . next: . setupBarcodePair,
148
+ ]
149
+ ) ,
150
+ . setupBarcodePair: PointOfSaleBarcodeScannerSetupStep (
142
151
content: {
143
- PointOfSaleBarcodeScannerErrorView ( )
152
+ PointOfSaleBarcodeScannerBarcodeView (
153
+ title: Localization . scannerSetUpBarcodeStepTitleFormat,
154
+ instruction: Localization . setUpBarcodePairStepInstruction,
155
+ barcode: . tera12002DPairBarcode)
144
156
} ,
145
- buttonCustomization: PointOfSaleBarcodeScannerErrorButtonCustomization ( ) ,
146
157
transitions: [
147
- . retry : . setupBarcodeHID ,
148
- . back: . test
158
+ . next : . pairing ,
159
+ . back: . setupBarcodeHID
149
160
]
150
161
) ,
151
- . setupInformation: PointOfSaleBarcodeScannerSetupStep (
152
- content: { ProductBarcodeSetupInformation ( ) } ,
153
- buttonCustomization: PointOfSaleBarcodeScannerNoButtonsButtonCustomization ( )
154
- )
155
- ]
156
- case . tbcScanner:
157
- return [
158
- . setupBarcodeHID: createWelcomeStep ( title: " TBC Scanner Setup " )
159
- // TODO: Add more steps for TBC Scanner WOOMOB-699
162
+ . pairing: PointOfSaleBarcodeScannerSetupStep (
163
+ content: {
164
+ PointOfSaleBarcodeScannerPairingView ( scanner: scannerType)
165
+ } ,
166
+ transitions: [
167
+ . next: . test,
168
+ . back: . setupBarcodePair
169
+ ]
170
+ ) ,
171
+ . test: testScanStep ( barcode: . ean13) ,
172
+ . testScanTimedOut: testScanTimeOutStep ( barcode: . ean13) ,
173
+ . testScanFailed: testScanFailedStep ( ) ,
174
+ . complete: setupCompleteStep ( ) ,
175
+ . setupInformation: setupInformationStep ( )
160
176
]
161
177
case . other:
162
178
return [
@@ -175,7 +191,7 @@ class PointOfSaleBarcodeScannerSetupFlow {
175
191
176
192
private func initialStep( for scannerType: PointOfSaleBarcodeScannerType ) -> PointOfSaleBarcodeScannerStepID {
177
193
switch scannerType {
178
- case . socketS720, . starBSH20B, . tbcScanner :
194
+ case . socketS720, . starBSH20B, . tera12002D :
179
195
return . setupBarcodeHID
180
196
case . other:
181
197
return . setupInformation
@@ -194,7 +210,9 @@ class PointOfSaleBarcodeScannerSetupFlow {
194
210
)
195
211
}
196
212
197
- private func testBarcodeStep( barcode: PointOfSaleBarcodeScannerTestBarcode , timerCompleted: Bool ) -> PointOfSaleBarcodeScannerSetupStep {
213
+ // MARK: - Steps
214
+
215
+ private func testScanStep( barcode: PointOfSaleBarcodeScannerTestBarcode , timerCompleted: Bool = false ) -> PointOfSaleBarcodeScannerSetupStep {
198
216
PointOfSaleBarcodeScannerSetupStep (
199
217
content: {
200
218
PointOfSaleBarcodeScannerTestBarcodeView (
@@ -221,6 +239,41 @@ class PointOfSaleBarcodeScannerSetupFlow {
221
239
]
222
240
)
223
241
}
242
+
243
+ private func testScanTimeOutStep( barcode: PointOfSaleBarcodeScannerTestBarcode ) -> PointOfSaleBarcodeScannerSetupStep {
244
+ testScanStep ( barcode: barcode, timerCompleted: true )
245
+ }
246
+
247
+ private func testScanFailedStep( ) -> PointOfSaleBarcodeScannerSetupStep {
248
+ PointOfSaleBarcodeScannerSetupStep (
249
+ content: {
250
+ PointOfSaleBarcodeScannerErrorView ( )
251
+ } ,
252
+ buttonCustomization: PointOfSaleBarcodeScannerErrorButtonCustomization ( ) ,
253
+ transitions: [
254
+ . retry: . setupBarcodeHID,
255
+ . back: . test
256
+ ]
257
+ )
258
+ }
259
+
260
+ private func setupCompleteStep( ) -> PointOfSaleBarcodeScannerSetupStep {
261
+ PointOfSaleBarcodeScannerSetupStep (
262
+ content: {
263
+ PointOfSaleBarcodeScannerSetupCompleteView ( )
264
+ } ,
265
+ buttonCustomization: PointOfSaleBarcodeScannerOptionalScannerInformationButtonCustomization ( ) ,
266
+ transitions: [
267
+ . next: . setupInformation,
268
+ ] )
269
+ }
270
+
271
+ private func setupInformationStep( ) -> PointOfSaleBarcodeScannerSetupStep {
272
+ PointOfSaleBarcodeScannerSetupStep (
273
+ content: { ProductBarcodeSetupInformation ( ) } ,
274
+ buttonCustomization: PointOfSaleBarcodeScannerNoButtonsButtonCustomization ( )
275
+ )
276
+ }
224
277
}
225
278
226
279
@available ( iOS 17 . 0 , * )
@@ -326,9 +379,7 @@ private extension PointOfSaleBarcodeScannerSetupFlow {
326
379
}
327
380
328
381
private func trackRetry( ) {
329
- if let step = getCurrentAnalyticsStepValue ( ) {
330
- analytics. track ( event: WooAnalyticsEvent . PointOfSale. barcodeScannerSetupRetryTapped ( scanner: scannerType) )
331
- }
382
+ analytics. track ( event: WooAnalyticsEvent . PointOfSale. barcodeScannerSetupRetryTapped ( scanner: scannerType) )
332
383
}
333
384
}
334
385
@@ -347,7 +398,8 @@ private extension PointOfSaleBarcodeScannerSetupFlow {
347
398
comment: " Title for the back button in barcode scanner setup navigation "
348
399
)
349
400
//TODO: WOOMOB-792
350
- static let starSetUpBarcodeStepTitleFormat = " %1$@ Setup "
351
- static let setUpBarcodeStepInstruction = " Scan the barcode to set up your scanner. "
401
+ static let scannerSetUpBarcodeStepTitleFormat = " Scanner Setup "
402
+ static let setUpBarcodeHIDStepInstruction = " Scan the Bluetooth HID symbol. "
403
+ static let setUpBarcodePairStepInstruction = " Scan the Pair symbol to get the scanner ready for pairing. "
352
404
}
353
405
}
0 commit comments