@pisell/pisellos 0.10.16 → 0.10.18

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 (63) hide show
  1. package/dist/model/strategy/adapter/promotion/index.js +9 -0
  2. package/dist/modules/OpenData/index.d.ts +5 -2
  3. package/dist/modules/OpenData/index.js +27 -12
  4. package/dist/modules/OpenData/types.d.ts +42 -0
  5. package/dist/modules/OpenData/types.js +7 -1
  6. package/dist/modules/OpenData/utils.d.ts +15 -1
  7. package/dist/modules/OpenData/utils.js +85 -0
  8. package/dist/modules/Order/index.d.ts +3 -1
  9. package/dist/modules/Order/index.js +68 -44
  10. package/dist/modules/Order/types.d.ts +3 -0
  11. package/dist/modules/Order/types.js +1 -0
  12. package/dist/modules/ProductList/index.js +96 -74
  13. package/dist/modules/Rules/index.js +11 -8
  14. package/dist/modules/SalesSummary/index.js +6 -4
  15. package/dist/server/index.d.ts +11 -0
  16. package/dist/server/index.js +845 -481
  17. package/dist/server/modules/order/index.d.ts +8 -0
  18. package/dist/server/modules/order/index.js +251 -215
  19. package/dist/server/utils/small-ticket.d.ts +9 -1
  20. package/dist/server/utils/small-ticket.js +117 -43
  21. package/dist/solution/BaseSales/index.d.ts +7 -0
  22. package/dist/solution/BaseSales/index.js +251 -144
  23. package/dist/solution/BookingByStep/index.d.ts +2 -2
  24. package/dist/solution/BookingTicket/index.d.ts +14 -19
  25. package/dist/solution/BookingTicket/index.js +545 -429
  26. package/dist/solution/Sales/index.d.ts +20 -4
  27. package/dist/solution/Sales/index.js +348 -75
  28. package/dist/solution/Sales/types.d.ts +10 -0
  29. package/dist/solution/UnifiedBookingSales/index.d.ts +5 -4
  30. package/dist/solution/UnifiedBookingSales/index.js +495 -422
  31. package/dist/solution/UnifiedBookingSales/types.d.ts +7 -1
  32. package/lib/model/strategy/adapter/promotion/index.js +1 -46
  33. package/lib/modules/OpenData/index.d.ts +5 -2
  34. package/lib/modules/OpenData/index.js +50 -3
  35. package/lib/modules/OpenData/types.d.ts +42 -0
  36. package/lib/modules/OpenData/types.js +9 -1
  37. package/lib/modules/OpenData/utils.d.ts +15 -1
  38. package/lib/modules/OpenData/utils.js +85 -0
  39. package/lib/modules/Order/index.d.ts +3 -1
  40. package/lib/modules/Order/index.js +41 -21
  41. package/lib/modules/Order/types.d.ts +3 -0
  42. package/lib/modules/Order/types.js +1 -0
  43. package/lib/modules/ProductList/index.js +9 -6
  44. package/lib/modules/Rules/index.js +8 -6
  45. package/lib/modules/SalesSummary/index.js +3 -1
  46. package/lib/server/index.d.ts +11 -0
  47. package/lib/server/index.js +395 -96
  48. package/lib/server/modules/order/index.d.ts +8 -0
  49. package/lib/server/modules/order/index.js +23 -0
  50. package/lib/server/utils/small-ticket.d.ts +9 -1
  51. package/lib/server/utils/small-ticket.js +107 -35
  52. package/lib/solution/BaseSales/index.d.ts +7 -0
  53. package/lib/solution/BaseSales/index.js +125 -28
  54. package/lib/solution/BookingByStep/index.d.ts +2 -2
  55. package/lib/solution/BookingTicket/index.d.ts +14 -19
  56. package/lib/solution/BookingTicket/index.js +70 -17
  57. package/lib/solution/Sales/index.d.ts +20 -4
  58. package/lib/solution/Sales/index.js +183 -15
  59. package/lib/solution/Sales/types.d.ts +10 -0
  60. package/lib/solution/UnifiedBookingSales/index.d.ts +5 -4
  61. package/lib/solution/UnifiedBookingSales/index.js +41 -15
  62. package/lib/solution/UnifiedBookingSales/types.d.ts +7 -1
  63. package/package.json +1 -1
