@pisell/pisellos 2.3.177 → 2.3.179

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";
@@ -73,7 +73,7 @@ export function normalizeSalesSettings(raw, platform) {
73
73
  showDontRemindAgainToday: isPos && booleanOr(raw === null || raw === void 0 ? void 0 : raw['sale.show_option'], false)
74
74
  },
75
75
  reservation: {
76
- multipleBookingScheduling: (raw === null || raw === void 0 ? void 0 : raw['reservation.multiple_booking_scheduling']) === 'same_start_time' ? 'same_start_time' : 'one_after_another',
76
+ multipleBookingScheduling: (raw === null || raw === void 0 ? void 0 : raw['reservation.multiple_booking_scheduling']) === 'one_after_another' ? 'one_after_another' : 'same_start_time',
77
77
  resourceSettings: normalizeSalesResourceSettings(raw === null || raw === void 0 ? void 0 : raw['reservation.resource_setting'])
78
78
  }
79
79
  };
@@ -595,7 +595,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
595
595
  generateIdempotencyToken(): string;
596
596
  syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
597
597
  createOrder(params: CommitOrderParams['query']): {
598
- type: "virtual" | "appointment_booking";
598
+ type: "appointment_booking" | "virtual";
599
599
  platform: string;
600
600
  sales_channel: string;
601
601
  order_sales_channel: string;
@@ -328,7 +328,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
328
328
  date: string;
329
329
  status: string;
330
330
  week: string;
331
- weekNum: 0 | 2 | 1 | 3 | 4 | 5 | 6;
331
+ weekNum: 0 | 1 | 2 | 5 | 4 | 3 | 6;
332
332
  }[]>;
333
333
  submitTimeSlot(timeSlots: TimeSliceItem): void;
334
334
  private getScheduleDataByIds;
@@ -366,7 +366,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
366
366
  * 获取当前的客户搜索条件
367
367
  * @returns 当前搜索条件
368
368
  */
