@pisell/pisellos 2.2.291 → 2.2.293

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 (174) hide show
  1. package/dist/core/index.d.ts +7 -0
  2. package/dist/core/index.js +108 -65
  3. package/dist/model/strategy/adapter/itemRule/adapter.d.ts +4 -1
  4. package/dist/model/strategy/adapter/itemRule/adapter.js +135 -35
  5. package/dist/model/strategy/adapter/itemRule/evaluator.d.ts +8 -1
  6. package/dist/model/strategy/adapter/itemRule/evaluator.js +25 -1
  7. package/dist/model/strategy/adapter/itemRule/type.d.ts +44 -0
  8. package/dist/model/strategy/adapter/itemRule/type.js +19 -1
  9. package/dist/model/strategy/adapter/promotion/index.js +0 -9
  10. package/dist/modules/BookingContext/index.d.ts +3 -0
  11. package/dist/modules/BookingContext/index.js +42 -13
  12. package/dist/modules/BookingContext/types.d.ts +4 -4
  13. package/dist/modules/BookingContext/types.js +3 -3
  14. package/dist/modules/OpenData/types.d.ts +1 -0
  15. package/dist/modules/Order/index.d.ts +18 -3
  16. package/dist/modules/Order/index.js +885 -485
  17. package/dist/modules/Order/salesNotes.d.ts +31 -0
  18. package/dist/modules/Order/salesNotes.js +492 -0
  19. package/dist/modules/Order/types.d.ts +93 -5
  20. package/dist/modules/Order/types.js +5 -0
  21. package/dist/modules/Order/utils.d.ts +12 -0
  22. package/dist/modules/Order/utils.js +96 -31
  23. package/dist/modules/Product/types.d.ts +2 -0
  24. package/dist/modules/ProductList/clientDataVariants.d.ts +50 -0
  25. package/dist/modules/ProductList/clientDataVariants.js +216 -0
  26. package/dist/modules/ProductList/index.d.ts +18 -3
  27. package/dist/modules/ProductList/index.js +220 -38
  28. package/dist/modules/ProductList/types.d.ts +10 -0
  29. package/dist/modules/Quotation/index.d.ts +22 -0
  30. package/dist/modules/Quotation/index.js +293 -28
  31. package/dist/modules/ResourcePlanner/index.d.ts +0 -22
  32. package/dist/modules/ResourcePlanner/index.js +1 -180
  33. package/dist/modules/ResourcePlanner/localClock.d.ts +33 -0
  34. package/dist/modules/ResourcePlanner/localClock.js +183 -0
  35. package/dist/modules/ResourcePlanner/planner.d.ts +5 -14
  36. package/dist/modules/ResourcePlanner/planner.js +2111 -958
  37. package/dist/modules/ResourcePlanner/types.d.ts +359 -187
  38. package/dist/modules/ResourcePlanner/types.js +33 -1
  39. package/dist/plugins/request.d.ts +1 -0
  40. package/dist/server/index.d.ts +17 -2
  41. package/dist/server/index.js +1134 -932
  42. package/dist/server/modules/floor-plan/index.d.ts +4 -0
  43. package/dist/server/modules/floor-plan/index.js +240 -98
  44. package/dist/server/modules/menu/index.js +48 -23
  45. package/dist/server/modules/order/index.d.ts +17 -7
  46. package/dist/server/modules/order/index.js +419 -207
  47. package/dist/server/modules/products/index.d.ts +10 -4
  48. package/dist/server/modules/products/index.js +177 -84
  49. package/dist/server/modules/resource/index.js +21 -13
  50. package/dist/server/utils/product.d.ts +1 -1
  51. package/dist/server/utils/product.js +186 -22
  52. package/dist/server/utils/small-ticket.d.ts +9 -1
  53. package/dist/server/utils/small-ticket.js +131 -84
  54. package/dist/solution/BaseSales/index.d.ts +26 -3
  55. package/dist/solution/BaseSales/index.js +1384 -905
  56. package/dist/solution/BaseSales/types.d.ts +2 -0
  57. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +3 -0
  58. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +10 -3
  59. package/dist/solution/BaseSales/utils.js +6 -3
  60. package/dist/solution/BookingByStep/index.d.ts +4 -4
  61. package/dist/solution/BookingTicket/index.d.ts +1 -1
  62. package/dist/solution/BookingTicket/index.js +4 -2
  63. package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +2 -1
  64. package/dist/solution/BookingTicket/utils/addProductDecision.js +6 -3
  65. package/dist/solution/BookingTicket/utils/orderCustomer.js +3 -2
  66. package/dist/solution/RegisterAndLogin/config.d.ts +9 -3
  67. package/dist/solution/RegisterAndLogin/config.js +95 -40
  68. package/dist/solution/RegisterAndLogin/index.js +4 -1
  69. package/dist/solution/ScanOrder/index.d.ts +1 -0
  70. package/dist/solution/ScanOrder/index.js +31 -27
  71. package/dist/solution/ScanOrder/types.d.ts +2 -0
  72. package/dist/solution/ScanOrder/utils.d.ts +1 -0
  73. package/dist/solution/ScanOrder/utils.js +8 -3
  74. package/dist/solution/UnifiedBookingSales/index.d.ts +128 -74
  75. package/dist/solution/UnifiedBookingSales/index.js +3877 -963
  76. package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +49 -0
  77. package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.js +430 -0
  78. package/dist/solution/UnifiedBookingSales/types.d.ts +161 -77
  79. package/dist/solution/UnifiedBookingSales/types.js +4 -9
  80. package/dist/solution/VenueBooking/index.d.ts +3 -0
  81. package/dist/solution/VenueBooking/index.js +549 -497
  82. package/dist/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
  83. package/dist/solution/VenueBooking/utils/dateSummary.js +3 -1
  84. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +2 -0
  85. package/dist/solution/VenueBooking/utils/slotMerge.js +3 -1
  86. package/dist/utils/platform.d.ts +8 -0
  87. package/dist/utils/platform.js +15 -0
  88. package/lib/core/index.d.ts +7 -0
  89. package/lib/core/index.js +20 -2
  90. package/lib/model/strategy/adapter/itemRule/adapter.d.ts +4 -1
  91. package/lib/model/strategy/adapter/itemRule/adapter.js +73 -4
  92. package/lib/model/strategy/adapter/itemRule/evaluator.d.ts +8 -1
  93. package/lib/model/strategy/adapter/itemRule/evaluator.js +23 -1
  94. package/lib/model/strategy/adapter/itemRule/type.d.ts +44 -0
  95. package/lib/model/strategy/adapter/itemRule/type.js +19 -1
  96. package/lib/modules/BookingContext/index.d.ts +3 -0
  97. package/lib/modules/BookingContext/index.js +35 -8
  98. package/lib/modules/BookingContext/types.d.ts +4 -4
  99. package/lib/modules/BookingContext/types.js +3 -3
  100. package/lib/modules/OpenData/types.d.ts +1 -0
  101. package/lib/modules/Order/index.d.ts +18 -3
  102. package/lib/modules/Order/index.js +325 -28
  103. package/lib/modules/Order/salesNotes.d.ts +31 -0
  104. package/lib/modules/Order/salesNotes.js +382 -0
  105. package/lib/modules/Order/types.d.ts +93 -5
  106. package/lib/modules/Order/types.js +4 -0
  107. package/lib/modules/Order/utils.d.ts +12 -0
  108. package/lib/modules/Order/utils.js +85 -16
  109. package/lib/modules/Product/types.d.ts +2 -0
  110. package/lib/modules/ProductList/clientDataVariants.d.ts +50 -0
  111. package/lib/modules/ProductList/clientDataVariants.js +204 -0
  112. package/lib/modules/ProductList/index.d.ts +18 -3
  113. package/lib/modules/ProductList/index.js +137 -8
  114. package/lib/modules/ProductList/types.d.ts +10 -0
  115. package/lib/modules/Quotation/index.d.ts +22 -0
  116. package/lib/modules/Quotation/index.js +158 -11
  117. package/lib/modules/ResourcePlanner/index.d.ts +0 -22
  118. package/lib/modules/ResourcePlanner/index.js +9 -129
  119. package/lib/modules/ResourcePlanner/localClock.d.ts +33 -0
  120. package/lib/modules/ResourcePlanner/localClock.js +205 -0
  121. package/lib/modules/ResourcePlanner/planner.d.ts +5 -14
  122. package/lib/modules/ResourcePlanner/planner.js +1807 -783
  123. package/lib/modules/ResourcePlanner/types.d.ts +359 -187
  124. package/lib/modules/ResourcePlanner/types.js +13 -1
  125. package/lib/plugins/request.d.ts +1 -0
  126. package/lib/server/index.d.ts +17 -2
  127. package/lib/server/index.js +149 -21
  128. package/lib/server/modules/floor-plan/index.d.ts +4 -0
  129. package/lib/server/modules/floor-plan/index.js +60 -7
  130. package/lib/server/modules/menu/index.js +26 -4
  131. package/lib/server/modules/order/index.d.ts +17 -7
  132. package/lib/server/modules/order/index.js +194 -57
  133. package/lib/server/modules/products/index.d.ts +10 -4
  134. package/lib/server/modules/products/index.js +93 -23
  135. package/lib/server/modules/resource/index.js +12 -2
  136. package/lib/server/utils/product.d.ts +1 -1
  137. package/lib/server/utils/product.js +163 -3
  138. package/lib/server/utils/small-ticket.d.ts +9 -1
  139. package/lib/server/utils/small-ticket.js +123 -79
  140. package/lib/solution/BaseSales/index.d.ts +26 -3
  141. package/lib/solution/BaseSales/index.js +396 -70
  142. package/lib/solution/BaseSales/types.d.ts +2 -0
  143. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +3 -0
  144. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +9 -2
  145. package/lib/solution/BaseSales/utils.js +3 -0
  146. package/lib/solution/BookingByStep/index.d.ts +4 -4
  147. package/lib/solution/BookingTicket/index.d.ts +1 -1
  148. package/lib/solution/BookingTicket/index.js +2 -1
  149. package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +2 -1
  150. package/lib/solution/BookingTicket/utils/addProductDecision.js +5 -2
  151. package/lib/solution/BookingTicket/utils/orderCustomer.js +2 -1
  152. package/lib/solution/RegisterAndLogin/config.d.ts +9 -3
  153. package/lib/solution/RegisterAndLogin/config.js +49 -8
  154. package/lib/solution/RegisterAndLogin/index.js +4 -1
  155. package/lib/solution/ScanOrder/index.d.ts +1 -0
  156. package/lib/solution/ScanOrder/index.js +5 -1
  157. package/lib/solution/ScanOrder/types.d.ts +2 -0
  158. package/lib/solution/ScanOrder/utils.d.ts +1 -0
  159. package/lib/solution/ScanOrder/utils.js +4 -0
  160. package/lib/solution/UnifiedBookingSales/index.d.ts +128 -74
  161. package/lib/solution/UnifiedBookingSales/index.js +2592 -424
  162. package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +49 -0
  163. package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.js +316 -0
  164. package/lib/solution/UnifiedBookingSales/types.d.ts +161 -77
  165. package/lib/solution/UnifiedBookingSales/types.js +4 -6
  166. package/lib/solution/VenueBooking/index.d.ts +3 -0
  167. package/lib/solution/VenueBooking/index.js +33 -9
  168. package/lib/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
  169. package/lib/solution/VenueBooking/utils/dateSummary.js +3 -1
  170. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +2 -0
  171. package/lib/solution/VenueBooking/utils/slotMerge.js +3 -1
  172. package/lib/utils/platform.d.ts +8 -0
  173. package/lib/utils/platform.js +22 -0
  174. package/package.json +1 -1
