@pisell/pisellos 2.3.172 → 2.3.174

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.
Files changed (83) hide show
  1. package/dist/index.d.ts +0 -1
  2. package/dist/index.js +0 -1
  3. package/dist/model/strategy/adapter/promotion/evaluator.d.ts +2 -1
  4. package/dist/model/strategy/adapter/promotion/evaluator.js +14 -8
  5. package/dist/modules/BookingContext/utils/productExtend.d.ts +5 -0
  6. package/dist/modules/BookingContext/utils/productExtend.js +61 -23
  7. package/dist/modules/Discount/index.js +0 -1
  8. package/dist/modules/OpenData/index.d.ts +1 -0
  9. package/dist/modules/OpenData/index.js +1 -0
  10. package/dist/modules/OpenData/salesSettings.d.ts +32 -0
  11. package/dist/modules/OpenData/salesSettings.js +80 -0
  12. package/dist/modules/OpenData/types.d.ts +13 -0
  13. package/dist/modules/Order/index.d.ts +3 -25
  14. package/dist/modules/Order/index.js +1313 -1772
  15. package/dist/modules/Order/types.d.ts +0 -7
  16. package/dist/modules/Order/utils/discountProductLineIdentity.js +2 -2
  17. package/dist/modules/ProductList/index.js +12 -33
  18. package/dist/modules/Rules/index.d.ts +0 -2
  19. package/dist/modules/Rules/index.js +21 -29
  20. package/dist/solution/BaseSales/index.d.ts +1 -16
  21. package/dist/solution/BaseSales/index.js +1325 -1511
  22. package/dist/solution/BookingTicket/index.d.ts +2 -2
  23. package/dist/solution/BookingTicket/index.js +108 -200
  24. package/dist/solution/BookingTicket/types.d.ts +2 -14
  25. package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +1 -1
  26. package/dist/solution/BookingTicket/utils/addProductDecision.js +3 -4
  27. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +58 -94
  28. package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +0 -1
  29. package/dist/solution/BookingTicket/utils/scan/handleScan.js +1 -2
  30. package/dist/solution/UnifiedBookingSales/index.d.ts +23 -2
  31. package/dist/solution/UnifiedBookingSales/index.js +923 -683
  32. package/dist/solution/UnifiedBookingSales/salesSettings.d.ts +16 -0
  33. package/dist/solution/UnifiedBookingSales/salesSettings.js +81 -0
  34. package/dist/utils/platform.d.ts +0 -2
  35. package/dist/utils/platform.js +0 -6
  36. package/lib/index.d.ts +0 -1
  37. package/lib/index.js +0 -12
  38. package/lib/model/strategy/adapter/promotion/evaluator.d.ts +2 -1
  39. package/lib/model/strategy/adapter/promotion/evaluator.js +13 -7
  40. package/lib/modules/BookingContext/utils/productExtend.d.ts +5 -0
  41. package/lib/modules/BookingContext/utils/productExtend.js +36 -3
  42. package/lib/modules/Discount/index.js +0 -1
  43. package/lib/modules/OpenData/index.d.ts +1 -0
  44. package/lib/modules/OpenData/index.js +12 -0
  45. package/lib/modules/OpenData/salesSettings.d.ts +32 -0
  46. package/lib/modules/OpenData/salesSettings.js +70 -0
  47. package/lib/modules/OpenData/types.d.ts +13 -0
  48. package/lib/modules/Order/index.d.ts +3 -25
  49. package/lib/modules/Order/index.js +38 -192
  50. package/lib/modules/Order/types.d.ts +0 -7
  51. package/lib/modules/Order/utils/discountProductLineIdentity.js +1 -1
  52. package/lib/modules/ProductList/index.js +0 -15
  53. package/lib/modules/Rules/index.d.ts +0 -2
  54. package/lib/modules/Rules/index.js +0 -6
  55. package/lib/solution/BaseSales/index.d.ts +1 -16
  56. package/lib/solution/BaseSales/index.js +9 -89
  57. package/lib/solution/BookingTicket/index.d.ts +2 -2
  58. package/lib/solution/BookingTicket/index.js +2 -38
  59. package/lib/solution/BookingTicket/types.d.ts +2 -14
  60. package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +1 -1
  61. package/lib/solution/BookingTicket/utils/addProductDecision.js +3 -4
  62. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +2 -14
  63. package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +0 -1
  64. package/lib/solution/BookingTicket/utils/scan/handleScan.js +1 -2
  65. package/lib/solution/UnifiedBookingSales/index.d.ts +23 -2
  66. package/lib/solution/UnifiedBookingSales/index.js +131 -15
  67. package/lib/solution/UnifiedBookingSales/salesSettings.d.ts +16 -0
  68. package/lib/solution/UnifiedBookingSales/salesSettings.js +72 -0
  69. package/lib/utils/platform.d.ts +0 -2
  70. package/lib/utils/platform.js +0 -7
  71. package/package.json +1 -1
  72. package/dist/inventory/index.d.ts +0 -92
  73. package/dist/inventory/index.js +0 -509
  74. package/dist/modules/Order/utils/productVoucherGroups.d.ts +0 -15
  75. package/dist/modules/Order/utils/productVoucherGroups.js +0 -115
  76. package/dist/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.d.ts +0 -10
  77. package/dist/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.js +0 -117
  78. package/lib/inventory/index.d.ts +0 -92
  79. package/lib/inventory/index.js +0 -287
  80. package/lib/modules/Order/utils/productVoucherGroups.d.ts +0 -15
  81. package/lib/modules/Order/utils/productVoucherGroups.js +0 -64
  82. package/lib/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.d.ts +0 -10
  83. package/lib/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.js +0 -71