369
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
369
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
370
370
  /**
371
371
  * 获取客户列表状态(包含滚动加载相关状态)
372
372
  * @returns 客户状态
@@ -3431,8 +3431,8 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3431
3431
  key: "syncAdditionalOrderFromResource",
3432
3432
  value: function () {
3433
3433
  var _syncAdditionalOrderFromResource = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(resourceId) {
3434
- var _ref10, _ref11, _ref12, _this$store$resource5, _this$store$resource6, _occupyDetails$2, _this$store$resource7, _this$otherParams21, _this$store$order8;
3435
- var tempOrder, normalizedResourceId, _result, occupyDetails, occupyDetail, resourceSelectType, allowAddItems, result;
3434
+ var _ref10, _ref11, _ref12, _this$store$resource5, _this$store$resource6, _occupyDetails$2, _this$store$resource7, _this$otherParams21, _this$store$resource8, _this$store$order8;
3435
+ var tempOrder, normalizedResourceId, _result, occupyDetails, occupyDetail, resourceSelectType, allowAddItems, result, resourceState;
3436
3436
  return _regeneratorRuntime().wrap(function _callee43$(_context43) {
3437
3437
  while (1) switch (_context43.prev = _context43.next) {
3438
3438
  case 0:
@@ -3481,6 +3481,11 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3481
3481
  tempOrder.resource_id = normalizedResourceId;
3482
3482
  tempOrder.relation_id = toPositiveString(occupyDetail === null || occupyDetail === void 0 ? void 0 : occupyDetail.form_record_id) || normalizedResourceId || tempOrder.relation_id;
3483
3483
  tempOrder.table_form_id = toPositiveString(occupyDetail === null || occupyDetail === void 0 ? void 0 : occupyDetail.form_id) || tempOrder.table_form_id;
3484
+ // 冲突后转加餐需同步模式,否则重试仍会携带整单数据走 checkout。
3485
+ resourceState = (_this$store$resource8 = this.store.resource) !== null && _this$store$resource8 !== void 0 ? _this$store$resource8 : this.normalizeResourceState(occupyDetail, resourceSelectType, true);
3486
+ resourceState.mode = 'additional_order';
3487
+ resourceState.order_id = result.order_id;
3488
+ this.store.resource = resourceState;
3484
3489
  (_this$store$order8 = this.store.order) === null || _this$store$order8 === void 0 || _this$store$order8.persistTempOrder();
3485
3490
  this.logMethodSuccess('syncAdditionalOrderFromResource', _objectSpread(_objectSpread({}, result), {}, {
3486
3491
  resourceId: normalizedResourceId,
@@ -3488,7 +3493,7 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3488
3493
  allowAddItems: allowAddItems
3489
3494
  }));
3490
3495
  return _context43.abrupt("return", result);
3491
- case 26:
3496
+ case 30:
3492
3497
  case "end":
3493
3498
  return _context43.stop();
3494
3499
  }
@@ -3503,9 +3508,9 @@ export var ScanOrderImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3503
3508
  }, {
3504
3509
  key: "getReservationResourceSelectType",
3505
3510
  value: function getReservationResourceSelectType() {
3506
- var _this$store$resource8;
3511
+ var _this$store$resource9;
3507
3512
  this.logMethodStart('getReservationResourceSelectType');
3508
- var resourceSelectType = (_this$store$resource8 = this.store.resource) === null || _this$store$resource8 === void 0 ? void 0 : _this$store$resource8.resourceSelectType;
3513
+ var resourceSelectType = (_this$store$resource9 = this.store.resource) === null || _this$store$resource9 === void 0 ? void 0 : _this$store$resource9.resourceSelectType;
3509
3514
  var result = _objectSpread(_objectSpread({}, resourceSelectType ? {
3510
3515
  resourceSelectType: resourceSelectType
3511
3516
  } : {}), {}, {
@@ -55,7 +55,7 @@ export function resolveDefaultBookingStart(_ref5) {
55
55
  var bookings = _ref5.bookings,
56
56
  holderIds = _ref5.holderIds,
57
57
  _ref5$mode = _ref5.mode,
58
- mode = _ref5$mode === void 0 ? 'one_after_another' : _ref5$mode,
58
+ mode = _ref5$mode === void 0 ? 'same_start_time' : _ref5$mode,
59
59
  fallback = _ref5.fallback;
60
60
  var holders = new Set(normalizeBookingHolderIds(holderIds));
61
61
  var related = bookings.flatMap(function (booking) {
@@ -63,7 +63,7 @@ function normalizeSalesSettings(raw, platform) {
63
63
  showDontRemindAgainToday: isPos && booleanOr(raw?.['sale.show_option'], false)
64
64
  },
65
65
  reservation: {
66
- multipleBookingScheduling: raw?.['reservation.multiple_booking_scheduling'] === 'same_start_time' ? 'same_start_time' : 'one_after_another',
66
+ multipleBookingScheduling: raw?.['reservation.multiple_booking_scheduling'] === 'one_after_another' ? 'one_after_another' : 'same_start_time',
67
67
  resourceSettings: normalizeSalesResourceSettings(raw?.['reservation.resource_setting'])
68
68
  }
69
69
  };
@@ -595,7 +595,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
595
595
  generateIdempotencyToken(): string;
596
596
  syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
597
597
  createOrder(params: CommitOrderParams['query']): {
598
- type: "virtual" | "appointment_booking";
598
+ type: "appointment_booking" | "virtual";
599
599
  platform: string;
600
600
  sales_channel: string;
601
601
  order_sales_channel: string;
@@ -328,7 +328,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
328
328
  date: string;
329
329
  status: string;
330
330
  week: string;
331
- weekNum: 0 | 2 | 1 | 3 | 4 | 5 | 6;
331
+ weekNum: 0 | 1 | 2 | 5 | 4 | 3 | 6;
332
332
  }[]>;
333
333
  submitTimeSlot(timeSlots: TimeSliceItem): void;
334
334
  private getScheduleDataByIds;
@@ -366,7 +366,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
366
366
  * 获取当前的客户搜索条件
367
367
  * @returns 当前搜索条件
368
368
  */
369
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
369
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
370
370
  /**
371
371
  * 获取客户列表状态(包含滚动加载相关状态)
372
372
  * @returns 客户状态
@@ -2113,6 +2113,11 @@ class ScanOrderImpl extends _BaseSales.BaseSalesImpl {
2113
2113
  tempOrder.resource_id = normalizedResourceId;
2114
2114
  tempOrder.relation_id = (0, _utils.toPositiveString)(occupyDetail?.form_record_id) || normalizedResourceId || tempOrder.relation_id;
2115
2115
  tempOrder.table_form_id = (0, _utils.toPositiveString)(occupyDetail?.form_id) || tempOrder.table_form_id;
2116
+ // 冲突后转加餐需同步模式,否则重试仍会携带整单数据走 checkout。
2117
+ const resourceState = this.store.resource ?? this.normalizeResourceState(occupyDetail, resourceSelectType, true);
2118
+ resourceState.mode = 'additional_order';
2119
+ resourceState.order_id = result.order_id;
2120
+ this.store.resource = resourceState;
2116
2121
  this.store.order?.persistTempOrder();
2117
2122
  this.logMethodSuccess('syncAdditionalOrderFromResource', {
2118
2123
  ...result,
@@ -49,7 +49,7 @@ function getBookingBoundary(booking, edge) {
49
49
  function resolveDefaultBookingStart({
50
50
  bookings,
51
51
  holderIds,
52
- mode = 'one_after_another',
52
+ mode = 'same_start_time',
53
53
  fallback
54
54
  }) {
55
55
  const holders = new Set(normalizeBookingHolderIds(holderIds));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "2.3.177",
4
+ "version": "2.3.179",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",