@@ -189,7 +189,7 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
189
189
  }, {
190
190
  key: "loadProducts",
191
191
  value: function () {
192
- var _loadProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
192
+ var _loadProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
193
193
  var _this$otherParams3,
194
194
  _this2 = this;
195
195
  var _ref,
@@ -221,16 +221,17 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
221
221
  mappedApplicationCode,
222
222
  queryPayload,
223
223
  handledByOsServer,
224
- callback,
224
+ originalCallback,
225
+ subscriptionCallback,
225
226
  productsData,
226
227
  resolvedList,
227
228
  sortedList,
228
- _args4 = arguments;
229
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
230
- while (1) switch (_context4.prev = _context4.next) {
229
+ _args5 = arguments;
230
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
231
+ while (1) switch (_context5.prev = _context5.next) {
231
232
  case 0:
232
- _ref = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : {}, _ref$category_ids = _ref.category_ids, category_ids = _ref$category_ids === void 0 ? [] : _ref$category_ids, _ref$product_ids = _ref.product_ids, product_ids = _ref$product_ids === void 0 ? [] : _ref$product_ids, _ref$collection = _ref.collection, collection = _ref$collection === void 0 ? [] : _ref$collection, _ref$menu_list_ids = _ref.menu_list_ids, menu_list_ids = _ref$menu_list_ids === void 0 ? [] : _ref$menu_list_ids, paramsCustomerId = _ref.customer_id, _ref$with_count = _ref.with_count, with_count = _ref$with_count === void 0 ? [] : _ref$with_count, schedule_datetime = _ref.schedule_datetime, schedule_date = _ref.schedule_date, cacheId = _ref.cacheId, with_schedule = _ref.with_schedule, extension_type = _ref.extension_type, _ref$status = _ref.status, status = _ref$status === void 0 ? 'published' : _ref$status, strategy_context = _ref.strategy_context;
233
- options = _args4.length > 1 ? _args4[1] : undefined;
233
+ _ref = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : {}, _ref$category_ids = _ref.category_ids, category_ids = _ref$category_ids === void 0 ? [] : _ref$category_ids, _ref$product_ids = _ref.product_ids, product_ids = _ref$product_ids === void 0 ? [] : _ref$product_ids, _ref$collection = _ref.collection, collection = _ref$collection === void 0 ? [] : _ref$collection, _ref$menu_list_ids = _ref.menu_list_ids, menu_list_ids = _ref$menu_list_ids === void 0 ? [] : _ref$menu_list_ids, paramsCustomerId = _ref.customer_id, _ref$with_count = _ref.with_count, with_count = _ref$with_count === void 0 ? [] : _ref$with_count, schedule_datetime = _ref.schedule_datetime, schedule_date = _ref.schedule_date, cacheId = _ref.cacheId, with_schedule = _ref.with_schedule, extension_type = _ref.extension_type, _ref$status = _ref.status, status = _ref$status === void 0 ? 'published' : _ref$status, strategy_context = _ref.strategy_context;
234
+ options = _args5.length > 1 ? _args5[1] : undefined;
234
235
  // // 如果 schedule_ids 为空,则需要尝试从 schedule 模块里获取
235
236
  // if (!schedule_ids?.length) {
236
237
  // const schedule_ids_data = this.store.schedule
@@ -291,29 +292,50 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
291
292
  strategy_context: strategy_context
292
293
  });
293
294
  handledByOsServer = this.isProductQueryHandledByOsServer();
294
- callback = !handledByOsServer && typeof (options === null || options === void 0 ? void 0 : options.callback) === 'function' ? function (result) {
295
- var _result$data, _options$callback2;
296
- var callbackList = result === null || result === void 0 || (_result$data = result.data) === null || _result$data === void 0 ? void 0 : _result$data.list;
297
- if (!Array.isArray(callbackList)) {
298
- var _options$callback;
299
- (_options$callback = options.callback) === null || _options$callback === void 0 || _options$callback.call(options, result);
300
- return;
301
- }
302
- (_options$callback2 = options.callback) === null || _options$callback2 === void 0 || _options$callback2.call(options, _objectSpread(_objectSpread({}, result), {}, {
303
- data: _objectSpread(_objectSpread({}, result.data), {}, {
304
- list: _this2.resolveClientDataVariants(callbackList, queryPayload, false)
305
- })
295
+ originalCallback = options === null || options === void 0 ? void 0 : options.callback;
296
+ subscriptionCallback = originalCallback ? ( /*#__PURE__*/function () {
297
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(result) {
298
+ var _result$data;
299
+ var callbackList, resolvedCallbackList;
300
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
301
+ while (1) switch (_context4.prev = _context4.next) {
302
+ case 0:
303
+ callbackList = result === null || result === void 0 || (_result$data = result.data) === null || _result$data === void 0 ? void 0 : _result$data.list;
304
+ if (Array.isArray(callbackList)) {
305
+ _context4.next = 4;
306
+ break;
307
+ }
308
+ originalCallback(result);
309
+ return _context4.abrupt("return");
310
+ case 4:
311
+ resolvedCallbackList = _this2.resolveClientDataVariants(callbackList, queryPayload, handledByOsServer);
312
+ _context4.next = 7;
313
+ return _this2.addProduct(resolvedCallbackList);
314
+ case 7:
315
+ originalCallback(resolvedCallbackList === callbackList ? result : _objectSpread(_objectSpread({}, result), {}, {
316
+ data: _objectSpread(_objectSpread({}, result.data), {}, {
317
+ list: resolvedCallbackList
318
+ })
319
+ }));
320
+ case 8:
321
+ case "end":
322
+ return _context4.stop();
323
+ }
324
+ }, _callee4);
306
325
  }));
307
- } : options === null || options === void 0 ? void 0 : options.callback;
308
- _context4.next = 13;
326
+ return function (_x5) {
327
+ return _ref2.apply(this, arguments);
328
+ };
329
+ }()) : undefined;
330
+ _context5.next = 14;
309
331
  return this.request.post("/product/query", queryPayload, {
310
332
  osServer: true,
311
- callback: callback,
333
+ callback: subscriptionCallback,
312
334
  subscriberId: options === null || options === void 0 ? void 0 : options.subscriberId,
313
335
  customToast: function customToast() {}
314
336
  });
315
- case 13:
316
- productsData = _context4.sent;
337
+ case 14:
338
+ productsData = _context5.sent;
317
339
  resolvedList = this.resolveClientDataVariants(productsData.data.list || [], queryPayload, handledByOsServer);
318
340
  sortedList = resolvedList.slice().sort(function (a, b) {
319
341
  return Number(b.sort) - Number(a.sort);
@@ -325,12 +347,12 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
325
347
  // })
326
348
  // }
327
349
  this.addProduct(sortedList);
328
- return _context4.abrupt("return", sortedList);
329
- case 18:
350
+ return _context5.abrupt("return", sortedList);
351
+ case 19:
330
352
  case "end":
331
- return _context4.stop();
353
+ return _context5.stop();
332
354
  }
333
- }, _callee4, this);
355
+ }, _callee5, this);
334
356
  }));