@@ -1,71 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.applyProductVoucherCollectionScan = applyProductVoucherCollectionScan;
7
- var _applyGlobalScan = require("./applyGlobalScan");
8
- /** Collect voucher candidates after customer binding and coupon loading finish.
9
- * Never expand a wristband's result to other orders of the same customer. */
10
- async function applyProductVoucherCollectionScan(host, formatted, bridge) {
11
- const assertCurrent = () => {
12
- if (bridge.isCurrent?.() === false) {
13
- throw new DOMException('Scan session ended', 'AbortError');
14
- }
15
- };
16
- let vouchers = [];
17
- assertCurrent();
18
- const result = await (0, _applyGlobalScan.applyGlobalScan)({
19
- ...host,
20
- setOrderCustomer: customer => {
21
- assertCurrent();
22
- host.setOrderCustomer(customer);
23
- },
24
- addProductToOrder: (product, booking) => {
25
- assertCurrent();
26
- return host.addProductToOrder(product, booking);
27
- }
28
- }, formatted, {
29
- ...bridge,
30
- applyPromotionCode: bridge.applyPromotionCode && (async (code, customerId, options) => {
31
- // Customer binding starts prepare/config in the background. Let it finish
32
- // before adding scanned coupons so its response cannot overwrite them.
33
- await host.waitForCustomerDiscounts();
34
- assertCurrent();
35
- const promotion = await bridge.applyPromotionCode(code, customerId, {
36
- ...options,
37
- productVouchersOnly: true,
38
- suppressFailureNotification: true
39
- });
40
- assertCurrent();
41
- // An empty successful search is different from a swallowed request error.
42
- if (!Array.isArray(promotion.scannedDiscountList)) {
43
- throw new Error('Could not resolve scanned vouchers');
44
- }
45
- vouchers = promotion.scannedDiscountList;
46
- return promotion;
47
- })
48
- });
49
- assertCurrent();
50
- if (formatted.searchType === 'wallet' && result.status === 'success') {
51
- vouchers = await host.loadCustomerDiscounts();
52
- assertCurrent();
53
- return {
54
- ...result,
55
- redemption: {
56
- source: 'wallet',
57
- vouchers
58
- }
59
- };
60
- }
61
- if (formatted.searchType === 'walletPass') {
62
- return {
63
- ...result,
64
- redemption: {
65
- source: 'scan',
66
- vouchers
67
- }
68
- };
69
- }
70
- return result;
71
- }