@pisell/pisellos 2.3.224 → 2.3.226

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 (37) hide show
  1. package/dist/model/strategy/adapter/dataVariant/evaluator.d.ts +2 -1
  2. package/dist/model/strategy/adapter/dataVariant/evaluator.js +60 -15
  3. package/dist/model/strategy/adapter/promotion/index.js +0 -9
  4. package/dist/modules/Customer/types.d.ts +4 -0
  5. package/dist/modules/Order/index.d.ts +1 -1
  6. package/dist/modules/Order/index.js +123 -79
  7. package/dist/modules/Order/types.d.ts +2 -0
  8. package/dist/modules/Order/utils/bookingUuid.d.ts +4 -0
  9. package/dist/modules/Order/utils/bookingUuid.js +24 -0
  10. package/dist/modules/Order/utils.js +2 -0
  11. package/dist/modules/Product/index.d.ts +1 -1
  12. package/dist/solution/BaseSales/index.js +3 -0
  13. package/dist/solution/BookingByStep/index.d.ts +2 -2
  14. package/dist/solution/BookingTicket/utils/redeemArrival.d.ts +12 -12
  15. package/dist/solution/Checkout/index.js +104 -69
  16. package/dist/solution/Checkout/types.d.ts +1 -0
  17. package/dist/solution/ScanOrder/index.js +10 -2
  18. package/dist/solution/VenueBooking/index.js +522 -490
  19. package/lib/model/strategy/adapter/dataVariant/evaluator.d.ts +2 -1
  20. package/lib/model/strategy/adapter/dataVariant/evaluator.js +40 -6
  21. package/lib/model/strategy/adapter/promotion/index.js +1 -46
  22. package/lib/modules/Customer/types.d.ts +4 -0
  23. package/lib/modules/Order/index.d.ts +1 -1
  24. package/lib/modules/Order/index.js +44 -6
  25. package/lib/modules/Order/types.d.ts +2 -0
  26. package/lib/modules/Order/utils/bookingUuid.d.ts +4 -0
  27. package/lib/modules/Order/utils/bookingUuid.js +25 -0
  28. package/lib/modules/Order/utils.js +5 -1
  29. package/lib/modules/Product/index.d.ts +1 -1
  30. package/lib/solution/BaseSales/index.js +3 -0
  31. package/lib/solution/BookingByStep/index.d.ts +2 -2
  32. package/lib/solution/BookingTicket/utils/redeemArrival.d.ts +12 -12
  33. package/lib/solution/Checkout/index.js +21 -0
  34. package/lib/solution/Checkout/types.d.ts +1 -0
  35. package/lib/solution/ScanOrder/index.js +6 -0
  36. package/lib/solution/VenueBooking/index.js +6 -1
  37. package/package.json +1 -1
@@ -44,7 +44,7 @@ export declare class DataVariantEvaluator {
44
44
  * 返回 null 表示接口没有提供该字段;空 Map 表示已计算但没有任何命中。
45
45
  */
46
46
  private getAuthoritativeVariantPriorities;
47
- private normalizeDataVariantId;
47
+ private normalizeId;
48
48
  private buildGlobalEffectiveRuleMap;
49
49
  private resolveProduct;
50
50
  /**
@@ -90,6 +90,7 @@ export declare class DataVariantEvaluator {
90
90
  private timeToMinutes;
91
91
  private isProductInMenuScope;
92
92
  private mergeMatchedVariants;
93
+ private mergeSkuVariants;
93
94
  private getProductDataVariants;
94
95
  private normalizeStrategyConfigs;
95
96
  private isStrategyActive;
@@ -230,7 +230,7 @@ export var DataVariantEvaluator = /*#__PURE__*/function () {
230
230
  try {
231
231
  for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
232
232
  var rawId = _step4.value;
233
- var id = this.normalizeDataVariantId(rawId);
233
+ var id = this.normalizeId(rawId);
234
234
  if (id === null || seen.has(id)) continue;
235
235
  seen.add(id);
236
236
  orderedIds.push(id);
@@ -245,8 +245,8 @@ export var DataVariantEvaluator = /*#__PURE__*/function () {
245
245
  }));
246
246
  }