335
357
  function loadProducts() {
336
358
  return _loadProducts.apply(this, arguments);
@@ -340,13 +362,13 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
340
362
  }, {
341
363
  key: "loadProductsPrice",
342
364
  value: function () {
343
- var _loadProductsPrice = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(_ref2) {
344
- var _ref2$ids, ids, customer_id, schedule_date, channel, productsData;
345
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
346
- while (1) switch (_context5.prev = _context5.next) {
365
+ var _loadProductsPrice = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(_ref3) {
366
+ var _ref3$ids, ids, customer_id, schedule_date, channel, productsData;
367
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
368
+ while (1) switch (_context6.prev = _context6.next) {
347
369
  case 0:
348
- _ref2$ids = _ref2.ids, ids = _ref2$ids === void 0 ? [] : _ref2$ids, customer_id = _ref2.customer_id, schedule_date = _ref2.schedule_date, channel = _ref2.channel;
349
- _context5.next = 3;
370
+ _ref3$ids = _ref3.ids, ids = _ref3$ids === void 0 ? [] : _ref3$ids, customer_id = _ref3.customer_id, schedule_date = _ref3.schedule_date, channel = _ref3.channel;
371
+ _context6.next = 3;
350
372
  return this.request.post("/product/query/price", {
351
373
  ids: ids,
352
374
  customer_id: customer_id,
@@ -356,15 +378,15 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
356
378
  useCache: true
357
379
  });
358
380
  case 3:
359
- productsData = _context5.sent;
360
- return _context5.abrupt("return", productsData.data);
381
+ productsData = _context6.sent;
382
+ return _context6.abrupt("return", productsData.data);
361
383
  case 5:
362
384
  case "end":
363
- return _context5.stop();
385
+ return _context6.stop();
364
386
  }
365
- }, _callee5, this);
387
+ }, _callee6, this);
366
388
  }));
