@pisell/pisellos 2.2.266 → 2.2.267

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 (93) hide show
  1. package/dist/model/strategy/adapter/promotion/adapter.d.ts +0 -4
  2. package/dist/model/strategy/adapter/promotion/adapter.js +0 -23
  3. package/dist/model/strategy/adapter/promotion/evaluator.d.ts +0 -17
  4. package/dist/model/strategy/adapter/promotion/evaluator.js +6 -279
  5. package/dist/model/strategy/adapter/promotion/examples.d.ts +0 -86
  6. package/dist/model/strategy/adapter/promotion/examples.js +0 -99
  7. package/dist/model/strategy/adapter/promotion/index.d.ts +1 -1
  8. package/dist/model/strategy/adapter/promotion/type.d.ts +2 -90
  9. package/dist/model/strategy/adapter/promotion/type.js +0 -45
  10. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +5 -3
  11. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +6 -3
  12. package/dist/modules/Order/index.d.ts +8 -27
  13. package/dist/modules/Order/index.js +493 -753
  14. package/dist/modules/Order/types.d.ts +1 -33
  15. package/dist/modules/Order/utils/orderCollectionIdentity.js +2 -7
  16. package/dist/modules/Order/utils.js +6 -10
  17. package/dist/modules/Payment/index.d.ts +0 -2
  18. package/dist/modules/Payment/index.js +50 -79
  19. package/dist/modules/Payment/types.d.ts +27 -29
  20. package/dist/modules/Payment/types.js +3 -5
  21. package/dist/modules/Rules/index.d.ts +0 -1
  22. package/dist/modules/Rules/index.js +14 -34
  23. package/dist/server/index.d.ts +0 -16
  24. package/dist/server/index.js +1036 -1933
  25. package/dist/server/modules/order/index.d.ts +4 -49
  26. package/dist/server/modules/order/index.js +695 -1574
  27. package/dist/server/modules/order/types.d.ts +3 -11
  28. package/dist/server/modules/order/types.js +1 -1
  29. package/dist/solution/BaseSales/index.d.ts +11 -55
  30. package/dist/solution/BaseSales/index.js +396 -711
  31. package/dist/solution/BaseSales/utils/cartPromotion.d.ts +1 -3
  32. package/dist/solution/BaseSales/utils/cartPromotion.js +36 -93
  33. package/dist/solution/BaseSales/utils/parseSalesResponse.d.ts +1 -6
  34. package/dist/solution/BookingTicket/index.d.ts +1 -1
  35. package/dist/solution/BookingTicket/index.js +29 -35
  36. package/dist/solution/BookingTicket/utils/addProductDecision.js +6 -0
  37. package/dist/solution/BookingTicket/utils/weighingProductSku.d.ts +5 -0
  38. package/dist/solution/BookingTicket/utils/weighingProductSku.js +45 -0
  39. package/dist/solution/Sales/index.d.ts +0 -1
  40. package/dist/solution/Sales/index.js +2 -10
  41. package/dist/solution/ScanOrder/index.js +20 -31
  42. package/dist/solution/VenueBooking/index.js +19 -30
  43. package/lib/model/strategy/adapter/promotion/adapter.d.ts +0 -4
  44. package/lib/model/strategy/adapter/promotion/adapter.js +0 -20
  45. package/lib/model/strategy/adapter/promotion/evaluator.d.ts +0 -17
  46. package/lib/model/strategy/adapter/promotion/evaluator.js +0 -235
  47. package/lib/model/strategy/adapter/promotion/examples.d.ts +0 -86
  48. package/lib/model/strategy/adapter/promotion/examples.js +0 -91
  49. package/lib/model/strategy/adapter/promotion/index.d.ts +1 -1
  50. package/lib/model/strategy/adapter/promotion/index.js +0 -51
  51. package/lib/model/strategy/adapter/promotion/type.d.ts +2 -90
  52. package/lib/model/strategy/adapter/promotion/type.js +0 -2
  53. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +2 -1
  54. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +2 -1
  55. package/lib/modules/Order/index.d.ts +8 -27
  56. package/lib/modules/Order/index.js +72 -193
  57. package/lib/modules/Order/types.d.ts +1 -33
  58. package/lib/modules/Order/utils/orderCollectionIdentity.js +0 -3
  59. package/lib/modules/Order/utils.js +4 -11
  60. package/lib/modules/Payment/index.d.ts +0 -2
  61. package/lib/modules/Payment/index.js +13 -34
  62. package/lib/modules/Payment/types.d.ts +27 -29
  63. package/lib/modules/Payment/types.js +3 -3
  64. package/lib/modules/Rules/index.d.ts +0 -1
  65. package/lib/modules/Rules/index.js +4 -23
  66. package/lib/server/index.d.ts +0 -16
  67. package/lib/server/index.js +18 -670
  68. package/lib/server/modules/order/index.d.ts +4 -49
  69. package/lib/server/modules/order/index.js +66 -657
  70. package/lib/server/modules/order/types.d.ts +3 -11
  71. package/lib/solution/BaseSales/index.d.ts +11 -55
  72. package/lib/solution/BaseSales/index.js +35 -235
  73. package/lib/solution/BaseSales/utils/cartPromotion.d.ts +1 -3
  74. package/lib/solution/BaseSales/utils/cartPromotion.js +17 -65
  75. package/lib/solution/BaseSales/utils/parseSalesResponse.d.ts +1 -6
  76. package/lib/solution/BookingTicket/index.d.ts +1 -1
  77. package/lib/solution/BookingTicket/index.js +3 -6
  78. package/lib/solution/BookingTicket/utils/addProductDecision.js +4 -0
  79. package/lib/solution/BookingTicket/utils/weighingProductSku.d.ts +5 -0
  80. package/lib/solution/BookingTicket/utils/weighingProductSku.js +63 -0
  81. package/lib/solution/Sales/index.d.ts +0 -1
  82. package/lib/solution/Sales/index.js +3 -5
  83. package/lib/solution/ScanOrder/index.js +0 -8
  84. package/lib/solution/VenueBooking/index.js +0 -8
  85. package/package.json +2 -2
  86. package/dist/modules/Order/payment-utils.d.ts +0 -26
  87. package/dist/modules/Order/payment-utils.js +0 -225
  88. package/dist/utils/payment-number.d.ts +0 -9
  89. package/dist/utils/payment-number.js +0 -69
  90. package/lib/modules/Order/payment-utils.d.ts +0 -26
  91. package/lib/modules/Order/payment-utils.js +0 -224
  92. package/lib/utils/payment-number.d.ts +0 -9
  93. package/lib/utils/payment-number.js +0 -64