247
247
  }, {
248
- key: "normalizeDataVariantId",
249
- value: function normalizeDataVariantId(value) {
248
+ key: "normalizeId",
249
+ value: function normalizeId(value) {
250
250
  if (value === undefined || value === null) return null;
251
251
  var normalized = String(value).trim();
252
252
  return normalized || null;
@@ -305,7 +305,7 @@ export var DataVariantEvaluator = /*#__PURE__*/function () {
305
305
  var variant = _step6.value;
306
306
  if (variant.business_type === 'multi_currency_settlement') continue;
307
307
  if (authoritativeVariantPriorities !== null) {
308
- var variantId = this.normalizeDataVariantId(variant.id);
308
+ var variantId = this.normalizeId(variant.id);
309
309
  var priority = variantId === null ? undefined : authoritativeVariantPriorities.get(variantId);
310
310
  if (priority === undefined) continue;
311
311
  matchedVariants.push({
@@ -357,7 +357,7 @@ export var DataVariantEvaluator = /*#__PURE__*/function () {
357
357
  var ruleId = String(variant.data_variant_rule_id);
358
358
  var isDefault = Number(variant.data_variant_rule_id) === 0;
359
359
  var rule = isDefault ? undefined : globalEffectiveRuleMap.get(ruleId);
360
- var variantId = _this3.normalizeDataVariantId(variant.id);
360
+ var variantId = _this3.normalizeId(variant.id);
361
361
  var authoritativePriority = variantId === null ? undefined : authoritativeVariantPriorities === null || authoritativeVariantPriorities === void 0 ? void 0 : authoritativeVariantPriorities.get(variantId);
362
362
  var available;
363
363
  var priority;
@@ -849,10 +849,15 @@ export var DataVariantEvaluator = /*#__PURE__*/function () {
849
849
  var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
850
850
  key = _Object$entries$_i[0],
851
851
  value = _Object$entries$_i[1];
852
- if (value === undefined) continue;
852
+ if (value === undefined || key === 'variant_overrides') continue;
853
853
  result[key] = value;
854
854
  appliedFields.add(key);
855
855
  }
856
+ var mergedVariants = this.mergeSkuVariants(result.variant, matched.data.variant_overrides);
857
+ if (mergedVariants) {
858
+ result.variant = mergedVariants;
859
+ appliedFields.add('variant');
860
+ }
856
861
  appliedRuleIds.push(matched.ruleId);
857
862
  }
858
863
  } catch (err) {
@@ -863,7 +868,7 @@ export var DataVariantEvaluator = /*#__PURE__*/function () {
863
868
  result._dataVariant = {
864
869
  appliedRuleIds: appliedRuleIds,
865
870
  appliedVariantIds: Array.from(new Set(_toConsumableArray(sortedVariants).reverse().map(function (matched) {
866
- return _this8.normalizeDataVariantId(matched.variant.id);
871
+ return _this8.normalizeId(matched.variant.id);
867
872
  }).filter(function (id) {
868
873
  return id !== null;
869
874
  }))),
@@ -872,6 +877,46 @@ export var DataVariantEvaluator = /*#__PURE__*/function () {
872
877
  };
873
878
  return result;
874
879
  }
880
+ }, {
881
+ key: "mergeSkuVariants",
882
+ value: function mergeSkuVariants(variants, overrides) {
883
+ var _this9 = this;
884
+ if (!Array.isArray(variants) || !Array.isArray(overrides)) return;
885
+ var overridesById = new Map();
886
+ var _iterator18 = _createForOfIteratorHelper(overrides),
887
+ _step18;
888
+ try {
889
+ for (_iterator18.s(); !(_step18 = _iterator18.n()).done;) {
890
+ var override = _step18.value;
891
+ var rawId = override === null || override === void 0 ? void 0 : override.id;
892
+ if (typeof rawId !== 'number' && typeof rawId !== 'string') continue;
893
+ var id = this.normalizeId(rawId);
894
+ if (id === null) continue;
895
+ var fields = Object.entries(override).filter(function (_ref5) {
896
+ var _ref6 = _slicedToArray(_ref5, 2),
897
+ key = _ref6[0],
898
+ value = _ref6[1];
899
+ return key !== 'id' && value !== undefined;
900
+ });
901
+ if (fields.length === 0) continue;
902
+ overridesById.set(id, _objectSpread(_objectSpread({}, overridesById.get(id)), Object.fromEntries(fields)));
903
+ }
904
+ } catch (err) {
905
+ _iterator18.e(err);
906
+ } finally {
907
+ _iterator18.f();
908
+ }
909
+ if (overridesById.size === 0) return;
910
+ var hasUpdates = false;
911
+ var merged = variants.map(function (variant) {
912
+ var id = _this9.normalizeId(variant === null || variant === void 0 ? void 0 : variant.id);
913
+ var fields = id === null ? undefined : overridesById.get(id);
914
+ if (!fields) return variant;
915
+ hasUpdates = true;
916
+ return _objectSpread(_objectSpread({}, variant), fields);
917
+ });
918
+ return hasUpdates ? merged : undefined;
919
+ }
875
920
  }, {
876
921
  key: "getProductDataVariants",
877
922
  value: function getProductDataVariants(product) {
@@ -915,11 +960,11 @@ export var DataVariantEvaluator = /*#__PURE__*/function () {
915
960
  key: "flattenConditionRules",
916
961
  value: function flattenConditionRules(group) {
917
962
  var rules = [];
918
- var _iterator18 = _createForOfIteratorHelper(group.rules),
919
- _step18;
963
+ var _iterator19 = _createForOfIteratorHelper(group.rules),
964
+ _step19;
920
965
  try {
921
- for (_iterator18.s(); !(_step18 = _iterator18.n()).done;) {
922
- var rule = _step18.value;
966
+ for (_iterator19.s(); !(_step19 = _iterator19.n()).done;) {
967
+ var rule = _step19.value;
923
968
  if (this.isConditionGroup(rule)) {
924
969
  rules.push.apply(rules, _toConsumableArray(this.flattenConditionRules(rule)));
925
970
  } else {
@@ -927,9 +972,9 @@ export var DataVariantEvaluator = /*#__PURE__*/function () {
927
972
  }
928
973
  }
929
974
  } catch (err) {
930
- _iterator18.e(err);
975
+ _iterator19.e(err);
931
976
  } finally {
932
- _iterator18.f();
977
+ _iterator19.f();
933
978
  }
934
979
  return rules;
935
980
  }
@@ -941,10 +986,10 @@ export var DataVariantEvaluator = /*#__PURE__*/function () {
941
986
  }, {
942
987
  key: "normalizeNumberArray",
943
988
  value: function normalizeNumberArray(value) {
944
- var _this9 = this;
989
+ var _this10 = this;
945
990
  if (!Array.isArray(value)) return [];
946
991
  return value.map(function (item) {
947
- return _this9.toNumber(item);
992
+ return _this10.toNumber(item);
948
993
  }).filter(function (item) {
949
994
  return item > 0;
950
995
  });
@@ -1,9 +0,0 @@
1
- // 导出评估器
2
- export { PromotionEvaluator } from "./evaluator";
3
-
4
- // 导出适配器
5
- export { PromotionAdapter } from "./adapter";
6
- export { default } from "./adapter";
7
-
8
- // 导出策略配置示例常量
9
- export { X_ITEMS_FOR_Y_PRICE_STRATEGY, BUY_X_GET_Y_FREE_STRATEGY, ITEM_REWARD_STRATEGY } from "./examples";
@@ -44,6 +44,10 @@ export interface ShopGetCustomerListParams {
44
44
  num?: number;
45
45
  /** 搜索关键词 */
46
46
  search?: string;
47
+ /** Full national phone number, without the international calling code. */
48
+ phone?: string;
49
+ /** Exact email lookup, independent from the generic search keyword. */
50
+ email?: string;
47
51
  /** 关联查询参数 */
48
52
  with?: CustomerWith[];
49
53
  /** wallet搜索标识 */
@@ -642,7 +642,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
642
642
  generateIdempotencyToken(): string;
643
643
  syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
644
644
  createOrder(params: CommitOrderParams['query']): {
645
- type: "virtual" | "appointment_booking";
645
+ type: "appointment_booking" | "virtual";
646
646
  platform: string;
647
647
  sales_channel: string;
648
648
  order_sales_channel: string;