@@ -1,4 +1,3 @@
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
1
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
3
2
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
3
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -6,6 +5,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
6
5
  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; }
7
6
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
8
7
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
+ 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); }
9
9
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
10
10
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11
11
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -195,9 +195,120 @@ var I18N_FIELD_MAP = {
195
195
  description_i18n: 'description',
196
196
  cover_i18n: 'cover'
197
197
  };
198
+ /**
199
+ * 按当前语言读取 i18n 文案;当前语言为空时回退到商家原始文案。
200
+ */
201
+ function resolveI18nValue(i18nDict, locale) {
202
+ if (!i18nDict) return undefined;
203
+ return i18nDict[locale] || i18nDict.original || undefined;
204
+ }
205
+
206
+ /**
207
+ * 递归格式化商品分类名称,同时保留未变化节点的引用。
208
+ */
209
+ function applyI18nToCategory(category, locale) {
210
+ if (!category || _typeof(category) !== 'object') return category;
211
+ var localizedName = resolveI18nValue(category.name_i18n, locale);
212
+ var localizedParent = applyI18nToCategory(category.parent_category, locale);
213
+ var nameChanged = localizedName !== undefined && localizedName !== category.name;
214
+ var parentChanged = localizedParent !== category.parent_category;
215
+ if (!nameChanged && !parentChanged) return category;
216
+ return _objectSpread(_objectSpread(_objectSpread({}, category), nameChanged ? {
217
+ name: localizedName
218
+ } : {}), parentChanged ? {
219
+ parent_category: localizedParent
220
+ } : {});
221
+ }
222
+ function applyI18nToCategories(categories, locale) {
223
+ if (!Array.isArray(categories)) return categories;
224
+ var changed = false;
225
+ var localizedCategories = categories.map(function (category) {
226
+ var localizedCategory = applyI18nToCategory(category, locale);
227
+ if (localizedCategory !== category) changed = true;
228
+ return localizedCategory;
229
+ });
230
+ return changed ? localizedCategories : categories;
231
+ }
232
+ function applyI18nToNamedItems(items, locale) {
233
+ if (!Array.isArray(items)) return items;
234
+ var changed = false;
235
+ var localizedItems = items.map(function (item) {
236
+ if (!item || _typeof(item) !== 'object') return item;
237
+ var localizedName = resolveI18nValue(item.name_i18n, locale);
238
+ if (localizedName === undefined || localizedName === item.name) return item;
239
+ changed = true;
240
+ return _objectSpread(_objectSpread({}, item), {}, {
241
+ name: localizedName
242
+ });
243
+ });
244
+ return changed ? localizedItems : items;
245
+ }
246
+
247
+ /**
248
+ * 格式化选项组、规格组及其子项名称,同时保留未变化节点的引用。
249
+ */
250
+ function applyI18nToNamedGroups(groups, itemKey, locale) {
251
+ if (!Array.isArray(groups)) return groups;
252
+ var changed = false;
253
+ var localizedGroups = groups.map(function (group) {
254
+ if (!group || _typeof(group) !== 'object') return group;
255
+ var localizedName = resolveI18nValue(group.name_i18n, locale);
256
+ var localizedItems = applyI18nToNamedItems(group[itemKey], locale);
257
+ var nameChanged = localizedName !== undefined && localizedName !== group.name;
258
+ var itemsChanged = localizedItems !== group[itemKey];
259
+ if (!nameChanged && !itemsChanged) return group;
260
+ changed = true;
261
+ return _objectSpread(_objectSpread(_objectSpread({}, group), nameChanged ? {
262
+ name: localizedName
263
+ } : {}), itemsChanged ? _defineProperty({}, itemKey, localizedItems) : {});
264
+ });
265
+ return changed ? localizedGroups : groups;
266
+ }
267
+ function applyI18nToBundleItems(items, locale) {
268
+ if (!Array.isArray(items)) return items;
269
+ var changed = false;
270
+ var localizedItems = items.map(function (item) {
271
+ if (!item || _typeof(item) !== 'object') return item;
272
+ var localizedTitle = resolveI18nValue(item.trans_title, locale);
273
+ var localizedOptionGroups = applyI18nToNamedGroups(item.option_group, 'option_item', locale);
274
+ var titleChanged = localizedTitle !== undefined && localizedTitle !== item.title;
275
+ var optionGroupsChanged = localizedOptionGroups !== item.option_group;
276
+ if (!titleChanged && !optionGroupsChanged) return item;
277
+ changed = true;
278
+ return _objectSpread(_objectSpread(_objectSpread({}, item), titleChanged ? {
279
+ title: localizedTitle
280
+ } : {}), optionGroupsChanged ? {
281
+ option_group: localizedOptionGroups
282
+ } : {});
283
+ });
284
+ return changed ? localizedItems : items;
285
+ }
198
286
 
