@@ -111,8 +111,8 @@ class PointOfSaleBarcodeScannerSetupFlow {
111111 . setupBarcodeHID: PointOfSaleBarcodeScannerSetupStep (
112112 content: {
113113 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 ,
116116 barcode: . starBsh20SetupBarcode)
117117 } ,
118118 transitions: [
@@ -128,35 +128,51 @@ class PointOfSaleBarcodeScannerSetupFlow {
128128 . back: . setupBarcodeHID
129129 ]
130130 ) ,
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 (
134140 content: {
135- PointOfSaleBarcodeScannerSetupCompleteView ( )
141+ PointOfSaleBarcodeScannerBarcodeView (
142+ title: Localization . scannerSetUpBarcodeStepTitleFormat,
143+ instruction: Localization . setUpBarcodeHIDStepInstruction,
144+ barcode: . tera12002DHIDBarcode)
136145 } ,
137- buttonCustomization: PointOfSaleBarcodeScannerOptionalScannerInformationButtonCustomization ( ) ,
138146 transitions: [
139- . next: . setupInformation,
140- ] ) ,
141- . testScanFailed: PointOfSaleBarcodeScannerSetupStep (
147+ . next: . setupBarcodePair,
148+ ]
149+ ) ,
150+ . setupBarcodePair: PointOfSaleBarcodeScannerSetupStep (
142151 content: {
143- PointOfSaleBarcodeScannerErrorView ( )
152+ PointOfSaleBarcodeScannerBarcodeView (
153+ title: Localization . scannerSetUpBarcodeStepTitleFormat,
154+ instruction: Localization . setUpBarcodePairStepInstruction,
155+ barcode: . tera12002DPairBarcode)
144156 } ,
145- buttonCustomization: PointOfSaleBarcodeScannerErrorButtonCustomization ( ) ,
146157 transitions: [
147- . retry : . setupBarcodeHID ,
148- . back: . test
158+ . next : . pairing ,
159+ . back: . setupBarcodeHID
149160 ]
150161 ) ,
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 ( )
160176 ]
161177 case . other:
162178 return [
@@ -175,7 +191,7 @@ class PointOfSaleBarcodeScannerSetupFlow {
175191
176192 private func initialStep( for scannerType: PointOfSaleBarcodeScannerType ) -> PointOfSaleBarcodeScannerStepID {
177193 switch scannerType {
178- case . socketS720, . starBSH20B, . tbcScanner :
194+ case . socketS720, . starBSH20B, . tera12002D :
179195 return . setupBarcodeHID
180196 case . other:
181197 return . setupInformation
@@ -194,7 +210,9 @@ class PointOfSaleBarcodeScannerSetupFlow {
194210 )
195211 }
196212
197- private func testBarcodeStep( barcode: PointOfSaleBarcodeScannerTestBarcode , timerCompleted: Bool ) -> PointOfSaleBarcodeScannerSetupStep {
213+ // MARK: - Steps
214+
215+ private func testScanStep( barcode: PointOfSaleBarcodeScannerTestBarcode , timerCompleted: Bool = false ) -> PointOfSaleBarcodeScannerSetupStep {
198216 PointOfSaleBarcodeScannerSetupStep (
199217 content: {
200218 PointOfSaleBarcodeScannerTestBarcodeView (
@@ -221,6 +239,41 @@ class PointOfSaleBarcodeScannerSetupFlow {
221239 ]
222240 )
223241 }
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+ }
224277}
225278
226279@available ( iOS 17 . 0 , * )
@@ -326,9 +379,7 @@ private extension PointOfSaleBarcodeScannerSetupFlow {
326379 }
327380
328381 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) )
332383 }
333384}
334385
@@ -347,7 +398,8 @@ private extension PointOfSaleBarcodeScannerSetupFlow {
347398 comment: " Title for the back button in barcode scanner setup navigation "
348399 )
349400 //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. "
352404 }
353405}
0 commit comments