@pisell/pisellos 2.3.50 → 2.3.53

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 (177) hide show
  1. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +12 -10
  2. package/dist/modules/Discount/index.d.ts +0 -1
  3. package/dist/modules/Discount/index.js +11 -40
  4. package/dist/modules/Discount/types.d.ts +0 -1
  5. package/dist/modules/OpenData/index.js +2 -2
  6. package/dist/modules/Order/index.d.ts +6 -8
  7. package/dist/modules/Order/index.js +165 -140
  8. package/dist/modules/Order/types.d.ts +21 -12
  9. package/dist/modules/Order/types.js +11 -0
  10. package/dist/modules/Order/utils.d.ts +0 -10
  11. package/dist/modules/Order/utils.js +3 -35
  12. package/dist/modules/Payment/types.d.ts +8 -0
  13. package/dist/modules/Payment/walletpass.d.ts +7 -1
  14. package/dist/modules/Payment/walletpass.js +155 -45
  15. package/dist/modules/Product/types.d.ts +0 -1
  16. package/dist/modules/ProductList/index.js +14 -33
  17. package/dist/modules/Quotation/index.d.ts +1 -1
  18. package/dist/modules/Quotation/index.js +2 -2
  19. package/dist/modules/Rules/index.js +32 -56
  20. package/dist/modules/SalesSummary/index.js +13 -12
  21. package/dist/modules/SalesSummary/utils.js +7 -1
  22. package/dist/modules/ScanOrderLogger/index.d.ts +0 -2
  23. package/dist/modules/ScanOrderLogger/index.js +2 -15
  24. package/dist/modules/ScanOrderLogger/providers/feishu.js +27 -45
  25. package/dist/modules/ScanOrderLogger/types.d.ts +0 -1
  26. package/dist/modules/Schedule/index.d.ts +1 -3
  27. package/dist/modules/Schedule/index.js +16 -21
  28. package/dist/modules/Summary/utils.js +13 -38
  29. package/dist/modules/index.d.ts +0 -2
  30. package/dist/modules/index.js +1 -3
  31. package/dist/plugins/window.d.ts +0 -1
  32. package/dist/server/index.d.ts +0 -14
  33. package/dist/server/index.js +793 -907
  34. package/dist/server/modules/index.d.ts +1 -1
  35. package/dist/server/modules/order/index.d.ts +16 -0
  36. package/dist/server/modules/order/index.js +964 -776
  37. package/dist/server/modules/order/types.d.ts +14 -0
  38. package/dist/server/modules/order/types.js +6 -0
  39. package/dist/solution/BaseSales/index.d.ts +18 -13
  40. package/dist/solution/BaseSales/index.js +202 -178
  41. package/dist/solution/BaseSales/utils/cartPromotion.js +5 -3
  42. package/dist/solution/BookingByStep/index.d.ts +2 -17
  43. package/dist/solution/BookingByStep/index.js +215 -294
  44. package/dist/solution/BookingByStep/types.d.ts +1 -2
  45. package/dist/solution/BookingByStep/types.js +1 -3
  46. package/dist/solution/BookingByStep/utils/capacity.js +1 -17
  47. package/dist/solution/BookingByStep/utils/timeslots.d.ts +1 -3
  48. package/dist/solution/BookingByStep/utils/timeslots.js +12 -19
  49. package/dist/solution/BookingTicket/index.d.ts +1 -13
  50. package/dist/solution/BookingTicket/index.js +2 -2
  51. package/dist/solution/BookingTicket/types.d.ts +3 -0
  52. package/dist/solution/BookingTicket/utils/cartView.js +44 -32
  53. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +1 -3
  54. package/dist/solution/BookingTicket/utils/scan/handleScan.js +2 -10
  55. package/dist/solution/Sales/index.d.ts +1 -0
  56. package/dist/solution/Sales/index.js +16 -2
  57. package/dist/solution/ScanOrder/index.d.ts +14 -26
  58. package/dist/solution/ScanOrder/index.js +739 -1142
  59. package/dist/solution/ScanOrder/types.d.ts +1 -21
  60. package/dist/solution/ScanOrder/utils.d.ts +0 -8
  61. package/dist/solution/ScanOrder/utils.js +25 -66
  62. package/dist/solution/ShopDiscount/index.d.ts +0 -1
  63. package/dist/solution/ShopDiscount/index.js +87 -125
  64. package/dist/solution/VenueBooking/index.d.ts +11 -39
  65. package/dist/solution/VenueBooking/index.js +841 -1167
  66. package/dist/solution/VenueBooking/types.d.ts +0 -3
  67. package/dist/solution/VenueBooking/utils/resource.js +0 -1
  68. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
  69. package/dist/solution/VenueBooking/utils/slotMerge.js +5 -10
  70. package/dist/solution/index.d.ts +0 -1
  71. package/dist/solution/index.js +1 -2
  72. package/dist/types/index.d.ts +0 -1
  73. package/lib/model/strategy/adapter/promotion/index.js +0 -51
  74. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +3 -1
  75. package/lib/modules/Discount/index.d.ts +0 -1
  76. package/lib/modules/Discount/index.js +0 -9
  77. package/lib/modules/Discount/types.d.ts +0 -1
  78. package/lib/modules/OpenData/index.js +1 -1
  79. package/lib/modules/Order/index.d.ts +6 -8
  80. package/lib/modules/Order/index.js +89 -38
  81. package/lib/modules/Order/types.d.ts +21 -12
  82. package/lib/modules/Order/utils.d.ts +0 -10
  83. package/lib/modules/Order/utils.js +5 -36
  84. package/lib/modules/Payment/types.d.ts +8 -0
  85. package/lib/modules/Payment/walletpass.d.ts +7 -1
  86. package/lib/modules/Payment/walletpass.js +107 -9
  87. package/lib/modules/Product/types.d.ts +0 -1
  88. package/lib/modules/ProductList/index.js +31 -40
  89. package/lib/modules/Quotation/index.d.ts +1 -1
  90. package/lib/modules/Quotation/index.js +2 -2
  91. package/lib/modules/Rules/index.js +32 -44
  92. package/lib/modules/SalesSummary/index.js +7 -6
  93. package/lib/modules/SalesSummary/utils.js +5 -1
  94. package/lib/modules/ScanOrderLogger/index.d.ts +0 -2
  95. package/lib/modules/ScanOrderLogger/index.js +1 -13
  96. package/lib/modules/ScanOrderLogger/providers/feishu.js +6 -15
  97. package/lib/modules/ScanOrderLogger/types.d.ts +0 -1
  98. package/lib/modules/Schedule/index.d.ts +1 -3
  99. package/lib/modules/Schedule/index.js +8 -10
  100. package/lib/modules/Summary/utils.js +1 -21
  101. package/lib/modules/index.d.ts +0 -2
  102. package/lib/modules/index.js +1 -5
  103. package/lib/plugins/window.d.ts +0 -1
  104. package/lib/server/index.d.ts +0 -14
  105. package/lib/server/index.js +15 -72
  106. package/lib/server/modules/index.d.ts +1 -1
  107. package/lib/server/modules/order/index.d.ts +16 -0
  108. package/lib/server/modules/order/index.js +140 -4
  109. package/lib/server/modules/order/types.d.ts +14 -0
  110. package/lib/server/modules/order/types.js +1 -0
  111. package/lib/solution/BaseSales/index.d.ts +18 -13
  112. package/lib/solution/BaseSales/index.js +58 -35
  113. package/lib/solution/BaseSales/utils/cartPromotion.js +5 -2
  114. package/lib/solution/BookingByStep/index.d.ts +2 -17
  115. package/lib/solution/BookingByStep/index.js +18 -60
  116. package/lib/solution/BookingByStep/types.d.ts +1 -2
  117. package/lib/solution/BookingByStep/types.js +0 -5
  118. package/lib/solution/BookingByStep/utils/capacity.js +1 -20
  119. package/lib/solution/BookingByStep/utils/timeslots.d.ts +1 -3
  120. package/lib/solution/BookingByStep/utils/timeslots.js +11 -19
  121. package/lib/solution/BookingTicket/index.d.ts +1 -13
  122. package/lib/solution/BookingTicket/index.js +2 -10
  123. package/lib/solution/BookingTicket/types.d.ts +3 -0
  124. package/lib/solution/BookingTicket/utils/cartView.js +43 -30
  125. package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +1 -3
  126. package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -2
  127. package/lib/solution/Sales/index.d.ts +1 -0
  128. package/lib/solution/Sales/index.js +15 -3
  129. package/lib/solution/ScanOrder/index.d.ts +14 -26
  130. package/lib/solution/ScanOrder/index.js +182 -449
  131. package/lib/solution/ScanOrder/types.d.ts +1 -21
  132. package/lib/solution/ScanOrder/utils.d.ts +0 -8
  133. package/lib/solution/ScanOrder/utils.js +0 -31
  134. package/lib/solution/ShopDiscount/index.d.ts +0 -1
  135. package/lib/solution/ShopDiscount/index.js +0 -14
  136. package/lib/solution/VenueBooking/index.d.ts +11 -39
  137. package/lib/solution/VenueBooking/index.js +110 -322
  138. package/lib/solution/VenueBooking/types.d.ts +0 -3
  139. package/lib/solution/VenueBooking/utils/resource.js +0 -1
  140. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
  141. package/lib/solution/VenueBooking/utils/slotMerge.js +4 -6
  142. package/lib/solution/index.d.ts +0 -1
  143. package/lib/solution/index.js +1 -3
  144. package/lib/types/index.d.ts +0 -1
  145. package/package.json +1 -1
  146. package/dist/modules/Holder/index.d.ts +0 -48
  147. package/dist/modules/Holder/index.js +0 -640
  148. package/dist/modules/Holder/types.d.ts +0 -123
  149. package/dist/modules/Holder/types.js +0 -1
  150. package/dist/modules/Holder/utils.d.ts +0 -13
  151. package/dist/modules/Holder/utils.js +0 -34
  152. package/dist/modules/ResourcePlanner/index.d.ts +0 -24
  153. package/dist/modules/ResourcePlanner/index.js +0 -181
  154. package/dist/modules/ResourcePlanner/planner.d.ts +0 -14
  155. package/dist/modules/ResourcePlanner/planner.js +0 -1069
  156. package/dist/modules/ResourcePlanner/types.d.ts +0 -227
  157. package/dist/modules/ResourcePlanner/types.js +0 -1
  158. package/dist/solution/UnifiedBookingSales/index.d.ts +0 -183
  159. package/dist/solution/UnifiedBookingSales/index.js +0 -1891
  160. package/dist/solution/UnifiedBookingSales/types.d.ts +0 -143
  161. package/dist/solution/UnifiedBookingSales/types.js +0 -11
  162. package/lib/modules/Holder/index.d.ts +0 -48
  163. package/lib/modules/Holder/index.js +0 -402
  164. package/lib/modules/Holder/types.d.ts +0 -123
  165. package/lib/modules/Holder/types.js +0 -17
  166. package/lib/modules/Holder/utils.d.ts +0 -13
  167. package/lib/modules/Holder/utils.js +0 -71
  168. package/lib/modules/ResourcePlanner/index.d.ts +0 -24
  169. package/lib/modules/ResourcePlanner/index.js +0 -148
  170. package/lib/modules/ResourcePlanner/planner.d.ts +0 -14
  171. package/lib/modules/ResourcePlanner/planner.js +0 -933
  172. package/lib/modules/ResourcePlanner/types.d.ts +0 -227
  173. package/lib/modules/ResourcePlanner/types.js +0 -17
  174. package/lib/solution/UnifiedBookingSales/index.d.ts +0 -183
  175. package/lib/solution/UnifiedBookingSales/index.js +0 -1084
  176. package/lib/solution/UnifiedBookingSales/types.d.ts +0 -143
  177. package/lib/solution/UnifiedBookingSales/types.js +0 -33
