@pisell/pisellos 2.2.268 → 2.2.269

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 (120) hide show
  1. package/dist/core/index.d.ts +2 -0
  2. package/dist/core/index.js +7 -0
  3. package/dist/model/strategy/adapter/promotion/adapter.d.ts +4 -0
  4. package/dist/model/strategy/adapter/promotion/adapter.js +23 -0
  5. package/dist/model/strategy/adapter/promotion/evaluator.d.ts +17 -0
  6. package/dist/model/strategy/adapter/promotion/evaluator.js +279 -6
  7. package/dist/model/strategy/adapter/promotion/examples.d.ts +86 -0
  8. package/dist/model/strategy/adapter/promotion/examples.js +99 -0
  9. package/dist/model/strategy/adapter/promotion/index.d.ts +1 -1
  10. package/dist/model/strategy/adapter/promotion/index.js +9 -0
  11. package/dist/model/strategy/adapter/promotion/type.d.ts +90 -2
  12. package/dist/model/strategy/adapter/promotion/type.js +45 -0
  13. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +12 -10
  14. package/dist/modules/OpenData/index.d.ts +2 -0
  15. package/dist/modules/OpenData/index.js +8 -0
  16. package/dist/modules/Order/index.d.ts +28 -8
  17. package/dist/modules/Order/index.js +813 -498
  18. package/dist/modules/Order/payment-utils.d.ts +26 -0
  19. package/dist/modules/Order/payment-utils.js +225 -0
  20. package/dist/modules/Order/types.d.ts +35 -1
  21. package/dist/modules/Order/utils/orderCollectionIdentity.js +7 -2
  22. package/dist/modules/Order/utils.js +10 -6
  23. package/dist/modules/Payment/index.d.ts +2 -0
  24. package/dist/modules/Payment/index.js +78 -49
  25. package/dist/modules/Payment/types.d.ts +104 -25
  26. package/dist/modules/Payment/types.js +17 -0
  27. package/dist/modules/Payment/walletpass.d.ts +38 -1
  28. package/dist/modules/Payment/walletpass.js +917 -114
  29. package/dist/modules/Rules/index.d.ts +3 -0
  30. package/dist/modules/Rules/index.js +146 -106
  31. package/dist/modules/SalesSummary/utils.js +7 -1
  32. package/dist/server/index.d.ts +16 -0
  33. package/dist/server/index.js +1940 -1043
  34. package/dist/server/modules/index.d.ts +1 -1
  35. package/dist/server/modules/order/index.d.ts +70 -4
  36. package/dist/server/modules/order/index.js +1816 -728
  37. package/dist/server/modules/order/types.d.ts +25 -3
  38. package/dist/server/modules/order/types.js +7 -1
  39. package/dist/solution/BaseSales/index.d.ts +115 -6
  40. package/dist/solution/BaseSales/index.js +1847 -478
  41. package/dist/solution/BaseSales/types.d.ts +55 -1
  42. package/dist/solution/BaseSales/types.js +2 -1
  43. package/dist/solution/BaseSales/utils/cartPromotion.d.ts +3 -1
  44. package/dist/solution/BaseSales/utils/cartPromotion.js +90 -31
  45. package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +6 -1
  46. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +6 -3
  47. package/dist/solution/BookingByStep/index.d.ts +1 -1
  48. package/dist/solution/BookingTicket/index.d.ts +9 -17
  49. package/dist/solution/BookingTicket/index.js +138 -52
  50. package/dist/solution/BookingTicket/types.d.ts +1 -0
  51. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +8 -0
  52. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +173 -83
  53. package/dist/solution/Sales/index.d.ts +2 -0
  54. package/dist/solution/Sales/index.js +26 -4
  55. package/dist/solution/ScanOrder/index.js +31 -20
  56. package/dist/solution/VenueBooking/index.d.ts +1 -0
  57. package/dist/solution/VenueBooking/index.js +30 -19
  58. package/dist/types/index.d.ts +1 -0
  59. package/dist/utils/payment-number.d.ts +9 -0
  60. package/dist/utils/payment-number.js +69 -0
  61. package/lib/core/index.d.ts +2 -0
  62. package/lib/core/index.js +4 -0
  63. package/lib/model/strategy/adapter/promotion/adapter.d.ts +4 -0
  64. package/lib/model/strategy/adapter/promotion/adapter.js +20 -0
  65. package/lib/model/strategy/adapter/promotion/evaluator.d.ts +17 -0
  66. package/lib/model/strategy/adapter/promotion/evaluator.js +235 -0
  67. package/lib/model/strategy/adapter/promotion/examples.d.ts +86 -0
  68. package/lib/model/strategy/adapter/promotion/examples.js +91 -0
  69. package/lib/model/strategy/adapter/promotion/index.d.ts +1 -1
  70. package/lib/model/strategy/adapter/promotion/type.d.ts +90 -2
  71. package/lib/model/strategy/adapter/promotion/type.js +2 -0
  72. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +3 -1
  73. package/lib/modules/OpenData/index.d.ts +2 -0
  74. package/lib/modules/OpenData/index.js +5 -0
  75. package/lib/modules/Order/index.d.ts +28 -8
  76. package/lib/modules/Order/index.js +236 -71
  77. package/lib/modules/Order/payment-utils.d.ts +26 -0
  78. package/lib/modules/Order/payment-utils.js +224 -0
  79. package/lib/modules/Order/types.d.ts +35 -1
  80. package/lib/modules/Order/utils/orderCollectionIdentity.js +3 -0
  81. package/lib/modules/Order/utils.js +11 -4
  82. package/lib/modules/Payment/index.d.ts +2 -0
  83. package/lib/modules/Payment/index.js +33 -12
  84. package/lib/modules/Payment/types.d.ts +104 -25
  85. package/lib/modules/Payment/types.js +1 -0
  86. package/lib/modules/Payment/walletpass.d.ts +38 -1
  87. package/lib/modules/Payment/walletpass.js +730 -21
  88. package/lib/modules/Rules/index.d.ts +3 -0
  89. package/lib/modules/Rules/index.js +54 -21
  90. package/lib/modules/SalesSummary/utils.js +5 -1
  91. package/lib/server/index.d.ts +16 -0
  92. package/lib/server/index.js +670 -18
  93. package/lib/server/modules/index.d.ts +1 -1
  94. package/lib/server/modules/order/index.d.ts +70 -4
  95. package/lib/server/modules/order/index.js +818 -69
  96. package/lib/server/modules/order/types.d.ts +25 -3
  97. package/lib/server/modules/order/types.js +1 -0
  98. package/lib/solution/BaseSales/index.d.ts +115 -6
  99. package/lib/solution/BaseSales/index.js +896 -32
  100. package/lib/solution/BaseSales/types.d.ts +55 -1
  101. package/lib/solution/BaseSales/types.js +2 -1
  102. package/lib/solution/BaseSales/utils/cartPromotion.d.ts +3 -1
  103. package/lib/solution/BaseSales/utils/cartPromotion.js +63 -12
  104. package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +6 -1
  105. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +3 -2
  106. package/lib/solution/BookingByStep/index.d.ts +1 -1
  107. package/lib/solution/BookingTicket/index.d.ts +9 -17
  108. package/lib/solution/BookingTicket/index.js +63 -9
  109. package/lib/solution/BookingTicket/types.d.ts +1 -0
  110. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +8 -0
  111. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +37 -5
  112. package/lib/solution/Sales/index.d.ts +2 -0
  113. package/lib/solution/Sales/index.js +20 -6
  114. package/lib/solution/ScanOrder/index.js +8 -0
  115. package/lib/solution/VenueBooking/index.d.ts +1 -0
  116. package/lib/solution/VenueBooking/index.js +8 -0
  117. package/lib/types/index.d.ts +1 -0
  118. package/lib/utils/payment-number.d.ts +9 -0
  119. package/lib/utils/payment-number.js +64 -0
  120. package/package.json +1 -1