367
- function loadProductsPrice(_x5) {
389
+ function loadProductsPrice(_x6) {
368
390
  return _loadProductsPrice.apply(this, arguments);
369
391
  }
370
392
  return loadProductsPrice;
@@ -372,19 +394,19 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
372
394
  }, {
373
395
  key: "getProducts",
374
396
  value: function () {
375
- var _getProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
376
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
377
- while (1) switch (_context6.prev = _context6.next) {
397
+ var _getProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
398
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
399
+ while (1) switch (_context7.prev = _context7.next) {
378
400
  case 0:
379
- _context6.next = 2;
401
+ _context7.next = 2;
380
402
  return this.core.effects.emit("".concat(this.name, ":onGetProducts"), this.store.list);
381
403
  case 2:
382
- return _context6.abrupt("return", cloneDeep(this.store.list));
404
+ return _context7.abrupt("return", cloneDeep(this.store.list));
383
405
  case 3:
384
406
  case "end":
385
- return _context6.stop();
407
+ return _context7.stop();
386
408
  }
387
- }, _callee6, this);
409
+ }, _callee7, this);
388
410
  }));
389
411
  function getProducts() {
390
412
  return _getProducts.apply(this, arguments);
@@ -394,25 +416,25 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
394
416
  }, {
395
417
  key: "getProduct",
396
418
  value: function () {
397
- var _getProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(id) {
419
+ var _getProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(id) {
398
420
  var product;
399
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
400
- while (1) switch (_context7.prev = _context7.next) {
421
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
422
+ while (1) switch (_context8.prev = _context8.next) {
401
423
  case 0:
402
- _context7.next = 2;
424
+ _context8.next = 2;
403
425
  return this.core.effects.emit("".concat(this.name, ":onGetProduct"), this.store.list);
404
426
  case 2:
405
427
  product = this.store.list.find(function (product) {
406
428
  return product.id === id;
407
429
  });
408
- return _context7.abrupt("return", product ? cloneDeep(product) : undefined);
430
+ return _context8.abrupt("return", product ? cloneDeep(product) : undefined);
409
431
  case 4:
410
432
  case "end":
411
- return _context7.stop();
433
+ return _context8.stop();
412
434
  }
413
- }, _callee7, this);
435
+ }, _callee8, this);
414
436
  }));
415
- function getProduct(_x6) {
437
+ function getProduct(_x7) {
416
438
  return _getProduct.apply(this, arguments);
417
439
  }
418
440
  return getProduct;
@@ -420,25 +442,25 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
420
442
  }, {
421
443
  key: "getProductByIds",
422
444
  value: function () {
423
- var _getProductByIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(ids) {
445
+ var _getProductByIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(ids) {
424
446
  var products;
425
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
426
- while (1) switch (_context8.prev = _context8.next) {
447
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
448
+ while (1) switch (_context9.prev = _context9.next) {
427
449
  case 0:
428
- _context8.next = 2;
450
+ _context9.next = 2;
429
451
  return this.core.effects.emit("".concat(this.name, ":onGetProductByIds"), this.store.list);
430
452
  case 2:
431
453
  products = this.store.list.filter(function (product) {
432
454
  return ids.includes(product.id);
433
455
  });
434
- return _context8.abrupt("return", products);
456
+ return _context9.abrupt("return", products);
435
457
  case 4:
436
458
  case "end":
437
- return _context8.stop();
459
+ return _context9.stop();
438
460
  }
439
- }, _callee8, this);
461
+ }, _callee9, this);
440
462
  }));