199
287
  /**
200
- * 根据 locale 将商品的 i18n 字段覆盖到对应原始字段
288
+ * 格式化套餐组名称、套餐子商品标题及子商品选项,同时保留未变化节点的引用。
289
+ */
290
+ function applyI18nToBundleGroups(groups, locale) {
291
+ if (!Array.isArray(groups)) return groups;
292
+ var changed = false;
293
+ var localizedGroups = groups.map(function (group) {
294
+ if (!group || _typeof(group) !== 'object') return group;
295
+ var localizedName = resolveI18nValue(group.name_i18n, locale);
296
+ var localizedItems = applyI18nToBundleItems(group.bundle_item, locale);
297
+ var nameChanged = localizedName !== undefined && localizedName !== group.name;
298
+ var itemsChanged = localizedItems !== group.bundle_item;
299
+ if (!nameChanged && !itemsChanged) return group;
300
+ changed = true;
301
+ return _objectSpread(_objectSpread(_objectSpread({}, group), nameChanged ? {
302
+ name: localizedName
303
+ } : {}), itemsChanged ? {
304
+ bundle_item: localizedItems
305
+ } : {});
306
+ });
307
+ return changed ? localizedGroups : groups;
308
+ }
309
+
310
+ /**
311
+ * 根据 locale 格式化商品、分类、规格及套餐文案,缺少对应语言时回退 original。
201
312
  */