@@ -87,7 +87,13 @@ function getUnitOriginalTotal(product) {
87
87
  function isGeneratedVoucherProduct(product) {
88
88
  var record = product;
89
89
  var metadata = (record === null || record === void 0 ? void 0 : record.metadata) || {};
90
- return (record === null || record === void 0 ? void 0 : record.extension_type) === 'product_voucher' || metadata.parent_order_detail_id !== undefined || metadata.gift_card_type !== undefined;
90
+ var isGeneratedChild = metadata.parent_order_detail_id !== undefined || metadata.gift_card_type !== undefined;
91
+ if (isGeneratedChild) return true;
92
+
93
+ // `product_voucher` 既可能是当前购物车生成的零价子券,也可能是独立售卖的
94
+ // gift card。已有 order_detail_id 且没有 parent 标记的是后者,必须继续计价。
95
+ var isPersisted = (record === null || record === void 0 ? void 0 : record.order_detail_id) !== undefined && (record === null || record === void 0 ? void 0 : record.order_detail_id) !== null;
96
+ return (record === null || record === void 0 ? void 0 : record.extension_type) === 'product_voucher' && !isPersisted;
91
97
  }
92
98
  function buildSurchargeServiceItems(products) {
93
99
  return products.map(function (product) {
@@ -57,6 +57,7 @@ declare class Server {
57
57
  private readonly BOOKING_REMOTE_CACHE_MAX_ENTRIES;
58
58
  private salesSearchSubscribers;
59
59
  private deviceTaskActionsRegistered;
60
+ private localPaymentUpdateQueues;
60
61
  private floorPlanQuerySubscribers;
61
62
  private moduleRegistry;
62
63
  constructor(core: PisellCore);
@@ -120,6 +121,8 @@ declare class Server {
120
121
  private handleSyncSalesTask;
121
122
  private runCheckoutSync;
122
123
  private omitCheckoutSyncMode;
124
+ private buildRemoteCheckoutData;
125
+ private mergeCheckoutSyncPayments;
123
126
  private persistSyncedCheckoutOrder;
124
127
  /**
125
128
  * 将普通层 QuotationModule 的报价单计算能力桥接到 Server Products 模块。
@@ -453,6 +456,18 @@ declare class Server {
453
456
  */
454
457
  private handleUpdateLocalOrder;
455
458
  private handleOrderSalesCheckout;
459
+ private handleOrderSalesDraft;
460
+ private createLocalPaymentOperationId;
461
+ private buildLocalPaymentOrderLogContext;
462
+ private isValidLocalPaymentDecimal;
463
+ private getInvalidLocalPaymentSurchargeFields;
464
+ private buildLocalPaymentSurchargeUpdate;
465
+ private handleGetLocalPayment;
466
+ private handleUpdateLocalPayment;
467
+ private runLocalPaymentUpdateInQueue;
468
+ private processLocalPaymentUpdate;
469
+ private processSuccessfulLocalPayment;
470
+ private sanitizeLocalRecoveryOrder;
456
471
  private handleOrderCheckout;
457
472
  private getDeviceTaskPlugin;
458
473
  private getIdGeneratorPlugin;
@@ -480,6 +495,7 @@ declare class Server {
480
495
  private syncMachinecodeRedeemStatusToLocalOrder;
481
496
  private handleOrderCheckoutSubmit;
482
497
  private handleSyncCheckoutSubmit;
498
+ private handleOrderDraftSubmit;
483
499
  private handlePendingSyncCheckoutOrder;
484
500
  private buildPendingSyncCheckoutOrder;
485
501
  private shouldBuildSmallTicketData;