441
- function getProductByIds(_x7) {
463
+ function getProductByIds(_x8) {
442
464
  return _getProductByIds.apply(this, arguments);
443
465
  }
444
466
  return getProductByIds;
@@ -446,10 +468,10 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
446
468
  }, {
447
469
  key: "addProduct",
448
470
  value: function () {
449
- var _addProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(products) {
471
+ var _addProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(products) {
450
472
  var _this3 = this;
451
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
452
- while (1) switch (_context9.prev = _context9.next) {
473
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
474
+ while (1) switch (_context10.prev = _context10.next) {
453
475
  case 0:
454
476
  // list 需要根据 id 去重
455
477
  if (!this.store.list) {
@@ -472,11 +494,11 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
472
494
  this.core.effects.emit("".concat(this.name, ":changed"), this.store.list);
473
495
  case 4:
474
496
  case "end":
475
- return _context9.stop();
497
+ return _context10.stop();
476
498
  }
477
- }, _callee9, this);
499
+ }, _callee10, this);
478
500
  }));
479
- function addProduct(_x8) {
501
+ function addProduct(_x9) {
480
502
  return _addProduct.apply(this, arguments);
481
503
  }
482
504
  return addProduct;
@@ -484,18 +506,18 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
484
506
  }, {
485
507
  key: "selectProducts",
486
508
  value: function () {
487
- var _selectProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(products) {
488
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
489
- while (1) switch (_context10.prev = _context10.next) {
509
+ var _selectProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(products) {
510
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
511
+ while (1) switch (_context11.prev = _context11.next) {
490
512
  case 0:
491
513
  this.store.selectProducts = products;
492
514
  case 1:
493
515
  case "end":
494
- return _context10.stop();
516
+ return _context11.stop();
495
517
  }
496
- }, _callee10, this);
518
+ }, _callee11, this);
497
519
  }));