202
313
  export function applyI18nToProducts(products, locale) {
203
314
  if (!locale) return products;
@@ -210,12 +321,65 @@ export function applyI18nToProducts(products, locale) {
210
321
  originalKey = _Object$entries$_i[1];
211
322
  var i18nDict = product[i18nKey];
212
323
  if (!i18nDict) continue;
213
- var localizedValue = i18nDict[locale];
214
- if (localizedValue) {
324
+ var localizedValue = resolveI18nValue(i18nDict, locale);
325
+ if (localizedValue !== undefined && localizedValue !== product[originalKey]) {
215
326
  if (!patched) patched = _objectSpread({}, product);
216
327
  patched[originalKey] = localizedValue;
217
328
  }
218
329
  }
330
+ var _iterator = _createForOfIteratorHelper(['category', 'categories']),
331
+ _step;
332
+ try {
333
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
334
+ var categoryKey = _step.value;
335
+ var categories = product[categoryKey];
336
+ var localizedCategories = applyI18nToCategories(categories, locale);
337
+ if (localizedCategories !== categories) {
338
+ if (!patched) patched = _objectSpread({}, product);
339
+ patched[categoryKey] = localizedCategories;
340
+ }
341
+ }
342
+ } catch (err) {
343
+ _iterator.e(err);
344
+ } finally {
345
+ _iterator.f();
346
+ }
347
+ var _iterator2 = _createForOfIteratorHelper([['option_group', 'option_item'], ['variant_group', 'variant_item']]),
348
+ _step2;
349
+ try {
350
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
351
+ var _step2$value = _slicedToArray(_step2.value, 2),
352
+ groupKey = _step2$value[0],
353
+ itemKey = _step2$value[1];
354
+ var groups = product[groupKey];
355
+ var localizedGroups = applyI18nToNamedGroups(groups, itemKey, locale);
356
+ if (localizedGroups !== groups) {
357
+ if (!patched) patched = _objectSpread({}, product);
358
+ patched[groupKey] = localizedGroups;
359
+ }
360
+ }
361
+ } catch (err) {
362
+ _iterator2.e(err);
363
+ } finally {
364
+ _iterator2.f();
365
+ }
366
+ var _iterator3 = _createForOfIteratorHelper(['bundle_group', 'bundle_groups']),
367
+ _step3;
368
+ try {
369
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
370
+ var bundleGroupKey = _step3.value;
371
+ var _groups = product[bundleGroupKey];
372
+ var _localizedGroups = applyI18nToBundleGroups(_groups, locale);
373
+ if (_localizedGroups !== _groups) {
374
+ if (!patched) patched = _objectSpread({}, product);
375
+ patched[bundleGroupKey] = _localizedGroups;
376
+ }
377
+ }
378
+ } catch (err) {
379
+ _iterator3.e(err);
380
+ } finally {
381
+ _iterator3.f();
382
+ }
219
383
  return (_patched = patched) !== null && _patched !== void 0 ? _patched : product;
