@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
@@ -582,7 +582,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
582
582
  break;
583
583
  }
584
584
  _context5.next = 6;
585
- return _this3.store.quotation.loadQuotations({
585
+ return _this3.ensureQuotationsLoaded({
586
586
  channel: (_this3$otherParams = _this3.otherParams) === null || _this3$otherParams === void 0 ? void 0 : _this3$otherParams.channel
587
587
  });
588
588
  case 6:
@@ -670,7 +670,6 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
670
670
  holderModule,
671
671
  _this$store$order,
672
672
  _this$store$order2,
673
- _this$store$quotation,
674
673
  _this$otherParams11,
675
674
  _args7 = arguments;
676
675
  return _regeneratorRuntime().wrap(function _callee7$(_context7) {
@@ -840,7 +839,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
840
839
  return this.store.schedule.loadAllSchedule();
841
840
  case 54:
842
841
  this.injectScheduleResolverToQuotation();
843
- (_this$store$quotation = this.store.quotation) === null || _this$store$quotation === void 0 || _this$store$quotation.loadQuotations({
842
+ this.preloadQuotations({
844
843
  channel: (_this$otherParams11 = this.otherParams) === null || _this$otherParams11 === void 0 ? void 0 : _this$otherParams11.channel
845
844
  });
846
845
  case 56:
@@ -1200,40 +1199,79 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1200
1199
 
1201
1200
  // ─── 报价单 ───
1202
1201
  }, {
1203
- key: "loadQuotations",
1202
+ key: "ensureQuotationsLoaded",
1204
1203
  value: function () {
1205
- var _loadQuotations = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(params) {
1204
+ var _ensureQuotationsLoaded = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(params) {
1205
+ var quotation, load;
1206
1206
  return _regeneratorRuntime().wrap(function _callee15$(_context15) {
1207
1207
  while (1) switch (_context15.prev = _context15.next) {
1208
+ case 0:
1209
+ quotation = this.store.quotation;
1210
+ if (quotation) {
1211
+ _context15.next = 3;
1212
+ break;
1213
+ }
1214
+ return _context15.abrupt("return");
1215
+ case 3:
1216
+ load = typeof quotation.ensureQuotations === 'function' ? quotation.ensureQuotations.bind(quotation) : quotation.loadQuotations.bind(quotation);
1217
+ _context15.next = 6;
1218
+ return load(params);
1219
+ case 6:
1220
+ case "end":
1221
+ return _context15.stop();
1222
+ }
1223
+ }, _callee15, this);
1224
+ }));
1225
+ function ensureQuotationsLoaded(_x7) {
1226
+ return _ensureQuotationsLoaded.apply(this, arguments);
1227
+ }
1228
+ return ensureQuotationsLoaded;
1229
+ }()
1230
+ }, {
1231
+ key: "preloadQuotations",
1232
+ value: function preloadQuotations(params) {
1233
+ var _this6 = this;
1234
+ void this.ensureQuotationsLoaded(params).catch(function (error) {
1235
+ _this6.logMethodError('preloadQuotations', error, {
1236
+ channel: params === null || params === void 0 ? void 0 : params.channel
1237
+ });
1238
+ });
1239
+ }
1240
+ }, {
1241
+ key: "loadQuotations",
1242
+ value: function () {
1243
+ var _loadQuotations = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(params) {
1244
+ return _regeneratorRuntime().wrap(function _callee16$(_context16) {
1245
+ while (1) switch (_context16.prev = _context16.next) {
1208
1246
  case 0:
1209
1247
  this.logMethodStart('loadQuotations');
1210
- _context15.prev = 1;
1248
+ _context16.prev = 1;
1211
1249
  if (this.store.quotation) {
1212
- _context15.next = 4;
1250
+ _context16.next = 4;
1213
1251
  break;
1214
1252
  }
1215
1253
  throw new Error('quotation 模块未初始化');
1216
1254
  case 4:
1217
- _context15.next = 6;
1255
+ _context16.next = 6;
1218
1256
  return this.store.quotation.loadQuotations(params);
1219
1257
  case 6:
1220
1258
  this.logMethodSuccess('loadQuotations', {
1221
1259
  count: this.store.quotation.getQuotationList().length
1222
1260
  });
1223
- _context15.next = 13;
1261
+ _context16.next = 13;
1224
1262
  break;
1225
1263
  case 9:
1226
- _context15.prev = 9;
1227
- _context15.t0 = _context15["catch"](1);
1228
- this.logMethodError('loadQuotations', _context15.t0);
1229
- throw _context15.t0;
1264
+ _context16.prev = 9;
1265
+ _context16.t0 = _context16["catch"](1);
1266
+ this.logMethodError('loadQuotations', _context16.t0);
1267
+ throw _context16.t0;
1230
1268
  case 13:
1231
1269
  case "end":
1232
- return _context15.stop();
1270
+ return _context16.stop();
1233
1271
  }
1234
- }, _callee15, this, [[1, 9]]);
1272
+ }, _callee16, this, [[1, 9]]);
1235
1273
  }));
1236
- function loadQuotations(_x7) {
1274
+ function loadQuotations(_x8) {
1237
1275
  return _loadQuotations.apply(this, arguments);
1238
1276
  }
1239
1277
  return loadQuotations;
@@ -1241,46 +1279,46 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1241
1279
  }, {
1242
1280
  key: "fetchResourceAvailability",
1243
1281
  value: function () {
1244
- var _fetchResourceAvailability = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(params) {
1282
+ var _fetchResourceAvailability = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(params) {
1245
1283
  var venueProducts, resourceIds, config, crossDay, effectiveEndDate, res, rawData, _iterator3, _step3, item, _i3, _rawData, _item, mappings, _iterator4, _step4, mapping;
1246
- return _regeneratorRuntime().wrap(function _callee16$(_context16) {
1247
- while (1) switch (_context16.prev = _context16.next) {
1284
+ return _regeneratorRuntime().wrap(function _callee17$(_context17) {
1285
+ while (1) switch (_context17.prev = _context17.next) {
1248
1286
  case 0:
1249
1287
  this.logMethodStart('fetchResourceAvailability', params);
1250
- _context16.prev = 1;
1288
+ _context17.prev = 1;
1251
1289
  venueProducts = this.getVenueProducts();
1252
1290
  if (venueProducts.length) {
1253
- _context16.next = 7;
1291
+ _context17.next = 7;
1254
1292
  break;
1255
1293
  }
1256
1294
  this.store.rawResourceData = [];
1257
1295
  this.logMethodSuccess('fetchResourceAvailability', {
1258
1296
  resourceCount: 0
1259
1297
  });
1260
- return _context16.abrupt("return");
1298
+ return _context17.abrupt("return");
1261
1299
  case 7:
1262
1300
  resourceIds = extractResourceIds(venueProducts);
1263
1301
  if (resourceIds.length) {
1264
- _context16.next = 12;
1302
+ _context17.next = 12;
1265
1303
  break;
1266
1304
  }
1267
1305
  this.store.rawResourceData = [];
1268
1306
  this.logMethodSuccess('fetchResourceAvailability', {
1269
1307
  resourceIds: []
1270
1308
  });
1271
- return _context16.abrupt("return");
1309
+ return _context17.abrupt("return");
1272
1310
  case 12:
1273
1311
  // 跨天营业时,endDate 扩展一天以覆盖次日凌晨时段
1274
1312
  config = this.store.slotConfig;
1275
1313
  crossDay = isBusinessHoursCrossDay(config);
1276
1314
  effectiveEndDate = crossDay ? dayjs(params.endDate).add(1, 'day').format('YYYY-MM-DD') : params.endDate;
1277
1315
  if (this.store.date) {
1278
- _context16.next = 17;
1316
+ _context17.next = 17;
1279
1317
  break;
1280
1318
  }
1281
1319
  throw new Error('date 模块未初始化');
1282
1320
  case 17:
1283
- _context16.next = 19;
1321
+ _context17.next = 19;
1284
1322
  return this.store.date.fetchResourceDates({
1285
1323
  query: {
1286
1324
  start_date: params.startDate,
@@ -1290,7 +1328,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1290
1328
  useCache: false
1291
1329
  });
1292
1330
  case 19:
1293
- res = _context16.sent;
1331
+ res = _context17.sent;
1294
1332
  rawData = [];
1295
1333
  if (res !== null && res !== void 0 && res.data && Array.isArray(res.data)) {
1296
1334
  _iterator3 = _createForOfIteratorHelper(res.data);
@@ -1313,16 +1351,16 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1313
1351
  _i3 = 0, _rawData = rawData;
1314
1352
  case 24:
1315
1353
  if (!(_i3 < _rawData.length)) {
1316
- _context16.next = 34;
1354
+ _context17.next = 34;
1317
1355
  break;
1318
1356
  }
1319
1357
  _item = _rawData[_i3];
1320
1358
  mappings = this.resourceProductMap.get(_item.resourceId);
1321
1359
  if (mappings) {
1322
- _context16.next = 29;
1360
+ _context17.next = 29;
1323
1361
  break;
1324
1362
  }
1325
- return _context16.abrupt("continue", 31);
1363
+ return _context17.abrupt("continue", 31);
1326
1364
  case 29:
1327
1365
  _iterator4 = _createForOfIteratorHelper(mappings);
1328
1366
  try {
@@ -1338,7 +1376,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1338
1376
  }
1339
1377
  case 31:
1340
1378
  _i3++;
1341
- _context16.next = 24;
1379
+ _context17.next = 24;
1342
1380
  break;
1343
1381
  case 34:
1344
1382
  this.logMethodSuccess('fetchResourceAvailability', {
@@ -1347,21 +1385,21 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1347
1385
  return sum + r.times.length;
1348
1386
  }, 0)
1349
1387
  });
1350
- _context16.next = 42;
1388
+ _context17.next = 42;
1351
1389
  break;
1352
1390
  case 37:
1353
- _context16.prev = 37;
1354
- _context16.t0 = _context16["catch"](1);
1391
+ _context17.prev = 37;
1392
+ _context17.t0 = _context17["catch"](1);
1355
1393
  this.store.rawResourceData = [];
1356
- this.logMethodError('fetchResourceAvailability', _context16.t0);
1357
- throw _context16.t0;
1394
+ this.logMethodError('fetchResourceAvailability', _context17.t0);
1395
+ throw _context17.t0;
1358
1396
  case 42:
1359
1397
  case "end":
1360
- return _context16.stop();
1398
+ return _context17.stop();
1361
1399
  }
1362
- }, _callee16, this, [[1, 37]]);
1400
+ }, _callee17, this, [[1, 37]]);
1363
1401
  }));
1364
- function fetchResourceAvailability(_x8) {
1402
+ function fetchResourceAvailability(_x9) {
1365
1403
  return _fetchResourceAvailability.apply(this, arguments);
1366
1404
  }
1367
1405
  return fetchResourceAvailability;
@@ -1442,7 +1480,8 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1442
1480
  }, {
1443
1481
  key: "getDateRangeSummary",
1444
1482
  value: function getDateRangeSummary(params) {
1445
- var _this6 = this;
1483
+ var _this$otherParams13,
1484
+ _this7 = this;
1446
1485
  return buildDateRangeSummary({
1447
1486
  startDate: params.startDate,
1448
1487
  endDate: params.endDate,
@@ -1450,8 +1489,9 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1450
1489
  rawResources: this.store.rawResourceData,
1451
1490
  resourceProductMap: this.resourceProductMap,
1452
1491
  quotationModule: this.store.quotation,
1492
+ channel: (_this$otherParams13 = this.otherParams) === null || _this$otherParams13 === void 0 ? void 0 : _this$otherParams13.channel,
1453
1493
  resolveConfig: function resolveConfig(date) {
1454
- return _this6.resolveSlotConfigForDate(date);
1494
+ return _this7.resolveSlotConfigForDate(date);
1455
1495
  }
1456
1496
  });
1457
1497
  }
@@ -1461,6 +1501,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1461
1501
  var resolvedSlotConfig = this.syncOperatingHoursToSlotConfig(date);
1462
1502
  var quotationPriceMap;
1463
1503
  if (this.store.quotation) {
1504
+ var _this$otherParams14;
1464
1505
  var productIds = _toConsumableArray(new Set(_toConsumableArray(this.resourceProductMap.values()).flat().map(function (m) {
1465
1506
  return m.productId;
1466
1507
  })));
@@ -1470,7 +1511,8 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1470
1511
  });
1471
1512
  quotationPriceMap = this.store.quotation.buildProductPriceMap({
1472
1513
  productIds: productIds,
1473
- timePoints: timePoints
1514
+ timePoints: timePoints,
1515
+ channel: (_this$otherParams14 = this.otherParams) === null || _this$otherParams14 === void 0 ? void 0 : _this$otherParams14.channel
1474
1516
  });
1475
1517
  }
1476
1518
  return buildTimeSlotGrid({
@@ -1494,20 +1536,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1494
1536
  }, {
1495
1537
  key: "toggleSlot",
1496
1538
  value: function () {
1497
- var _toggleSlot = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(slot) {
1539
+ var _toggleSlot = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(slot) {
1498
1540
  var mappings, mapping, currentSlots, existIndex, nextSlots, products;
1499
- return _regeneratorRuntime().wrap(function _callee17$(_context17) {
1500
- while (1) switch (_context17.prev = _context17.next) {
1541
+ return _regeneratorRuntime().wrap(function _callee18$(_context18) {
1542
+ while (1) switch (_context18.prev = _context18.next) {
1501
1543
  case 0:
1502
1544
  this.logMethodStart('toggleSlot', {
1503
1545
  resourceId: slot.resourceId,
1504
1546
  productId: slot.productId,
1505
1547
  startTime: slot.startTime
1506
1548
  });
1507
- _context17.prev = 1;
1549
+ _context18.prev = 1;
1508
1550
  mappings = this.resourceProductMap.get(slot.resourceId);
1509
1551
  if (!(!mappings || !mappings.length)) {
1510
- _context17.next = 5;
1552
+ _context18.next = 5;
1511
1553
  break;
1512
1554
  }
1513
1555
  throw new Error("\u672A\u627E\u5230\u8D44\u6E90 ".concat(slot.resourceId, " \u7684\u5546\u54C1\u6620\u5C04"));
@@ -1516,13 +1558,13 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1516
1558
  return m.productId === slot.productId;
1517
1559
  });
1518
1560
  if (mapping) {
1519
- _context17.next = 8;
1561
+ _context18.next = 8;
1520
1562
  break;
1521
1563
  }
1522
1564
  throw new Error("\u8D44\u6E90 ".concat(slot.resourceId, " \u672A\u5173\u8054\u5546\u54C1 ").concat(slot.productId));
1523
1565
  case 8:
1524
1566
  if (this.store.order) {
1525
- _context17.next = 10;
1567
+ _context18.next = 10;
1526
1568
  break;
1527
1569
  }
1528
1570
  throw new Error('order 模块未初始化');
@@ -1538,14 +1580,14 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1538
1580
  } else {
1539
1581
  nextSlots = [].concat(_toConsumableArray(currentSlots), [slot]);
1540
1582
  }
1541
- _context17.next = 15;
1583
+ _context18.next = 15;
1542
1584
  return this.reconcileOrderForResourceProduct(slot.resourceId, slot.productId, nextSlots);
1543
1585
  case 15:
1544
1586
  products = this.store.order.getOrderProducts();
1545
- _context17.next = 18;
1587
+ _context18.next = 18;
1546
1588
  return this.refreshItemRuleQuantityLimits();
1547
1589
  case 18:
1548
- _context17.next = 20;
1590
+ _context18.next = 20;
1549
1591
  return this.refreshCartValidationPassed();
1550
1592
  case 20:
1551
1593
  this.logMethodSuccess('toggleSlot', {
@@ -1554,19 +1596,19 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1554
1596
  productId: slot.productId,
1555
1597
  slotCount: nextSlots.length
1556
1598
  });
1557
- return _context17.abrupt("return", products);
1599
+ return _context18.abrupt("return", products);
1558
1600
  case 24:
1559
- _context17.prev = 24;
1560
- _context17.t0 = _context17["catch"](1);
1561
- this.logMethodError('toggleSlot', _context17.t0);
1562
- throw _context17.t0;
1601
+ _context18.prev = 24;
1602
+ _context18.t0 = _context18["catch"](1);
1603
+ this.logMethodError('toggleSlot', _context18.t0);
1604
+ throw _context18.t0;
1563
1605
  case 28:
1564
1606
  case "end":
1565
- return _context17.stop();
1607
+ return _context18.stop();
1566
1608
  }
1567
- }, _callee17, this, [[1, 24]]);
1609
+ }, _callee18, this, [[1, 24]]);
1568
1610
  }));
1569
- function toggleSlot(_x9) {
1611
+ function toggleSlot(_x10) {
1570
1612
  return _toggleSlot.apply(this, arguments);
1571
1613
  }
1572
1614
  return toggleSlot;
@@ -1644,7 +1686,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1644
1686
  }, {
1645
1687
  key: "isSlotDisabledBySelection",
1646
1688
  value: function isSlotDisabledBySelection(params) {
1647
- var _this7 = this;
1689
+ var _this8 = this;
1648
1690
  var resourceId = params.resourceId,
1649
1691
  productId = params.productId,
1650
1692
  startTime = params.startTime;
@@ -1666,7 +1708,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1666
1708
 
1667
1709
  // 组合资源字段缓存
1668
1710
  var getCombinedChildIds = function getCombinedChildIds(resId) {
1669
- var raw = _this7.store.rawResourceData.find(function (r) {
1711
+ var raw = _this8.store.rawResourceData.find(function (r) {
1670
1712
  return String(r.resourceId) === String(resId);
1671
1713
  });
1672
1714
  var combined = raw === null || raw === void 0 ? void 0 : raw.combined_resource;
@@ -1801,27 +1843,27 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1801
1843
  }, {
1802
1844
  key: "reconcileOrderForResourceProduct",
1803
1845
  value: (function () {
1804
- var _reconcileOrderForResourceProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18(resourceId, productId, slots) {
1846
+ var _reconcileOrderForResourceProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(resourceId, productId, slots) {
1805
1847
  var _this$store$order6, _this$store$order6$ge;
1806
- var mappings, mapping, tempOrder, matchesCurrent, merged, rawResource, childRawResources, venueProduct, i, _rawResource$form_id, _venueProduct$is_char, group, identityKey, bookingUuid, startMoment, endMoment, duration, customDepositData, productTitle, resourceEntry, venueProductOrigin, normalizedVenueOrderProduct, venueOrderProduct, booking, products;
1807
- return _regeneratorRuntime().wrap(function _callee18$(_context18) {
1808
- while (1) switch (_context18.prev = _context18.next) {
1848
+ var mappings, mapping, tempOrder, matchesCurrent, merged, rawResource, childRawResources, venueProduct, i, _rawResource$form_id, _venueProduct$is_char, _this$otherParams15, group, identityKey, bookingUuid, startMoment, endMoment, duration, customDepositData, productTitle, resourceEntry, venueProductOrigin, normalizedVenueOrderProduct, venueOrderProduct, booking, products;
1849
+ return _regeneratorRuntime().wrap(function _callee19$(_context19) {
1850
+ while (1) switch (_context19.prev = _context19.next) {
1809
1851
  case 0:
1810
1852
  mappings = this.resourceProductMap.get(resourceId);
1811
1853
  if (!(!mappings || !mappings.length || !this.store.order)) {
1812
- _context18.next = 3;
1854
+ _context19.next = 3;
1813
1855
  break;
1814
1856
  }
1815
- return _context18.abrupt("return");
1857
+ return _context19.abrupt("return");
1816
1858
  case 3:
1817
1859
  mapping = mappings.find(function (m) {
1818
1860
  return m.productId === productId;
1819
1861
  });
1820
1862
  if (mapping) {
1821
- _context18.next = 6;
1863
+ _context19.next = 6;
1822
1864
  break;
1823
1865
  }
1824
- return _context18.abrupt("return");
1866
+ return _context19.abrupt("return");
1825
1867
  case 6:
1826
1868
  tempOrder = this.store.order.ensureTempOrder();
1827
1869
  matchesCurrent = function matchesCurrent(meta, pid) {
@@ -1839,17 +1881,17 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1839
1881
  return Number(bookingProductId) !== Number(productId);
1840
1882
  });
1841
1883
  if (slots.length) {
1842
- _context18.next = 16;
1884
+ _context19.next = 16;
1843
1885
  break;
1844
1886
  }
1845
1887
  this.store.order.applyDiscount();
1846
- _context18.next = 14;
1888
+ _context19.next = 14;
1847
1889
  return this.store.order.recalculateSummary({
1848
1890
  createIfMissing: true
1849
1891
  });
1850
1892
  case 14:
1851
1893
  this.store.order.persistTempOrder();
1852
- return _context18.abrupt("return");
1894
+ return _context19.abrupt("return");
1853
1895
  case 16:
1854
1896
  merged = mergeConsecutiveSlots(slots);
1855
1897
  rawResource = this.store.rawResourceData.find(function (r) {
@@ -1958,7 +2000,8 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1958
2000
  price_breakdown: buildPriceBreakdown({
1959
2001
  group: group,
1960
2002
  productId: mapping.productId,
1961
- quotation: this.store.quotation
2003
+ quotation: this.store.quotation,
2004
+ channel: (_this$otherParams15 = this.otherParams) === null || _this$otherParams15 === void 0 ? void 0 : _this$otherParams15.channel
1962
2005
  })
1963
2006
  }),
1964
2007
  _origin: venueProductOrigin
@@ -1982,11 +2025,11 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1982
2025
 
1983
2026
  // 获取表单信息
1984
2027
  products = ((_this$store$order6 = this.store.order) === null || _this$store$order6 === void 0 || (_this$store$order6$ge = _this$store$order6.getOrderProducts) === null || _this$store$order6$ge === void 0 ? void 0 : _this$store$order6$ge.call(_this$store$order6)) || [];
1985
- _context18.next = 25;
2028
+ _context19.next = 25;
1986
2029
  return this.preloadHolderForms(products);
1987
2030
  case 25:
1988
2031
  this.store.order.applyDiscount();
1989
- _context18.next = 28;
2032
+ _context19.next = 28;
1990
2033
  return this.store.order.recalculateSummary({
1991
2034
  createIfMissing: true
1992
2035
  });
@@ -1994,11 +2037,11 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
1994
2037
  this.store.order.persistTempOrder();
1995
2038
  case 29:
1996
2039
  case "end":
1997
- return _context18.stop();
2040
+ return _context19.stop();
1998
2041
  }
1999
- }, _callee18, this);
2042
+ }, _callee19, this);
2000
2043
  }));
2001
- function reconcileOrderForResourceProduct(_x10, _x11, _x12) {
2044
+ function reconcileOrderForResourceProduct(_x11, _x12, _x13) {
2002
2045
  return _reconcileOrderForResourceProduct.apply(this, arguments);
2003
2046
  }
2004
2047
  return reconcileOrderForResourceProduct;
@@ -2006,7 +2049,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2006
2049
  }, {
2007
2050
  key: "getCombinedChildRawResources",
2008
2051
  value: function getCombinedChildRawResources(rawResource) {
2009
- var _this8 = this;
2052
+ var _this9 = this;
2010
2053
  if (!rawResource) return undefined;
2011
2054
  var combined = rawResource.combined_resource;
2012
2055
  if (!combined || combined.status !== 1 || !Array.isArray(combined.resource_ids) || !combined.resource_ids.length) {
@@ -2018,7 +2061,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2018
2061
  try {
2019
2062
  var _loop3 = function _loop3() {
2020
2063
  var id = _step12.value;
2021
- var child = _this8.store.rawResourceData.find(function (r) {
2064
+ var child = _this9.store.rawResourceData.find(function (r) {
2022
2065
  return String(r.resourceId) === String(id);
2023
2066
  });
2024
2067
  if (child) children.push(child);
@@ -2051,35 +2094,35 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2051
2094
  }, {
2052
2095
  key: "loadSchedules",
2053
2096
  value: function () {
2054
- var _loadSchedules = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19() {
2055
- return _regeneratorRuntime().wrap(function _callee19$(_context19) {
2056
- while (1) switch (_context19.prev = _context19.next) {
2097
+ var _loadSchedules = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20() {
2098
+ return _regeneratorRuntime().wrap(function _callee20$(_context20) {
2099
+ while (1) switch (_context20.prev = _context20.next) {
2057
2100
  case 0:
2058
2101
  this.logMethodStart('loadSchedules');
2059
- _context19.prev = 1;
2102
+ _context20.prev = 1;
2060
2103
  if (this.store.schedule) {
2061
- _context19.next = 4;
2104
+ _context20.next = 4;
2062
2105
  break;
2063
2106
  }
2064
2107
  throw new Error('schedule 模块未初始化');
2065
2108
  case 4:
2066
- _context19.next = 6;
2109
+ _context20.next = 6;
2067
2110
  return this.store.schedule.loadAllSchedule();
2068
2111
  case 6:
2069
2112
  this.injectScheduleResolverToQuotation();
2070
2113
  this.logMethodSuccess('loadSchedules');
2071
- _context19.next = 14;
2114
+ _context20.next = 14;
2072
2115
  break;
2073
2116
  case 10:
2074
- _context19.prev = 10;
2075
- _context19.t0 = _context19["catch"](1);
2076
- this.logMethodError('loadSchedules', _context19.t0);
2077
- throw _context19.t0;
2117
+ _context20.prev = 10;
2118
+ _context20.t0 = _context20["catch"](1);
2119
+ this.logMethodError('loadSchedules', _context20.t0);
2120
+ throw _context20.t0;
2078
2121
  case 14:
2079
2122
  case "end":
2080
- return _context19.stop();
2123
+ return _context20.stop();
2081
2124
  }
2082
- }, _callee19, this, [[1, 10]]);
2125
+ }, _callee20, this, [[1, 10]]);
2083
2126
  }));
2084
2127
  function loadSchedules() {
2085
2128
  return _loadSchedules.apply(this, arguments);
@@ -2089,10 +2132,10 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2089
2132
  }, {
2090
2133
  key: "injectScheduleResolverToQuotation",
2091
2134
  value: function injectScheduleResolverToQuotation() {
2092
- var _this9 = this;
2135
+ var _this10 = this;
2093
2136
  if (this.store.quotation && this.store.schedule) {
2094
2137
  this.store.quotation.setScheduleResolver(function (id) {
2095
- return _this9.store.schedule.getScheduleListByIds([id])[0];
2138
+ return _this10.store.schedule.getScheduleListByIds([id])[0];
2096
2139
  });
2097
2140
  }
2098
2141
  }
@@ -2133,15 +2176,15 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2133
2176
  }, {
2134
2177
  key: "onCustomerLogin",
2135
2178
  value: function () {
2136
- var _onCustomerLogin = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20(params) {
2137
- return _regeneratorRuntime().wrap(function _callee20$(_context20) {
2138
- while (1) switch (_context20.prev = _context20.next) {
2179
+ var _onCustomerLogin = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(params) {
2180
+ return _regeneratorRuntime().wrap(function _callee21$(_context21) {
2181
+ while (1) switch (_context21.prev = _context21.next) {
2139
2182
  case 0:
2140
2183
  this.logMethodStart('onCustomerLogin', {
2141
2184
  customerId: params.customerId
2142
2185
  });
2143
- _context20.prev = 1;
2144
- _context20.next = 4;
2186
+ _context21.prev = 1;
2187
+ _context21.next = 4;
2145
2188
  return this.refreshOrderMarketingAfterLogin({
2146
2189
  customerId: params.customerId
2147
2190
  });
@@ -2149,20 +2192,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2149
2192
  this.logMethodSuccess('onCustomerLogin', {
2150
2193
  customerId: params.customerId
2151
2194
  });
2152
- _context20.next = 11;
2195
+ _context21.next = 11;
2153
2196
  break;
2154
2197
  case 7:
2155
- _context20.prev = 7;
2156
- _context20.t0 = _context20["catch"](1);
2157
- this.logMethodError('onCustomerLogin', _context20.t0);
2158
- throw _context20.t0;
2198
+ _context21.prev = 7;
2199
+ _context21.t0 = _context21["catch"](1);
2200
+ this.logMethodError('onCustomerLogin', _context21.t0);
2201
+ throw _context21.t0;
2159
2202
  case 11:
2160
2203
  case "end":
2161
- return _context20.stop();
2204
+ return _context21.stop();
2162
2205
  }
2163
- }, _callee20, this, [[1, 7]]);
2206
+ }, _callee21, this, [[1, 7]]);
2164
2207
  }));
2165
- function onCustomerLogin(_x13) {
2208
+ function onCustomerLogin(_x14) {
2166
2209
  return _onCustomerLogin.apply(this, arguments);
2167
2210
  }
2168
2211
  return onCustomerLogin;
@@ -2171,7 +2214,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2171
2214
  key: "recalculateOrderPricesFromQuotation",
2172
2215
  value: function recalculateOrderPricesFromQuotation() {
2173
2216
  var _tempOrder$products,
2174
- _this10 = this;
2217
+ _this11 = this;
2175
2218
  if (!this.store.order || !this.store.quotation) return;
2176
2219
  var tempOrder = this.store.order.getTempOrder();
2177
2220
  if (!(tempOrder !== null && tempOrder !== void 0 && (_tempOrder$products = tempOrder.products) !== null && _tempOrder$products !== void 0 && _tempOrder$products.length)) return;
@@ -2183,39 +2226,43 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2183
2226
  var _product$metadata3;
2184
2227
  var product = _step13.value;
2185
2228
  if ((_product$metadata3 = product.metadata) !== null && _product$metadata3 !== void 0 && _product$metadata3.venue_booking) {
2186
- var mappings = _this10.resourceProductMap.get(product.metadata.resource_id);
2229
+ var mappings = _this11.resourceProductMap.get(product.metadata.resource_id);
2187
2230
  if (!mappings || !mappings.length) return 0; // continue
2188
2231
  var mapping = mappings.find(function (m) {
2189
2232
  return Number(m.productId) === Number(product.product_id);
2190
2233
  }) || mappings[0];
2191
2234
  if (!mapping) return 0; // continue
2192
- var slots = expandMergedSlotToIndividual(product, _this10.store.slotConfig.slotDurationMinutes);
2235
+ var slots = expandMergedSlotToIndividual(product, _this11.store.slotConfig.slotDurationMinutes);
2193
2236
  var updatedSlots = slots.map(function (slot) {
2194
- var _getPriceForProduct;
2237
+ var _getPriceForProduct, _this11$otherParams;
2195
2238
  return _objectSpread(_objectSpread({}, slot), {}, {
2196
2239
  productId: mapping.productId,
2197
- price: (_getPriceForProduct = _this10.store.quotation.getPriceForProduct({
2240
+ price: (_getPriceForProduct = _this11.store.quotation.getPriceForProduct({
2198
2241
  productId: mapping.productId,
2199
- datetime: slot.startTime
2242
+ datetime: slot.startTime,
2243
+ channel: (_this11$otherParams = _this11.otherParams) === null || _this11$otherParams === void 0 ? void 0 : _this11$otherParams.channel
2200
2244
  })) !== null && _getPriceForProduct !== void 0 ? _getPriceForProduct : mapping.price
2201
2245
  });
2202
2246
  });
2203
2247
  var merged = mergeConsecutiveSlots(updatedSlots);
2204
2248
  if (merged.length === 1) {
2249
+ var _this11$otherParams2;
2205
2250
  product.selling_price = merged[0].totalPrice;
2206
2251
  product.original_price = merged[0].totalPrice;
2207
2252
  product.metadata.price_breakdown = buildPriceBreakdown({
2208
2253
  group: merged[0],
2209
2254
  productId: mapping.productId,
2210
- quotation: _this10.store.quotation
2255
+ quotation: _this11.store.quotation,
2256
+ channel: (_this11$otherParams2 = _this11.otherParams) === null || _this11$otherParams2 === void 0 ? void 0 : _this11$otherParams2.channel
2211
2257
  });
2212
2258
  }
2213
2259
  } else if (product.product_id != null) {
2214
- var _product$product_vari;
2215
- var quotationPrice = _this10.store.quotation.getPriceForProduct({
2260
+ var _product$product_vari, _this11$otherParams3;
2261
+ var quotationPrice = _this11.store.quotation.getPriceForProduct({
2216
2262
  productId: product.product_id,
2217
2263
  variantId: (_product$product_vari = product.product_variant_id) !== null && _product$product_vari !== void 0 ? _product$product_vari : undefined,
2218
- datetime: now
2264
+ datetime: now,
2265
+ channel: (_this11$otherParams3 = _this11.otherParams) === null || _this11$otherParams3 === void 0 ? void 0 : _this11$otherParams3.channel
2219
2266
  });
2220
2267
  if (quotationPrice !== null) {
2221
2268
  product.selling_price = quotationPrice;
@@ -2237,30 +2284,30 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2237
2284
  }, {
2238
2285
  key: "scanCode",
2239
2286
  value: function () {
2240
- var _scanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(code, customerId) {
2287
+ var _scanCode = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(code, customerId) {
2241
2288
  var result;
2242
- return _regeneratorRuntime().wrap(function _callee21$(_context21) {
2243
- while (1) switch (_context21.prev = _context21.next) {
2289
+ return _regeneratorRuntime().wrap(function _callee22$(_context22) {
2290
+ while (1) switch (_context22.prev = _context22.next) {
2244
2291
  case 0:
2245
2292
  this.logMethodStart('scanCode', {
2246
2293
  code: code
2247
2294
  });
2248
- _context21.prev = 1;
2295
+ _context22.prev = 1;
2249
2296
  if (this.store.order) {
2250
- _context21.next = 4;
2297
+ _context22.next = 4;
2251
2298
  break;
2252
2299
  }
2253
2300
  throw new Error('order 模块未初始化');
2254
2301
  case 4:
2255
- _context21.next = 6;
2302
+ _context22.next = 6;
2256
2303
  return this.store.order.scanCode(code, customerId);
2257
2304
  case 6:
2258
- result = _context21.sent;
2305
+ result = _context22.sent;
2259
2306
  if (!result.isAvailable) {
2260
- _context21.next = 11;
2307
+ _context22.next = 11;
2261
2308
  break;
2262
2309
  }
2263
- _context21.next = 10;
2310
+ _context22.next = 10;
2264
2311
  return this.store.order.recalculateSummary({
2265
2312
  createIfMissing: true
2266
2313
  });
@@ -2270,19 +2317,19 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2270
2317
  this.logMethodSuccess('scanCode', {
2271
2318
  isAvailable: result.isAvailable
2272
2319
  });
2273
- return _context21.abrupt("return", result);
2320
+ return _context22.abrupt("return", result);
2274
2321
  case 15:
2275
- _context21.prev = 15;
2276
- _context21.t0 = _context21["catch"](1);
2277
- this.logMethodError('scanCode', _context21.t0);
2278
- throw _context21.t0;
2322
+ _context22.prev = 15;
2323
+ _context22.t0 = _context22["catch"](1);
2324
+ this.logMethodError('scanCode', _context22.t0);
2325
+ throw _context22.t0;
2279
2326
  case 19:
2280
2327
  case "end":
2281
- return _context21.stop();
2328
+ return _context22.stop();
2282
2329
  }
2283
- }, _callee21, this, [[1, 15]]);
2330
+ }, _callee22, this, [[1, 15]]);
2284
2331
  }));
2285
- function scanCode(_x14, _x15) {
2332
+ function scanCode(_x15, _x16) {
2286
2333
  return _scanCode.apply(this, arguments);
2287
2334
  }
2288
2335
  return scanCode;
@@ -2298,15 +2345,15 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2298
2345
  }, {
2299
2346
  key: "setDiscountSelected",
2300
2347
  value: (function () {
2301
- var _setDiscountSelected = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(params) {
2348
+ var _setDiscountSelected = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23(params) {
2302
2349
  var _tempOrder$holder, _this$store$order$get, _this$store$order$get2, list, beforeTarget, updated, updatedTarget, tempOrder, orderStore, discountModule, rulesModule, holders, nextDiscountList, _tempOrder$holder2, result, beforeSelectedIds, _iterator14, _step14, d, selectedResourceIds, _iterator15, _step15, _origin, _product$metadata$sou, _product$metadata4, _product$metadata5, _product$original_pri, product, totalPerUnitDiscount, optionSum, sourcePrice, newSourceSellingPrice, newMainSellingPrice, afterApplyTarget, finalSummary, finalProduct, finalTarget;
2303
- return _regeneratorRuntime().wrap(function _callee22$(_context22) {
2304
- while (1) switch (_context22.prev = _context22.next) {
2350
+ return _regeneratorRuntime().wrap(function _callee23$(_context23) {
2351
+ while (1) switch (_context23.prev = _context23.next) {
2305
2352
  case 0:
2306
2353
  this.logMethodStart('setDiscountSelected', params);
2307
- _context22.prev = 1;
2354
+ _context23.prev = 1;
2308
2355
  if (this.store.order) {
2309
- _context22.next = 4;
2356
+ _context23.next = 4;
2310
2357
  break;
2311
2358
  }
2312
2359
  throw new Error('order 模块未初始化');
@@ -2332,7 +2379,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2332
2379
  form_record_id: tempOrder.holder.form_record_id
2333
2380
  }] : [];
2334
2381
  nextDiscountList = updated;
2335
- _context22.next = 16;
2382
+ _context23.next = 16;
2336
2383
  return discountModule === null || discountModule === void 0 ? void 0 : discountModule.setDiscountList(updated);
2337
2384
  case 16:
2338
2385
  if (rulesModule) {
@@ -2384,26 +2431,26 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2384
2431
  // 目的:避免 unselect 后 selling_price 残留、reselect 时把残留价带进下一轮 Rules 造成双折扣。
2385
2432
  // 手动改价商品(_origin.isManualDiscount=true)不参与券流程归一化,保留手工价。
2386
2433
  _iterator15 = _createForOfIteratorHelper(tempOrder.products);
2387
- _context22.prev = 19;
2434
+ _context23.prev = 19;
2388
2435
  _iterator15.s();
2389
2436
  case 21:
2390
2437
  if ((_step15 = _iterator15.n()).done) {
2391
- _context22.next = 38;
2438
+ _context23.next = 38;
2392
2439
  break;
2393
2440
  }
2394
2441
  product = _step15.value;
2395
2442
  if (!((_origin = product._origin) !== null && _origin !== void 0 && _origin.isManualDiscount)) {
2396
- _context22.next = 25;
2443
+ _context23.next = 25;
2397
2444
  break;
2398
2445
  }
2399
- return _context22.abrupt("continue", 36);
2446
+ return _context23.abrupt("continue", 36);
2400
2447
  case 25:
2401
2448
  if (!(product.discount_list || []).some(isItemRewardProductDiscount)) {
2402
- _context22.next = 28;
2449
+ _context23.next = 28;
2403
2450
  break;
2404
2451
  }
2405
2452
  product.discount_list = (product.discount_list || []).filter(isItemRewardProductDiscount);
2406
- return _context22.abrupt("continue", 36);
2453
+ return _context23.abrupt("continue", 36);
2407
2454
  case 28:
2408
2455
  // 1. 把 product.discount_list 和当前选中的 discount 对齐(剔除已取消的券)
2409
2456
  product.discount_list = (product.discount_list || []).filter(function (pd) {
@@ -2430,22 +2477,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2430
2477
  bundle: product.product_bundle
2431
2478
  });
2432
2479
  case 36:
2433
- _context22.next = 21;
2480
+ _context23.next = 21;
2434
2481
  break;
2435
2482
  case 38:
2436
- _context22.next = 43;
2483
+ _context23.next = 43;
2437
2484
  break;
2438
2485
  case 40:
2439
- _context22.prev = 40;
2440
- _context22.t0 = _context22["catch"](19);
2441
- _iterator15.e(_context22.t0);
2486
+ _context23.prev = 40;
2487
+ _context23.t0 = _context23["catch"](19);
2488
+ _iterator15.e(_context23.t0);
2442
2489
  case 43:
2443
- _context22.prev = 43;
2490
+ _context23.prev = 43;
2444
2491
  _iterator15.f();
2445
- return _context22.finish(43);
2492
+ return _context23.finish(43);
2446
2493
  case 46:
2447
2494
  OrderModule.populateSavedAmounts(tempOrder.products, nextDiscountList);
2448
- _context22.next = 49;
2495
+ _context23.next = 49;
2449
2496
  return discountModule === null || discountModule === void 0 ? void 0 : discountModule.setDiscountList(nextDiscountList);
2450
2497
  case 49:
2451
2498
  tempOrder.discount_list = (nextDiscountList || []).filter(function (d) {
@@ -2454,7 +2501,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2454
2501
  afterApplyTarget = this.store.order.getDiscountList().find(function (d) {
2455
2502
  return d.id === params.discountId;
2456
2503
  }) || null;
2457
- _context22.next = 53;
2504
+ _context23.next = 53;
2458
2505
  return this.store.order.recalculateSummary({
2459
2506
  createIfMissing: true
2460
2507
  });
@@ -2466,19 +2513,19 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2466
2513
  finalTarget = this.store.order.getDiscountList().find(function (d) {
2467
2514
  return d.id === params.discountId;
2468
2515
  }) || null;
2469
- return _context22.abrupt("return", this.store.order.getDiscountList());
2516
+ return _context23.abrupt("return", this.store.order.getDiscountList());
2470
2517
  case 61:
2471
- _context22.prev = 61;
2472
- _context22.t1 = _context22["catch"](1);
2473
- this.logMethodError('setDiscountSelected', _context22.t1);
2474
- throw _context22.t1;
2518
+ _context23.prev = 61;
2519
+ _context23.t1 = _context23["catch"](1);
2520
+ this.logMethodError('setDiscountSelected', _context23.t1);
2521
+ throw _context23.t1;
2475
2522
  case 65:
2476
2523
  case "end":
2477
- return _context22.stop();
2524
+ return _context23.stop();
2478
2525
  }
2479
- }, _callee22, this, [[1, 61], [19, 40, 43, 46]]);
2526
+ }, _callee23, this, [[1, 61], [19, 40, 43, 46]]);
2480
2527
  }));
2481
- function setDiscountSelected(_x16) {
2528
+ function setDiscountSelected(_x17) {
2482
2529
  return _setDiscountSelected.apply(this, arguments);
2483
2530
  }
2484
2531
  return setDiscountSelected;
@@ -2486,37 +2533,37 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2486
2533
  }, {
2487
2534
  key: "addNewOrder",
2488
2535
  value: function () {
2489
- var _addNewOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
2536
+ var _addNewOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
2490
2537
  var tempOrder;
2491
- return _regeneratorRuntime().wrap(function _callee23$(_context23) {
2492
- while (1) switch (_context23.prev = _context23.next) {
2538
+ return _regeneratorRuntime().wrap(function _callee24$(_context24) {
2539
+ while (1) switch (_context24.prev = _context24.next) {
2493
2540
  case 0:
2494
2541
  this.logMethodStart('addNewOrder');
2495
- _context23.prev = 1;
2542
+ _context24.prev = 1;
2496
2543
  if (this.store.order) {
2497
- _context23.next = 4;
2544
+ _context24.next = 4;
2498
2545
  break;
2499
2546
  }
2500
2547
  throw new Error('order 模块未初始化');
2501
2548
  case 4:
2502
- _context23.next = 6;
2549
+ _context24.next = 6;
2503
2550
  return this.store.order.addNewOrder();
2504
2551
  case 6:
2505
- tempOrder = _context23.sent;
2552
+ tempOrder = _context24.sent;
2506
2553
  this.logMethodSuccess('addNewOrder', {
2507
2554
  productCount: tempOrder.products.length
2508
2555
  });
2509
- return _context23.abrupt("return", tempOrder);
2556
+ return _context24.abrupt("return", tempOrder);
2510
2557
  case 11:
2511
- _context23.prev = 11;
2512
- _context23.t0 = _context23["catch"](1);
2513
- this.logMethodError('addNewOrder', _context23.t0);
2514
- throw _context23.t0;
2558
+ _context24.prev = 11;
2559
+ _context24.t0 = _context24["catch"](1);
2560
+ this.logMethodError('addNewOrder', _context24.t0);
2561
+ throw _context24.t0;
2515
2562
  case 15:
2516
2563
  case "end":
2517
- return _context23.stop();
2564
+ return _context24.stop();
2518
2565
  }
2519
- }, _callee23, this, [[1, 11]]);
2566
+ }, _callee24, this, [[1, 11]]);
2520
2567
  }));
2521
2568
  function addNewOrder() {
2522
2569
  return _addNewOrder.apply(this, arguments);
@@ -2533,37 +2580,37 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2533
2580
  }, {
2534
2581
  key: "getSummary",
2535
2582
  value: function () {
2536
- var _getSummary = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
2583
+ var _getSummary = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
2537
2584
  var summary;
2538
- return _regeneratorRuntime().wrap(function _callee24$(_context24) {
2539
- while (1) switch (_context24.prev = _context24.next) {
2585
+ return _regeneratorRuntime().wrap(function _callee25$(_context25) {
2586
+ while (1) switch (_context25.prev = _context25.next) {
2540
2587
  case 0:
2541
2588
  this.logMethodStart('getSummary');
2542
- _context24.prev = 1;
2589
+ _context25.prev = 1;
2543
2590
  if (this.store.order) {
2544
- _context24.next = 4;
2591
+ _context25.next = 4;
2545
2592
  break;
2546
2593
  }
2547
2594
  throw new Error('order 模块未初始化');
2548
2595
  case 4:
2549
- _context24.next = 6;
2596
+ _context25.next = 6;
2550
2597
  return this.store.order.getOrderSummary();
2551
2598
  case 6:
2552
- summary = _context24.sent;
2599
+ summary = _context25.sent;
2553
2600
  this.logMethodSuccess('getSummary', {
2554
2601
  totalAmount: summary.total_amount
2555
2602
  });
2556
- return _context24.abrupt("return", summary);
2603
+ return _context25.abrupt("return", summary);
2557
2604
  case 11:
2558
- _context24.prev = 11;
2559
- _context24.t0 = _context24["catch"](1);
2560
- this.logMethodError('getSummary', _context24.t0);
2561
- throw _context24.t0;
2605
+ _context25.prev = 11;
2606
+ _context25.t0 = _context25["catch"](1);
2607
+ this.logMethodError('getSummary', _context25.t0);
2608
+ throw _context25.t0;
2562
2609
  case 15:
2563
2610
  case "end":
2564
- return _context24.stop();
2611
+ return _context25.stop();
2565
2612
  }
2566
- }, _callee24, this, [[1, 11]]);
2613
+ }, _callee25, this, [[1, 11]]);
2567
2614
  }));
2568
2615
  function getSummary() {
2569
2616
  return _getSummary.apply(this, arguments);
@@ -2573,47 +2620,47 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2573
2620
  }, {
2574
2621
  key: "submitOrder",
2575
2622
  value: function () {
2576
- var _submitOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
2577
- var _this$otherParams13, _this$otherParams14, _this$otherParams15, _this$otherParams16, _tempOrder$products2, result, tempOrder;
2578
- return _regeneratorRuntime().wrap(function _callee25$(_context25) {
2579
- while (1) switch (_context25.prev = _context25.next) {
2623
+ var _submitOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26() {
2624
+ var _this$otherParams16, _this$otherParams17, _this$otherParams18, _this$otherParams19, _tempOrder$products2, result, tempOrder;
2625
+ return _regeneratorRuntime().wrap(function _callee26$(_context26) {
2626
+ while (1) switch (_context26.prev = _context26.next) {
2580
2627
  case 0:
2581
2628
  this.logMethodStart('submitOrder');
2582
- _context25.prev = 1;
2583
- _context25.next = 4;
2629
+ _context26.prev = 1;
2630
+ _context26.next = 4;
2584
2631
  return this.validateBeforeSubmitByItemRule();
2585
2632
  case 4:
2586
2633
  if (this.store.order) {
2587
- _context25.next = 6;
2634
+ _context26.next = 6;
2588
2635
  break;
2589
2636
  }
2590
2637
  throw new Error('venueBooking解决方案需要 order 模块支持');
2591
2638
  case 6:
2592
- _context25.next = 8;
2639
+ _context26.next = 8;
2593
2640
  return this.store.order.submitTempOrder({
2594
2641
  cacheId: this.cacheId,
2595
- platform: (_this$otherParams13 = this.otherParams) === null || _this$otherParams13 === void 0 ? void 0 : _this$otherParams13.platform,
2596
- businessCode: (_this$otherParams14 = this.otherParams) === null || _this$otherParams14 === void 0 ? void 0 : _this$otherParams14.businessCode,
2597
- channel: (_this$otherParams15 = this.otherParams) === null || _this$otherParams15 === void 0 ? void 0 : _this$otherParams15.channel,
2598
- type: (_this$otherParams16 = this.otherParams) === null || _this$otherParams16 === void 0 ? void 0 : _this$otherParams16.type
2642
+ platform: (_this$otherParams16 = this.otherParams) === null || _this$otherParams16 === void 0 ? void 0 : _this$otherParams16.platform,
2643
+ businessCode: (_this$otherParams17 = this.otherParams) === null || _this$otherParams17 === void 0 ? void 0 : _this$otherParams17.businessCode,
2644
+ channel: (_this$otherParams18 = this.otherParams) === null || _this$otherParams18 === void 0 ? void 0 : _this$otherParams18.channel,
2645
+ type: (_this$otherParams19 = this.otherParams) === null || _this$otherParams19 === void 0 ? void 0 : _this$otherParams19.type
2599
2646
  });
2600
2647
  case 8:
2601
- result = _context25.sent;
2648
+ result = _context26.sent;
2602
2649
  tempOrder = this.store.order.getTempOrder();
2603
2650
  this.logMethodSuccess('submitOrder', {
2604
2651
  productCount: (tempOrder === null || tempOrder === void 0 || (_tempOrder$products2 = tempOrder.products) === null || _tempOrder$products2 === void 0 ? void 0 : _tempOrder$products2.length) || 0
2605
2652
  });
2606
- return _context25.abrupt("return", result);
2653
+ return _context26.abrupt("return", result);
2607
2654
  case 14:
2608
- _context25.prev = 14;
2609
- _context25.t0 = _context25["catch"](1);
2610
- this.logMethodError('submitOrder', _context25.t0);
2611
- throw _context25.t0;
2655
+ _context26.prev = 14;
2656
+ _context26.t0 = _context26["catch"](1);
2657
+ this.logMethodError('submitOrder', _context26.t0);
2658
+ throw _context26.t0;
2612
2659
  case 18:
2613
2660
  case "end":
2614
- return _context25.stop();
2661
+ return _context26.stop();
2615
2662
  }
2616
- }, _callee25, this, [[1, 14]]);
2663
+ }, _callee26, this, [[1, 14]]);
2617
2664
  }));
2618
2665
  function submitOrder() {
2619
2666
  return _submitOrder.apply(this, arguments);
@@ -2623,18 +2670,18 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2623
2670
  }, {
2624
2671
  key: "addProductToOrder",
2625
2672
  value: function () {
2626
- var _addProductToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(product) {
2627
- var _product$metadata6, _product$product_vari2, quotationPrice, products;
2628
- return _regeneratorRuntime().wrap(function _callee26$(_context26) {
2629
- while (1) switch (_context26.prev = _context26.next) {
2673
+ var _addProductToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(product) {
2674
+ var _product$metadata6, _product$product_vari2, _this$otherParams20, quotationPrice, products;
2675
+ return _regeneratorRuntime().wrap(function _callee27$(_context27) {
2676
+ while (1) switch (_context27.prev = _context27.next) {
2630
2677
  case 0:
2631
2678
  this.logMethodStart('addProductToOrder', {
2632
2679
  product_id: product.product_id,
2633
2680
  product_variant_id: product.product_variant_id
2634
2681
  });
2635
- _context26.prev = 1;
2682
+ _context27.prev = 1;
2636
2683
  if (this.store.order) {
2637
- _context26.next = 4;
2684
+ _context27.next = 4;
2638
2685
  break;
2639
2686
  }
2640
2687
  throw new Error('order 模块未初始化');
@@ -2643,7 +2690,8 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2643
2690
  quotationPrice = this.store.quotation.getPriceForProduct({
2644
2691
  productId: product.product_id,
2645
2692
  variantId: (_product$product_vari2 = product.product_variant_id) !== null && _product$product_vari2 !== void 0 ? _product$product_vari2 : undefined,
2646
- datetime: dayjs().format('YYYY-MM-DD HH:mm:ss')
2693
+ datetime: dayjs().format('YYYY-MM-DD HH:mm:ss'),
2694
+ channel: (_this$otherParams20 = this.otherParams) === null || _this$otherParams20 === void 0 ? void 0 : _this$otherParams20.channel
2647
2695
  });
2648
2696
  if (quotationPrice !== null) {
2649
2697
  product.selling_price = quotationPrice;
@@ -2652,32 +2700,32 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2652
2700
  product.original_price = product.selling_price;
2653
2701
  }
2654
2702
  }
2655
- _context26.next = 7;
2703
+ _context27.next = 7;
2656
2704
  return this.store.order.addProductToOrder(product);
2657
2705
  case 7:
2658
- products = _context26.sent;
2659
- _context26.next = 10;
2706
+ products = _context27.sent;
2707
+ _context27.next = 10;
2660
2708
  return this.refreshItemRuleQuantityLimits();
2661
2709
  case 10:
2662
- _context26.next = 12;
2710
+ _context27.next = 12;
2663
2711
  return this.refreshCartValidationPassed();
2664
2712
  case 12:
2665
2713
  this.logMethodSuccess('addProductToOrder', {
2666
2714
  productCount: products.length
2667
2715
  });
2668
- return _context26.abrupt("return", products);
2716
+ return _context27.abrupt("return", products);
2669
2717
  case 16:
2670
- _context26.prev = 16;
2671
- _context26.t0 = _context26["catch"](1);
2672
- this.logMethodError('addProductToOrder', _context26.t0);
2673
- throw _context26.t0;
2718
+ _context27.prev = 16;
2719
+ _context27.t0 = _context27["catch"](1);
2720
+ this.logMethodError('addProductToOrder', _context27.t0);
2721
+ throw _context27.t0;
2674
2722
  case 20:
2675
2723
  case "end":
2676
- return _context26.stop();
2724
+ return _context27.stop();
2677
2725
  }
2678
- }, _callee26, this, [[1, 16]]);
2726
+ }, _callee27, this, [[1, 16]]);
2679
2727
  }));
2680
- function addProductToOrder(_x17) {
2728
+ function addProductToOrder(_x18) {
2681
2729
  return _addProductToOrder.apply(this, arguments);
2682
2730
  }
2683
2731
  return addProductToOrder;
@@ -2685,48 +2733,48 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2685
2733
  }, {
2686
2734
  key: "updateOrderProduct",
2687
2735
  value: function () {
2688
- var _updateOrderProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(params) {
2736
+ var _updateOrderProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(params) {
2689
2737
  var products;
2690
- return _regeneratorRuntime().wrap(function _callee27$(_context27) {
2691
- while (1) switch (_context27.prev = _context27.next) {
2738
+ return _regeneratorRuntime().wrap(function _callee28$(_context28) {
2739
+ while (1) switch (_context28.prev = _context28.next) {
2692
2740
  case 0:
2693
2741
  this.logMethodStart('updateOrderProduct', {
2694
2742
  product_id: params.product_id,
2695
2743
  product_variant_id: params.product_variant_id
2696
2744
  });
2697
- _context27.prev = 1;
2745
+ _context28.prev = 1;
2698
2746
  if (this.store.order) {
2699
- _context27.next = 4;
2747
+ _context28.next = 4;
2700
2748
  break;
2701
2749
  }
2702
2750
  throw new Error('order 模块未初始化');
2703
2751
  case 4:
2704
- _context27.next = 6;
2752
+ _context28.next = 6;
2705
2753
  return this.store.order.updateOrderProduct(params);
2706
2754
  case 6:
2707
- products = _context27.sent;
2708
- _context27.next = 9;
2755
+ products = _context28.sent;
2756
+ _context28.next = 9;
2709
2757
  return this.refreshItemRuleQuantityLimits();
2710
2758
  case 9:
2711
- _context27.next = 11;
2759
+ _context28.next = 11;
2712
2760
  return this.refreshCartValidationPassed();
2713
2761
  case 11:
2714
2762
  this.logMethodSuccess('updateOrderProduct', {
2715
2763
  productCount: products.length
2716
2764
  });
2717
- return _context27.abrupt("return", products);
2765
+ return _context28.abrupt("return", products);
2718
2766
  case 15:
2719
- _context27.prev = 15;
2720
- _context27.t0 = _context27["catch"](1);
2721
- this.logMethodError('updateOrderProduct', _context27.t0);
2722
- throw _context27.t0;
2767
+ _context28.prev = 15;
2768
+ _context28.t0 = _context28["catch"](1);
2769
+ this.logMethodError('updateOrderProduct', _context28.t0);
2770
+ throw _context28.t0;
2723
2771
  case 19:
2724
2772
  case "end":
2725
- return _context27.stop();
2773
+ return _context28.stop();
2726
2774
  }
2727
- }, _callee27, this, [[1, 15]]);
2775
+ }, _callee28, this, [[1, 15]]);
2728
2776
  }));
2729
- function updateOrderProduct(_x18) {
2777
+ function updateOrderProduct(_x19) {
2730
2778
  return _updateOrderProduct.apply(this, arguments);
2731
2779
  }
2732
2780
  return updateOrderProduct;
@@ -2734,66 +2782,66 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2734
2782
  }, {
2735
2783
  key: "removeProductFromOrder",
2736
2784
  value: function () {
2737
- var _removeProductFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(identity) {
2785
+ var _removeProductFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(identity) {
2738
2786
  var _this$store$order$get3, _this$store$order8, _this$store$order$ens, _this$store$order9, _tempOrder$bookings, tempOrder, products, _tempOrder$bookings2, _tempOrder$bookings3, venueProductUids, venueBookingUids, _iterator16, _step16, _product$metadata7, _product$metadata8, product, beforeBookingCount, _this$store$order$per, _this$store$order10;
2739
- return _regeneratorRuntime().wrap(function _callee28$(_context28) {
2740
- while (1) switch (_context28.prev = _context28.next) {
2787
+ return _regeneratorRuntime().wrap(function _callee29$(_context29) {
2788
+ while (1) switch (_context29.prev = _context29.next) {
2741
2789
  case 0:
2742
2790
  this.logMethodStart('removeProductFromOrder', {
2743
2791
  product_id: identity.product_id,
2744
2792
  product_variant_id: identity.product_variant_id
2745
2793
  });
2746
- _context28.prev = 1;
2794
+ _context29.prev = 1;
2747
2795
  if (this.store.order) {
2748
- _context28.next = 4;
2796
+ _context29.next = 4;
2749
2797
  break;
2750
2798
  }
2751
2799
  throw new Error('order 模块未初始化');
2752
2800
  case 4:
2753
2801
  tempOrder = ((_this$store$order$get3 = (_this$store$order8 = this.store.order).getTempOrder) === null || _this$store$order$get3 === void 0 ? void 0 : _this$store$order$get3.call(_this$store$order8)) || ((_this$store$order$ens = (_this$store$order9 = this.store.order).ensureTempOrder) === null || _this$store$order$ens === void 0 ? void 0 : _this$store$order$ens.call(_this$store$order9));
2754
- _context28.next = 7;
2802
+ _context29.next = 7;
2755
2803
  return this.store.order.removeProductFromOrder(identity);
2756
2804
  case 7:
2757
- products = _context28.sent;
2805
+ products = _context29.sent;
2758
2806
  if (!(tempOrder !== null && tempOrder !== void 0 && (_tempOrder$bookings = tempOrder.bookings) !== null && _tempOrder$bookings !== void 0 && _tempOrder$bookings.length)) {
2759
- _context28.next = 33;
2807
+ _context29.next = 33;
2760
2808
  break;
2761
2809
  }
2762
2810
  venueProductUids = new Set();
2763
2811
  venueBookingUids = new Set();
2764
2812
  _iterator16 = _createForOfIteratorHelper(tempOrder.products || []);
2765
- _context28.prev = 12;
2813
+ _context29.prev = 12;
2766
2814
  _iterator16.s();
2767
2815
  case 14:
2768
2816
  if ((_step16 = _iterator16.n()).done) {
2769
- _context28.next = 22;
2817
+ _context29.next = 22;
2770
2818
  break;
2771
2819
  }
2772
2820
  product = _step16.value;
2773
2821
  if (product !== null && product !== void 0 && (_product$metadata7 = product.metadata) !== null && _product$metadata7 !== void 0 && _product$metadata7.venue_booking) {
2774
- _context28.next = 18;
2822
+ _context29.next = 18;
2775
2823
  break;
2776
2824
  }
2777
- return _context28.abrupt("continue", 20);
2825
+ return _context29.abrupt("continue", 20);
2778
2826
  case 18:
2779
2827
  if (product.identity_key) venueProductUids.add(String(product.identity_key));
2780
2828
  if ((_product$metadata8 = product.metadata) !== null && _product$metadata8 !== void 0 && _product$metadata8.booking_uid) {
2781
2829
  venueBookingUids.add(String(product.metadata.booking_uid));
2782
2830
  }
2783
2831
  case 20:
2784
- _context28.next = 14;
2832
+ _context29.next = 14;
2785
2833
  break;
2786
2834
  case 22:
2787
- _context28.next = 27;
2835
+ _context29.next = 27;
2788
2836
  break;
2789
2837
  case 24:
2790
- _context28.prev = 24;
2791
- _context28.t0 = _context28["catch"](12);
2792
- _iterator16.e(_context28.t0);
2838
+ _context29.prev = 24;
2839
+ _context29.t0 = _context29["catch"](12);
2840
+ _iterator16.e(_context29.t0);
2793
2841
  case 27:
2794
- _context28.prev = 27;
2842
+ _context29.prev = 27;
2795
2843
  _iterator16.f();
2796
- return _context28.finish(27);
2844
+ return _context29.finish(27);
2797
2845
  case 30:
2798
2846
  beforeBookingCount = ((_tempOrder$bookings2 = tempOrder.bookings) === null || _tempOrder$bookings2 === void 0 ? void 0 : _tempOrder$bookings2.length) || 0;
2799
2847
  tempOrder.bookings = (tempOrder.bookings || []).filter(function (booking) {
@@ -2810,28 +2858,28 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2810
2858
  (_this$store$order$per = (_this$store$order10 = this.store.order).persistTempOrder) === null || _this$store$order$per === void 0 || _this$store$order$per.call(_this$store$order10);
2811
2859
  }
2812
2860
  case 33:
2813
- _context28.next = 35;
2861
+ _context29.next = 35;
2814
2862
  return this.refreshItemRuleQuantityLimits();
2815
2863
  case 35:
2816
- _context28.next = 37;
2864
+ _context29.next = 37;
2817
2865
  return this.refreshCartValidationPassed();
2818
2866
  case 37:
2819
2867
  this.logMethodSuccess('removeProductFromOrder', {
2820
2868
  productCount: products.length
2821
2869
  });
2822
- return _context28.abrupt("return", products);
2870
+ return _context29.abrupt("return", products);
2823
2871
  case 41:
2824
- _context28.prev = 41;
2825
- _context28.t1 = _context28["catch"](1);
2826
- this.logMethodError('removeProductFromOrder', _context28.t1);
2827
- throw _context28.t1;
2872
+ _context29.prev = 41;
2873
+ _context29.t1 = _context29["catch"](1);
2874
+ this.logMethodError('removeProductFromOrder', _context29.t1);
2875
+ throw _context29.t1;
2828
2876
  case 45:
2829
2877
  case "end":
2830
- return _context28.stop();
2878
+ return _context29.stop();
2831
2879
  }
2832
- }, _callee28, this, [[1, 41], [12, 24, 27, 30]]);
2880
+ }, _callee29, this, [[1, 41], [12, 24, 27, 30]]);
2833
2881
  }));
2834
- function removeProductFromOrder(_x19) {
2882
+ function removeProductFromOrder(_x20) {
2835
2883
  return _removeProductFromOrder.apply(this, arguments);
2836
2884
  }
2837
2885
  return removeProductFromOrder;
@@ -2839,27 +2887,27 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2839
2887
  }, {
2840
2888
  key: "getProductList",
2841
2889
  value: function () {
2842
- var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29() {
2890
+ var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30() {
2843
2891
  var result;
2844
- return _regeneratorRuntime().wrap(function _callee29$(_context29) {
2845
- while (1) switch (_context29.prev = _context29.next) {
2892
+ return _regeneratorRuntime().wrap(function _callee30$(_context30) {
2893
+ while (1) switch (_context30.prev = _context30.next) {
2846
2894
  case 0:
2847
2895
  if (!this.productsLoaded) {
2848
- _context29.next = 2;
2896
+ _context30.next = 2;
2849
2897
  break;
2850
2898
  }
2851
- return _context29.abrupt("return", attachItemRuleLimitsToTopLevelProducts(this.getAddonProductsList(), this.store.itemRuleQuantityLimits || []));
2899
+ return _context30.abrupt("return", attachItemRuleLimitsToTopLevelProducts(this.getAddonProductsList(), this.store.itemRuleQuantityLimits || []));
2852
2900
  case 2:
2853
- _context29.next = 4;
2901
+ _context30.next = 4;
2854
2902
  return this.loadAllProducts();
2855
2903
  case 4:
2856
- result = _context29.sent;
2857
- return _context29.abrupt("return", attachItemRuleLimitsToTopLevelProducts(result.addonProducts, this.store.itemRuleQuantityLimits || []));
2904
+ result = _context30.sent;
2905
+ return _context30.abrupt("return", attachItemRuleLimitsToTopLevelProducts(result.addonProducts, this.store.itemRuleQuantityLimits || []));
2858
2906
  case 6:
2859
2907
  case "end":
2860
- return _context29.stop();
2908
+ return _context30.stop();
2861
2909
  }
2862
- }, _callee29, this);
2910
+ }, _callee30, this);
2863
2911
  }));
2864
2912
  function getProductList() {
2865
2913
  return _getProductList.apply(this, arguments);
@@ -2869,13 +2917,13 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2869
2917
  }, {
2870
2918
  key: "loadOpenDataConfig",
2871
2919
  value: function () {
2872
- var _loadOpenDataConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30() {
2920
+ var _loadOpenDataConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31() {
2873
2921
  var lastFetchedAt, cachedData, openDataConfig;
2874
- return _regeneratorRuntime().wrap(function _callee30$(_context30) {
2875
- while (1) switch (_context30.prev = _context30.next) {
2922
+ return _regeneratorRuntime().wrap(function _callee31$(_context31) {
2923
+ while (1) switch (_context31.prev = _context31.next) {
2876
2924
  case 0:
2877
2925
  if (this.store.openData) {
2878
- _context30.next = 2;
2926
+ _context31.next = 2;
2879
2927
  break;
2880
2928
  }
2881
2929
  throw new Error('openData 模块未初始化');
@@ -2883,42 +2931,42 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2883
2931
  lastFetchedAt = this.store.openData.getLastFetchedAt();
2884
2932
  cachedData = this.store.openData.getOpenData();
2885
2933
  if (!(cachedData && lastFetchedAt && Date.now() - lastFetchedAt < VenueBookingImpl.OPEN_DATA_CACHE_TTL)) {
2886
- _context30.next = 7;
2934
+ _context31.next = 7;
2887
2935
  break;
2888
2936
  }
2889
2937
  this.otherParams.openData = cachedData;
2890
- return _context30.abrupt("return", cachedData);
2938
+ return _context31.abrupt("return", cachedData);
2891
2939
  case 7:
2892
2940
  if (!this.loadOpenDataConfigInFlight) {
2893
- _context30.next = 11;
2941
+ _context31.next = 11;
2894
2942
  break;
2895
2943
  }
2896
- _context30.next = 10;
2944
+ _context31.next = 10;
2897
2945
  return this.loadOpenDataConfigInFlight;
2898
2946
  case 10:
2899
- return _context30.abrupt("return", _context30.sent);
2947
+ return _context31.abrupt("return", _context31.sent);
2900
2948
  case 11:
2901
2949
  this.loadOpenDataConfigInFlight = this.store.openData.fetchOpenData({
2902
2950
  scope: 'board',
2903
2951
  target: 'venue_booking+online_store',
2904
2952
  section_code: [].concat(OPEN_DATA_SECTION_CODES)
2905
2953
  });
2906
- _context30.prev = 12;
2907
- _context30.next = 15;
2954
+ _context31.prev = 12;
2955
+ _context31.next = 15;
2908
2956
  return this.loadOpenDataConfigInFlight;
2909
2957
  case 15:
2910
- openDataConfig = _context30.sent;
2958
+ openDataConfig = _context31.sent;
2911
2959
  this.otherParams.openData = openDataConfig;
2912
- return _context30.abrupt("return", openDataConfig);
2960
+ return _context31.abrupt("return", openDataConfig);
2913
2961
  case 18:
2914
- _context30.prev = 18;
2962
+ _context31.prev = 18;
2915
2963
  this.loadOpenDataConfigInFlight = null;
2916
- return _context30.finish(18);
2964
+ return _context31.finish(18);
2917
2965
  case 21:
2918
2966
  case "end":
2919
- return _context30.stop();
2967
+ return _context31.stop();
2920
2968
  }
2921
- }, _callee30, this, [[12,, 18, 21]]);
2969
+ }, _callee31, this, [[12,, 18, 21]]);
2922
2970
  }));
2923
2971
  function loadOpenDataConfig() {
2924
2972
  return _loadOpenDataConfig.apply(this, arguments);
@@ -2928,29 +2976,29 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2928
2976
  }, {
2929
2977
  key: "loadRuntimeConfigs",
2930
2978
  value: function () {
2931
- var _loadRuntimeConfigs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31() {
2979
+ var _loadRuntimeConfigs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32() {
2932
2980
  var itemRuleConfigs;
2933
- return _regeneratorRuntime().wrap(function _callee31$(_context31) {
2934
- while (1) switch (_context31.prev = _context31.next) {
2981
+ return _regeneratorRuntime().wrap(function _callee32$(_context32) {
2982
+ while (1) switch (_context32.prev = _context32.next) {
2935
2983
  case 0:
2936
- _context31.next = 2;
2984
+ _context32.next = 2;
2937
2985
  return this.loadOpenDataConfig();
2938
2986
  case 2:
2939
- _context31.next = 4;
2987
+ _context32.next = 4;
2940
2988
  return this.ensureItemRuleConfigsLoaded();
2941
2989
  case 4:
2942
- itemRuleConfigs = _context31.sent;
2990
+ itemRuleConfigs = _context32.sent;
2943
2991
  this.logMethodSuccess('loadRuntimeConfigs', {
2944
2992
  itemRuleCount: itemRuleConfigs.length
2945
2993
  });
2946
- return _context31.abrupt("return", {
2994
+ return _context32.abrupt("return", {
2947
2995
  itemRuleConfigs: itemRuleConfigs
2948
2996
  });
2949
2997
  case 7:
2950
2998
  case "end":
2951
- return _context31.stop();
2999
+ return _context32.stop();
2952
3000
  }
2953
- }, _callee31, this);
3001
+ }, _callee32, this);
2954
3002
  }));
2955
3003
  function loadRuntimeConfigs() {
2956
3004
  return _loadRuntimeConfigs.apply(this, arguments);
@@ -2960,22 +3008,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2960
3008
  }, {
2961
3009
  key: "fetchItemRuleConfigsByModelIds",
2962
3010
  value: function () {
2963
- var _fetchItemRuleConfigsByModelIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(strategyModelIds) {
3011
+ var _fetchItemRuleConfigsByModelIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33(strategyModelIds) {
2964
3012
  var result, configs;
2965
- return _regeneratorRuntime().wrap(function _callee32$(_context32) {
2966
- while (1) switch (_context32.prev = _context32.next) {
3013
+ return _regeneratorRuntime().wrap(function _callee33$(_context33) {
3014
+ while (1) switch (_context33.prev = _context33.next) {
2967
3015
  case 0:
2968
3016
  this.logMethodStart('fetchItemRuleConfigsByModelIds', {
2969
3017
  strategyModelIds: strategyModelIds
2970
3018
  });
2971
3019
  if (strategyModelIds.length) {
2972
- _context32.next = 3;
3020
+ _context33.next = 3;
2973
3021
  break;
2974
3022
  }
2975
- return _context32.abrupt("return", []);
3023
+ return _context33.abrupt("return", []);
2976
3024
  case 3:
2977
- _context32.prev = 3;
2978
- _context32.next = 6;
3025
+ _context33.prev = 3;
3026
+ _context33.next = 6;
2979
3027
  return this.request.get('/promotion', {
2980
3028
  skip: 1,
2981
3029
  num: 99,
@@ -2983,7 +3031,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2983
3031
  ids: strategyModelIds
2984
3032
  });
2985
3033
  case 6:
2986
- result = _context32.sent;
3034
+ result = _context33.sent;
2987
3035
  configs = [];
2988
3036
  if (result.code === 200) {
2989
3037
  configs = result.data.list.map(function (item) {
@@ -2994,21 +3042,21 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
2994
3042
  strategyModelIds: strategyModelIds,
2995
3043
  strategyCount: configs.length
2996
3044
  });
2997
- return _context32.abrupt("return", configs);
3045
+ return _context33.abrupt("return", configs);
2998
3046
  case 13:
2999
- _context32.prev = 13;
3000
- _context32.t0 = _context32["catch"](3);
3001
- this.logMethodError('fetchItemRuleConfigsByModelIds', _context32.t0, {
3047
+ _context33.prev = 13;
3048
+ _context33.t0 = _context33["catch"](3);
3049
+ this.logMethodError('fetchItemRuleConfigsByModelIds', _context33.t0, {
3002
3050
  strategyModelIds: strategyModelIds
3003
3051
  });
3004
- return _context32.abrupt("return", []);
3052
+ return _context33.abrupt("return", []);
3005
3053
  case 17:
3006
3054
  case "end":
3007
- return _context32.stop();
3055
+ return _context33.stop();
3008
3056
  }
3009
- }, _callee32, this, [[3, 13]]);
3057
+ }, _callee33, this, [[3, 13]]);
3010
3058
  }));
3011
- function fetchItemRuleConfigsByModelIds(_x20) {
3059
+ function fetchItemRuleConfigsByModelIds(_x21) {
3012
3060
  return _fetchItemRuleConfigsByModelIds.apply(this, arguments);
3013
3061
  }
3014
3062
  return fetchItemRuleConfigsByModelIds;
@@ -3016,22 +3064,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3016
3064
  }, {
3017
3065
  key: "buildPrefillProductSourceMap",
3018
3066
  value: function () {
3019
- var _buildPrefillProductSourceMap = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee33() {
3067
+ var _buildPrefillProductSourceMap = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34() {
3020
3068
  var sourceMap, productList, visited, collectFromValue;
3021
- return _regeneratorRuntime().wrap(function _callee33$(_context33) {
3022
- while (1) switch (_context33.prev = _context33.next) {
3069
+ return _regeneratorRuntime().wrap(function _callee34$(_context34) {
3070
+ while (1) switch (_context34.prev = _context34.next) {
3023
3071
  case 0:
3024
3072
  sourceMap = new Map();
3025
- _context33.prev = 1;
3026
- _context33.next = 4;
3073
+ _context34.prev = 1;
3074
+ _context34.next = 4;
3027
3075
  return this.getProductList();
3028
3076
  case 4:
3029
- productList = _context33.sent;
3077
+ productList = _context34.sent;
3030
3078
  if (Array.isArray(productList)) {
3031
- _context33.next = 7;
3079
+ _context34.next = 7;
3032
3080
  break;
3033
3081
  }
3034
- return _context33.abrupt("return", sourceMap);
3082
+ return _context34.abrupt("return", sourceMap);
3035
3083
  case 7:
3036
3084
  visited = new Set();
3037
3085
  collectFromValue = function collectFromValue(value) {
@@ -3070,19 +3118,19 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3070
3118
  }
3071
3119
  };
3072
3120
  collectFromValue(productList);
3073
- _context33.next = 15;
3121
+ _context34.next = 15;
3074
3122
  break;
3075
3123
  case 12:
3076
- _context33.prev = 12;
3077
- _context33.t0 = _context33["catch"](1);
3078
- this.logMethodError('buildPrefillProductSourceMap', _context33.t0);
3124
+ _context34.prev = 12;
3125
+ _context34.t0 = _context34["catch"](1);
3126
+ this.logMethodError('buildPrefillProductSourceMap', _context34.t0);
3079
3127
  case 15:
3080
- return _context33.abrupt("return", sourceMap);
3128
+ return _context34.abrupt("return", sourceMap);
3081
3129
  case 16:
3082
3130
  case "end":
3083
- return _context33.stop();
3131
+ return _context34.stop();
3084
3132
  }
3085
- }, _callee33, this, [[1, 12]]);
3133
+ }, _callee34, this, [[1, 12]]);
3086
3134
  }));
3087
3135
  function buildPrefillProductSourceMap() {
3088
3136
  return _buildPrefillProductSourceMap.apply(this, arguments);
@@ -3092,61 +3140,65 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3092
3140
  }, {
3093
3141
  key: "getItemRuleRuntimeConfig",
3094
3142
  value: function getItemRuleRuntimeConfig() {
3095
- return this.itemRuleRuntimeConfig || {};
3143
+ var _ref6, _runtimeConfig$channe, _runtimeConfig$custom, _this$otherParams21;
3144
+ var runtimeConfig = this.itemRuleRuntimeConfig || {};
3145
+ return _objectSpread(_objectSpread({}, runtimeConfig), {}, {
3146
+ channel: (_ref6 = (_runtimeConfig$channe = runtimeConfig.channel) !== null && _runtimeConfig$channe !== void 0 ? _runtimeConfig$channe : (_runtimeConfig$custom = runtimeConfig.custom) === null || _runtimeConfig$custom === void 0 ? void 0 : _runtimeConfig$custom.channel) !== null && _ref6 !== void 0 ? _ref6 : (_this$otherParams21 = this.otherParams) === null || _this$otherParams21 === void 0 ? void 0 : _this$otherParams21.channel
3147
+ });
3096
3148
  }
3097
3149
  }, {
3098
3150
  key: "ensureItemRuleConfigsLoaded",
3099
3151
  value: function () {
3100
- var _ensureItemRuleConfigsLoaded = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35() {
3101
- var _this11 = this;
3102
- return _regeneratorRuntime().wrap(function _callee35$(_context35) {
3103
- while (1) switch (_context35.prev = _context35.next) {
3152
+ var _ensureItemRuleConfigsLoaded = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36() {
3153
+ var _this12 = this;
3154
+ return _regeneratorRuntime().wrap(function _callee36$(_context36) {
3155
+ while (1) switch (_context36.prev = _context36.next) {
3104
3156
  case 0:
3105
3157
  if (!(this.itemRuleConfigs.length > 0)) {
3106
- _context35.next = 2;
3158
+ _context36.next = 2;
3107
3159
  break;
3108
3160
  }
3109
- return _context35.abrupt("return", this.itemRuleConfigs);
3161
+ return _context36.abrupt("return", this.itemRuleConfigs);
3110
3162
  case 2:
3111
3163
  if (!this.itemRuleConfigsPromise) {
3112
- _context35.next = 4;
3164
+ _context36.next = 4;
3113
3165
  break;
3114
3166
  }
3115
- return _context35.abrupt("return", this.itemRuleConfigsPromise);
3167
+ return _context36.abrupt("return", this.itemRuleConfigsPromise);
3116
3168
  case 4:
3117
- this.itemRuleConfigsPromise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee34() {
3169
+ this.itemRuleConfigsPromise = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee35() {
3118
3170
  var runtimeConfig, staticConfigs;
3119
- return _regeneratorRuntime().wrap(function _callee34$(_context34) {
3120
- while (1) switch (_context34.prev = _context34.next) {
3171
+ return _regeneratorRuntime().wrap(function _callee35$(_context35) {
3172
+ while (1) switch (_context35.prev = _context35.next) {
3121
3173
  case 0:
3122
- runtimeConfig = _this11.getItemRuleRuntimeConfig();
3174
+ runtimeConfig = _this12.getItemRuleRuntimeConfig();
3123
3175
  staticConfigs = normalizeItemRuleStrategies(runtimeConfig.strategyConfigs);
3124
3176
  if (!(staticConfigs.length > 0)) {
3125
- _context34.next = 6;
3177
+ _context35.next = 6;
3126
3178
  break;
3127
3179
  }
3128
- _this11.itemRuleConfigs = staticConfigs;
3129
- _this11.itemRuleEvaluator.setStrategyConfigs(staticConfigs);
3130
- return _context34.abrupt("return", _this11.itemRuleConfigs);
3180
+ _this12.itemRuleConfigs = staticConfigs;
3181
+ _this12.itemRuleEvaluator.setStrategyConfigs(staticConfigs);
3182
+ return _context35.abrupt("return", _this12.itemRuleConfigs);
3131
3183
  case 6:
3132
- _this11.itemRuleConfigs = [];
3133
- _this11.itemRuleEvaluator.setStrategyConfigs([]);
3134
- return _context34.abrupt("return", _this11.itemRuleConfigs);
3184
+ _this12.itemRuleConfigs = [];
3185
+ _this12.itemRuleEvaluator.setStrategyConfigs([]);
3186
+ return _context35.abrupt("return", _this12.itemRuleConfigs);
3135
3187
  case 9:
3136
3188
  case "end":
3137
- return _context34.stop();
3189
+ return _context35.stop();
3138
3190
  }
3139
- }, _callee34);
3191
+ }, _callee35);
3140
3192
  }))();
3141
- _context35.next = 7;
3193
+ _context36.next = 7;
3142
3194
  return this.itemRuleConfigsPromise;
3143
3195
  case 7:
3144
- return _context35.abrupt("return", _context35.sent);
3196
+ return _context36.abrupt("return", _context36.sent);
3145
3197
  case 8:
3146
3198
  case "end":
3147
- return _context35.stop();
3199
+ return _context36.stop();
3148
3200
  }
3149
- }, _callee35, this);
3201
+ }, _callee36, this);
3150
3202
  }));
3151
3203
  function ensureItemRuleConfigsLoaded() {
3152
3204
  return _ensureItemRuleConfigsLoaded.apply(this, arguments);
@@ -3156,22 +3208,22 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3156
3208
  }, {
3157
3209
  key: "refreshItemRuleQuantityLimits",
3158
3210
  value: function () {
3159
- var _refreshItemRuleQuantityLimits = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36() {
3211
+ var _refreshItemRuleQuantityLimits = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37() {
3160
3212
  var strategyConfigs, businessData, limits;
3161
- return _regeneratorRuntime().wrap(function _callee36$(_context36) {
3162
- while (1) switch (_context36.prev = _context36.next) {
3213
+ return _regeneratorRuntime().wrap(function _callee37$(_context37) {
3214
+ while (1) switch (_context37.prev = _context37.next) {
3163
3215
  case 0:
3164
- _context36.prev = 0;
3165
- _context36.next = 3;
3216
+ _context37.prev = 0;
3217
+ _context37.next = 3;
3166
3218
  return this.ensureItemRuleConfigsLoaded();
3167
3219
  case 3:
3168
- strategyConfigs = _context36.sent;
3220
+ strategyConfigs = _context37.sent;
3169
3221
  if (strategyConfigs.length) {
3170
- _context36.next = 7;
3222
+ _context37.next = 7;
3171
3223
  break;
3172
3224
  }
3173
3225
  this.store.itemRuleQuantityLimits = [];
3174
- return _context36.abrupt("return", []);
3226
+ return _context37.abrupt("return", []);
3175
3227
  case 7:
3176
3228
  businessData = buildItemRuleBusinessData({
3177
3229
  tempOrder: this.ensureVenueTempOrder(),
@@ -3183,18 +3235,18 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3183
3235
  this.logMethodSuccess('refreshItemRuleQuantityLimits', {
3184
3236
  limitCount: limits.length
3185
3237
  });
3186
- return _context36.abrupt("return", limits);
3238
+ return _context37.abrupt("return", limits);
3187
3239
  case 14:
3188
- _context36.prev = 14;
3189
- _context36.t0 = _context36["catch"](0);
3240
+ _context37.prev = 14;
3241
+ _context37.t0 = _context37["catch"](0);
3190
3242
  this.store.itemRuleQuantityLimits = [];
3191
- this.logMethodError('refreshItemRuleQuantityLimits', _context36.t0);
3192
- return _context36.abrupt("return", []);
3243
+ this.logMethodError('refreshItemRuleQuantityLimits', _context37.t0);
3244
+ return _context37.abrupt("return", []);
3193
3245
  case 19:
3194
3246
  case "end":
3195
- return _context36.stop();
3247
+ return _context37.stop();
3196
3248
  }
3197
- }, _callee36, this, [[0, 14]]);
3249
+ }, _callee37, this, [[0, 14]]);
3198
3250
  }));
3199
3251
  function refreshItemRuleQuantityLimits() {
3200
3252
  return _refreshItemRuleQuantityLimits.apply(this, arguments);
@@ -3204,32 +3256,32 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3204
3256
  }, {
3205
3257
  key: "applyPrefillByItemRule",
3206
3258
  value: function () {
3207
- var _applyPrefillByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee37() {
3259
+ var _applyPrefillByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38() {
3208
3260
  var strategyConfigs, businessData, prefillItems, productSourceMap, tempOrder, hasChanges, _iterator18, _step18, _prefillItem$product_, prefillItem, productId, productVariantId, targetQuantity, sourceItem, productIndex, _sourceItem$price, _product$metadata9, sellingPrice, origin, product, productUid, targetProduct, previousOrigin, nextOrigin, existedQuantity, delta, nextProduct, _nextProduct$metadata, _productUid;
3209
- return _regeneratorRuntime().wrap(function _callee37$(_context37) {
3210
- while (1) switch (_context37.prev = _context37.next) {
3261
+ return _regeneratorRuntime().wrap(function _callee38$(_context38) {
3262
+ while (1) switch (_context38.prev = _context38.next) {
3211
3263
  case 0:
3212
3264
  if (!this.itemRulePrefillApplied) {
3213
- _context37.next = 2;
3265
+ _context38.next = 2;
3214
3266
  break;
3215
3267
  }
3216
- return _context37.abrupt("return");
3268
+ return _context38.abrupt("return");
3217
3269
  case 2:
3218
3270
  if (this.store.order) {
3219
- _context37.next = 4;
3271
+ _context38.next = 4;
3220
3272
  break;
3221
3273
  }
3222
- return _context37.abrupt("return");
3274
+ return _context38.abrupt("return");
3223
3275
  case 4:
3224
- _context37.next = 6;
3276
+ _context38.next = 6;
3225
3277
  return this.ensureItemRuleConfigsLoaded();
3226
3278
  case 6:
3227
- strategyConfigs = _context37.sent;
3279
+ strategyConfigs = _context38.sent;
3228
3280
  if (strategyConfigs.length) {
3229
- _context37.next = 9;
3281
+ _context38.next = 9;
3230
3282
  break;
3231
3283
  }
3232
- return _context37.abrupt("return");
3284
+ return _context38.abrupt("return");
3233
3285
  case 9:
3234
3286
  businessData = buildItemRuleBusinessData({
3235
3287
  tempOrder: this.ensureVenueTempOrder(),
@@ -3238,24 +3290,24 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3238
3290
  });
3239
3291
  prefillItems = this.itemRuleEvaluator.getPrefillItems(businessData);
3240
3292
  if (prefillItems.length) {
3241
- _context37.next = 14;
3293
+ _context38.next = 14;
3242
3294
  break;
3243
3295
  }
3244
3296
  this.itemRulePrefillApplied = true;
3245
- return _context37.abrupt("return");
3297
+ return _context38.abrupt("return");
3246
3298
  case 14:
3247
- _context37.next = 16;
3299
+ _context38.next = 16;
3248
3300
  return this.buildPrefillProductSourceMap();
3249
3301
  case 16:
3250
- productSourceMap = _context37.sent;
3302
+ productSourceMap = _context38.sent;
3251
3303
  tempOrder = this.ensureVenueTempOrder();
3252
3304
  hasChanges = false;
3253
3305
  _iterator18 = _createForOfIteratorHelper(prefillItems);
3254
- _context37.prev = 20;
3306
+ _context38.prev = 20;
3255
3307
  _iterator18.s();
3256
3308
  case 22:
3257
3309
  if ((_step18 = _iterator18.n()).done) {
3258
- _context37.next = 51;
3310
+ _context38.next = 51;
3259
3311
  break;
3260
3312
  }
3261
3313
  prefillItem = _step18.value;
@@ -3263,16 +3315,16 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3263
3315
  productVariantId = Number((_prefillItem$product_ = prefillItem.product_variant_id) !== null && _prefillItem$product_ !== void 0 ? _prefillItem$product_ : 0);
3264
3316
  targetQuantity = toNonNegativeInt(prefillItem.quantity);
3265
3317
  if (!(!Number.isFinite(productId) || targetQuantity <= 0)) {
3266
- _context37.next = 29;
3318
+ _context38.next = 29;
3267
3319
  break;
3268
3320
  }
3269
- return _context37.abrupt("continue", 49);
3321
+ return _context38.abrupt("continue", 49);
3270
3322
  case 29:
3271
3323
  if (!Number.isNaN(productVariantId)) {
3272
- _context37.next = 31;
3324
+ _context38.next = 31;
3273
3325
  break;
3274
3326
  }
3275
- return _context37.abrupt("continue", 49);
3327
+ return _context38.abrupt("continue", 49);
3276
3328
  case 31:
3277
3329
  sourceItem = productSourceMap.get(buildProductKey(productId, productVariantId)) || productSourceMap.get(buildProductKey(productId, 0)) || null;
3278
3330
  productIndex = getProductIdentityIndex(tempOrder.products, {
@@ -3280,7 +3332,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3280
3332
  product_variant_id: productVariantId
3281
3333
  });
3282
3334
  if (!(productIndex === -1)) {
3283
- _context37.next = 42;
3335
+ _context38.next = 42;
3284
3336
  break;
3285
3337
  }
3286
3338
  sellingPrice = toPriceString((_sourceItem$price = sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.price) !== null && _sourceItem$price !== void 0 ? _sourceItem$price : sourceItem === null || sourceItem === void 0 ? void 0 : sourceItem.selling_price, '0.00');
@@ -3304,7 +3356,7 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3304
3356
  this.attachProductOriginToTempOrder(tempOrder, productUid, origin);
3305
3357
  tempOrder.products.push(product);
3306
3358
  hasChanges = true;
3307
- return _context37.abrupt("continue", 49);
3359
+ return _context38.abrupt("continue", 49);
3308
3360
  case 42:
3309
3361
  targetProduct = tempOrder.products[productIndex];
3310
3362
  previousOrigin = this.readProductOriginFromTempOrder(tempOrder, targetProduct);
@@ -3326,34 +3378,34 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3326
3378
  hasChanges = true;
3327
3379
  }
3328
3380
  case 49:
3329
- _context37.next = 22;
3381
+ _context38.next = 22;
3330
3382
  break;
3331
3383
  case 51:
3332
- _context37.next = 56;
3384
+ _context38.next = 56;
3333
3385
  break;
3334
3386
  case 53:
3335
- _context37.prev = 53;
3336
- _context37.t0 = _context37["catch"](20);
3337
- _iterator18.e(_context37.t0);
3387
+ _context38.prev = 53;
3388
+ _context38.t0 = _context38["catch"](20);
3389
+ _iterator18.e(_context38.t0);
3338
3390
  case 56:
3339
- _context37.prev = 56;
3391
+ _context38.prev = 56;
3340
3392
  _iterator18.f();
3341
- return _context37.finish(56);
3393
+ return _context38.finish(56);
3342
3394
  case 59:
3343
3395
  if (!hasChanges) {
3344
- _context37.next = 64;
3396
+ _context38.next = 64;
3345
3397
  break;
3346
3398
  }
3347
3399
  // Prefill 属于 products CRUD 的一种形式:新增后让 Rules 重算,以支持自动应用可用优惠券。
3348
3400
  this.store.order.applyDiscount();
3349
- _context37.next = 63;
3401
+ _context38.next = 63;
3350
3402
  return this.store.order.recalculateSummary({
3351
3403
  createIfMissing: true
3352
3404
  });
3353
3405
  case 63:
3354
3406
  this.store.order.persistTempOrder();
3355
3407
  case 64:
3356
- _context37.next = 66;
3408
+ _context38.next = 66;
3357
3409
  return this.refreshItemRuleQuantityLimits();
3358
3410
  case 66:
3359
3411
  this.itemRulePrefillApplied = true;
@@ -3363,9 +3415,9 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3363
3415
  });
3364
3416
  case 68:
3365
3417
  case "end":
3366
- return _context37.stop();
3418
+ return _context38.stop();
3367
3419
  }
3368
- }, _callee37, this, [[20, 53, 56, 59]]);
3420
+ }, _callee38, this, [[20, 53, 56, 59]]);
3369
3421
  }));
3370
3422
  function applyPrefillByItemRule() {
3371
3423
  return _applyPrefillByItemRule.apply(this, arguments);
@@ -3375,24 +3427,24 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3375
3427
  }, {
3376
3428
  key: "applyItemRulePrefill",
3377
3429
  value: function () {
3378
- var _applyItemRulePrefill = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee38() {
3379
- return _regeneratorRuntime().wrap(function _callee38$(_context38) {
3380
- while (1) switch (_context38.prev = _context38.next) {
3430
+ var _applyItemRulePrefill = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39() {
3431
+ return _regeneratorRuntime().wrap(function _callee39$(_context39) {
3432
+ while (1) switch (_context39.prev = _context39.next) {
3381
3433
  case 0:
3382
3434
  this.logMethodStart('applyItemRulePrefill');
3383
- _context38.next = 3;
3435
+ _context39.next = 3;
3384
3436
  return this.applyPrefillByItemRule();
3385
3437
  case 3:
3386
- _context38.next = 5;
3438
+ _context39.next = 5;
3387
3439
  return this.refreshItemRuleQuantityLimits();
3388
3440
  case 5:
3389
- _context38.next = 7;
3441
+ _context39.next = 7;
3390
3442
  return this.refreshCartValidationPassed();
3391
3443
  case 7:
3392
3444
  case "end":
3393
- return _context38.stop();
3445
+ return _context39.stop();
3394
3446
  }
3395
- }, _callee38, this);
3447
+ }, _callee39, this);
3396
3448
  }));
3397
3449
  function applyItemRulePrefill() {
3398
3450
  return _applyItemRulePrefill.apply(this, arguments);
@@ -3402,20 +3454,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3402
3454
  }, {
3403
3455
  key: "evaluateCartValidationByItemRule",
3404
3456
  value: function () {
3405
- var _evaluateCartValidationByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee39() {
3457
+ var _evaluateCartValidationByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40() {
3406
3458
  var strategyConfigs, businessData;
3407
- return _regeneratorRuntime().wrap(function _callee39$(_context39) {
3408
- while (1) switch (_context39.prev = _context39.next) {
3459
+ return _regeneratorRuntime().wrap(function _callee40$(_context40) {
3460
+ while (1) switch (_context40.prev = _context40.next) {
3409
3461
  case 0:
3410
- _context39.next = 2;
3462
+ _context40.next = 2;
3411
3463
  return this.ensureItemRuleConfigsLoaded();
3412
3464
  case 2:
3413
- strategyConfigs = _context39.sent;
3465
+ strategyConfigs = _context40.sent;
3414
3466
  if (strategyConfigs.length) {
3415
- _context39.next = 5;
3467
+ _context40.next = 5;
3416
3468
  break;
3417
3469
  }
3418
- return _context39.abrupt("return", {
3470
+ return _context40.abrupt("return", {
3419
3471
  passed: true,
3420
3472
  failures: []
3421
3473
  });
@@ -3425,12 +3477,12 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3425
3477
  runtimeConfig: this.getItemRuleRuntimeConfig(),
3426
3478
  itemRuleConfigs: this.itemRuleConfigs
3427
3479
  });
3428
- return _context39.abrupt("return", this.itemRuleEvaluator.validateCart(businessData));
3480
+ return _context40.abrupt("return", this.itemRuleEvaluator.validateCart(businessData));
3429
3481
  case 7:
3430
3482
  case "end":
3431
- return _context39.stop();
3483
+ return _context40.stop();
3432
3484
  }
3433
- }, _callee39, this);
3485
+ }, _callee40, this);
3434
3486
  }));
3435
3487
  function evaluateCartValidationByItemRule() {
3436
3488
  return _evaluateCartValidationByItemRule.apply(this, arguments);
@@ -3440,20 +3492,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3440
3492
  }, {
3441
3493
  key: "validateBeforeSubmitByItemRule",
3442
3494
  value: function () {
3443
- var _validateBeforeSubmitByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee40() {
3495
+ var _validateBeforeSubmitByItemRule = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41() {
3444
3496
  var validationResult, firstFailure, errorMessage, error;
3445
- return _regeneratorRuntime().wrap(function _callee40$(_context40) {
3446
- while (1) switch (_context40.prev = _context40.next) {
3497
+ return _regeneratorRuntime().wrap(function _callee41$(_context41) {
3498
+ while (1) switch (_context41.prev = _context41.next) {
3447
3499
  case 0:
3448
- _context40.next = 2;
3500
+ _context41.next = 2;
3449
3501
  return this.evaluateCartValidationByItemRule();
3450
3502
  case 2:
3451
- validationResult = _context40.sent;
3503
+ validationResult = _context41.sent;
3452
3504
  if (!validationResult.passed) {
3453
- _context40.next = 5;
3505
+ _context41.next = 5;
3454
3506
  break;
3455
3507
  }
3456
- return _context40.abrupt("return");
3508
+ return _context41.abrupt("return");
3457
3509
  case 5:
3458
3510
  firstFailure = validationResult.failures[0];
3459
3511
  errorMessage = (firstFailure === null || firstFailure === void 0 ? void 0 : firstFailure.validationMessage) || '当前购物车未满足商品规则,请调整后再提交';
@@ -3462,9 +3514,9 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3462
3514
  throw error;
3463
3515
  case 10:
3464
3516
  case "end":
3465
- return _context40.stop();
3517
+ return _context41.stop();
3466
3518
  }
3467
- }, _callee40, this);
3519
+ }, _callee41, this);
3468
3520
  }));
3469
3521
  function validateBeforeSubmitByItemRule() {
3470
3522
  return _validateBeforeSubmitByItemRule.apply(this, arguments);
@@ -3474,10 +3526,10 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3474
3526
  }, {
3475
3527
  key: "refreshCartValidationPassed",
3476
3528
  value: function () {
3477
- var _refreshCartValidationPassed = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee41() {
3529
+ var _refreshCartValidationPassed = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42() {
3478
3530
  var previous, nextState, validationResult, changed;
3479
- return _regeneratorRuntime().wrap(function _callee41$(_context41) {
3480
- while (1) switch (_context41.prev = _context41.next) {
3531
+ return _regeneratorRuntime().wrap(function _callee42$(_context42) {
3532
+ while (1) switch (_context42.prev = _context42.next) {
3481
3533
  case 0:
3482
3534
  previous = this.store.cartValidation || {
3483
3535
  passed: null,
@@ -3487,20 +3539,20 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3487
3539
  passed: null,
3488
3540
  failures: []
3489
3541
  };
3490
- _context41.prev = 2;
3491
- _context41.next = 5;
3542
+ _context42.prev = 2;
3543
+ _context42.next = 5;
3492
3544
  return this.evaluateCartValidationByItemRule();
3493
3545
  case 5:
3494
- validationResult = _context41.sent;
3546
+ validationResult = _context42.sent;
3495
3547
  nextState = {
3496
3548
  passed: validationResult.passed,
3497
3549
  failures: validationResult.failures || []
3498
3550
  };
3499
- _context41.next = 12;
3551
+ _context42.next = 12;
3500
3552
  break;
3501
3553
  case 9:
3502
- _context41.prev = 9;
3503
- _context41.t0 = _context41["catch"](2);
3554
+ _context42.prev = 9;
3555
+ _context42.t0 = _context42["catch"](2);
3504
3556
  nextState = {
3505
3557
  passed: false,
3506
3558
  failures: []
@@ -3509,21 +3561,21 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3509
3561
  this.store.cartValidation = nextState;
3510
3562
  changed = previous.passed !== nextState.passed || previous.failures !== nextState.failures;
3511
3563
  if (!changed) {
3512
- _context41.next = 17;
3564
+ _context42.next = 17;
3513
3565
  break;
3514
3566
  }
3515
- _context41.next = 17;
3567
+ _context42.next = 17;
3516
3568
  return this.core.effects.emit(VenueBookingHooks.onCartValidationChanged, {
3517
3569
  cartValidation: nextState,
3518
3570
  cartValidationPassed: nextState.passed
3519
3571
  });
3520
3572
  case 17:
3521
- return _context41.abrupt("return", nextState.passed);
3573
+ return _context42.abrupt("return", nextState.passed);
3522
3574
  case 18:
3523
3575
  case "end":
3524
- return _context41.stop();
3576
+ return _context42.stop();
3525
3577
  }
3526
- }, _callee41, this, [[2, 9]]);
3578
+ }, _callee42, this, [[2, 9]]);
3527
3579
  }));
3528
3580
  function refreshCartValidationPassed() {
3529
3581
  return _refreshCartValidationPassed.apply(this, arguments);
@@ -3533,14 +3585,14 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3533
3585
  }, {
3534
3586
  key: "setItemRuleRuntimeConfig",
3535
3587
  value: function () {
3536
- var _setItemRuleRuntimeConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee42() {
3588
+ var _setItemRuleRuntimeConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43() {
3537
3589
  var _this$itemRuleRuntime, _this$itemRuleRuntime2;
3538
3590
  var config,
3539
- _args42 = arguments;
3540
- return _regeneratorRuntime().wrap(function _callee42$(_context42) {
3541
- while (1) switch (_context42.prev = _context42.next) {
3591
+ _args43 = arguments;
3592
+ return _regeneratorRuntime().wrap(function _callee43$(_context43) {
3593
+ while (1) switch (_context43.prev = _context43.next) {
3542
3594
  case 0:
3543
- config = _args42.length > 0 && _args42[0] !== undefined ? _args42[0] : {};
3595
+ config = _args43.length > 0 && _args43[0] !== undefined ? _args43[0] : {};
3544
3596
  this.logMethodStart('setItemRuleRuntimeConfig');
3545
3597
  this.itemRuleRuntimeConfig = _objectSpread(_objectSpread(_objectSpread({}, this.itemRuleRuntimeConfig), config), {}, {
3546
3598
  pax: _objectSpread(_objectSpread({}, ((_this$itemRuleRuntime = this.itemRuleRuntimeConfig) === null || _this$itemRuleRuntime === void 0 ? void 0 : _this$itemRuleRuntime.pax) || {}), (config === null || config === void 0 ? void 0 : config.pax) || {}),
@@ -3552,10 +3604,10 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3552
3604
  this.itemRuleEvaluator.setStrategyConfigs([]);
3553
3605
  }
3554
3606
  this.itemRulePrefillApplied = false;
3555
- _context42.next = 7;
3607
+ _context43.next = 7;
3556
3608
  return this.refreshItemRuleQuantityLimits();
3557
3609
  case 7:
3558
- _context42.next = 9;
3610
+ _context43.next = 9;
3559
3611
  return this.refreshCartValidationPassed();
3560
3612
  case 9:
3561
3613
  this.logMethodSuccess('setItemRuleRuntimeConfig', {
@@ -3563,9 +3615,9 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3563
3615
  });
3564
3616
  case 10:
3565
3617
  case "end":
3566
- return _context42.stop();
3618
+ return _context43.stop();
3567
3619
  }
3568
- }, _callee42, this);
3620
+ }, _callee43, this);
3569
3621
  }));
3570
3622
  function setItemRuleRuntimeConfig() {
3571
3623
  return _setItemRuleRuntimeConfig.apply(this, arguments);
@@ -3686,30 +3738,30 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3686
3738
  }, {
3687
3739
  key: "refreshAllHolderFormRecords",
3688
3740
  value: (function () {
3689
- var _refreshAllHolderFormRecords = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee43(params) {
3741
+ var _refreshAllHolderFormRecords = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee44(params) {
3690
3742
  var _params$customer_id, _params$useCache;
3691
3743
  var customer_id;
3692
- return _regeneratorRuntime().wrap(function _callee43$(_context43) {
3693
- while (1) switch (_context43.prev = _context43.next) {
3744
+ return _regeneratorRuntime().wrap(function _callee44$(_context44) {
3745
+ while (1) switch (_context44.prev = _context44.next) {
3694
3746
  case 0:
3695
3747
  if (this.store.holder) {
3696
- _context43.next = 2;
3748
+ _context44.next = 2;
3697
3749
  break;
3698
3750
  }
3699
3751
  throw new Error('[VenueBooking] holder 模块未初始化');
3700
3752
  case 2:
3701
3753
  customer_id = (_params$customer_id = params === null || params === void 0 ? void 0 : params.customer_id) !== null && _params$customer_id !== void 0 ? _params$customer_id : this.resolveHolderCustomerId();
3702
- return _context43.abrupt("return", this.store.holder.refreshAllFormRecords(_objectSpread(_objectSpread({}, params), {}, {
3754
+ return _context44.abrupt("return", this.store.holder.refreshAllFormRecords(_objectSpread(_objectSpread({}, params), {}, {
3703
3755
  customer_id: customer_id,
3704
3756
  useCache: (_params$useCache = params === null || params === void 0 ? void 0 : params.useCache) !== null && _params$useCache !== void 0 ? _params$useCache : false
3705
3757
  })));
3706
3758
  case 4:
3707
3759
  case "end":
3708
- return _context43.stop();
3760
+ return _context44.stop();
3709
3761
  }
3710
- }, _callee43, this);
3762
+ }, _callee44, this);
3711
3763
  }));
3712
- function refreshAllHolderFormRecords(_x21) {
3764
+ function refreshAllHolderFormRecords(_x22) {
3713
3765
  return _refreshAllHolderFormRecords.apply(this, arguments);
3714
3766
  }
3715
3767
  return refreshAllHolderFormRecords;
@@ -3729,25 +3781,25 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3729
3781
  }, {
3730
3782
  key: "checkOpenDataAvailability",
3731
3783
  value: function () {
3732
- var _checkOpenDataAvailability = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee44() {
3733
- return _regeneratorRuntime().wrap(function _callee44$(_context44) {
3734
- while (1) switch (_context44.prev = _context44.next) {
3784
+ var _checkOpenDataAvailability = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45() {
3785
+ return _regeneratorRuntime().wrap(function _callee45$(_context45) {
3786
+ while (1) switch (_context45.prev = _context45.next) {
3735
3787
  case 0:
3736
3788
  if (this.store.openData) {
3737
- _context44.next = 2;
3789
+ _context45.next = 2;
3738
3790
  break;
3739
3791
  }
3740
3792
  throw new Error('openData 模块未初始化');
3741
3793
  case 2:
3742
- _context44.next = 4;
3794
+ _context45.next = 4;
3743
3795
  return this.loadOpenDataConfig();
3744
3796
  case 4:
3745
- return _context44.abrupt("return", this.store.openData.checkAvailability(this.store.schedule));
3797
+ return _context45.abrupt("return", this.store.openData.checkAvailability(this.store.schedule));
3746
3798
  case 5:
3747
3799
  case "end":
3748
- return _context44.stop();
3800
+ return _context45.stop();
3749
3801
  }
3750
- }, _callee44, this);
3802
+ }, _callee45, this);
3751
3803
  }));
3752
3804
  function checkOpenDataAvailability() {
3753
3805
  return _checkOpenDataAvailability.apply(this, arguments);
@@ -3757,15 +3809,15 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3757
3809
  }, {
3758
3810
  key: "setOtherParams",
3759
3811
  value: function () {
3760
- var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45(params) {
3761
- var _ref7,
3762
- _ref7$cover,
3812
+ var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee46(params) {
3813
+ var _ref8,
3814
+ _ref8$cover,
3763
3815
  cover,
3764
- _args45 = arguments;
3765
- return _regeneratorRuntime().wrap(function _callee45$(_context45) {
3766
- while (1) switch (_context45.prev = _context45.next) {
3816
+ _args46 = arguments;
3817
+ return _regeneratorRuntime().wrap(function _callee46$(_context46) {
3818
+ while (1) switch (_context46.prev = _context46.next) {
3767
3819
  case 0:
3768
- _ref7 = _args45.length > 1 && _args45[1] !== undefined ? _args45[1] : {}, _ref7$cover = _ref7.cover, cover = _ref7$cover === void 0 ? false : _ref7$cover;
3820
+ _ref8 = _args46.length > 1 && _args46[1] !== undefined ? _args46[1] : {}, _ref8$cover = _ref8.cover, cover = _ref8$cover === void 0 ? false : _ref8$cover;
3769
3821
  if (cover) {
3770
3822
  this.otherParams = params;
3771
3823
  } else {
@@ -3773,11 +3825,11 @@ export var VenueBookingImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3773
3825
  }
3774
3826
  case 2:
3775
3827
  case "end":
3776
- return _context45.stop();
3828
+ return _context46.stop();
3777
3829
  }
3778
- }, _callee45, this);
3830
+ }, _callee46, this);
3779
3831
  }));
3780
- function setOtherParams(_x22) {
3832
+ function setOtherParams(_x23) {
3781
3833
  return _setOtherParams.apply(this, arguments);
3782
3834
  }
3783
3835
  return setOtherParams;