@pisell/private-materials 6.12.168 → 6.12.170
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +10 -10
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +10 -10
- package/es/components/HDLKiosk/{contracts → app/contracts}/config.js +1 -1
- package/es/components/HDLKiosk/app/manifest.js +11 -11
- package/es/components/HDLKiosk/app/operations.js +92 -0
- package/es/components/HDLKiosk/app/workflow/barcode.js +7 -3
- package/es/components/HDLKiosk/app/workflow/index.js +16 -0
- package/es/components/HDLKiosk/app/workflow/predicates.js +1 -1
- package/es/components/HDLKiosk/app/workflow/quick.js +1 -1
- package/es/components/HDLKiosk/app/workflow/registry.js +4 -4
- package/es/components/HDLKiosk/app/workflow/scale.js +5 -1
- package/es/components/HDLKiosk/components/common/HDLKioskSkuOptionsSelection/index.less +1 -1
- package/es/components/HDLKiosk/components/overlays/HDLKioskModal/index.less +1 -1
- package/es/components/HDLKiosk/components/shell/HDLKioskBottomBarHost/index.js +4 -1
- package/es/components/HDLKiosk/docs/00-/346/226/207/344/273/266/345/257/274/350/210/252.md +104 -167
- package/es/components/HDLKiosk/docs/01-/346/240/270/345/277/203/350/277/220/350/241/214/346/234/272/345/210/266.md +95 -89
- package/es/components/HDLKiosk/docs/02-Host/351/200/202/351/205/215/344/270/216/344/270/232/345/212/241/346/225/260/346/215/256.md +20 -19
- package/es/components/HDLKiosk/docs/04-/350/256/276/345/244/207/344/270/216/347/247/260/351/207/215.md +43 -26
- package/es/components/HDLKiosk/docs/05-/344/272/244/346/230/223/345/256/211/345/205/250.md +2 -0
- package/es/components/HDLKiosk/docs/08-/346/227/240/345/244/264Application/350/277/220/350/241/214/346/227/266/351/207/215/346/236/204/350/256/276/350/256/241.md +719 -0
- package/es/components/HDLKiosk/docs/09-Entry/350/256/276/345/244/207/344/272/213/344/273/266/351/207/215/346/236/204/344/277/256/345/244/215/346/212/245/345/221/212.md +187 -0
- package/es/components/HDLKiosk/docs/README.md +6 -2
- package/es/components/HDLKiosk/docs//345/256/236/346/226/275/350/277/233/345/272/246.md +8 -7
- package/es/components/HDLKiosk/docs//346/236/266/346/236/204/350/256/276/350/256/241.md +16 -18
- package/es/components/HDLKiosk/index.js +32 -30
- package/es/components/HDLKiosk/index.less +8 -3
- package/es/components/HDLKiosk/kernel/README.md +13 -12
- package/es/components/HDLKiosk/kernel/application/defineApplication.js +63 -24
- package/es/components/HDLKiosk/kernel/application/defineSlice.js +6 -6
- package/es/components/HDLKiosk/kernel/application/runtime.js +237 -0
- package/es/components/HDLKiosk/kernel/operations/coordinator.js +1 -1
- package/es/components/HDLKiosk/kernel/operations/registry.js +3 -3
- package/es/components/HDLKiosk/kernel/operations/sessionEpoch.js +1 -1
- package/es/components/HDLKiosk/kernel/operations/types.js +7 -3
- package/es/components/HDLKiosk/kernel/workflow/actor.js +16 -17
- package/es/components/HDLKiosk/kernel/workflow/compiler.js +14 -16
- package/es/components/HDLKiosk/runtime/createRuntime.js +238 -0
- package/es/components/HDLKiosk/{devices → runtime/devices}/dedupeStore.js +1 -1
- package/es/components/HDLKiosk/{devices → runtime/devices}/scaleIngress.js +1 -1
- package/es/components/HDLKiosk/{devices/scale/runtime.js → runtime/devices/scaleStore.js} +18 -24
- package/es/components/HDLKiosk/{devices → runtime/devices}/scannerIngress.js +1 -1
- package/es/components/HDLKiosk/runtime/devices/scannerSessionPort.js +60 -0
- package/es/components/HDLKiosk/runtime/devices/scannerSessionRouter.js +212 -0
- package/es/components/HDLKiosk/runtime/operations/barcode.js +18 -0
- package/es/components/HDLKiosk/runtime/operations/cart.js +44 -0
- package/es/components/HDLKiosk/{app → runtime}/operations/cartConsistency.js +1 -1
- package/es/components/HDLKiosk/{app → runtime}/operations/checkout.js +95 -110
- package/es/components/HDLKiosk/{app → runtime}/operations/checkoutRequirements.js +1 -1
- package/es/components/HDLKiosk/{app → runtime}/operations/checkoutSafety.js +1 -1
- package/es/components/HDLKiosk/{app → runtime}/operations/coordinator.js +2 -2
- package/es/components/HDLKiosk/runtime/operations/customization.js +70 -0
- package/es/components/HDLKiosk/{app → runtime}/operations/errors.js +1 -1
- package/es/components/HDLKiosk/runtime/operations/fulfillment.js +6 -0
- package/es/components/HDLKiosk/runtime/operations/identity.js +55 -0
- package/es/components/HDLKiosk/runtime/operations/registry.js +34 -0
- package/es/components/HDLKiosk/runtime/operations/session.js +29 -0
- package/es/components/HDLKiosk/runtime/operations/types.js +13 -0
- package/es/components/HDLKiosk/runtime/session/blockPolicy.js +14 -0
- package/es/components/HDLKiosk/runtime/{createWorkflowSession.js → session/createSession.js} +67 -17
- package/es/components/HDLKiosk/runtime/{domainTransitionRunner.js → session/transitionRunner.js} +10 -5
- package/es/components/HDLKiosk/runtime/{workflowContext.js → session/workflowContext.js} +2 -2
- package/es/components/HDLKiosk/runtime/{workflowLifecycle.js → session/workflowLifecycle.js} +2 -2
- package/es/components/HDLKiosk/runtime/triggers.js +28 -0
- package/es/components/HDLKiosk/slices/catalog/Screen/index.js +15 -8
- package/es/components/HDLKiosk/slices/catalog/Screen/index.less +74 -13
- package/es/components/HDLKiosk/slices/catalog/slice.js +2 -2
- package/es/components/HDLKiosk/slices/customization/Screen/index.js +34 -35
- package/es/components/HDLKiosk/slices/customization/Screen/index.less +5 -0
- package/es/components/HDLKiosk/slices/customization/slice.js +2 -3
- package/es/components/HDLKiosk/slices/fulfillment/slice.js +2 -2
- package/es/components/HDLKiosk/slices/fulfillment/view.js +1 -1
- package/es/components/HDLKiosk/slices/identity/Screen/index.less +1 -1
- package/es/components/HDLKiosk/slices/identity/slice.js +2 -2
- package/es/components/HDLKiosk/slices/identity/view.js +1 -1
- package/es/components/HDLKiosk/slices/payment/Screen/index.less +1 -1
- package/es/components/HDLKiosk/slices/payment/slice.js +3 -3
- package/es/components/HDLKiosk/slices/primaryProductPrompt/slice.js +1 -1
- package/es/components/HDLKiosk/{runtime → ui}/HDLKioskWorkflowView.js +68 -129
- package/es/components/HDLKiosk/ui/ScaleSimulatorConsole/index.js +387 -0
- package/es/components/HDLKiosk/ui/ScaleSimulatorConsole/index.less +621 -0
- package/es/components/HDLKiosk/{app → ui}/ScreenRenderer.js +1 -1
- package/es/components/HDLKiosk/ui/collaborationStatus.js +11 -0
- package/es/components/HDLKiosk/ui/controllers/useHDLKioskActionDispatcher.js +66 -0
- package/es/components/HDLKiosk/{runtime → ui}/controllers/useHDLKioskCustomerController.js +1 -1
- package/es/components/HDLKiosk/ui/controllers/useHDLKioskDeviceController.js +25 -0
- package/es/components/HDLKiosk/ui/controllers/useHDLKioskExitController.js +53 -0
- package/es/components/HDLKiosk/{runtime → ui}/controllers/useHDLKioskScreenData.js +1 -1
- package/es/components/HDLKiosk/ui/controllers/useHDLKioskSessionController.js +39 -0
- package/es/components/HDLKiosk/{app → ui}/entry/Screen/index.js +8 -6
- package/es/components/HDLKiosk/{app → ui}/entry/model.js +2 -2
- package/es/components/HDLKiosk/ui/scale.js +20 -0
- package/es/components/HDLKiosk/{runtime/useHostSnapshot.js → ui/snapshots.js} +6 -8
- package/es/components/HDLKiosk/{app → ui}/views.js +1 -1
- package/es/components/HDLKiosk/{runtime → ui}/workflowEvent.js +1 -1
- package/es/components/HDLKiosk/utils.js +4 -4
- package/es/components/bigSale/templates/HDLKiosk/README.md +43 -0
- package/es/components/bigSale/templates/HDLKiosk/adapter/createHost.js +7 -7
- package/es/components/bigSale/templates/HDLKiosk/adapter/{devices.js → devices/devicePort.js} +10 -38
- package/es/components/bigSale/templates/HDLKiosk/adapter/{capabilities.js → host/capabilities.js} +2 -2
- package/es/components/bigSale/templates/HDLKiosk/adapter/{fulfillment.js → host/fulfillmentWriter.js} +3 -3
- package/es/components/bigSale/templates/HDLKiosk/adapter/{projection.js → host/projection.js} +24 -14
- package/es/components/bigSale/templates/HDLKiosk/adapter/{telemetry.js → host/telemetry.js} +1 -1
- package/es/components/bigSale/templates/HDLKiosk/adapter/sales/cart.js +187 -0
- package/es/components/bigSale/templates/HDLKiosk/adapter/sales/catalog.js +160 -0
- package/es/components/bigSale/templates/HDLKiosk/adapter/{customizationProduct.js → sales/customizationProduct.js} +3 -3
- package/es/components/bigSale/templates/HDLKiosk/adapter/sales/fulfillment.js +31 -0
- package/es/components/bigSale/templates/HDLKiosk/adapter/sales/identity.js +57 -0
- package/es/components/bigSale/templates/HDLKiosk/adapter/sales/index.js +18 -0
- package/es/components/bigSale/templates/HDLKiosk/adapter/sales/payment.js +123 -0
- package/es/components/bigSale/templates/HDLKiosk/adapter/sales/session.js +71 -0
- package/es/components/bigSale/templates/HDLKiosk/adapter/sales/weightedOperations.js +124 -0
- package/es/components/bigSale/templates/HDLKiosk/adapter/{weightedProduct.js → sales/weightedProduct.js} +2 -2
- package/es/components/bigSale/templates/HDLKiosk/adapter/useBigSaleHDLKioskAdapter.js +41 -0
- package/es/components/bigSale/templates/HDLKiosk/adapter/useBigSaleHDLKioskHost.js +10 -7
- package/es/components/bigSale/templates/HDLKiosk/cart/useBigSaleHDLKioskCart.js +122 -0
- package/es/components/bigSale/templates/HDLKiosk/{adapter → hooks}/useHDLKioskEntryPreparationToast.js +2 -1
- package/es/components/bigSale/templates/HDLKiosk/index.js +42 -148
- package/es/components/bigSale/templates/HDLKiosk/{adapter/scaleTrigger.js → runtime/BigSaleScaleRuntimeOwner.js} +33 -62
- package/es/components/bigSale/templates/HDLKiosk/{adapter → runtime}/HDLKioskPaymentRuntime.js +4 -3
- package/es/components/bigSale/templates/HDLKiosk/runtime/scaleBridge.js +44 -0
- package/lib/components/HDLKiosk/{contracts → app/contracts}/config.js +1 -1
- package/lib/components/HDLKiosk/app/manifest.js +18 -19
- package/lib/components/HDLKiosk/app/operations.js +105 -0
- package/lib/components/HDLKiosk/app/workflow/barcode.js +7 -3
- package/lib/components/HDLKiosk/app/workflow/index.js +16 -0
- package/lib/components/HDLKiosk/app/workflow/predicates.js +1 -0
- package/lib/components/HDLKiosk/app/workflow/quick.js +1 -1
- package/lib/components/HDLKiosk/app/workflow/registry.js +3 -3
- package/lib/components/HDLKiosk/app/workflow/scale.js +5 -1
- package/lib/components/HDLKiosk/components/common/HDLKioskSkuOptionsSelection/index.less +1 -1
- package/lib/components/HDLKiosk/components/overlays/HDLKioskModal/index.less +1 -1
- package/lib/components/HDLKiosk/components/shell/HDLKioskBottomBarHost/index.js +4 -1
- package/lib/components/HDLKiosk/docs/00-/346/226/207/344/273/266/345/257/274/350/210/252.md +104 -167
- package/lib/components/HDLKiosk/docs/01-/346/240/270/345/277/203/350/277/220/350/241/214/346/234/272/345/210/266.md +95 -89
- package/lib/components/HDLKiosk/docs/02-Host/351/200/202/351/205/215/344/270/216/344/270/232/345/212/241/346/225/260/346/215/256.md +20 -19
- package/lib/components/HDLKiosk/docs/04-/350/256/276/345/244/207/344/270/216/347/247/260/351/207/215.md +43 -26
- package/lib/components/HDLKiosk/docs/05-/344/272/244/346/230/223/345/256/211/345/205/250.md +2 -0
- package/lib/components/HDLKiosk/docs/08-/346/227/240/345/244/264Application/350/277/220/350/241/214/346/227/266/351/207/215/346/236/204/350/256/276/350/256/241.md +719 -0
- package/lib/components/HDLKiosk/docs/09-Entry/350/256/276/345/244/207/344/272/213/344/273/266/351/207/215/346/236/204/344/277/256/345/244/215/346/212/245/345/221/212.md +187 -0
- package/lib/components/HDLKiosk/docs/README.md +6 -2
- package/lib/components/HDLKiosk/docs//345/256/236/346/226/275/350/277/233/345/272/246.md +8 -7
- package/lib/components/HDLKiosk/docs//346/236/266/346/236/204/350/256/276/350/256/241.md +16 -18
- package/lib/components/HDLKiosk/index.js +35 -33
- package/lib/components/HDLKiosk/index.less +8 -3
- package/lib/components/HDLKiosk/kernel/README.md +13 -12
- package/lib/components/HDLKiosk/kernel/application/defineApplication.js +65 -25
- package/lib/components/HDLKiosk/kernel/application/defineSlice.js +6 -6
- package/lib/components/HDLKiosk/kernel/application/runtime.js +237 -0
- package/lib/components/HDLKiosk/kernel/operations/coordinator.js +1 -1
- package/lib/components/HDLKiosk/kernel/operations/registry.js +3 -3
- package/lib/components/HDLKiosk/kernel/operations/sessionEpoch.js +1 -1
- package/lib/components/HDLKiosk/kernel/operations/types.js +8 -3
- package/lib/components/HDLKiosk/kernel/workflow/actor.js +16 -17
- package/lib/components/HDLKiosk/kernel/workflow/compiler.js +14 -16
- package/lib/components/HDLKiosk/runtime/createRuntime.js +239 -0
- package/lib/components/HDLKiosk/{devices → runtime/devices}/dedupeStore.js +1 -1
- package/lib/components/HDLKiosk/{devices → runtime/devices}/scaleIngress.js +1 -1
- package/lib/components/HDLKiosk/{devices/scale/runtime.js → runtime/devices/scaleStore.js} +17 -27
- package/lib/components/HDLKiosk/{devices → runtime/devices}/scannerIngress.js +1 -1
- package/lib/components/HDLKiosk/runtime/devices/scannerSessionPort.js +60 -0
- package/lib/components/HDLKiosk/runtime/devices/scannerSessionRouter.js +212 -0
- package/lib/components/HDLKiosk/runtime/operations/barcode.js +17 -0
- package/lib/components/HDLKiosk/runtime/operations/cart.js +46 -0
- package/lib/components/HDLKiosk/{app → runtime}/operations/cartConsistency.js +1 -1
- package/lib/components/HDLKiosk/{app → runtime}/operations/checkout.js +97 -112
- package/lib/components/HDLKiosk/{app → runtime}/operations/checkoutRequirements.js +1 -1
- package/lib/components/HDLKiosk/{app → runtime}/operations/checkoutSafety.js +1 -1
- package/lib/components/HDLKiosk/{app → runtime}/operations/coordinator.js +2 -2
- package/lib/components/HDLKiosk/runtime/operations/customization.js +73 -0
- package/lib/components/HDLKiosk/{app → runtime}/operations/errors.js +1 -1
- package/lib/components/HDLKiosk/runtime/operations/fulfillment.js +5 -0
- package/lib/components/HDLKiosk/runtime/operations/identity.js +55 -0
- package/lib/components/HDLKiosk/runtime/operations/registry.js +34 -0
- package/lib/components/HDLKiosk/runtime/operations/session.js +30 -0
- package/lib/components/HDLKiosk/runtime/operations/types.js +14 -0
- package/lib/components/HDLKiosk/runtime/session/blockPolicy.js +14 -0
- package/lib/components/HDLKiosk/runtime/{createWorkflowSession.js → session/createSession.js} +71 -21
- package/lib/components/HDLKiosk/runtime/{domainTransitionRunner.js → session/transitionRunner.js} +10 -5
- package/lib/components/HDLKiosk/runtime/{workflowContext.js → session/workflowContext.js} +2 -2
- package/lib/components/HDLKiosk/runtime/{workflowLifecycle.js → session/workflowLifecycle.js} +2 -2
- package/lib/components/HDLKiosk/runtime/triggers.js +28 -0
- package/lib/components/HDLKiosk/slices/catalog/Screen/index.js +15 -8
- package/lib/components/HDLKiosk/slices/catalog/Screen/index.less +74 -13
- package/lib/components/HDLKiosk/slices/catalog/slice.js +3 -3
- package/lib/components/HDLKiosk/slices/customization/Screen/index.js +35 -36
- package/lib/components/HDLKiosk/slices/customization/Screen/index.less +5 -0
- package/lib/components/HDLKiosk/slices/customization/slice.js +5 -6
- package/lib/components/HDLKiosk/slices/fulfillment/slice.js +3 -3
- package/lib/components/HDLKiosk/slices/fulfillment/view.js +1 -1
- package/lib/components/HDLKiosk/slices/identity/Screen/index.less +1 -1
- package/lib/components/HDLKiosk/slices/identity/slice.js +4 -4
- package/lib/components/HDLKiosk/slices/identity/view.js +1 -1
- package/lib/components/HDLKiosk/slices/payment/Screen/index.less +1 -1
- package/lib/components/HDLKiosk/slices/payment/slice.js +5 -5
- package/lib/components/HDLKiosk/slices/primaryProductPrompt/slice.js +1 -1
- package/lib/components/HDLKiosk/{runtime → ui}/HDLKioskWorkflowView.js +69 -130
- package/lib/components/HDLKiosk/ui/ScaleSimulatorConsole/index.js +390 -0
- package/lib/components/HDLKiosk/ui/ScaleSimulatorConsole/index.less +621 -0
- package/lib/components/HDLKiosk/{app → ui}/ScreenRenderer.js +1 -1
- package/lib/components/HDLKiosk/ui/collaborationStatus.js +11 -0
- package/lib/components/HDLKiosk/ui/controllers/useHDLKioskActionDispatcher.js +67 -0
- package/lib/components/HDLKiosk/{runtime → ui}/controllers/useHDLKioskCustomerController.js +1 -1
- package/lib/components/HDLKiosk/ui/controllers/useHDLKioskDeviceController.js +26 -0
- package/lib/components/HDLKiosk/ui/controllers/useHDLKioskExitController.js +54 -0
- package/lib/components/HDLKiosk/{runtime → ui}/controllers/useHDLKioskScreenData.js +1 -1
- package/lib/components/HDLKiosk/ui/controllers/useHDLKioskSessionController.js +40 -0
- package/lib/components/HDLKiosk/{app → ui}/entry/Screen/index.js +8 -6
- package/lib/components/HDLKiosk/{app → ui}/entry/model.js +2 -2
- package/lib/components/HDLKiosk/ui/scale.js +24 -0
- package/lib/components/HDLKiosk/{runtime/useHostSnapshot.js → ui/snapshots.js} +6 -7
- package/lib/components/HDLKiosk/{app → ui}/views.js +1 -1
- package/lib/components/HDLKiosk/{runtime → ui}/workflowEvent.js +1 -1
- package/lib/components/HDLKiosk/utils.js +4 -4
- package/lib/components/bigSale/templates/HDLKiosk/README.md +43 -0
- package/lib/components/bigSale/templates/HDLKiosk/adapter/createHost.js +9 -9
- package/lib/components/bigSale/templates/HDLKiosk/adapter/{devices.js → devices/devicePort.js} +10 -38
- package/lib/components/bigSale/templates/HDLKiosk/adapter/{capabilities.js → host/capabilities.js} +2 -2
- package/lib/components/bigSale/templates/HDLKiosk/adapter/{fulfillment.js → host/fulfillmentWriter.js} +3 -3
- package/lib/components/bigSale/templates/HDLKiosk/adapter/{projection.js → host/projection.js} +25 -14
- package/lib/components/bigSale/templates/HDLKiosk/adapter/{telemetry.js → host/telemetry.js} +1 -1
- package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/cart.js +189 -0
- package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/catalog.js +162 -0
- package/lib/components/bigSale/templates/HDLKiosk/adapter/{customizationProduct.js → sales/customizationProduct.js} +4 -4
- package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/fulfillment.js +31 -0
- package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/identity.js +57 -0
- package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/index.js +18 -0
- package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/payment.js +123 -0
- package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/session.js +71 -0
- package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/weightedOperations.js +126 -0
- package/lib/components/bigSale/templates/HDLKiosk/adapter/{weightedProduct.js → sales/weightedProduct.js} +3 -3
- package/lib/components/bigSale/templates/HDLKiosk/adapter/useBigSaleHDLKioskAdapter.js +42 -0
- package/lib/components/bigSale/templates/HDLKiosk/adapter/useBigSaleHDLKioskHost.js +10 -7
- package/lib/components/bigSale/templates/HDLKiosk/cart/useBigSaleHDLKioskCart.js +124 -0
- package/lib/components/bigSale/templates/HDLKiosk/{adapter → hooks}/useHDLKioskEntryPreparationToast.js +2 -1
- package/lib/components/bigSale/templates/HDLKiosk/index.js +43 -149
- package/lib/components/bigSale/templates/HDLKiosk/{adapter/scaleTrigger.js → runtime/BigSaleScaleRuntimeOwner.js} +31 -61
- package/lib/components/bigSale/templates/HDLKiosk/{adapter → runtime}/HDLKioskPaymentRuntime.js +4 -3
- package/lib/components/bigSale/templates/HDLKiosk/runtime/scaleBridge.js +44 -0
- package/package.json +2 -2
- package/es/components/HDLKiosk/app/constants.js +0 -9
- package/es/components/HDLKiosk/app/operations/barcode.js +0 -22
- package/es/components/HDLKiosk/app/operations/cart.js +0 -60
- package/es/components/HDLKiosk/app/operations/fulfillment.js +0 -11
- package/es/components/HDLKiosk/app/operations/session.js +0 -41
- package/es/components/HDLKiosk/app/operations/types.js +0 -11
- package/es/components/HDLKiosk/devices/entryArbiter.js +0 -33
- package/es/components/HDLKiosk/runtime/controllers/useHDLKioskDeviceController.js +0 -75
- package/es/components/HDLKiosk/runtime/controllers/useHDLKioskScannerController.js +0 -160
- package/es/components/HDLKiosk/runtime/controllers/useHDLKioskSessionController.js +0 -185
- package/es/components/HDLKiosk/runtime/useWorkflowSnapshot.js +0 -12
- package/es/components/HDLKiosk/slices/customization/operation.js +0 -80
- package/es/components/HDLKiosk/slices/identity/operation.js +0 -60
- package/es/components/bigSale/templates/HDLKiosk/adapter/sales.js +0 -692
- package/lib/components/HDLKiosk/app/constants.js +0 -9
- package/lib/components/HDLKiosk/app/operations/barcode.js +0 -21
- package/lib/components/HDLKiosk/app/operations/cart.js +0 -62
- package/lib/components/HDLKiosk/app/operations/fulfillment.js +0 -10
- package/lib/components/HDLKiosk/app/operations/session.js +0 -42
- package/lib/components/HDLKiosk/app/operations/types.js +0 -12
- package/lib/components/HDLKiosk/devices/entryArbiter.js +0 -33
- package/lib/components/HDLKiosk/runtime/controllers/useHDLKioskDeviceController.js +0 -76
- package/lib/components/HDLKiosk/runtime/controllers/useHDLKioskScannerController.js +0 -161
- package/lib/components/HDLKiosk/runtime/controllers/useHDLKioskSessionController.js +0 -186
- package/lib/components/HDLKiosk/runtime/useWorkflowSnapshot.js +0 -13
- package/lib/components/HDLKiosk/slices/customization/operation.js +0 -83
- package/lib/components/HDLKiosk/slices/identity/operation.js +0 -60
- package/lib/components/bigSale/templates/HDLKiosk/adapter/sales.js +0 -694
- /package/es/components/HDLKiosk/{app → ui}/entry/Screen/index.less +0 -0
- /package/lib/components/HDLKiosk/{app → ui}/entry/Screen/index.less +0 -0
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
const require_objectSpread2 = require("../../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
|
|
2
|
+
const require_asyncToGenerator = require("../../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js");
|
|
3
|
+
const require_normalize = require("../normalize.js");
|
|
4
|
+
const require_projection = require("../host/projection.js");
|
|
5
|
+
const require_catalog = require("./catalog.js");
|
|
6
|
+
//#region src/components/bigSale/templates/HDLKiosk/adapter/sales/cart.ts
|
|
7
|
+
function cancelled(reason) {
|
|
8
|
+
return {
|
|
9
|
+
status: "cancelled",
|
|
10
|
+
reason
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function findCartLine(context, lineId) {
|
|
14
|
+
var _context$cart$display;
|
|
15
|
+
return ((_context$cart$display = context.cart.displayLines) !== null && _context$cart$display !== void 0 ? _context$cart$display : context.cart.items).find((line) => require_projection.resolveBigSaleLineId(line) === lineId);
|
|
16
|
+
}
|
|
17
|
+
function projectConfirmedMutationLine(product) {
|
|
18
|
+
var _projectBigSaleCartLi;
|
|
19
|
+
return product ? (_projectBigSaleCartLi = require_projection.projectBigSaleCartLine(product)) !== null && _projectBigSaleCartLi !== void 0 ? _projectBigSaleCartLi : void 0 : void 0;
|
|
20
|
+
}
|
|
21
|
+
function projectConfirmedCartLineById(products, lineId) {
|
|
22
|
+
return projectConfirmedMutationLine(products.find((candidate) => require_projection.resolveBigSaleLineId(candidate) === lineId));
|
|
23
|
+
}
|
|
24
|
+
function createBigSaleCartOperations({ getContext, getSnapshot, executeScan }) {
|
|
25
|
+
return {
|
|
26
|
+
consumeBarcode: function() {
|
|
27
|
+
var _ref = require_asyncToGenerator._asyncToGenerator(function* (code, signal) {
|
|
28
|
+
if (signal.aborted) return { status: "cancelled" };
|
|
29
|
+
if (!code.trim()) return require_normalize.failed("barcodeEmpty", "back");
|
|
30
|
+
try {
|
|
31
|
+
var _scanResult$meta$coun, _scanResult$meta;
|
|
32
|
+
const execution = yield executeScan(code);
|
|
33
|
+
if (signal.aborted) return require_normalize.unknown("barcodeAbortedAfterDispatch");
|
|
34
|
+
const scanResult = execution.scanResult;
|
|
35
|
+
if (!scanResult) return require_normalize.failed("barcodeUnavailable", "staff");
|
|
36
|
+
if (scanResult.status === "cancelled") return {
|
|
37
|
+
status: "cancelled",
|
|
38
|
+
reason: scanResult.reason
|
|
39
|
+
};
|
|
40
|
+
if (scanResult.status === "failed") return require_normalize.failed("barcodeNotResolved", "retry");
|
|
41
|
+
return {
|
|
42
|
+
status: "succeeded",
|
|
43
|
+
data: {
|
|
44
|
+
code: scanResult.status === "pending" ? "requiresSelection" : "added",
|
|
45
|
+
cartChangeConfirmed: scanResult.status === "success" && Number((_scanResult$meta$coun = (_scanResult$meta = scanResult.meta) === null || _scanResult$meta === void 0 ? void 0 : _scanResult$meta.count) !== null && _scanResult$meta$coun !== void 0 ? _scanResult$meta$coun : 0) > 0
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
} catch (error) {
|
|
49
|
+
return require_normalize.partialFailure("barcodeDispatchFailed", error);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
return function consumeBarcode(_x, _x2) {
|
|
53
|
+
return _ref.apply(this, arguments);
|
|
54
|
+
};
|
|
55
|
+
}(),
|
|
56
|
+
addProduct: function() {
|
|
57
|
+
var _ref2 = require_asyncToGenerator._asyncToGenerator(function* (input, signal) {
|
|
58
|
+
if (signal.aborted) return { status: "cancelled" };
|
|
59
|
+
const productId = Number(input.productId);
|
|
60
|
+
const quantity = Number(input.quantity);
|
|
61
|
+
if (!Number.isFinite(productId) || !Number.isFinite(quantity) || quantity <= 0) return require_normalize.failed("productInputInvalid", "back");
|
|
62
|
+
try {
|
|
63
|
+
const context = getContext();
|
|
64
|
+
const product = require_catalog.findCatalogProduct(context, String(productId));
|
|
65
|
+
if (!product) return require_normalize.failed("productNotFound", "back");
|
|
66
|
+
const result = yield context.cart.addProductWithFlow(product, {
|
|
67
|
+
quantity,
|
|
68
|
+
notShowToast: true
|
|
69
|
+
});
|
|
70
|
+
if (signal.aborted) return require_normalize.unknown("addProductAbortedAfterDispatch");
|
|
71
|
+
if (result.status === "cancelled") return cancelled("userCancelled");
|
|
72
|
+
if (result.status !== "added") return require_normalize.failed("productRequiresUnsupportedSelection", "back");
|
|
73
|
+
const confirmedLine = projectConfirmedMutationLine([...Array.isArray(result.products) ? result.products : []].reverse().find((candidate) => {
|
|
74
|
+
var _candidate$product_id;
|
|
75
|
+
return String((_candidate$product_id = candidate.product_id) !== null && _candidate$product_id !== void 0 ? _candidate$product_id : "") === input.productId;
|
|
76
|
+
}));
|
|
77
|
+
return {
|
|
78
|
+
status: "succeeded",
|
|
79
|
+
data: confirmedLine ? {
|
|
80
|
+
affectedLineId: confirmedLine.lineId,
|
|
81
|
+
confirmedLine
|
|
82
|
+
} : {}
|
|
83
|
+
};
|
|
84
|
+
} catch (error) {
|
|
85
|
+
return require_normalize.partialFailure("addProductFailed", error);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
return function addProduct(_x3, _x4) {
|
|
89
|
+
return _ref2.apply(this, arguments);
|
|
90
|
+
};
|
|
91
|
+
}(),
|
|
92
|
+
updateQuantity: function() {
|
|
93
|
+
var _ref3 = require_asyncToGenerator._asyncToGenerator(function* (input, signal) {
|
|
94
|
+
if (signal.aborted) return { status: "cancelled" };
|
|
95
|
+
const quantity = Number(input.quantity);
|
|
96
|
+
if (!Number.isFinite(quantity) || quantity <= 0) return require_normalize.failed("quantityInvalid", "back");
|
|
97
|
+
const context = getContext();
|
|
98
|
+
const line = findCartLine(context, input.lineId);
|
|
99
|
+
if (!line) return require_normalize.failed("cartLineNotFound", "back");
|
|
100
|
+
try {
|
|
101
|
+
const updatedProducts = yield context.cart.updateItemQuantity(line, quantity);
|
|
102
|
+
if (signal.aborted) return require_normalize.unknown("updateQuantityAbortedAfterDispatch");
|
|
103
|
+
const confirmedLine = projectConfirmedCartLineById(Array.isArray(updatedProducts) ? updatedProducts : [], input.lineId);
|
|
104
|
+
return {
|
|
105
|
+
status: "succeeded",
|
|
106
|
+
data: require_objectSpread2._objectSpread2({ affectedLineId: input.lineId }, confirmedLine ? { confirmedLine } : {})
|
|
107
|
+
};
|
|
108
|
+
} catch (error) {
|
|
109
|
+
return require_normalize.partialFailure("updateQuantityFailed", error);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
return function updateQuantity(_x5, _x6) {
|
|
113
|
+
return _ref3.apply(this, arguments);
|
|
114
|
+
};
|
|
115
|
+
}(),
|
|
116
|
+
removeLine: function() {
|
|
117
|
+
var _ref4 = require_asyncToGenerator._asyncToGenerator(function* (input, signal) {
|
|
118
|
+
if (signal.aborted) return { status: "cancelled" };
|
|
119
|
+
const context = getContext();
|
|
120
|
+
const line = findCartLine(context, input.lineId);
|
|
121
|
+
if (!line) return require_normalize.failed("cartLineNotFound", "back");
|
|
122
|
+
try {
|
|
123
|
+
const remainingProducts = yield context.cart.removeItem(line);
|
|
124
|
+
if (signal.aborted) return require_normalize.unknown("removeLineAbortedAfterDispatch");
|
|
125
|
+
return {
|
|
126
|
+
status: "succeeded",
|
|
127
|
+
data: require_objectSpread2._objectSpread2({ affectedLineId: input.lineId }, Array.isArray(remainingProducts) && !remainingProducts.some((candidate) => require_projection.resolveBigSaleLineId(candidate) === input.lineId) ? { removedLineId: input.lineId } : {})
|
|
128
|
+
};
|
|
129
|
+
} catch (error) {
|
|
130
|
+
return require_normalize.partialFailure("removeLineFailed", error);
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
return function removeLine(_x7, _x8) {
|
|
134
|
+
return _ref4.apply(this, arguments);
|
|
135
|
+
};
|
|
136
|
+
}(),
|
|
137
|
+
waitForCartConsistency: function() {
|
|
138
|
+
var _ref5 = require_asyncToGenerator._asyncToGenerator(function* (signal) {
|
|
139
|
+
if (signal.aborted) return { status: "cancelled" };
|
|
140
|
+
try {
|
|
141
|
+
yield getContext().cart.waitForCartConsistency();
|
|
142
|
+
if (signal.aborted) return require_normalize.unknown("consistencyAbortedAfterWait");
|
|
143
|
+
return {
|
|
144
|
+
status: "succeeded",
|
|
145
|
+
data: { observationId: getSnapshot().observationId }
|
|
146
|
+
};
|
|
147
|
+
} catch (error) {
|
|
148
|
+
return require_normalize.failed("cartConsistencyFailed", "retry", error);
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
return function waitForCartConsistency(_x9) {
|
|
152
|
+
return _ref5.apply(this, arguments);
|
|
153
|
+
};
|
|
154
|
+
}(),
|
|
155
|
+
recalculateSummary: function() {
|
|
156
|
+
var _ref6 = require_asyncToGenerator._asyncToGenerator(function* (signal) {
|
|
157
|
+
if (signal.aborted) return { status: "cancelled" };
|
|
158
|
+
try {
|
|
159
|
+
var _getContext$sales$tem, _getContext$sales$tem2, _getContext$sales$tem3, _getContext$sales$tem4;
|
|
160
|
+
const summary = yield getContext().cart.recalcSummary();
|
|
161
|
+
if (signal.aborted) return require_normalize.unknown("summaryAbortedAfterDispatch");
|
|
162
|
+
if (!summary) return require_normalize.failed("summaryMissing", "retry");
|
|
163
|
+
return {
|
|
164
|
+
status: "succeeded",
|
|
165
|
+
data: {
|
|
166
|
+
observationId: getSnapshot().observationId,
|
|
167
|
+
confirmedSummary: {
|
|
168
|
+
status: "ready",
|
|
169
|
+
currency: String((_getContext$sales$tem = (_getContext$sales$tem2 = getContext().sales.tempOrder) === null || _getContext$sales$tem2 === void 0 ? void 0 : _getContext$sales$tem2.currency_code) !== null && _getContext$sales$tem !== void 0 ? _getContext$sales$tem : ""),
|
|
170
|
+
currencySymbol: String((_getContext$sales$tem3 = (_getContext$sales$tem4 = getContext().sales.tempOrder) === null || _getContext$sales$tem4 === void 0 ? void 0 : _getContext$sales$tem4.currency_symbol) !== null && _getContext$sales$tem3 !== void 0 ? _getContext$sales$tem3 : ""),
|
|
171
|
+
total: String(summary.total_amount),
|
|
172
|
+
due: String(summary.expect_amount)
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
} catch (error) {
|
|
177
|
+
return require_normalize.failed("summaryRecalculationFailed", "retry", error);
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
return function recalculateSummary(_x10) {
|
|
181
|
+
return _ref6.apply(this, arguments);
|
|
182
|
+
};
|
|
183
|
+
}()
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
//#endregion
|
|
187
|
+
exports.createBigSaleCartOperations = createBigSaleCartOperations;
|
|
188
|
+
exports.findCartLine = findCartLine;
|
|
189
|
+
exports.projectConfirmedMutationLine = projectConfirmedMutationLine;
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
const require_objectSpread2 = require("../../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
|
|
2
|
+
const require_asyncToGenerator = require("../../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js");
|
|
3
|
+
const require_pricePresentation = require("../../../../../../plus/productSelect/pricing/pricePresentation.js");
|
|
4
|
+
const require_normalize = require("../normalize.js");
|
|
5
|
+
//#region src/components/bigSale/templates/HDLKiosk/adapter/sales/catalog.ts
|
|
6
|
+
function findCatalogProduct(context, productId) {
|
|
7
|
+
return context.products.products.find((product) => String(product.id) === productId);
|
|
8
|
+
}
|
|
9
|
+
function resolveProductQuery(context) {
|
|
10
|
+
var _bookingTicket$store;
|
|
11
|
+
if (typeof context.products.queryProducts === "function") return function() {
|
|
12
|
+
var _ref = require_asyncToGenerator._asyncToGenerator(function* (params) {
|
|
13
|
+
return (yield context.products.queryProducts.call(context.products, params)) || [];
|
|
14
|
+
});
|
|
15
|
+
return function(_x) {
|
|
16
|
+
return _ref.apply(this, arguments);
|
|
17
|
+
};
|
|
18
|
+
}();
|
|
19
|
+
const bookingTicket = context.sales.bookingTicket;
|
|
20
|
+
if (typeof (bookingTicket === null || bookingTicket === void 0 ? void 0 : bookingTicket.queryProducts) === "function") return function() {
|
|
21
|
+
var _ref2 = require_asyncToGenerator._asyncToGenerator(function* (params) {
|
|
22
|
+
return (yield bookingTicket.queryProducts(params)) || [];
|
|
23
|
+
});
|
|
24
|
+
return function(_x2) {
|
|
25
|
+
return _ref2.apply(this, arguments);
|
|
26
|
+
};
|
|
27
|
+
}();
|
|
28
|
+
const productListStore = bookingTicket === null || bookingTicket === void 0 || (_bookingTicket$store = bookingTicket.store) === null || _bookingTicket$store === void 0 ? void 0 : _bookingTicket$store.products;
|
|
29
|
+
if (typeof (productListStore === null || productListStore === void 0 ? void 0 : productListStore.queryProducts) === "function") return function() {
|
|
30
|
+
var _ref3 = require_asyncToGenerator._asyncToGenerator(function* (params) {
|
|
31
|
+
return (yield productListStore.queryProducts.call(productListStore, params)) || [];
|
|
32
|
+
});
|
|
33
|
+
return function(_x3) {
|
|
34
|
+
return _ref3.apply(this, arguments);
|
|
35
|
+
};
|
|
36
|
+
}();
|
|
37
|
+
}
|
|
38
|
+
function queryPrimaryProduct(_x4, _x5, _x6) {
|
|
39
|
+
return _queryPrimaryProduct.apply(this, arguments);
|
|
40
|
+
}
|
|
41
|
+
function _queryPrimaryProduct() {
|
|
42
|
+
_queryPrimaryProduct = require_asyncToGenerator._asyncToGenerator(function* (context, productId, signal) {
|
|
43
|
+
if (signal.aborted) return { status: "cancelled" };
|
|
44
|
+
const queryProducts = resolveProductQuery(context);
|
|
45
|
+
if (!queryProducts) return require_normalize.failed("primaryProductQueryUnavailable", "staff");
|
|
46
|
+
try {
|
|
47
|
+
let products = yield queryProducts({ includeIds: [productId] });
|
|
48
|
+
if (signal.aborted) return { status: "cancelled" };
|
|
49
|
+
let product = products.find((candidate) => String(candidate.id) === productId);
|
|
50
|
+
const numericProductId = Number(productId);
|
|
51
|
+
if (!product && Number.isSafeInteger(numericProductId) && numericProductId > 0 && typeof context.products.findByIds === "function") {
|
|
52
|
+
yield context.products.findByIds([numericProductId], {
|
|
53
|
+
loadMissing: true,
|
|
54
|
+
refreshCatalog: false
|
|
55
|
+
});
|
|
56
|
+
if (signal.aborted) return { status: "cancelled" };
|
|
57
|
+
products = yield queryProducts({ includeIds: [productId] });
|
|
58
|
+
if (signal.aborted) return { status: "cancelled" };
|
|
59
|
+
product = products.find((candidate) => String(candidate.id) === productId);
|
|
60
|
+
}
|
|
61
|
+
return product ? {
|
|
62
|
+
status: "succeeded",
|
|
63
|
+
data: product
|
|
64
|
+
} : require_normalize.failed("primaryProductNotFound", "staff");
|
|
65
|
+
} catch (error) {
|
|
66
|
+
return require_normalize.partialFailure("primaryProductQueryFailed", error);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
return _queryPrimaryProduct.apply(this, arguments);
|
|
70
|
+
}
|
|
71
|
+
function readProductName(product) {
|
|
72
|
+
const rawName = product.title;
|
|
73
|
+
if (typeof rawName === "string") return rawName || void 0;
|
|
74
|
+
if (!rawName || typeof rawName !== "object") return void 0;
|
|
75
|
+
return Object.values(rawName).find((value) => typeof value === "string" && value.length > 0);
|
|
76
|
+
}
|
|
77
|
+
function readLocalizedText(value) {
|
|
78
|
+
if (typeof value === "string") return value || void 0;
|
|
79
|
+
if (!value || typeof value !== "object") return void 0;
|
|
80
|
+
return Object.values(value).find((item) => typeof item === "string" && item.length > 0);
|
|
81
|
+
}
|
|
82
|
+
function projectProductCategories(product) {
|
|
83
|
+
const directCategories = Array.isArray(product.category) ? product.category : [];
|
|
84
|
+
const categories = /* @__PURE__ */ new Map();
|
|
85
|
+
const visit = (category, direct) => {
|
|
86
|
+
var _category$name, _ref4, _category$parent_id;
|
|
87
|
+
if (!category || category.id === void 0 || category.id === null) return;
|
|
88
|
+
const parent = category.parent_category;
|
|
89
|
+
visit(parent, false);
|
|
90
|
+
const categoryId = String(category.id);
|
|
91
|
+
const name = readLocalizedText((_category$name = category.name) !== null && _category$name !== void 0 ? _category$name : category.title);
|
|
92
|
+
if (!name) return;
|
|
93
|
+
const parentId = (_ref4 = (_category$parent_id = category.parent_id) !== null && _category$parent_id !== void 0 ? _category$parent_id : parent === null || parent === void 0 ? void 0 : parent.id) !== null && _ref4 !== void 0 ? _ref4 : void 0;
|
|
94
|
+
const previous = categories.get(categoryId);
|
|
95
|
+
categories.set(categoryId, Object.freeze({
|
|
96
|
+
categoryId,
|
|
97
|
+
name,
|
|
98
|
+
parentId: parentId === void 0 || parentId === null || parentId === 0 ? void 0 : String(parentId),
|
|
99
|
+
sort: Number.isFinite(Number(category.sort)) ? Number(category.sort) : void 0,
|
|
100
|
+
direct: direct || (previous === null || previous === void 0 ? void 0 : previous.direct) === true
|
|
101
|
+
}));
|
|
102
|
+
};
|
|
103
|
+
directCategories.forEach((category) => visit(category, true));
|
|
104
|
+
return Object.freeze(Array.from(categories.values()));
|
|
105
|
+
}
|
|
106
|
+
function projectCatalogProduct(product, currency, currencySymbol) {
|
|
107
|
+
var _ref5, _ref6, _product$price, _product$variants, _product$variants2;
|
|
108
|
+
const name = readProductName(product);
|
|
109
|
+
if (!name) return void 0;
|
|
110
|
+
const rawPrice = (_ref5 = (_ref6 = (_product$price = product.price) !== null && _product$price !== void 0 ? _product$price : product.selling_price) !== null && _ref6 !== void 0 ? _ref6 : (_product$variants = product.variants) === null || _product$variants === void 0 || (_product$variants = _product$variants[0]) === null || _product$variants === void 0 ? void 0 : _product$variants.selling_price) !== null && _ref5 !== void 0 ? _ref5 : (_product$variants2 = product.variants) === null || _product$variants2 === void 0 || (_product$variants2 = _product$variants2[0]) === null || _product$variants2 === void 0 ? void 0 : _product$variants2.price;
|
|
111
|
+
const pricePresentation = require_pricePresentation.resolveProductPricePresentation(product, rawPrice === void 0 || rawPrice === null ? void 0 : { price: rawPrice });
|
|
112
|
+
const categories = projectProductCategories(product);
|
|
113
|
+
return Object.freeze(require_objectSpread2._objectSpread2({
|
|
114
|
+
productId: String(product.id),
|
|
115
|
+
name,
|
|
116
|
+
imageUrl: product.cover || void 0,
|
|
117
|
+
currency: currency || void 0,
|
|
118
|
+
currencySymbol: currencySymbol || void 0,
|
|
119
|
+
pricePresentation: pricePresentation ? Object.freeze({
|
|
120
|
+
amount: String(pricePresentation.amount),
|
|
121
|
+
originalAmount: pricePresentation.originalAmount === void 0 ? void 0 : String(pricePresentation.originalAmount),
|
|
122
|
+
qualifier: pricePresentation.qualifier,
|
|
123
|
+
unit: pricePresentation.unit,
|
|
124
|
+
precision: pricePresentation.precision
|
|
125
|
+
}) : void 0,
|
|
126
|
+
available: product.status !== "disabled" && product.status !== "sold_out" && product.is_sold_out !== true
|
|
127
|
+
}, categories.length ? { categories } : {}));
|
|
128
|
+
}
|
|
129
|
+
function createBigSaleCatalogOperations({ getContext }) {
|
|
130
|
+
return {
|
|
131
|
+
getCatalogSnapshot: () => {
|
|
132
|
+
var _context$sales$tempOr, _context$sales$tempOr2, _context$sales$tempOr3, _context$sales$tempOr4;
|
|
133
|
+
const context = getContext();
|
|
134
|
+
const currency = String((_context$sales$tempOr = (_context$sales$tempOr2 = context.sales.tempOrder) === null || _context$sales$tempOr2 === void 0 ? void 0 : _context$sales$tempOr2.currency_code) !== null && _context$sales$tempOr !== void 0 ? _context$sales$tempOr : "");
|
|
135
|
+
const currencySymbol = String((_context$sales$tempOr3 = (_context$sales$tempOr4 = context.sales.tempOrder) === null || _context$sales$tempOr4 === void 0 ? void 0 : _context$sales$tempOr4.currency_symbol) !== null && _context$sales$tempOr3 !== void 0 ? _context$sales$tempOr3 : "");
|
|
136
|
+
const products = context.products.products.map((product) => projectCatalogProduct(product, currency, currencySymbol)).filter((product) => product !== void 0);
|
|
137
|
+
return Object.freeze({
|
|
138
|
+
status: context.products.error ? "error" : context.products.loading || context.sales.catalogState === "pending" ? "loading" : "ready",
|
|
139
|
+
products: Object.freeze(products)
|
|
140
|
+
});
|
|
141
|
+
},
|
|
142
|
+
loadPrimaryProduct: function() {
|
|
143
|
+
var _ref7 = require_asyncToGenerator._asyncToGenerator(function* (rawProductId, signal) {
|
|
144
|
+
if (signal.aborted) return { status: "cancelled" };
|
|
145
|
+
const productId = Number(rawProductId);
|
|
146
|
+
if (!Number.isFinite(productId)) return require_normalize.failed("primaryProductIdInvalid", "staff");
|
|
147
|
+
try {
|
|
148
|
+
return yield queryPrimaryProduct(getContext(), String(productId), signal);
|
|
149
|
+
} catch (error) {
|
|
150
|
+
return require_normalize.partialFailure("primaryProductLoadFailed", error);
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
return function loadPrimaryProduct(_x7, _x8) {
|
|
154
|
+
return _ref7.apply(this, arguments);
|
|
155
|
+
};
|
|
156
|
+
}()
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
//#endregion
|
|
160
|
+
exports.createBigSaleCatalogOperations = createBigSaleCatalogOperations;
|
|
161
|
+
exports.findCatalogProduct = findCatalogProduct;
|
|
162
|
+
exports.queryPrimaryProduct = queryPrimaryProduct;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const require_runtime = require("
|
|
2
|
-
const require_objectSpread2 = require("
|
|
3
|
-
const require_validateSkuValue = require("
|
|
1
|
+
const require_runtime = require("../../../../../../_virtual/_rolldown/runtime.js");
|
|
2
|
+
const require_objectSpread2 = require("../../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
|
|
3
|
+
const require_validateSkuValue = require("../../../../../../plus/skuOptionsSelection/utils/validateSkuValue.js");
|
|
4
4
|
const require_weightedProduct = require("./weightedProduct.js");
|
|
5
5
|
let decimal_js = require("decimal.js");
|
|
6
6
|
decimal_js = require_runtime.__toESM(decimal_js);
|
|
7
|
-
//#region src/components/bigSale/templates/HDLKiosk/adapter/customizationProduct.ts
|
|
7
|
+
//#region src/components/bigSale/templates/HDLKiosk/adapter/sales/customizationProduct.ts
|
|
8
8
|
/**
|
|
9
9
|
* 文件角色:将 HDLKiosk 选中结果写入 OS 标准称重商品。
|
|
10
10
|
* 运行机制:提交时按 SKUOptionsSelection 的标准 ProductData 约束校验 SkuValue,并将
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const require_asyncToGenerator = require("../../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js");
|
|
2
|
+
const require_normalize = require("../normalize.js");
|
|
3
|
+
//#region src/components/bigSale/templates/HDLKiosk/adapter/sales/fulfillment.ts
|
|
4
|
+
function createBigSaleFulfillmentOperations({ writeFulfillment, getWriteFulfillment, allowSimulatedFulfillment = false, onSimulatedFulfillment }) {
|
|
5
|
+
return { setFulfillment: function() {
|
|
6
|
+
var _ref = require_asyncToGenerator._asyncToGenerator(function* (input, signal) {
|
|
7
|
+
if (signal.aborted) return { status: "cancelled" };
|
|
8
|
+
const currentWriteFulfillment = getWriteFulfillment ? getWriteFulfillment() : writeFulfillment;
|
|
9
|
+
if (!currentWriteFulfillment) {
|
|
10
|
+
if (allowSimulatedFulfillment) {
|
|
11
|
+
onSimulatedFulfillment === null || onSimulatedFulfillment === void 0 || onSimulatedFulfillment(input);
|
|
12
|
+
return {
|
|
13
|
+
status: "succeeded",
|
|
14
|
+
data: void 0
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
return require_normalize.failed("fulfillmentHostWriterUnavailable", "staff");
|
|
18
|
+
}
|
|
19
|
+
try {
|
|
20
|
+
return yield currentWriteFulfillment(input, signal);
|
|
21
|
+
} catch (error) {
|
|
22
|
+
return require_normalize.partialFailure("fulfillmentWriteFailed", error);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
return function setFulfillment(_x, _x2) {
|
|
26
|
+
return _ref.apply(this, arguments);
|
|
27
|
+
};
|
|
28
|
+
}() };
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
exports.createBigSaleFulfillmentOperations = createBigSaleFulfillmentOperations;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
const require_objectSpread2 = require("../../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
|
|
2
|
+
const require_asyncToGenerator = require("../../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js");
|
|
3
|
+
const require_normalize = require("../normalize.js");
|
|
4
|
+
//#region src/components/bigSale/templates/HDLKiosk/adapter/sales/identity.ts
|
|
5
|
+
function projectConfirmedCustomer(customer) {
|
|
6
|
+
var _customer$id;
|
|
7
|
+
if (!customer || [
|
|
8
|
+
"0",
|
|
9
|
+
"1",
|
|
10
|
+
""
|
|
11
|
+
].includes(String((_customer$id = customer.id) !== null && _customer$id !== void 0 ? _customer$id : ""))) return;
|
|
12
|
+
return Object.freeze(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({
|
|
13
|
+
customerId: String(customer.id),
|
|
14
|
+
displayName: typeof customer.name === "string" ? customer.name : void 0
|
|
15
|
+
}, typeof customer.avatar === "string" && customer.avatar.trim() ? { avatarUrl: customer.avatar.trim() } : {}), {}, { member: true }));
|
|
16
|
+
}
|
|
17
|
+
function createBigSaleIdentityOperations({ getContext, getAuthenticatedCustomer }) {
|
|
18
|
+
return { selectIdentity: function() {
|
|
19
|
+
var _ref = require_asyncToGenerator._asyncToGenerator(function* (input, signal) {
|
|
20
|
+
if (signal.aborted) return { status: "cancelled" };
|
|
21
|
+
try {
|
|
22
|
+
var _input$customerId, _currentCustomer$id, _selected$id;
|
|
23
|
+
const context = getContext();
|
|
24
|
+
const customerId = (_input$customerId = input.customerId) === null || _input$customerId === void 0 ? void 0 : _input$customerId.trim();
|
|
25
|
+
if (!customerId) {
|
|
26
|
+
context.customer.select(null);
|
|
27
|
+
if (signal.aborted) return require_normalize.unknown("identityAbortedAfterDispatch");
|
|
28
|
+
return {
|
|
29
|
+
status: "succeeded",
|
|
30
|
+
data: {}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const authenticatedCustomer = getAuthenticatedCustomer === null || getAuthenticatedCustomer === void 0 ? void 0 : getAuthenticatedCustomer(customerId);
|
|
34
|
+
const currentCustomer = context.customer.selected;
|
|
35
|
+
const selected = authenticatedCustomer !== null && authenticatedCustomer !== void 0 ? authenticatedCustomer : String((_currentCustomer$id = currentCustomer === null || currentCustomer === void 0 ? void 0 : currentCustomer.id) !== null && _currentCustomer$id !== void 0 ? _currentCustomer$id : "") === customerId ? currentCustomer : void 0;
|
|
36
|
+
if (!selected || String(selected.id) !== customerId || [
|
|
37
|
+
"0",
|
|
38
|
+
"1",
|
|
39
|
+
""
|
|
40
|
+
].includes(String((_selected$id = selected.id) !== null && _selected$id !== void 0 ? _selected$id : ""))) return require_normalize.failed("authenticatedCustomerUnavailable", "back");
|
|
41
|
+
context.customer.select(selected);
|
|
42
|
+
if (signal.aborted) return require_normalize.unknown("identityAbortedAfterDispatch");
|
|
43
|
+
return {
|
|
44
|
+
status: "succeeded",
|
|
45
|
+
data: { customer: projectConfirmedCustomer(selected) }
|
|
46
|
+
};
|
|
47
|
+
} catch (error) {
|
|
48
|
+
return require_normalize.partialFailure("identitySelectionFailed", error);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
return function selectIdentity(_x, _x2) {
|
|
52
|
+
return _ref.apply(this, arguments);
|
|
53
|
+
};
|
|
54
|
+
}() };
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
exports.createBigSaleIdentityOperations = createBigSaleIdentityOperations;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const require_objectSpread2 = require("../../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
|
|
2
|
+
const require_catalog = require("./catalog.js");
|
|
3
|
+
const require_cart = require("./cart.js");
|
|
4
|
+
const require_fulfillment = require("./fulfillment.js");
|
|
5
|
+
const require_identity = require("./identity.js");
|
|
6
|
+
const require_payment = require("./payment.js");
|
|
7
|
+
const require_session = require("./session.js");
|
|
8
|
+
const require_weightedOperations = require("./weightedOperations.js");
|
|
9
|
+
//#region src/components/bigSale/templates/HDLKiosk/adapter/sales/index.ts
|
|
10
|
+
function createBigSaleSalesPort(dependencies) {
|
|
11
|
+
const { getContext, getSnapshot, subscribeProjection } = dependencies;
|
|
12
|
+
return require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({ getObservedSnapshot: getSnapshot }, require_catalog.createBigSaleCatalogOperations({ getContext })), {}, { subscribe: (listener) => {
|
|
13
|
+
var _subscribeProjection;
|
|
14
|
+
return (_subscribeProjection = subscribeProjection === null || subscribeProjection === void 0 ? void 0 : subscribeProjection(listener)) !== null && _subscribeProjection !== void 0 ? _subscribeProjection : (() => void 0);
|
|
15
|
+
} }, require_session.createBigSaleSessionOperations({ getContext })), require_identity.createBigSaleIdentityOperations(dependencies)), require_fulfillment.createBigSaleFulfillmentOperations(dependencies)), require_weightedOperations.createBigSaleWeightedProductOperations({ getContext })), require_cart.createBigSaleCartOperations(dependencies)), require_payment.createBigSalePaymentOperations(dependencies));
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
exports.createBigSaleSalesPort = createBigSaleSalesPort;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
const require_asyncToGenerator = require("../../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js");
|
|
2
|
+
const require_normalize = require("../normalize.js");
|
|
3
|
+
//#region src/components/bigSale/templates/HDLKiosk/adapter/sales/payment.ts
|
|
4
|
+
function cancelled(reason) {
|
|
5
|
+
return {
|
|
6
|
+
status: "cancelled",
|
|
7
|
+
reason
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
function normalizeCheckoutResult(result, snapshot) {
|
|
11
|
+
var _readPath, _result$orderId, _snapshot$orderId, _snapshot$customer;
|
|
12
|
+
const status = require_normalize.isRecord(result) ? result.status : void 0;
|
|
13
|
+
const reason = require_normalize.isRecord(result) ? result.reason : void 0;
|
|
14
|
+
const type = require_normalize.isRecord(result) ? result.type : void 0;
|
|
15
|
+
if (status === "cancelled" || reason === "back" || reason === "cancel") return {
|
|
16
|
+
status: "cancelled",
|
|
17
|
+
reason: String(reason !== null && reason !== void 0 ? reason : "cancelled")
|
|
18
|
+
};
|
|
19
|
+
const paymentStatus = (_readPath = require_normalize.readPath(result, [
|
|
20
|
+
"payload",
|
|
21
|
+
"paymentResult",
|
|
22
|
+
"paymentResultViewModel",
|
|
23
|
+
"status"
|
|
24
|
+
])) !== null && _readPath !== void 0 ? _readPath : require_normalize.readPath(result, [
|
|
25
|
+
"data",
|
|
26
|
+
"paymentResult",
|
|
27
|
+
"paymentResultViewModel",
|
|
28
|
+
"status"
|
|
29
|
+
]);
|
|
30
|
+
if (paymentStatus === "failed" || paymentStatus === "wallet-pass-failed") return require_normalize.failed("checkoutFailed", "retry");
|
|
31
|
+
if (type === "error" || status === "failed") return require_normalize.failed("checkoutFailed", "retry");
|
|
32
|
+
if (!(paymentStatus === "success" || paymentStatus === "paid" || paymentStatus === "deposit-paid" || status === "success" || status === "paid")) return require_normalize.unknown("checkoutResultAmbiguous");
|
|
33
|
+
const resultOrderId = require_normalize.isRecord(result) && ((_result$orderId = result.orderId) !== null && _result$orderId !== void 0 ? _result$orderId : result.order_id) || require_normalize.readPath(result, ["payload", "order_id"]) || require_normalize.readPath(result, ["payload", "orderId"]);
|
|
34
|
+
const orderId = (_snapshot$orderId = snapshot.orderId) !== null && _snapshot$orderId !== void 0 ? _snapshot$orderId : resultOrderId;
|
|
35
|
+
if (!orderId || snapshot.summary.status !== "ready") return require_normalize.unknown("checkoutSuccessMissingOrderFacts");
|
|
36
|
+
return {
|
|
37
|
+
status: "succeeded",
|
|
38
|
+
data: {
|
|
39
|
+
orderId: String(orderId),
|
|
40
|
+
amount: snapshot.summary.due,
|
|
41
|
+
member: ((_snapshot$customer = snapshot.customer) === null || _snapshot$customer === void 0 ? void 0 : _snapshot$customer.member) === true
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function refreshCheckoutOrderProjection(_x, _x2, _x3) {
|
|
46
|
+
return _refreshCheckoutOrderProjection.apply(this, arguments);
|
|
47
|
+
}
|
|
48
|
+
function _refreshCheckoutOrderProjection() {
|
|
49
|
+
_refreshCheckoutOrderProjection = require_asyncToGenerator._asyncToGenerator(function* (getContext, getSnapshot, result) {
|
|
50
|
+
if (result.status !== "succeeded" || getSnapshot().pickupNumber) return;
|
|
51
|
+
const loadDetail = getContext().sales.loadDetail;
|
|
52
|
+
if (typeof loadDetail !== "function") return;
|
|
53
|
+
try {
|
|
54
|
+
yield loadDetail({
|
|
55
|
+
orderId: result.data.orderId,
|
|
56
|
+
forceRemote: true
|
|
57
|
+
});
|
|
58
|
+
} catch (_unused) {}
|
|
59
|
+
});
|
|
60
|
+
return _refreshCheckoutOrderProjection.apply(this, arguments);
|
|
61
|
+
}
|
|
62
|
+
function createBigSalePaymentOperations({ getContext, getSnapshot, getPaymentController }) {
|
|
63
|
+
return {
|
|
64
|
+
loadPaymentMethods: function() {
|
|
65
|
+
var _ref = require_asyncToGenerator._asyncToGenerator(function* (signal) {
|
|
66
|
+
if (signal.aborted) return cancelled("paymentMethodsAborted");
|
|
67
|
+
const controller = getPaymentController === null || getPaymentController === void 0 ? void 0 : getPaymentController();
|
|
68
|
+
return controller ? controller.loadPaymentMethods() : require_normalize.failed("paymentRuntimeUnavailable", "staff");
|
|
69
|
+
});
|
|
70
|
+
return function loadPaymentMethods(_x4) {
|
|
71
|
+
return _ref.apply(this, arguments);
|
|
72
|
+
};
|
|
73
|
+
}(),
|
|
74
|
+
payEftpos: function() {
|
|
75
|
+
var _ref2 = require_asyncToGenerator._asyncToGenerator(function* (input, signal) {
|
|
76
|
+
if (signal.aborted) return cancelled("eftposAborted");
|
|
77
|
+
const controller = getPaymentController === null || getPaymentController === void 0 ? void 0 : getPaymentController();
|
|
78
|
+
return controller ? controller.payEftpos(input) : require_normalize.failed("paymentRuntimeUnavailable", "staff");
|
|
79
|
+
});
|
|
80
|
+
return function payEftpos(_x5, _x6) {
|
|
81
|
+
return _ref2.apply(this, arguments);
|
|
82
|
+
};
|
|
83
|
+
}(),
|
|
84
|
+
requestStaffPaymentApproval: function() {
|
|
85
|
+
var _ref3 = require_asyncToGenerator._asyncToGenerator(function* (input, signal) {
|
|
86
|
+
if (signal.aborted) return cancelled("staffPaymentApprovalAborted");
|
|
87
|
+
const controller = getPaymentController === null || getPaymentController === void 0 ? void 0 : getPaymentController();
|
|
88
|
+
return controller ? controller.requestStaffPaymentApproval(input) : require_normalize.failed("paymentRuntimeUnavailable", "staff");
|
|
89
|
+
});
|
|
90
|
+
return function requestStaffPaymentApproval(_x7, _x8) {
|
|
91
|
+
return _ref3.apply(this, arguments);
|
|
92
|
+
};
|
|
93
|
+
}(),
|
|
94
|
+
subscribeStaffPaymentAuthorizationResult: (listener) => {
|
|
95
|
+
var _controller$subscribe;
|
|
96
|
+
const controller = getPaymentController === null || getPaymentController === void 0 ? void 0 : getPaymentController();
|
|
97
|
+
return (_controller$subscribe = controller === null || controller === void 0 ? void 0 : controller.subscribeStaffPaymentAuthorizationResult(listener)) !== null && _controller$subscribe !== void 0 ? _controller$subscribe : (() => void 0);
|
|
98
|
+
},
|
|
99
|
+
openCheckout: function() {
|
|
100
|
+
var _ref4 = require_asyncToGenerator._asyncToGenerator(function* (signal) {
|
|
101
|
+
if (signal.aborted) return { status: "cancelled" };
|
|
102
|
+
try {
|
|
103
|
+
const snapshotBeforeCheckout = getSnapshot();
|
|
104
|
+
const result = yield getContext().sales.openCheckout({
|
|
105
|
+
paymentResultDisplayMode: "page",
|
|
106
|
+
walletPassMode: "shared"
|
|
107
|
+
});
|
|
108
|
+
if (signal.aborted) return require_normalize.unknown("checkoutAbortedAfterDispatch");
|
|
109
|
+
const checkoutResult = normalizeCheckoutResult(result, snapshotBeforeCheckout);
|
|
110
|
+
yield refreshCheckoutOrderProjection(getContext, getSnapshot, checkoutResult);
|
|
111
|
+
return checkoutResult;
|
|
112
|
+
} catch (error) {
|
|
113
|
+
return require_normalize.unknown("checkoutInvocationFailed", error);
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
return function openCheckout(_x9) {
|
|
117
|
+
return _ref4.apply(this, arguments);
|
|
118
|
+
};
|
|
119
|
+
}()
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
//#endregion
|
|
123
|
+
exports.createBigSalePaymentOperations = createBigSalePaymentOperations;
|