@@ -1,4 +1,4 @@
1
- import { ProductList, CartModule, ProductData, AccountModule, AccountListModule, DateModule, GuestListModule, OrderModule, PaymentModule, ResourceListModule, StepModule, SummaryModule, SalesSummaryModule, ScheduleModule, ScanOrderLoggerModule, HolderModule } from '../../modules';
1
+ import { ProductList, CartModule, ProductData, AccountModule, AccountListModule, DateModule, GuestListModule, OrderModule, PaymentModule, ResourceListModule, StepModule, SummaryModule, SalesSummaryModule, ScheduleModule, ScanOrderLoggerModule } from '../../modules';
2
2
  export interface BookingByStepState {
3
3
  cart: CartModule;
4
4
  summary: SummaryModule;
@@ -16,7 +16,6 @@ export interface BookingByStepState {
16
16
  schedule: ScheduleModule;
17
17
  salesSummary?: SalesSummaryModule;
18
18
  scanOrderLogger?: ScanOrderLoggerModule;
19
- holder: HolderModule;
20
19
  }
21
20
  export declare function createModule<T extends keyof BookingByStepState>(moduleName: T, solutionName: string, name?: string, version?: string): BookingByStepState[T];
22
21
  export declare enum BookingByStepHooks {
@@ -1,4 +1,4 @@
1
- import { ProductList, CartModule, AccountListModule, DateModule, OrderModule, PaymentModule, StepModule, SummaryModule, SalesSummaryModule, ScheduleModule, ScanOrderLoggerModule, HolderModule } from "../../modules";
1
+ import { ProductList, CartModule, AccountListModule, DateModule, OrderModule, PaymentModule, StepModule, SummaryModule, SalesSummaryModule, ScheduleModule, ScanOrderLoggerModule } from "../../modules";
2
2
  export function createModule(moduleName, solutionName, name, version) {
3
3
  switch (moduleName) {
4
4
  case 'cart':
@@ -23,8 +23,6 @@ export function createModule(moduleName, solutionName, name, version) {
23
23
  return new ScheduleModule("".concat(solutionName, "_").concat(name || moduleName), version);
24
24
  case 'scanOrderLogger':
25
25
  return new ScanOrderLoggerModule("".concat(solutionName, "_").concat(name || moduleName), version);
26
- case 'holder':
27
- return new HolderModule("".concat(solutionName, "_").concat(name || moduleName), version);
28
26
  default:
29
27
  throw new Error("Unknown module type: ".concat(moduleName));
30
28
  }
@@ -23,27 +23,11 @@ export var formatDefaultCapacitys = function formatDefaultCapacitys(_ref) {
23
23
  product_bundle = _ref.product_bundle;
24
24
  if ((capacity === null || capacity === void 0 ? void 0 : capacity.type) === 'package') {
25
25
  return (product_bundle || []).map(function (d) {
26
- var _window;
27
26
  var id = d.bundle_product_id;
28
27
  var variantId = d.bundle_variant_id;
29
28
  var item = ((capacity === null || capacity === void 0 ? void 0 : capacity.package) || []).find(function (item) {
30
- return item.product_id == id || item.product_id == variantId;
29
+ return item.product_id === id || item.product_id === variantId;
31
30
  });
32
- if (!item && (_window = window) !== null && _window !== void 0 && _window.sendWarningLog) {
33
- window.sendWarningLog({
34
- title: '未找到套餐 capacity 配置',
35
- content: [{
36
- key: 'product_id',
37
- value: id
38
- }, {
39
- key: 'variant_id',
40
- value: variantId
41
- }, {
42
- key: 'package',
43
- value: JSON.stringify((capacity === null || capacity === void 0 ? void 0 : capacity.package) || [])
44
- }]
45
- });
46
- }
47
31
  return {
48
32
  id: id,
49
33
  value: item ? d.num || 0 : 0,
@@ -19,12 +19,10 @@ export declare function calculateResourceAvailableTime({ resource, timeSlots, cu
19
19
  * @param countMap 已预约数量映射
20
20
  * @returns 最快可用的资源
21
21
  */
22
- export declare function findFastestAvailableResource({ resources, currentCapacity, countMap, targetDate, durationMinutes, }: {
22
+ export declare function findFastestAvailableResource({ resources, currentCapacity, countMap, }: {
23
23
  resources: ResourceItem[];
24
24
  currentCapacity?: number;
25
25
  countMap?: Record<number, number>;
26
- targetDate?: string | Dayjs;
27
- durationMinutes?: number;
28
26
  }): ResourceItem | null;
29
27
  /**
30
28
  * 给定一个时间列表,通过开始和结束时间过滤出符合条件的时间段
@@ -91,14 +91,8 @@ export function findFastestAvailableResource(_ref2) {
91
91
  _ref2$currentCapacity = _ref2.currentCapacity,
92
92
  currentCapacity = _ref2$currentCapacity === void 0 ? 1 : _ref2$currentCapacity,
93
93
  _ref2$countMap = _ref2.countMap,
94
- countMap = _ref2$countMap === void 0 ? {} : _ref2$countMap,
95
- targetDate = _ref2.targetDate,
96
- _ref2$durationMinutes = _ref2.durationMinutes,
97
- durationMinutes = _ref2$durationMinutes === void 0 ? 30 : _ref2$durationMinutes;
94
+ countMap = _ref2$countMap === void 0 ? {} : _ref2$countMap;
98
95
  var currentTime = dayjs();
99
- var resolvedDuration = durationMinutes > 0 ? durationMinutes : 30;
100
- var targetDay = targetDate ? dayjs(targetDate) : currentTime;
101
- var isTargetDayToday = targetDay.isSame(currentTime, 'day');
102
96
  var fastestTime = null;
103
97
  var fastestResources = [];
104
98
  console.log('[TimeslotUtils] 查找最快可用资源:', {
@@ -114,18 +108,17 @@ export function findFastestAvailableResource(_ref2) {
114
108
  try {
115
109
  for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
116
110
  var _resource = _step2.value;
117
- // 获取资源在目标日期且还在工作时间内的时间段
118
- var targetDayTimes = _resource.times.filter(function (time) {
119
- var isSameTargetDay = dayjs(time.start_at).isSame(targetDay, 'day');
120
- if (!isSameTargetDay) return false;
121
- if (!isTargetDayToday) return true;
122
- return dayjs(time.end_at).isAfter(currentTime);
111
+ // 获取资源当天且还在工作时间内的时间段
112
+ var todayTimes = _resource.times.filter(function (time) {
113
+ var isToday = dayjs(time.start_at).isSame(currentTime, 'day');
114
+ var isStillWorking = dayjs(time.end_at).isAfter(currentTime);
115
+ return isToday && isStillWorking;
123
116
  });
124
- if (targetDayTimes.length === 0) {
117
+ if (todayTimes.length === 0) {
125
118
  console.log("[TimeslotUtils] \u8D44\u6E90 ".concat(_resource.id, "(").concat(_resource.main_field, ") \u4ECA\u65E5\u65E0\u53EF\u7528\u65F6\u95F4\u6BB5"));
126
119
  continue;
127
120
  }
128
- var _iterator4 = _createForOfIteratorHelper(targetDayTimes),
121
+ var _iterator4 = _createForOfIteratorHelper(todayTimes),
129
122
  _step4;
130
123
  try {
131
124
  var _loop = function _loop() {
@@ -135,7 +128,7 @@ export function findFastestAvailableResource(_ref2) {
135
128
  var workEndTime = dayjs(time.end_at);
136
129
 
137
130
  // 确定检查的起始时间(当前时间 vs 工作开始时间)
138
- var nextAvailableTime = isTargetDayToday && currentTime.isAfter(workStartTime) ? currentTime : workStartTime;
131
+ var nextAvailableTime = currentTime.isBefore(workStartTime) ? workStartTime : currentTime;
139
132
  console.log("[TimeslotUtils] \u68C0\u67E5\u8D44\u6E90 ".concat(_resource.id, "(").concat(_resource.main_field, "):"), {
140
133
  workTime: "".concat(workStartTime.format('HH:mm'), "-").concat(workEndTime.format('HH:mm')),
141
134
  checkStartTime: nextAvailableTime.format('HH:mm:ss'),
@@ -172,7 +165,7 @@ export function findFastestAvailableResource(_ref2) {
172
165
  // 检查资源类型和容量
173
166
  if (_resource.resourceType === 'single' || (_resource.capacity || 1) === 1) {
174
167
  // 单人预约资源:检查时间冲突
175
- if (finalAvailableTime.isBefore(_eventEnd) && _eventStart.isBefore(finalAvailableTime.add(resolvedDuration, 'minute'))) {
168
+ if (finalAvailableTime.isBefore(_eventEnd) && _eventStart.isBefore(finalAvailableTime.add(30, 'minute'))) {
176
169
  // 有冲突,使用事件结束时间
177
170
  finalAvailableTime = _eventEnd;
178
171
  console.log("[TimeslotUtils] \u53D1\u73B0\u65F6\u95F4\u51B2\u7A81\uFF0C\u8C03\u6574\u5230: ".concat(finalAvailableTime.format('HH:mm:ss')));
@@ -184,7 +177,7 @@ export function findFastestAvailableResource(_ref2) {
184
177
  var eventUsedCapacity = _event.pax || 1;
185
178
 
186
179
  // 如果在事件时间范围内,检查容量是否足够
187
- if (finalAvailableTime.isBefore(_eventEnd) && _eventStart.isBefore(finalAvailableTime.add(resolvedDuration, 'minute'))) {
180
+ if (finalAvailableTime.isBefore(_eventEnd) && _eventStart.isBefore(finalAvailableTime.add(30, 'minute'))) {
188
181
  var totalRequiredCapacity = currentUsedCapacity + currentCapacity + eventUsedCapacity;
189
182
  if (totalRequiredCapacity > totalCapacity) {
190
183
  // 容量不足,使用事件结束时间
@@ -201,7 +194,7 @@ export function findFastestAvailableResource(_ref2) {
201
194
  } finally {
202
195
  _iterator5.f();
203
196
  }
204
- if (finalAvailableTime.add(resolvedDuration, 'minute').isAfter(workEndTime)) {
197
+ if (finalAvailableTime.isAfter(workEndTime)) {
205
198
  console.log("[TimeslotUtils] \u8D44\u6E90 ".concat(_resource.id, " \u53EF\u7528\u65F6\u95F4\u8D85\u51FA\u5DE5\u4F5C\u65F6\u95F4\uFF0C\u8DF3\u8FC7"));
206
199
  return 0; // continue
207
200
  }
@@ -445,19 +445,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
445
445
  * 加车两阶段主决策(规格弹窗 / 资源编辑 / 直接加车)。
446
446
  * 与 ticketBooking `handleSelectProduct` + `handleBooking4Service` 等价。
447
447
  */
448
- decideAddProduct(item: any, options?: Partial<AddProductDecideContext>): {
449
- action: "reloadCatalog";
450
- } | {
451
- action: "add";
452
- cacheItem: any;
453
- } | {
454
- action: "requiresDetail";
455
- payload: AddProductRequiresDetailPayload;
456
- } | {
457
- action: "requiresBookingEdit";
458
- cacheItem: any;
459
- payload: import("./utils/addProductDecision").AddProductRequiresBookingEditPayload;
460
- };
448
+ decideAddProduct(item: any, options?: Partial<AddProductDecideContext>): import("./utils/addProductDecision").AddProductDecision;
461
449
  /** 规格弹窗 callback 后的第二段决策。 */
462
450
  decideAfterDetail(cacheItem: any, options?: Partial<AddProductDecideContext>): import("./utils/addProductDecision").AddProductDecision;
463
451
  /**
@@ -1901,7 +1901,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1901
1901
  var localSearch = function localSearch(v) {
1902
1902
  return _this5.store.products.findProductsByCodeOrBarcode(v);
1903
1903
  };
1904
- var scanCallback = handleGlobalScan(this.request, localSearch, this.getSubmitOrderSalesChannel());
1904
+ var scanCallback = handleGlobalScan(this.request, localSearch);
1905
1905
  var safeCallback = function safeCallback(d) {
1906
1906
  try {
1907
1907
  callback(d);
@@ -2395,7 +2395,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2395
2395
  localSearch = function localSearch(v) {
2396
2396
  return _this6.store.products.findProductsByCodeOrBarcode(v);
2397
2397
  };
2398
- scanCallback = handleGlobalScan(this.request, localSearch, this.getSubmitOrderSalesChannel());
2398
+ scanCallback = handleGlobalScan(this.request, localSearch);
2399
2399
  _context28.next = 9;
2400
2400
  return scanCallback({
2401
2401
  type: 'nativeScanner',
@@ -118,12 +118,15 @@ export interface BookingTicketCartBookingView extends ISalesBooking {
118
118
  canAddTime: boolean;
119
119
  };
120
120
  }
121
+ export type BookingTicketCartLineView = BookingTicketCartBookingView | BookingTicketCartItemView;
121
122
  /**
122
123
  * BookingTicket 面向 UI 的购物车视图。
123
124
  */
124
125
  export interface BookingTicketCartView {
125
126
  bookings: BookingTicketCartBookingView[];
126
127
  items: BookingTicketCartItemView[];
128
+ /** 以 tempOrder.products 为唯一顺序真源的统一购物车行(旧到新)。 */
129
+ lines: BookingTicketCartLineView[];
127
130
  }
128
131
  /**
129
132
  * BookingTicket 面向 UI 的客户展示视图。
@@ -108,33 +108,28 @@ export function buildCartView(lines, bookings) {
108
108
  var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
109
109
  var productLines = Array.isArray(lines) ? lines : [];
110
110
  var bookingList = Array.isArray(bookings) ? bookings : [];
111
+ var childBookings = bookingList.filter(function (booking) {
112
+ return booking.parent_id !== 0;
113
+ });
114
+ var bookingsByProductUid = indexBookingsByProductUid(childBookings);
111
115
  var linesByUid = indexProductsByUid(productLines);
112
116
  var addTimeLinesByBookingUid = indexAddTimeProductsByBookingUid(productLines);
113
- var claimedUids = new Set();
114
117
  var claimedAddTimeLines = new Set();
115
- var cartBookings = bookingList.filter(function (booking) {
116
- return booking.parent_id !== 0;
117
- }).reduce(function (acc, booking) {
118
- var uid = booking === null || booking === void 0 ? void 0 : booking.product_uid;
118
+ childBookings.forEach(function (booking) {
119
119
  var bookingUid = getBookingUid(booking);
120
- var product = null;
121
- if (uid !== undefined && uid !== null && uid !== '') {
122
- var key = String(uid);
123
- if (!claimedUids.has(key)) {
124
- var line = linesByUid[key];
125
- // 赠品预约只作为提交数据保留,不在购物车顶部预约卡片区展示。
126
- if (isGiftProductLine(line)) return acc;
127
- if (line) {
128
- claimedUids.add(key);
129
- product = line;
130
- }
131
- }
132
- }
133
- var addTimeProduct = bookingUid ? addTimeLinesByBookingUid[bookingUid] || [] : [];
134
- addTimeProduct.forEach(function (line) {
135
- return claimedAddTimeLines.add(line);
120
+ if (!bookingUid) return;
121
+ (addTimeLinesByBookingUid[bookingUid] || []).forEach(function (line) {
122
+ claimedAddTimeLines.add(line);
136
123
  });
137
- acc.push(_objectSpread(_objectSpread({}, booking), {}, {
124
+ });
125
+ var claimedBookings = new Set();
126
+ var cartBookings = [];
127
+ var items = [];
128
+ var orderedLines = [];
129
+ var buildBookingView = function buildBookingView(booking, product) {
130
+ var bookingUid = getBookingUid(booking);
131
+ var addTimeProduct = bookingUid ? addTimeLinesByBookingUid[bookingUid] || [] : [];
132
+ return _objectSpread(_objectSpread({}, booking), {}, {
138
133
  _extend: {
139
134
  product: product,
140
135
  addTimeProduct: addTimeProduct,
@@ -147,21 +142,38 @@ export function buildCartView(lines, bookings) {
147
142
  shopOpeningHours: options.shopOpeningHours
148
143
  })
149
144
  }
150
- }));
151
- return acc;
152
- }, []);
153
- var items = productLines.filter(function (line) {
145
+ });
146
+ };
147
+ productLines.forEach(function (line) {
154
148
  var _line$metadata6;
155
- // 促销赠品行仅通过主商品 Gift 行展示,不在 items 单独占一行(对齐 legacy `isGift: !!_giftInfo`)
156
- if (isGiftProductLine(line)) return false;
157
- if (claimedAddTimeLines.has(line)) return false;
149
+ // 赠品由主商品 Gift 行展示;加时商品挂在 booking._extend.addTimeProduct。
150
+ if (isGiftProductLine(line) || claimedAddTimeLines.has(line)) return;
158
151
  var uid = (_line$metadata6 = line.metadata) === null || _line$metadata6 === void 0 ? void 0 : _line$metadata6.unique_identification_number;
159
- if (uid === undefined || uid === null || uid === '') return true;
160
- return !claimedUids.has(String(uid));
152
+ var matchedBooking = uid === undefined || uid === null || uid === '' ? undefined : (bookingsByProductUid[String(uid)] || []).find(function (booking) {
153
+ return !claimedBookings.has(booking);
154
+ });
155
+ if (matchedBooking) {
156
+ claimedBookings.add(matchedBooking);
157
+ var bookingView = buildBookingView(matchedBooking, line);
158
+ cartBookings.push(bookingView);
159
+ orderedLines.push(bookingView);
160
+ return;
161
+ }
162
+ items.push(line);
163
+ orderedLines.push(line);
164
+ });
165
+ childBookings.forEach(function (booking) {
166
+ if (claimedBookings.has(booking)) return;
167
+ var uid = booking === null || booking === void 0 ? void 0 : booking.product_uid;
168
+ var linkedProduct = uid === undefined || uid === null || uid === '' ? null : linesByUid[String(uid)] || null;
169
+ // 赠品预约只作为提交数据保留,不在购物车预约卡片区展示。
170
+ if (isGiftProductLine(linkedProduct)) return;
171
+ cartBookings.push(buildBookingView(booking, null));
161
172
  });
162
173
  return {
163
174
  bookings: cartBookings,
164
- items: items
175
+ items: items,
176
+ lines: orderedLines
165
177
  };
166
178
  }
167
179
  export function isWalkInCustomer(customer) {
@@ -2,11 +2,9 @@ import { RequestPlugin } from '../../../../plugins';
2
2
  /**
3
3
  * 处理全局扫码
4
4
  * @param request 请求插件
5
- * @param localSearch 本地商品搜索
6
- * @param channel 当前销售渠道
7
5
  * @returns 处理结果
8
6
  */
9
- export declare const handleGlobalScan: (request: RequestPlugin, localSearch: (v: string) => any[], channel?: string) => (scanResult: {
7
+ export declare const handleGlobalScan: (request: RequestPlugin, localSearch: (v: string) => any[]) => (scanResult: {
10
8
  type: string;
11
9
  value: string;
12
10
  }) => Promise<any>;
@@ -1,10 +1,4 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
3
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
5
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
6
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
7
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
8
2
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
9
3
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
10
4
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
@@ -156,18 +150,16 @@ var handleScanFn = function handleScanFn(getRequestList, localSearch) {
156
150
  /**
157
151
  * 处理全局扫码
158
152
  * @param request 请求插件
159
- * @param localSearch 本地商品搜索
160
- * @param channel 当前销售渠道
161
153
  * @returns 处理结果
162
154
  */
163
- export var handleGlobalScan = function handleGlobalScan(request, localSearch, channel) {
155
+ export var handleGlobalScan = function handleGlobalScan(request, localSearch) {
164
156
  var getRequestList = function getRequestList(value) {
165
157
  var requestList = [];
166
158
  // 如果value是已WL开头的,则认为是钱包识别码
167
159
  if (value.startsWith('WL')) {
168
160
  requestList = [searchWallet(request, value)];
169
161
  } else {
170
- requestList = [].concat(_toConsumableArray(channel === 'kiosk' ? [] : [searchOrder(request, value)]), [searchWalletPass(request, value), searchWallet(request, value), searchProduct(request, value)]);
162
+ requestList = [searchOrder(request, value), searchWalletPass(request, value), searchWallet(request, value), searchProduct(request, value)];
171
163
  }
172
164
  return requestList;
173
165
  };
@@ -95,6 +95,7 @@ export declare class SalesImpl extends BaseModule implements Module, SalesModule
95
95
  * 2) 若无 active,返回已超时且仍占用中的预约(允许并发多条)
96
96
  * 3) 若仍无,返回最近一组未来预约(同 start_time 的并发预约全部返回)
97
97
  * 4) 最后兜底返回一条(避免资源有历史预约时完全无反馈)
98
+ * - includeAllFuture 时,保留选中预约并返回当天全部后续预约;仅详情接口启用。
98
99
  */
99
100
  private pickBookingsForCurrentPoint;
100
101
  /**
@@ -485,11 +485,13 @@ export var SalesImpl = /*#__PURE__*/function (_BaseModule) {
485
485
  * 2) 若无 active,返回已超时且仍占用中的预约(允许并发多条)
486
486
  * 3) 若仍无,返回最近一组未来预约(同 start_time 的并发预约全部返回)
487
487
  * 4) 最后兜底返回一条(避免资源有历史预约时完全无反馈)
488
+ * - includeAllFuture 时,保留选中预约并返回当天全部后续预约;仅详情接口启用。
488
489
  */
489
490
  }, {
490
491
  key: "pickBookingsForCurrentPoint",
491
492
  value: function pickBookingsForCurrentPoint(current, bookings) {
492
493
  var _this4 = this;
494
+ var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
493
495
  if (bookings.length === 0) return [];
494
496
  var currentDayStart = current.startOf('day');
495
497
  var currentDayEnd = current.endOf('day');
@@ -504,6 +506,13 @@ export var SalesImpl = /*#__PURE__*/function (_BaseModule) {
504
506
  if (dayScopedBookings.length === 0) return [];
505
507
  var appendNextStartGroupIfNeeded = function appendNextStartGroupIfNeeded(selectedBookings) {
506
508
  if (selectedBookings.length === 0) return selectedBookings;
509
+ if (options.includeAllFuture) {
510
+ var allFutureBookings = dayScopedBookings.filter(function (booking) {
511
+ var startAt = _this4.toBookingDateTime(booking.start_date, booking.start_time);
512
+ return startAt.isValid() && startAt.isAfter(current);
513
+ });
514
+ return [].concat(_toConsumableArray(selectedBookings), _toConsumableArray(allFutureBookings));
515
+ }
507
516
  var shouldAppendNextGroup = selectedBookings.some(function (booking) {
508
517
  return booking.status === 'reserved' || booking.status === 'occupied';
509
518
  });
@@ -554,6 +563,7 @@ export var SalesImpl = /*#__PURE__*/function (_BaseModule) {
554
563
  return startAt.isValid() && startAt.isAfter(current) && startAt.isSame(current, 'day');
555
564
  });
556
565
  if (upcoming.length > 0) {
566
+ if (options.includeAllFuture) return upcoming;
557
567
  var firstStartAt = this.toBookingDateTime(upcoming[0].start_date, upcoming[0].start_time).valueOf();
558
568
  var upcomingStartGroup = upcoming.filter(function (booking) {
559
569
  var startAt = _this4.toBookingDateTime(booking.start_date, booking.start_time);
@@ -907,7 +917,9 @@ export var SalesImpl = /*#__PURE__*/function (_BaseModule) {
907
917
  unpaidBookingList = matchedBookingList.filter(function (booking) {
908
918
  return _this7.isUnpaidBooking(booking);
909
919
  });
910
- bookings = this.pickBookingsForCurrentPoint(current, this.normalizeResourceBookings(current, deviceCurrent, matchedBookingList));
920
+ bookings = this.pickBookingsForCurrentPoint(current, this.normalizeResourceBookings(current, deviceCurrent, matchedBookingList), {
921
+ includeAllFuture: true
922
+ });
911
923
  completedBookings = completedBookingList.map(function (booking) {
912
924
  return _objectSpread(_objectSpread({}, booking), {}, {
913
925
  status: 'compelete',
@@ -919,7 +931,9 @@ export var SalesImpl = /*#__PURE__*/function (_BaseModule) {
919
931
  remainingReserveTime: undefined
920
932
  });
921
933
  });
922
- unpaidBookings = this.pickBookingsForCurrentPoint(current, this.normalizeResourceBookings(current, deviceCurrent, unpaidBookingList));
934
+ unpaidBookings = this.pickBookingsForCurrentPoint(current, this.normalizeResourceBookings(current, deviceCurrent, unpaidBookingList), {
935
+ includeAllFuture: true
936
+ });
923
937
  orderCount = this.countBookingOrders(statsBookingList);
924
938
  bookingCount = statsBookingList.length;
925
939
  compeleteBookingCount = this.countCompletedBookings(statsBookingList);
@@ -1,9 +1,8 @@
1
1
  import { Module, ModuleOptions, PisellCore } from '../../types';
2
- import { BaseSalesImpl } from '../BaseSales';
3
- import { ScanOrderAddLogParams, ScanOrderAvailabilityInfo, ScanOrderAllowAddItemsInfo, ScanOrderOrderProduct, ScanOrderOrderProductIdentity, ScanOrderReservationResourceSelectInfo, ScanOrderState, ScanOrderScanCodeResult, ScanOrderSyncAdditionalOrderResult } from './types';
2
+ import { BaseModule } from '../../modules/BaseModule';
3
+ import { ScanOrderAddLogParams, ScanOrderAvailabilityInfo, ScanOrderOrderProduct, ScanOrderOrderProductIdentity, ScanOrderScanCodeResult } from './types';
4
4
  import type { UpdateOrderProductParams } from '../../modules/Order/types';
5
5
  import type { Discount } from '../../modules/Discount/types';
6
- import { RequestPlugin, WindowPlugin } from '../../plugins';
7
6
  import { type CartItemSummary, type PaxInfo, type QuantityCheckResult, type QuantityLimitResult } from '../../model/strategy/adapter/itemRule';
8
7
  import type { StrategyConfig } from '../../model/strategy/type';
9
8
  import type { ProductData } from '../../modules/Product/types';
@@ -16,16 +15,16 @@ interface ScanOrderItemRuleRuntimeConfig {
16
15
  submissionIndex?: number;
17
16
  custom?: Record<string, any>;
18
17
  }
19
- export declare class ScanOrderImpl extends BaseSalesImpl implements Module {
18
+ export declare class ScanOrderImpl extends BaseModule implements Module {
20
19
  protected defaultName: string;
21
20
  protected defaultVersion: string;
22
21
  isSolution: boolean;
23
- protected initializeOptions: ModuleOptions;
24
- protected store: ScanOrderState;
25
- protected otherParams: Record<string, any>;
26
- protected cacheId: string | undefined;
27
- window: WindowPlugin;
28
- request: RequestPlugin;
22
+ private initializeOptions;
23
+ private store;
24
+ private otherParams;
25
+ private cacheId;
26
+ private window;
27
+ private request;
29
28
  private itemRuleEvaluator;
30
29
  private itemRuleConfigs;
31
30
  private itemRuleConfigsPromise;
@@ -54,10 +53,9 @@ export declare class ScanOrderImpl extends BaseSalesImpl implements Module {
54
53
  private registerCustomerLoginListeners;
55
54
  private refreshOrderMarketingAfterLogin;
56
55
  constructor(name?: string, version?: string);
57
- protected getRegisteredModuleNames(): readonly string[];
58
- protected createSubModule(moduleName: string): Module | null;
59
56
  /** 与 `otherParams.cacheId` 一致,供宿主在 URL 变化时判断是否需要重新注册模块 */
60
57
  getCacheId(): string | undefined;
58
+ private destroyRegisteredChildModules;
61
59
  initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
62
60
  destroy(): Promise<void>;
63
61
  retryInit(): Promise<void>;
@@ -73,14 +71,12 @@ export declare class ScanOrderImpl extends BaseSalesImpl implements Module {
73
71
  };
74
72
  getTempOrder(): import("../../modules/Order/types").OrderTempOrder | null;
75
73
  updateTempOrderNote(note: string): string;
76
- updateTempOrderNote(note: string, sync: true): Promise<string>;
77
- updateTempOrderNote(note: string, sync: boolean): string | Promise<string>;
78
74
  setPickupReferenceMode(mode: 'counter_pickup' | 'table_service'): {
79
- service_type: 'dine_in' | '';
75
+ service_type: 'dine_in';
80
76
  pickup_reference_mode: 'counter_pickup' | 'table_service';
81
77
  };
82
78
  setPickupRef(buzzer: string): string;
83
- private ensureScanOrderTempOrder;
79
+ private ensureTempOrder;
84
80
  addNewOrder(): Promise<import("../../modules/Order/types").OrderTempOrder>;
85
81
  restoreOrder(): Promise<import("../../modules/Order/types").OrderTempOrder>;
86
82
  getOrderProducts(): import("../../modules/Order/types").OrderProduct[];
@@ -96,10 +92,7 @@ export declare class ScanOrderImpl extends BaseSalesImpl implements Module {
96
92
  }): Promise<void>;
97
93
  private findReservationRuleResource;
98
94
  private buildScanOrderResourceMetadata;
99
- private prepareRetailAvailability;
100
95
  private buildSubmitPayloadEnhancer;
101
- private isScanOrderMoreMode;
102
- private submitScanOrderMore;
103
96
  submitScanOrder<T = any>(): Promise<T>;
104
97
  addProductToOrder(product: Partial<ScanOrderOrderProduct> & ScanOrderOrderProductIdentity): Promise<import("../../modules/Order/types").OrderProduct[]>;
105
98
  updateOrderProduct(params: UpdateOrderProductParams): Promise<import("../../modules/Order/types").OrderProduct[]>;
@@ -124,10 +117,8 @@ export declare class ScanOrderImpl extends BaseSalesImpl implements Module {
124
117
  setItemRuleRuntimeConfig(config?: ScanOrderItemRuleRuntimeConfig): Promise<void>;
125
118
  private normalizeResourceState;
126
119
  private resolveResourceSelectType;
127
- private fetchResourceOccupyDetailsByResourceId;
128
- private resolveAdditionalOrderFromOccupyDetail;
129
- checkResourceAvailable(resourceId?: string | null, hasOrderId?: boolean): Promise<ScanOrderAvailabilityInfo>;
130
- restorePreviousOrderData(): Promise<void>;
120
+ private fetchResourceOccupyDetailByResourceId;
121
+ checkResourceAvailable(resourceId: string, hasOrderId: boolean): Promise<ScanOrderAvailabilityInfo>;
131
122
  getAdditionalOrderInfo(): Promise<{
132
123
  orderId: string;
133
124
  orderStatus: 'pending' | 'processing' | 'completed' | 'cancelled';
@@ -150,9 +141,6 @@ export declare class ScanOrderImpl extends BaseSalesImpl implements Module {
150
141
  clearUIState(): void;
151
142
  setEntryPaxNumber(number: number): Promise<void>;
152
143
  getEntryPaxNumber(): number | null;
153
- syncAdditionalOrderFromResource(resourceId?: string | null): Promise<ScanOrderSyncAdditionalOrderResult>;
154
- getReservationResourceSelectType(): ScanOrderReservationResourceSelectInfo;
155
- checkAllowAddItems(): ScanOrderAllowAddItemsInfo;
156
144
  getFulfillmentModes(): {
157
145
  enablePickup: boolean;
158
146
  enableTableService: boolean;