498
- function selectProducts(_x9) {
520
+ function selectProducts(_x10) {
499
521
  return _selectProducts.apply(this, arguments);
500
522
  }
501
523
  return selectProducts;
@@ -2223,7 +2223,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
2223
2223
  }, {
2224
2224
  key: "checkPackageSubItemUsageRules",
2225
2225
  value: function checkPackageSubItemUsageRules(discount, flatItem) {
2226
- var _flatItem$product;
2226
+ var _flatItem$product, _flatItem$originProdu, _flatItem$parentProdu10;
2227
2227
  var limitedData = discount.limited_relation_product_data;
2228
2228
  var usageRules = limitedData === null || limitedData === void 0 ? void 0 : limitedData.package_sub_item_usage_rules;
2229
2229
  var rules = ['original_price'].concat(_toConsumableArray((usageRules === null || usageRules === void 0 ? void 0 : usageRules.rules) || []));
@@ -2236,7 +2236,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
2236
2236
  // 套餐适用范围配置
2237
2237
  var packageScope = usageRules === null || usageRules === void 0 ? void 0 : usageRules.package_scope;
2238
2238
  var _ref18 = packageScope || {},
2239
- scopeType = _ref18.type,
2239
+ _ref18$type = _ref18.type,
2240
+ scopeType = _ref18$type === void 0 ? 'product_all' : _ref18$type,
2240
2241
  _ref18$exclude_bundle = _ref18.exclude_bundle_product_ids,
2241
2242
  exclude_bundle_product_ids = _ref18$exclude_bundle === void 0 ? [] : _ref18$exclude_bundle,
2242
2243
  _ref18$include_bundle = _ref18.include_bundle_product_ids,
@@ -2246,6 +2247,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
2246
2247
  var isMainProduct = flatItem.type === 'main'; // 单独购买
2247
2248
  var isBundleItem = flatItem.type === 'bundle'; // 套餐中购买
2248
2249
  var bundleMainProductId = (_flatItem$product = flatItem.product) === null || _flatItem$product === void 0 ? void 0 : _flatItem$product.product_id;
2250
+ // 主商品id
2251
+ var mainProductId = (flatItem === null || flatItem === void 0 || (_flatItem$originProdu = flatItem.originProduct) === null || _flatItem$originProdu === void 0 || (_flatItem$originProdu = _flatItem$originProdu._productOrigin) === null || _flatItem$originProdu === void 0 ? void 0 : _flatItem$originProdu.id) || (flatItem === null || flatItem === void 0 || (_flatItem$parentProdu10 = flatItem.parentProduct) === null || _flatItem$parentProdu10 === void 0 ? void 0 : _flatItem$parentProdu10.id) || 0;
2249
2252
 
2250
2253
  // 主商品直接可用
2251
2254
  if (isMainProduct) {
@@ -2258,12 +2261,12 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
2258
2261
  return true; // 单独购买时可用
2259
2262
  }
2260
2263
  if (isBundleItem) {
2261
- var _flatItem$bundleItem10, _flatItem$bundleItem11, _flatItem$originProdu, _flatItem$parentProdu10;
2264
+ var _flatItem$bundleItem10, _flatItem$bundleItem11;
2262
2265
  // 套餐中购买时,判断是否为原价
2263
2266
  var priceType = (_flatItem$bundleItem10 = flatItem.bundleItem) === null || _flatItem$bundleItem10 === void 0 ? void 0 : _flatItem$bundleItem10.price_type;
2264
2267
  var priceTypeExt = (_flatItem$bundleItem11 = flatItem.bundleItem) === null || _flatItem$bundleItem11 === void 0 ? void 0 : _flatItem$bundleItem11.price_type_ext;
2265
2268
  // 主商品id
2266
- var mainProductId = (flatItem === null || flatItem === void 0 || (_flatItem$originProdu = flatItem.originProduct) === null || _flatItem$originProdu === void 0 || (_flatItem$originProdu = _flatItem$originProdu._productOrigin) === null || _flatItem$originProdu === void 0 ? void 0 : _flatItem$originProdu.id) || (flatItem === null || flatItem === void 0 || (_flatItem$parentProdu10 = flatItem.parentProduct) === null || _flatItem$parentProdu10 === void 0 ? void 0 : _flatItem$parentProdu10.id) || 0;
2269
+ // const mainProductId = flatItem?.originProduct?._productOrigin?.id || flatItem?.parentProduct?.id || 0;
2267
2270
  // original_price 对应:
2268
2271
  // 1. price_type: "markup" && price_type_ext: "product_price"
2269
2272
  // markup_price 对应:
@@ -2288,13 +2291,13 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
2288
2291
  if (!filter) {
2289
2292
  isScopeValid = true;
2290
2293
  } else {
2291
- isScopeValid = !exclude_bundle_product_ids.includes(Number(bundleMainProductId));
2294
+ isScopeValid = !exclude_bundle_product_ids.includes(Number(mainProductId));
2292
2295
  }
2293
2296
  }
2294
2297
 
2295
2298
  // 包含套餐判断, products值兼容旧数据
2296
2299
  if (scopeType === 'specific_packages' || scopeType === 'products') {
2297
- isScopeValid = include_bundle_product_ids.includes(Number(bundleMainProductId));
2300
+ isScopeValid = include_bundle_product_ids.includes(Number(mainProductId));
2298
2301
  }
2299
2302
 
2300
2303
  // 价格和套餐适用范围都符合,则可用
@@ -2357,13 +2360,13 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
2357
2360
  if (!filter) {
2358
2361
  _isScopeValid = true;
2359
2362
  } else {
2360
- _isScopeValid = !exclude_bundle_product_ids.includes(Number(bundleMainProductId));
2363
+ _isScopeValid = !exclude_bundle_product_ids.includes(Number(mainProductId));
2361
2364
  }
2362
2365
  }
2363
2366
 
2364
2367
  // 包含套餐判断, products值兼容旧数据
2365
2368
  if (scopeType === 'specific_packages' || scopeType === 'products') {
2366
- _isScopeValid = include_bundle_product_ids.includes(Number(bundleMainProductId));
2369
+ _isScopeValid = include_bundle_product_ids.includes(Number(mainProductId));
2367
2370
  }
2368
2371
 
2369
2372
  // 价格和套餐适用范围都符合,则可用
@@ -212,8 +212,8 @@ export var SalesSummaryModule = /*#__PURE__*/function (_BaseModule) {
212
212
  key: "getSummary",
213
213
  value: function () {
214
214
  var _getSummary = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(params) {
215
- var _this$store$surcharge, _ref;
216
- var _params$products, products, isPriceIncludeTax, taxRate, shopDiscount, channel, _params$virtualSettle, virtualSettlementMode, summaryChannel, taxConfig, summarySchedule, needScheduleIds, scheduleList, scheduleById, _iterator, _step, item, summary, summaryWithTaxMeta;
215
+ var _this$otherParams2, _this$store$surcharge, _ref;
216
+ var _params$products, products, isPriceIncludeTax, taxRate, shopDiscount, channel, _params$virtualSettle, virtualSettlementMode, summaryChannel, taxConfig, fatherModuleName, scheduleModuleName, summarySchedule, needScheduleIds, scheduleList, scheduleById, _iterator, _step, item, summary, summaryWithTaxMeta;
217
217
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
218
218
  while (1) switch (_context4.prev = _context4.next) {
219
219
  case 0:
@@ -227,7 +227,9 @@ export var SalesSummaryModule = /*#__PURE__*/function (_BaseModule) {
227
227
  return this.getSurchargeList(summaryChannel);
228
228
  case 5:
229
229
  taxConfig = this.getTaxConfig();
230
- summarySchedule = this.core.getModule("".concat(this.name.split('_')[0], "_schedule"));
230
+ fatherModuleName = ((_this$otherParams2 = this.otherParams) === null || _this$otherParams2 === void 0 ? void 0 : _this$otherParams2.fatherModule) || this.name.replace(/_salesSummary$/, '');
231
+ scheduleModuleName = "".concat(fatherModuleName, "_schedule");
232
+ summarySchedule = this.core.getModule(scheduleModuleName);
231
233
  needScheduleIds = (((_this$store$surcharge = this.store.surchargeList) === null || _this$store$surcharge === void 0 || (_this$store$surcharge = _this$store$surcharge.map(function (item) {
232
234
  return item.available_schedule_ids;
233
235
  })) === null || _this$store$surcharge === void 0 ? void 0 : _this$store$surcharge.flat()) || []).filter(function (id) {
@@ -265,7 +267,7 @@ export var SalesSummaryModule = /*#__PURE__*/function (_BaseModule) {
265
267
  });
266
268
  this.store.summary = summaryWithTaxMeta;
267
269
  return _context4.abrupt("return", summaryWithTaxMeta);
268
- case 15:
270
+ case 17:
269
271
  case "end":
270
272
  return _context4.stop();
271
273
  }
@@ -505,6 +505,14 @@ declare class Server {
505
505
  private buildCheckoutTaskIdempotencyKey;
506
506
  private isBlankCheckoutValue;
507
507
  private isLocalCheckoutOrderId;
508
+ private normalizePrintInvoiceLayoutConfig;
509
+ private extractInvoiceLayoutConfig;
510
+ private normalizePrintInvoiceTemplateSettings;
511
+ private extractInvoiceTemplateSettings;
512
+ private applyCheckoutFulfillmentBuzzer;
513
+ private buildCheckoutResourceIdentifierBuzzer;
514
+ private getCheckoutResourceIdentifier;
515
+ private stringifyCheckoutResourceIdentifier;
508
516
  private normalizeCheckoutSubmitData;
509
517
  private ensureCheckoutOrderNumbers;
510
518
  private dispatchCheckoutSyncTask;
@@ -514,6 +522,7 @@ declare class Server {
514
522
  private dispatchLocalReceiptPrint;
515
523
  private shouldLookupLocalPrintOrder;
516
524
  private getLocalPrintOrderLookup;
525
+ private mergeLocalPrintOrderInput;
517
526
  private handleLocalPrintOrder;
518
527
  private handleMachinecodeBatchMeta;
519
528
  private resolveMachinecodeBatchMetadataLookup;
@@ -552,6 +561,8 @@ declare class Server {
552
561
  private shouldLookupPaymentMethodNameByCode;
553
562
  private enrichPaymentNamesByCode;
554
563
  private withLocalSmallTicketData;
564
+ private normalizeRemoteSalesOrderErrorCode;
565
+ private fetchAndPersistSalesOrderByLookup;
555
566
  private handleOrderSalesDetail;
556
567
  /**
557
568
  * 解析 order_ids 入参,兼容 url query / data 字段、字符串(csv) / 数组两种形态。