220
384
  });
221
385
  }
@@ -234,54 +398,54 @@ var formatDataKey = function formatDataKey(data) {
234
398
 
235
399
  // 单规格
236
400
  if (_data !== null && _data !== void 0 && (_data$option = _data.option) !== null && _data$option !== void 0 && _data$option.length) {
237
- var _iterator = _createForOfIteratorHelper(_data.option),
238
- _step;
401
+ var _iterator4 = _createForOfIteratorHelper(_data.option),
402
+ _step4;
239
403
  try {
240
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
241
- var item = _step.value;
404
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
405
+ var item = _step4.value;
242
406
  var _str = "_".concat(item.option_group_id, "_").concat(item.option_group_item_id);
243
407
  key += _str;
244
408
  rowKey += "".concat(_str, "_").concat(item.quantity || item.num);
245
409
  }
246
410
  } catch (err) {
247
- _iterator.e(err);
411
+ _iterator4.e(err);
248
412
  } finally {
249
- _iterator.f();
413
+ _iterator4.f();
250
414
  }
251
415
  }
252
416
 
253
417
  // 套餐
254
418
  if (_data !== null && _data !== void 0 && (_data$bundle = _data.bundle) !== null && _data$bundle !== void 0 && _data$bundle.length) {
255
- var _iterator2 = _createForOfIteratorHelper(_data.bundle),
256
- _step2;
419
+ var _iterator5 = _createForOfIteratorHelper(_data.bundle),
420
+ _step5;
257
421
  try {
258
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
259
- var _item = _step2.value;
422
+ for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
423
+ var _item = _step5.value;
260
424
  var _str2 = "_".concat(_item.group_id, "_").concat(_item.bundle_product_id);
261
425
  key += _str2;
262
426
  rowKey += "".concat(_str2, "_").concat(_item.quantity || _item.num);
263
427
  // 如果有单规格
264
428
  if (_item !== null && _item !== void 0 && _item.option) {
265
- var _iterator3 = _createForOfIteratorHelper(_item.option),
266
- _step3;
429
+ var _iterator6 = _createForOfIteratorHelper(_item.option),
430
+ _step6;
267
431
  try {
268
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
269
- var opt = _step3.value;
432
+ for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
433
+ var opt = _step6.value;
270
434
  var _str3 = "_".concat(opt.option_group_id, "_").concat(opt.option_group_item_id);
271
435
  key += _str3;
272
436
  rowKey += "".concat(_str3, "_").concat(opt.quantity || opt.num);
273
437
  }
274
438
  } catch (err) {
275
- _iterator3.e(err);
439
+ _iterator6.e(err);
276
440
  } finally {
277
- _iterator3.f();
441
+ _iterator6.f();
278
442
  }
279
443
  }
280
444
  }