@@ -241,17 +241,6 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
241
241
  value: function resolveDiscountListForManualOverride(discountList) {
242
242
  return this.excludeDiscountListByType(discountList, 'promotion');
243
243
  }
244
- }, {
245
- key: "isItemRewardProductDiscount",
246
- value: function isItemRewardProductDiscount(product) {
247
- var _product$_promotion;
248
- var discountList = Array.isArray(product === null || product === void 0 ? void 0 : product.discount_list) ? product.discount_list : [];
249
- return (product === null || product === void 0 || (_product$_promotion = product._promotion) === null || _product$_promotion === void 0 ? void 0 : _product$_promotion.actionType) === 'ITEM_REWARD' && discountList.some(function (item) {
250
- var _item$metadata, _item$metadata2;
251
- return (item === null || item === void 0 ? void 0 : item.type) === 'product' && (item === null || item === void 0 || (_item$metadata = item.metadata) === null || _item$metadata === void 0 ? void 0 : _item$metadata.source) === 'promotion' && (item === null || item === void 0 || (_item$metadata2 = item.metadata) === null || _item$metadata2 === void 0 ? void 0 : _item$metadata2.actionType) === 'ITEM_REWARD';
252
- });
253
- }
254
-
255
244
  // 获取券不可用的原因
256
245
  }, {
257
246
  key: "getUnavailableReason",
@@ -740,9 +729,6 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
740
729
  startDate: (_flatItem$parentProdu = flatItem.parentProduct) === null || _flatItem$parentProdu === void 0 ? void 0 : _flatItem$parentProdu.startDate
741
730
  };
