@pisell/pisellos 0.10.35 → 0.10.37

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.
@@ -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";
@@ -107,13 +107,6 @@ function getVoucherPaymentLifecycleKey(payment) {
107
107
  if (!isVoucherPaymentRecord(payment)) return null;
108
108
  return "".concat(String(payment.voucher_id), "::").concat(String(payment.status || ''));
109
109
  }
110
- function hasPersistedOrderId(orderId) {
111
- if (orderId === undefined || orderId === null || orderId === '') return false;
112
- if (typeof orderId === 'string' && orderId.startsWith('LOCAL_')) return false;
113
- var normalizedOrderId = Number(orderId);
114
- if (Number.isFinite(normalizedOrderId)) return normalizedOrderId > 0;
115
- return String(orderId).trim() !== '';
116
- }
117
110
  export var OrderModule = /*#__PURE__*/function (_BaseModule) {
118
111
  _inherits(OrderModule, _BaseModule);
119
112
  var _super = _createSuper(OrderModule);
@@ -593,7 +586,6 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
593
586
  this.store.virtualCurrencyList = (prepareConfigResult === null || prepareConfigResult === void 0 ? void 0 : prepareConfigResult.virtualCurrencyList) || [];
594
587
  if (prepareConfigResult) {
595
588
  this.writePointCardSnapshotFromPrepareConfig({
596
- orderId: orderId,
597
589
  customerId: params.customerId,
598
590
  availableWalletPassList: prepareConfigResult.availableWalletPassList || []
599
591
  });
@@ -1467,12 +1459,10 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
1467
1459
  }, {
1468
1460
  key: "writePointCardSnapshotFromPrepareConfig",
1469
1461
  value: function writePointCardSnapshotFromPrepareConfig(params) {
1470
- var _tempOrder$customer_i, _params$orderId;
1462
+ var _tempOrder$customer_i;
1471
1463
  var tempOrder = this.store.tempOrder;
1472
1464
  if (!tempOrder) return;
1473
1465
  if (String((_tempOrder$customer_i = tempOrder.customer_id) !== null && _tempOrder$customer_i !== void 0 ? _tempOrder$customer_i : '') !== String(params.customerId)) return;
1474
- var effectiveOrderId = (_params$orderId = params.orderId) !== null && _params$orderId !== void 0 ? _params$orderId : tempOrder.order_id;
1475
- if (hasPersistedOrderId(effectiveOrderId)) return;
1476
1466
  tempOrder.order_meta_list = _objectSpread(_objectSpread({}, normalizeOrderMetaList(tempOrder.order_meta_list) || {}), {}, {
1477
1467
  point_cards_snapshot: buildPointCardSnapshotFromWalletPassList(params.availableWalletPassList)
1478
1468
  });
@@ -3507,7 +3497,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
3507
3497
  email: tempOrder.email
3508
3498
  });
3509
3499
  var nextCustomerId = (_tempOrder$customer_i4 = tempOrder.customer_id) !== null && _tempOrder$customer_i4 !== void 0 ? _tempOrder$customer_i4 : null;
3510
- if (String(previousCustomerId !== null && previousCustomerId !== void 0 ? previousCustomerId : '') !== String(nextCustomerId !== null && nextCustomerId !== void 0 ? nextCustomerId : '') && !hasPersistedOrderId(tempOrder.order_id)) {
3500
+ if (String(previousCustomerId !== null && previousCustomerId !== void 0 ? previousCustomerId : '') !== String(nextCustomerId !== null && nextCustomerId !== void 0 ? nextCustomerId : '')) {
3511
3501
  this.store.availableWalletIds = [];
3512
3502
  this.clearTempOrderPointCardSnapshot(tempOrder);
3513
3503
  }
@@ -3550,9 +3540,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
3550
3540
  if (String(previousCustomerId !== null && previousCustomerId !== void 0 ? previousCustomerId : '') !== String(nextCustomerId !== null && nextCustomerId !== void 0 ? nextCustomerId : '')) {
3551
3541
  this.store.availableWalletIds = [];
3552
3542
  this.store.virtualCurrencyList = [];
3553
- if (!hasPersistedOrderId(tempOrder.order_id)) {
3554
- this.clearTempOrderPointCardSnapshot(tempOrder);
3555
- }
3543
+ this.clearTempOrderPointCardSnapshot(tempOrder);
3556
3544
  clearTempOrderHolderAssignments(tempOrder);
3557
3545
  this.clearCustomerBoundDiscounts(tempOrder);
3558
3546
  this.applyDiscount();
@@ -3599,9 +3587,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
3599
3587
  if (tempOrder._extend) delete tempOrder._extend.customerSnapshot;
3600
3588
  this.store.availableWalletIds = [];
3601
3589
  this.store.virtualCurrencyList = [];
3602
- if (!hasPersistedOrderId(tempOrder.order_id)) {
3603
- this.clearTempOrderPointCardSnapshot(tempOrder);
3604
- }
3590
+ this.clearTempOrderPointCardSnapshot(tempOrder);
3605
3591
  this.clearCustomerBoundDiscounts(tempOrder);
3606
3592
  this.applyDiscount();
3607
3593
  this.persistTempOrder();
@@ -28,6 +28,8 @@ export interface SmallTicketItem {
28
28
  value: string;
29
29
  size?: number;
30
30
  align?: string;
31
+ product_uid?: string | number;
32
+ booking_uid?: string | number;
31
33
  }
32
34
  export interface SmallTicketProduct {
33
35
  product_title: string;
@@ -35,7 +37,7 @@ export interface SmallTicketProduct {
35
37
  selling_price: string;
36
38
  total_selling_price: string;
37
39
  original_price: string;
38
- base_price: string;
40
+ base_price?: string;
39
41
  total_original_price: string;
40
42
  options_total_price?: string;
41
43
  package_items_total_price?: string;
@@ -53,11 +55,7 @@ export interface SmallTicketProduct {
53
55
  variant?: string;
54
56
  combinations?: any[];
55
57
  }
56
- export interface SmallTicketBookingSnapshot extends Record<string, any> {
57
- product_uid?: string | number;
58
- booking_uid?: string | number;
59
- }
60
- export type SmallTicketAppointment = SmallTicketItem[] | SmallTicketBookingSnapshot[];
58
+ export type SmallTicketAppointment = SmallTicketItem[];
61
59
  export interface SmallTicketLocaleData {
62
60
  base_data: Record<string, any>;
63
61
  products: SmallTicketProduct[];