281
445
  } catch (err) {
282
- _iterator2.e(err);
446
+ _iterator5.e(err);
283
447
  } finally {
284
- _iterator2.f();
448
+ _iterator5.f();
285
449
  }
286
450
  }
287
451
 
@@ -35,6 +35,8 @@ export interface SmallTicketProduct {
35
35
  original_price: string;
36
36
  total_original_price: string;
37
37
  extension_list: any[];
38
+ product_uid?: string | number;
39
+ booking_uid?: string | number;
38
40
  options?: Array<{
39
41
  name: string;
40
42
  num?: number;
@@ -44,6 +46,11 @@ export interface SmallTicketProduct {
44
46
  variant?: string;
45
47
  combinations?: any[];
46
48
  }
49
+ export interface SmallTicketBookingSnapshot extends Record<string, any> {
50
+ product_uid?: string | number;
51
+ booking_uid?: string | number;
52
+ }
53
+ export type SmallTicketAppointment = SmallTicketItem[] | SmallTicketBookingSnapshot[];
47
54
  export interface SmallTicketLocaleData {
48
55
  base_data: Record<string, any>;
49
56
  products: SmallTicketProduct[];
@@ -52,7 +59,7 @@ export interface SmallTicketLocaleData {
52
59
  countFee: Record<string, any>;
53
60
  };
54
61
  customer: SmallTicketItem[];
55
- appointment: SmallTicketItem[];
62
+ appointment: SmallTicketAppointment;
56
63
  delivery?: SmallTicketItem[];
57
64
  resources: Array<{
58
65
  id: string | number;
@@ -61,6 +68,7 @@ export interface SmallTicketLocaleData {
61
68
  form_title: string;
62
69
  }>;
63
70
  payment_data: SmallTicketItem[][];
71
+ wallets: SmallTicketItem[][];
64
72
  tickets: any[];
65
73
  source_shop: any[];
66
74
  refund_data: any[];