742
731
  }
743
- if (_this3.isItemRewardProductDiscount(product)) {
744
- return false;
745
- }
746
732
 
747
733
  // 编辑的商品使用了优惠券不可用
748
734
  var isAvailableProduct = flatItem.type === 'main' ? !((_product2 = product) !== null && _product2 !== void 0 && _product2.booking_id && (_product3 = product) !== null && _product3 !== void 0 && (_product3 = _product3.discount_list) !== null && _product3 !== void 0 && _product3.length && (_product4 = product) !== null && _product4 !== void 0 && (_product4 = _product4.discount_list) !== null && _product4 !== void 0 && _product4.every(function (d) {
@@ -929,7 +915,6 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
929
915
  };
930
916
  originProduct = flatItem.originProduct;
931
917
  }
932
- var isItemRewardProductDiscount = _this3.isItemRewardProductDiscount(product);
933
918
  addModeDiscount.forEach(function (discount) {
934
919
  var _product6, _product7, _product8, _product9, _flatItem$bundleItem3, _flatItem$bundleItem4, _discount$config;
935
920
  var limitedData = discount === null || discount === void 0 ? void 0 : discount.limited_relation_product_data;
@@ -955,7 +940,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
955
940
  var isBundleAvailable = _this3.checkPackageSubItemUsageRules(discount, flatItem);
956
941
 
957
942
  // 判断优惠券是否适用于该商品
958
- if (isAvailableProduct && !isItemRewardProductDiscount && isLimitedProduct && timeLimit && isBundleAvailable && (_discount$config = discount.config) !== null && _discount$config !== void 0 && _discount$config.isAvailable) {
943
+ if (isAvailableProduct && isLimitedProduct && timeLimit && isBundleAvailable && (_discount$config = discount.config) !== null && _discount$config !== void 0 && _discount$config.isAvailable) {
959
944
  var _discountApplicabilit, _discount$metadata4, _discount$metadata5;
960
945
  // 记录此优惠券适用的商品
961
946
  (_discountApplicabilit = discountApplicability.get(discount.id)) === null || _discountApplicabilit === void 0 || _discountApplicabilit.push(product.id);
@@ -1100,7 +1085,6 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1100
1085
  // 找到适用于此商品的所有优惠券,仅考虑isSelected不为false的优惠券
1101
1086
  var applicableDiscounts = sortedDiscountList.filter(function (discount) {
1102
1087
  var _product$discount_lis3, _product$discount_lis4;
1103
- if (_this3.isItemRewardProductDiscount(product)) return false;
1104
1088
  // 🔥 检查策略可用性(针对 good_pass 和折扣卡)
1105
1089
  var discountType = discount.tag || discount.type;
1106
1090
  var currentOriginUid = getOriginProductUid(originProduct);
@@ -1188,7 +1172,6 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1188
1172
 
1189
1173
  // 如果是手动折扣,则不适用优惠券
1190
1174
  var isManualDiscount = false;
1191
- var isItemRewardProductDiscount = false;
1192
1175
  if (flatItem.type === 'main') {
1193
1176
  var _product$discount_lis5, _product$discount_lis6, _product12, _product12$every;
1194
1177
  // 主商品:判断自身是否手动折扣
@@ -1200,8 +1183,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1200
1183
  }) && (!((_product$discount_lis6 = product.discount_list) !== null && _product$discount_lis6 !== void 0 && _product$discount_lis6.length) || ((_product12 = product) === null || _product12 === void 0 || (_product12 = _product12.discount_list) === null || _product12 === void 0 || (_product12$every = _product12.every) === null || _product12$every === void 0 ? void 0 : _product12$every.call(_product12, function (item) {
1201
1184
  return item.type === 'product';
1202
1185
  })));
1203
- isItemRewardProductDiscount = _this3.isItemRewardProductDiscount(product);
1204
- if (product.inPromotion && !isItemRewardProductDiscount) {
1186
+ if (product.inPromotion) {
1205
1187
  isManualDiscount = false;
1206
1188
  }
1207
1189
  } else {
@@ -1311,17 +1293,15 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1311
1293
  var main_product_selling_price = product.price;
1312
1294
  if ((product.discount_list || []).some(function (item) {
1313
1295
  return item.type === 'promotion';
1314
- }) || isItemRewardProductDiscount || isBoolean(product.vouchersApplicable) && !product.vouchersApplicable) {
1296
+ }) || isBoolean(product.vouchersApplicable) && !product.vouchersApplicable) {
1315
1297
  var _product$total, _product$main_product;
1316
1298
  total = (_product$total = product.total) !== null && _product$total !== void 0 ? _product$total : product.origin_total;
1317
1299
  main_product_selling_price = (_product$main_product = product.main_product_selling_price) !== null && _product$main_product !== void 0 ? _product$main_product : main_product_selling_price;
1318
1300
  }
1319
- processedProductsMap.set(product._id, [_this3.hooks.setProduct(originProduct, _objectSpread(_objectSpread({}, isManualDiscount ? _objectSpread({
1301
+ processedProductsMap.set(product._id, [_this3.hooks.setProduct(originProduct, _objectSpread(_objectSpread({}, isManualDiscount ? {
1320
1302
  price: product.price,
1321
- main_product_selling_price: isItemRewardProductDiscount ? main_product_selling_price : product.price
1322
- }, isItemRewardProductDiscount ? {
1323
- total: total
1324
- } : {}) : {
1303
+ main_product_selling_price: product.price
1304
+ } : {
1325
1305
  _id: product._id.split('___')[0] + '___' + index,
1326
1306
  total: total,
1327
1307
  price: product.price,
@@ -1770,11 +1750,11 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1770
1750
  processedItems.forEach(function (item) {
1771
1751
  // 🔥 更新 discount_list 中的 num,使其与拆分后的 item.num 一致
1772
1752
  var updatedDiscountList = (item.discount_list || []).map(function (discount) {
1773
- var _item$metadata3;
1753
+ var _item$metadata;
1774
1754
  return _objectSpread(_objectSpread({}, discount), {}, {
1775
1755
  metadata: _objectSpread(_objectSpread({}, discount.metadata), {}, {
1776
1756
  num: item.num,
1777
- custom_product_bundle_map_id: (_item$metadata3 = item.metadata) === null || _item$metadata3 === void 0 ? void 0 : _item$metadata3.custom_product_bundle_map_id
1757
+ custom_product_bundle_map_id: (_item$metadata = item.metadata) === null || _item$metadata === void 0 ? void 0 : _item$metadata.custom_product_bundle_map_id
1778
1758
  })
1779
1759
  // num: item.num, // 使用拆分后的 num
1780
1760
  });
@@ -1793,11 +1773,11 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1793
1773
  if (item.processed) {
1794
1774
  // 🔥 同样需要更新 discount_list 中的 num
1795
1775
  var _updatedDiscountList = (item.discount_list || []).map(function (discount) {
1796
- var _item$metadata4;
1776
+ var _item$metadata2;
1797
1777
  return _objectSpread(_objectSpread({}, discount), {}, {
1798
1778
  metadata: _objectSpread(_objectSpread({}, discount.metadata), {}, {
1799
1779
  num: item.num,
1800
- custom_product_bundle_map_id: (_item$metadata4 = item.metadata) === null || _item$metadata4 === void 0 ? void 0 : _item$metadata4.custom_product_bundle_map_id
1780
+ custom_product_bundle_map_id: (_item$metadata2 = item.metadata) === null || _item$metadata2 === void 0 ? void 0 : _item$metadata2.custom_product_bundle_map_id
1801
1781
  })
1802
1782
  // num: item.num, // 使用当前的 num
1803
1783
  });
@@ -1838,8 +1818,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1838
1818
 
1839
1819
  // 🔥 使用更新后的列表计算折扣金额
1840
1820
  var mainDiscountList = updatedMainDiscountList.filter(function (item) {
1841
- var _item$metadata5;
1842
- return !(item !== null && item !== void 0 && (_item$metadata5 = item.metadata) !== null && _item$metadata5 !== void 0 && _item$metadata5.custom_product_bundle_map_id);
1821
+ var _item$metadata3;
1822
+ return !(item !== null && item !== void 0 && (_item$metadata3 = item.metadata) !== null && _item$metadata3 !== void 0 && _item$metadata3.custom_product_bundle_map_id);
1843
1823
  });
1844
1824
  if (mainDiscountList && mainDiscountList.length > 0) {
1845
1825
  var _Decimal$minus$toNumb, _mainProductData$orig;
@@ -1912,8 +1892,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1912
1892
 
1913
1893
  // 🔥 使用更新后的列表计算折扣金额
1914
1894
  var mainDiscountListOriginal = updatedMainDiscountListOriginal.filter(function (item) {
1915
- var _item$metadata6;
1916
- return !(item !== null && item !== void 0 && (_item$metadata6 = item.metadata) !== null && _item$metadata6 !== void 0 && _item$metadata6.custom_product_bundle_map_id);
1895
+ var _item$metadata4;
1896
+ return !(item !== null && item !== void 0 && (_item$metadata4 = item.metadata) !== null && _item$metadata4 !== void 0 && _item$metadata4.custom_product_bundle_map_id);
1917
1897
  });
1918
1898
  if (mainDiscountListOriginal && mainDiscountListOriginal.length > 0) {
1919
1899
  var _Decimal$minus$toNumb2, _mainProductData$orig2;
@@ -57,7 +57,6 @@ declare class Server {
57
57
  private readonly BOOKING_REMOTE_CACHE_MAX_ENTRIES;
58
58
  private salesSearchSubscribers;
59
59
  private deviceTaskActionsRegistered;
60
- private localPaymentUpdateQueues;
61
60
  private floorPlanQuerySubscribers;
62
61
  private moduleRegistry;
63
62
  constructor(core: PisellCore);
@@ -121,8 +120,6 @@ declare class Server {
121
120
  private handleSyncSalesTask;
122
121
  private runCheckoutSync;
123
122
  private omitCheckoutSyncMode;
124
- private buildRemoteCheckoutData;
125
- private mergeCheckoutSyncPayments;
126
123
  private persistSyncedCheckoutOrder;
127
124
  /**
128
125
  * 将普通层 QuotationModule 的报价单计算能力桥接到 Server Products 模块。
@@ -456,18 +453,6 @@ declare class Server {
456
453
  */
457
454
  private handleUpdateLocalOrder;
458
455
  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;
471
456
  private handleOrderCheckout;
472
457
  private getDeviceTaskPlugin;
473
458
  private getIdGeneratorPlugin;
@@ -495,7 +480,6 @@ declare class Server {
495
480
  private syncMachinecodeRedeemStatusToLocalOrder;
496
481
  private handleOrderCheckoutSubmit;
497
482
  private handleSyncCheckoutSubmit;
498
- private handleOrderDraftSubmit;
499
483
  private handlePendingSyncCheckoutOrder;
500
484
  private buildPendingSyncCheckoutOrder;
501
485
  private shouldBuildSmallTicketData;