@pisell/pisellos 0.10.76 → 0.10.78

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 (212) hide show
  1. package/dist/apis/picoding.d.ts +0 -0
  2. package/dist/effects/index.d.ts +19 -0
  3. package/dist/model/strategy/adapter/dataVariant/adapter.d.ts +50 -0
  4. package/dist/model/strategy/adapter/dataVariant/evaluator.d.ts +105 -0
  5. package/dist/model/strategy/adapter/dataVariant/examples.d.ts +39 -0
  6. package/dist/model/strategy/adapter/dataVariant/index.d.ts +4 -0
  7. package/dist/model/strategy/adapter/dataVariant/type.d.ts +173 -0
  8. package/dist/model/strategy/adapter/promotion/adapter.d.ts +70 -0
  9. package/dist/model/strategy/adapter/promotion/examples.d.ts +224 -0
  10. package/dist/model/strategy/adapter/promotion/index.js +0 -9
  11. package/dist/model/strategy/adapter/promotion/type.d.ts +535 -0
  12. package/dist/model/strategy/adapter/type.d.ts +28 -0
  13. package/dist/model/strategy/adapter/walletPass/index.d.ts +32 -0
  14. package/dist/model/strategy/adapter/walletPass/locales.d.ts +1 -0
  15. package/dist/model/strategy/adapter/walletPass/type.d.ts +192 -0
  16. package/dist/model/strategy/adapter/walletPass/utils.d.ts +50 -0
  17. package/dist/model/strategy/engine.d.ts +119 -0
  18. package/dist/model/strategy/type.d.ts +245 -0
  19. package/dist/modules/Account/types.d.ts +56 -0
  20. package/dist/modules/BookingContext/types.d.ts +104 -0
  21. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
  22. package/dist/modules/BookingContext/utils/flexible.d.ts +28 -0
  23. package/dist/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
  24. package/dist/modules/BookingContext/utils/noResource.d.ts +13 -0
  25. package/dist/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
  26. package/dist/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
  27. package/dist/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
  28. package/dist/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
  29. package/dist/modules/BookingContext/utils/timeSlices.d.ts +42 -0
  30. package/dist/modules/Customer/constants.d.ts +7 -0
  31. package/dist/modules/Date/types.d.ts +84 -0
  32. package/dist/modules/Date/utils.d.ts +36 -0
  33. package/dist/modules/FulfillmentTiming/index.d.ts +11 -0
  34. package/dist/modules/FulfillmentTiming/types.d.ts +67 -0
  35. package/dist/modules/Order/payment-utils.d.ts +26 -0
  36. package/dist/modules/Order/pickupTiming.d.ts +46 -0
  37. package/dist/modules/Order/utils/manualProductDiscount.d.ts +106 -0
  38. package/dist/modules/Order/utils/orderCollectionIdentity.d.ts +68 -0
  39. package/dist/modules/Order/utils/weighedProduct.d.ts +12 -0
  40. package/dist/modules/Payment/cashRecommendationAlgorithm.d.ts +21 -0
  41. package/dist/modules/Payment/mx51.d.ts +0 -0
  42. package/dist/modules/Payment/types.d.ts +943 -0
  43. package/dist/modules/Payment/utils.d.ts +19 -0
  44. package/dist/modules/Product/index.d.ts +1 -1
  45. package/dist/modules/ProductList/index.d.ts +2 -0
  46. package/dist/modules/ProductList/index.js +125 -39
  47. package/dist/modules/Quotation/types.d.ts +61 -0
  48. package/dist/modules/Resource/types.d.ts +50 -0
  49. package/dist/modules/Resource/utils.d.ts +23 -0
  50. package/dist/modules/ResourcePlanner/localClock.d.ts +33 -0
  51. package/dist/modules/ResourcePlanner/planner.js +5 -0
  52. package/dist/modules/SalesSummary/types.d.ts +69 -0
  53. package/dist/modules/ScanOrderLogger/providers/feishu.d.ts +2 -0
  54. package/dist/modules/ScanOrderLogger/providers/grafana.d.ts +2 -0
  55. package/dist/modules/ScanOrderLogger/types.d.ts +53 -0
  56. package/dist/modules/Schedule/getDateIsInSchedule.d.ts +32 -0
  57. package/dist/modules/Schedule/type.d.ts +157 -0
  58. package/dist/modules/Schedule/types.d.ts +201 -0
  59. package/dist/modules/Schedule/utils.d.ts +67 -0
  60. package/dist/modules/Step/tyeps.d.ts +20 -0
  61. package/dist/modules/SurchargeList/types.d.ts +15 -0
  62. package/dist/plugins/app.d.ts +10 -0
  63. package/dist/plugins/shopStore.d.ts +4 -0
  64. package/dist/plugins/user.d.ts +7 -0
  65. package/dist/server/modules/floor-plan/types.d.ts +43 -0
  66. package/dist/server/modules/menu/types.d.ts +68 -0
  67. package/dist/server/modules/payment/types.d.ts +9 -0
  68. package/dist/server/modules/quotation/types.d.ts +50 -0
  69. package/dist/server/modules/resource/types.d.ts +121 -0
  70. package/dist/server/modules/schedule/types.d.ts +1 -0
  71. package/dist/server/modules/schedule/utils.d.ts +32 -0
  72. package/dist/server/types.d.ts +66 -0
  73. package/dist/server/utils/index.d.ts +5 -0
  74. package/dist/server/utils/schedule.d.ts +14 -0
  75. package/dist/server/utils/time.d.ts +18 -0
  76. package/dist/solution/BaseSales/index.d.ts +12 -1
  77. package/dist/solution/BaseSales/index.js +275 -185
  78. package/dist/solution/BookingByStep/index.d.ts +2 -2
  79. package/dist/solution/BookingTicket/index.d.ts +1 -13
  80. package/dist/solution/BookingTicket/utils/bookingStatus.d.ts +77 -0
  81. package/dist/solution/BookingTicket/utils/exampleData.d.ts +123 -0
  82. package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
  83. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +38 -0
  84. package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts +78 -0
  85. package/dist/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
  86. package/dist/solution/BookingTicket/utils/weighingProductSku.d.ts +5 -0
  87. package/dist/solution/PlaceOrder/index.d.ts +0 -0
  88. package/dist/solution/RegisterAndLogin/config.d.ts +93 -0
  89. package/dist/solution/RegisterAndLogin/types.d.ts +445 -0
  90. package/dist/solution/RegisterAndLogin/utils.d.ts +103 -0
  91. package/dist/solution/UnifiedBookingSales/index.d.ts +23 -1
  92. package/dist/solution/UnifiedBookingSales/index.js +1367 -646
  93. package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +2 -0
  94. package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.js +4 -0
  95. package/dist/solution/UnifiedBookingSales/sessionResourceCache.d.ts +27 -0
  96. package/dist/solution/UnifiedBookingSales/sessionResourceCache.js +271 -0
  97. package/dist/solution/UnifiedBookingSales/types.d.ts +25 -0
  98. package/dist/solution/UnifiedBookingSales/types.js +2 -0
  99. package/dist/solution/UnifiedBookingSales/venueCatalogSession.d.ts +32 -0
  100. package/dist/solution/UnifiedBookingSales/venueCatalogSession.js +277 -0
  101. package/dist/store/createStore.d.ts +3 -0
  102. package/dist/types/index.d.ts +132 -0
  103. package/dist/utils/os-private-payload.d.ts +5 -0
  104. package/dist/utils/payment-number.d.ts +9 -0
  105. package/dist/utils/task.d.ts +40 -0
  106. package/dist/utils/watch.d.ts +102 -0
  107. package/lib/apis/picoding.d.ts +0 -0
  108. package/lib/effects/index.d.ts +19 -0
  109. package/lib/model/strategy/adapter/dataVariant/adapter.d.ts +50 -0
  110. package/lib/model/strategy/adapter/dataVariant/evaluator.d.ts +105 -0
  111. package/lib/model/strategy/adapter/dataVariant/examples.d.ts +39 -0
  112. package/lib/model/strategy/adapter/dataVariant/index.d.ts +4 -0
  113. package/lib/model/strategy/adapter/dataVariant/type.d.ts +173 -0
  114. package/lib/model/strategy/adapter/promotion/adapter.d.ts +70 -0
  115. package/lib/model/strategy/adapter/promotion/examples.d.ts +224 -0
  116. package/lib/model/strategy/adapter/promotion/type.d.ts +535 -0
  117. package/lib/model/strategy/adapter/type.d.ts +28 -0
  118. package/lib/model/strategy/adapter/walletPass/index.d.ts +32 -0
  119. package/lib/model/strategy/adapter/walletPass/locales.d.ts +1 -0
  120. package/lib/model/strategy/adapter/walletPass/type.d.ts +192 -0
  121. package/lib/model/strategy/adapter/walletPass/utils.d.ts +50 -0
  122. package/lib/model/strategy/engine.d.ts +119 -0
  123. package/lib/model/strategy/type.d.ts +245 -0
  124. package/lib/modules/Account/types.d.ts +56 -0
  125. package/lib/modules/BookingContext/types.d.ts +104 -0
  126. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
  127. package/lib/modules/BookingContext/utils/flexible.d.ts +28 -0
  128. package/lib/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
  129. package/lib/modules/BookingContext/utils/noResource.d.ts +13 -0
  130. package/lib/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
  131. package/lib/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
  132. package/lib/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
  133. package/lib/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
  134. package/lib/modules/BookingContext/utils/timeSlices.d.ts +42 -0
  135. package/lib/modules/Customer/constants.d.ts +7 -0
  136. package/lib/modules/Date/types.d.ts +84 -0
  137. package/lib/modules/Date/utils.d.ts +36 -0
  138. package/lib/modules/FulfillmentTiming/index.d.ts +11 -0
  139. package/lib/modules/FulfillmentTiming/types.d.ts +67 -0
  140. package/lib/modules/Order/payment-utils.d.ts +26 -0
  141. package/lib/modules/Order/pickupTiming.d.ts +46 -0
  142. package/lib/modules/Order/utils/manualProductDiscount.d.ts +106 -0
  143. package/lib/modules/Order/utils/orderCollectionIdentity.d.ts +68 -0
  144. package/lib/modules/Order/utils/weighedProduct.d.ts +12 -0
  145. package/lib/modules/Payment/cashRecommendationAlgorithm.d.ts +21 -0
  146. package/lib/modules/Payment/mx51.d.ts +0 -0
  147. package/lib/modules/Payment/types.d.ts +943 -0
  148. package/lib/modules/Payment/utils.d.ts +19 -0
  149. package/lib/modules/Product/index.d.ts +1 -1
  150. package/lib/modules/ProductList/index.d.ts +2 -0
  151. package/lib/modules/ProductList/index.js +56 -0
  152. package/lib/modules/Quotation/types.d.ts +61 -0
  153. package/lib/modules/Resource/types.d.ts +50 -0
  154. package/lib/modules/Resource/utils.d.ts +23 -0
  155. package/lib/modules/ResourcePlanner/localClock.d.ts +33 -0
  156. package/lib/modules/ResourcePlanner/planner.js +4 -0
  157. package/lib/modules/SalesSummary/types.d.ts +69 -0
  158. package/lib/modules/ScanOrderLogger/providers/feishu.d.ts +2 -0
  159. package/lib/modules/ScanOrderLogger/providers/grafana.d.ts +2 -0
  160. package/lib/modules/ScanOrderLogger/types.d.ts +53 -0
  161. package/lib/modules/Schedule/getDateIsInSchedule.d.ts +32 -0
  162. package/lib/modules/Schedule/type.d.ts +157 -0
  163. package/lib/modules/Schedule/types.d.ts +201 -0
  164. package/lib/modules/Schedule/utils.d.ts +67 -0
  165. package/lib/modules/Step/tyeps.d.ts +20 -0
  166. package/lib/modules/SurchargeList/types.d.ts +15 -0
  167. package/lib/plugins/app.d.ts +10 -0
  168. package/lib/plugins/shopStore.d.ts +4 -0
  169. package/lib/plugins/user.d.ts +7 -0
  170. package/lib/server/modules/floor-plan/types.d.ts +43 -0
  171. package/lib/server/modules/menu/types.d.ts +68 -0
  172. package/lib/server/modules/payment/types.d.ts +9 -0
  173. package/lib/server/modules/quotation/types.d.ts +50 -0
  174. package/lib/server/modules/resource/types.d.ts +121 -0
  175. package/lib/server/modules/schedule/types.d.ts +1 -0
  176. package/lib/server/modules/schedule/utils.d.ts +32 -0
  177. package/lib/server/types.d.ts +66 -0
  178. package/lib/server/utils/index.d.ts +5 -0
  179. package/lib/server/utils/schedule.d.ts +14 -0
  180. package/lib/server/utils/time.d.ts +18 -0
  181. package/lib/solution/BaseSales/index.d.ts +12 -1
  182. package/lib/solution/BaseSales/index.js +65 -0
  183. package/lib/solution/BookingByStep/index.d.ts +2 -2
  184. package/lib/solution/BookingTicket/index.d.ts +1 -13
  185. package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +77 -0
  186. package/lib/solution/BookingTicket/utils/exampleData.d.ts +123 -0
  187. package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
  188. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +38 -0
  189. package/lib/solution/BookingTicket/utils/scan/scanCache.d.ts +78 -0
  190. package/lib/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
  191. package/lib/solution/BookingTicket/utils/weighingProductSku.d.ts +5 -0
  192. package/lib/solution/PlaceOrder/index.d.ts +0 -0
  193. package/lib/solution/RegisterAndLogin/config.d.ts +93 -0
  194. package/lib/solution/RegisterAndLogin/types.d.ts +445 -0
  195. package/lib/solution/RegisterAndLogin/utils.d.ts +103 -0
  196. package/lib/solution/UnifiedBookingSales/index.d.ts +23 -1
  197. package/lib/solution/UnifiedBookingSales/index.js +399 -14
  198. package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +2 -0
  199. package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.js +2 -0
  200. package/lib/solution/UnifiedBookingSales/sessionResourceCache.d.ts +27 -0
  201. package/lib/solution/UnifiedBookingSales/sessionResourceCache.js +199 -0
  202. package/lib/solution/UnifiedBookingSales/types.d.ts +25 -0
  203. package/lib/solution/UnifiedBookingSales/types.js +1 -0
  204. package/lib/solution/UnifiedBookingSales/venueCatalogSession.d.ts +32 -0
  205. package/lib/solution/UnifiedBookingSales/venueCatalogSession.js +151 -0
  206. package/lib/store/createStore.d.ts +3 -0
  207. package/lib/types/index.d.ts +132 -0
  208. package/lib/utils/os-private-payload.d.ts +5 -0
  209. package/lib/utils/payment-number.d.ts +9 -0
  210. package/lib/utils/task.d.ts +40 -0
  211. package/lib/utils/watch.d.ts +102 -0
  212. package/package.json +1 -1
@@ -0,0 +1,19 @@
1
+ export declare const getAvailableMaxAmount: (data: Record<string, any>) => any;
2
+ /**
3
+ * 将walletPass列表数据转换为prepare_payments需要的数据格式
4
+ * @param list
5
+ */
6
+ export declare const formatWalletPassList2PreparePayments: (list?: any[]) => {
7
+ voucher_id: any;
8
+ amount: number;
9
+ tag: any;
10
+ wallet_pass_usage_unit: any;
11
+ wallet_pass_use_value: any;
12
+ }[];
13
+ /**
14
+ * 对用户识别码列表进行排序
15
+ * 排序规则:正常数据 -> unified_available_status===1 -> 500601/500602 -> unified_available_status===0
16
+ * @param list 用户识别码列表
17
+ * @returns 排序后的列表
18
+ */
19
+ export declare const sortUserIdentificationCodeList: (list: any[]) => any[];
@@ -49,5 +49,5 @@ export declare class Product extends BaseModule implements Module {
49
49
  getCategories(): ProductCategory[];
50
50
  setOtherParams(key: string, value: any): void;
51
51
  getOtherParams(): any;
52
- getProductType(): "normal" | "duration" | "session";
52
+ getProductType(): "duration" | "session" | "normal";
53
53
  }
@@ -37,6 +37,8 @@ export declare class ProductList extends BaseModule implements Module {
37
37
  schedule_date?: string;
38
38
  channel?: string;
39
39
  }): Promise<any>;
40
+ /** Venue-only raw, complete pool load. No date/customer evaluation and no shared catalog publication. */
41
+ loadVenueCatalogPool(params?: Pick<ProductListLoadProductsParams, 'product_ids' | 'collection' | 'category_ids' | 'extension_type' | 'cacheId'>): Promise<ProductData[]>;
40
42
  /**
41
43
  * Remember raw remote product records before client-side Data Variant
42
44
  * evaluation. Quote-only reads can then always start from a clean baseline.
@@ -413,11 +413,97 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
413
413
  return _loadProductsPrice.apply(this, arguments);
414
414
  }
415
415
  return loadProductsPrice;
416
+ }() /** Venue-only raw, complete pool load. No date/customer evaluation and no shared catalog publication. */
417
+ }, {
418
+ key: "loadVenueCatalogPool",
419
+ value: (function () {
420
+ var _loadVenueCatalogPool = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
421
+ var _this$otherParams5, _params$product_ids, _params$category_ids, _params$extension_typ, _ref4, _data$total;
422
+ var params,
423
+ channelMap,
424
+ channel,
425
+ response,
426
+ data,
427
+ total,
428
+ _args7 = arguments;
429
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
430
+ while (1) switch (_context7.prev = _context7.next) {
431
+ case 0:
432
+ params = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {};
433
+ channelMap = {
434
+ online_store: 'online-store',
435
+ scan_to_order: 'online-store',
436
+ 'scan-to-order': 'online-store',
437
+ scan_to_order_2: 'online-store',
438
+ scan_to_order_3: 'scantoorder3'
439
+ };
440
+ channel = (_this$otherParams5 = this.otherParams) === null || _this$otherParams5 === void 0 ? void 0 : _this$otherParams5.channel;
441
+ _context7.next = 5;
442
+ return this.request.post('/product/query', _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
443
+ // The customer endpoint otherwise filters out future/variant members.
444
+ open_quotation: 0,
445
+ open_bundle: 1,
446
+ with: _toConsumableArray(PRODUCT_QUERY_DATA_VARIANT_RELATIONS),
447
+ with_count: ['bundleGroup', 'optionGroup'],
448
+ with_schedule: 1,
449
+ status: 'published',
450
+ num: 500,
451
+ skip: 1,
452
+ is_eject: 1,
453
+ // Channel is stable for this runtime owner and remains a server publication
454
+ // filter. Date/customer/menu membership and pricing are evaluated locally.
455
+ application_code: typeof channel === 'string' ? channelMap[channel] || channel : channel
456
+ }, (_params$product_ids = params.product_ids) !== null && _params$product_ids !== void 0 && _params$product_ids.length ? {
457
+ ids: params.product_ids
458
+ } : {}), params.collection ? {
459
+ collection: params.collection
460
+ } : {}), (_params$category_ids = params.category_ids) !== null && _params$category_ids !== void 0 && _params$category_ids.length ? {
461
+ category_ids: params.category_ids
462
+ } : {}), (_params$extension_typ = params.extension_type) !== null && _params$extension_typ !== void 0 && _params$extension_typ.length ? {
463
+ extension_type: params.extension_type
464
+ } : {}), {}, {
465
+ front_end_cache_id: params.cacheId
466
+ }), {
467
+ useCache: false,
468
+ customToast: function customToast() {}
469
+ });
470
+ case 5:
471
+ response = _context7.sent;
472
+ data = response === null || response === void 0 ? void 0 : response.data;
473
+ if (!((response === null || response === void 0 ? void 0 : response.status) === false || (response === null || response === void 0 ? void 0 : response.code) != null && Number(response.code) !== 200 || !Array.isArray(data === null || data === void 0 ? void 0 : data.list))) {
474
+ _context7.next = 9;
475
+ break;
476
+ }
477
+ throw Object.assign(new Error((response === null || response === void 0 ? void 0 : response.message) || 'The complete venue product pool could not be loaded.'), {
478
+ code: 'VENUE_CATALOG_LOAD_FAILED'
479
+ });
480
+ case 9:
481
+ total = (_ref4 = (_data$total = data.total) !== null && _data$total !== void 0 ? _data$total : data.total_count) !== null && _ref4 !== void 0 ? _ref4 : data.total_num;
482
+ if (!(total != null && Number.isFinite(Number(total)) && Number(total) > data.list.length || total == null && data.list.length >= 500)) {
483
+ _context7.next = 12;
484
+ break;
485
+ }
486
+ throw Object.assign(new Error('The venue product pool is incomplete. A single complete catalog response is required.'), {
487
+ code: 'VENUE_CATALOG_INCOMPLETE'
488
+ });
489
+ case 12:
490
+ return _context7.abrupt("return", cloneDeep(data.list));
491
+ case 13:
492
+ case "end":
493
+ return _context7.stop();
494
+ }
495
+ }, _callee7, this);
496
+ }));
497
+ function loadVenueCatalogPool() {
498
+ return _loadVenueCatalogPool.apply(this, arguments);
499
+ }
500
+ return loadVenueCatalogPool;
416
501
  }()
417
502
  /**
418
503
  * Remember raw remote product records before client-side Data Variant
419
504
  * evaluation. Quote-only reads can then always start from a clean baseline.
420
505
  */
506
+ )
421
507
  }, {
422
508
  key: "rememberRawProductQueryResult",
423
509
  value: function rememberRawProductQueryResult(products) {
@@ -471,19 +557,19 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
471
557
  }, {
472
558
  key: "getProducts",
473
559
  value: function () {
474
- var _getProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
475
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
476
- while (1) switch (_context7.prev = _context7.next) {
560
+ var _getProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
561
+ return _regeneratorRuntime().wrap(function _callee8$(_context8) {
562
+ while (1) switch (_context8.prev = _context8.next) {
477
563
  case 0:
478
- _context7.next = 2;
564
+ _context8.next = 2;
479
565
  return this.core.effects.emit("".concat(this.name, ":onGetProducts"), this.store.list);
480
566
  case 2:
481
- return _context7.abrupt("return", cloneDeep(this.store.list));
567
+ return _context8.abrupt("return", cloneDeep(this.store.list));
482
568
  case 3:
483
569
  case "end":
484
- return _context7.stop();
570
+ return _context8.stop();
485
571
  }
486
- }, _callee7, this);
572
+ }, _callee8, this);
487
573
  }));
488
574
  function getProducts() {
489
575
  return _getProducts.apply(this, arguments);
@@ -493,23 +579,23 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
493
579
  }, {
494
580
  key: "getProduct",
495
581
  value: function () {
496
- var _getProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(id) {
582
+ var _getProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(id) {
497
583
  var product;
498
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
499
- while (1) switch (_context8.prev = _context8.next) {
584
+ return _regeneratorRuntime().wrap(function _callee9$(_context9) {
585
+ while (1) switch (_context9.prev = _context9.next) {
500
586
  case 0:
501
- _context8.next = 2;
587
+ _context9.next = 2;
502
588
  return this.core.effects.emit("".concat(this.name, ":onGetProduct"), this.store.list);
503
589
  case 2:
504
590
  product = this.store.list.find(function (product) {
505
591
  return product.id === id;
506
592
  });
507
- return _context8.abrupt("return", product ? cloneDeep(product) : undefined);
593
+ return _context9.abrupt("return", product ? cloneDeep(product) : undefined);
508
594
  case 4:
509
595
  case "end":
510
- return _context8.stop();
596
+ return _context9.stop();
511
597
  }
512
- }, _callee8, this);
598
+ }, _callee9, this);
513
599
  }));
514
600
  function getProduct(_x7) {
515
601
  return _getProduct.apply(this, arguments);
@@ -519,7 +605,7 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
519
605
  }, {
520
606
  key: "queryProducts",
521
607
  value: function () {
522
- var _queryProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
608
+ var _queryProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10() {
523
609
  var params,
524
610
  includeIds,
525
611
  excludeIds,
@@ -530,11 +616,11 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
530
616
  channelApplications,
531
617
  codeOrBarcode,
532
618
  products,
533
- _args9 = arguments;
534
- return _regeneratorRuntime().wrap(function _callee9$(_context9) {
535
- while (1) switch (_context9.prev = _context9.next) {
619
+ _args10 = arguments;
620
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
621
+ while (1) switch (_context10.prev = _context10.next) {
536
622
  case 0:
537
- params = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : {};
623
+ params = _args10.length > 0 && _args10[0] !== undefined ? _args10[0] : {};
538
624
  includeIds = normalizeQuerySet(params.includeIds);
539
625
  excludeIds = normalizeQuerySet(params.excludeIds);
540
626
  categoryIds = normalizeQuerySet(params.categoryIds);
@@ -573,12 +659,12 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
573
659
  }
574
660
  return true;
575
661
  });
576
- return _context9.abrupt("return", cloneDeep(products));
662
+ return _context10.abrupt("return", cloneDeep(products));
577
663
  case 11:
578
664
  case "end":
579
- return _context9.stop();
665
+ return _context10.stop();
580
666
  }
581
- }, _callee9, this);
667
+ }, _callee10, this);
582
668
  }));
583
669
  function queryProducts() {
584
670
  return _queryProducts.apply(this, arguments);
@@ -588,21 +674,21 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
588
674
  }, {
589
675
  key: "getProductByIds",
590
676
  value: function () {
591
- var _getProductByIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(ids) {
592
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
593
- while (1) switch (_context10.prev = _context10.next) {
677
+ var _getProductByIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(ids) {
678
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
679
+ while (1) switch (_context11.prev = _context11.next) {
594
680
  case 0:
595
- _context10.next = 2;
681
+ _context11.next = 2;
596
682
  return this.core.effects.emit("".concat(this.name, ":onGetProductByIds"), this.store.list);
597
683
  case 2:
598
- return _context10.abrupt("return", this.queryProducts({
684
+ return _context11.abrupt("return", this.queryProducts({
599
685
  includeIds: ids
600
686
  }));
601
687
  case 3:
602
688
  case "end":
603
- return _context10.stop();
689
+ return _context11.stop();
604
690
  }
605
- }, _callee10, this);
691
+ }, _callee11, this);
606
692
  }));
607
693
  function getProductByIds(_x8) {
608
694
  return _getProductByIds.apply(this, arguments);
@@ -612,10 +698,10 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
612
698
  }, {
613
699
  key: "addProduct",
614
700
  value: function () {
615
- var _addProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(products) {
701
+ var _addProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(products) {
616
702
  var _this6 = this;
617
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
618
- while (1) switch (_context11.prev = _context11.next) {
703
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
704
+ while (1) switch (_context12.prev = _context12.next) {
619
705
  case 0:
620
706
  // list 需要根据 id 去重
621
707
  if (!this.store.list) {
@@ -638,9 +724,9 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
638
724
  this.core.effects.emit("".concat(this.name, ":changed"), this.store.list);
639
725
  case 4:
640
726
  case "end":
641
- return _context11.stop();
727
+ return _context12.stop();
642
728
  }
643
- }, _callee11, this);
729
+ }, _callee12, this);
644
730
  }));
645
731
  function addProduct(_x9) {
646
732
  return _addProduct.apply(this, arguments);
@@ -650,16 +736,16 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
650
736
  }, {
651
737
  key: "selectProducts",
652
738
  value: function () {
653
- var _selectProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(products) {
654
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
655
- while (1) switch (_context12.prev = _context12.next) {
739
+ var _selectProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(products) {
740
+ return _regeneratorRuntime().wrap(function _callee13$(_context13) {
741
+ while (1) switch (_context13.prev = _context13.next) {
656
742
  case 0:
657
743
  this.store.selectProducts = products;
658
744
  case 1:
659
745
  case "end":
660
- return _context12.stop();
746
+ return _context13.stop();
661
747
  }
662
- }, _callee12, this);
748
+ }, _callee13, this);
663
749
  }));
664
750
  function selectProducts(_x10) {
665
751
  return _selectProducts.apply(this, arguments);
@@ -0,0 +1,61 @@
1
+ export interface QuotationProductData {
2
+ id: number;
3
+ shelf_id: number;
4
+ product_id: number;
5
+ variant_id: number;
6
+ type: string;
7
+ value: number;
8
+ }
9
+ export interface QuotationSchedule {
10
+ id: number;
11
+ name: string;
12
+ type: 'standard' | 'time-slots' | 'designation';
13
+ start_time: string;
14
+ end_time: string;
15
+ is_all: number;
16
+ repeat_type?: string;
17
+ repeat_rule?: any;
18
+ designation?: any;
19
+ time_slot?: Array<{
20
+ start_time: string;
21
+ end_time: string;
22
+ }>;
23
+ pivot?: Record<string, any>;
24
+ }
25
+ export interface QuotationCustomer {
26
+ id: number | string;
27
+ [key: string]: any;
28
+ }
29
+ export interface QuotationItem {
30
+ id: number;
31
+ shop_id: number;
32
+ shelf_type_id?: number;
33
+ name: string;
34
+ description?: string;
35
+ status: string;
36
+ sort: number;
37
+ channel: string[];
38
+ created_at?: string;
39
+ updated_at?: string;
40
+ deleted_at?: string | null;
41
+ customer?: QuotationCustomer[];
42
+ schedule: QuotationSchedule[];
43
+ product_data: QuotationProductData[];
44
+ }
45
+ export interface QuotationState {
46
+ list: QuotationItem[];
47
+ }
48
+ export interface QuotationCustomerScope {
49
+ quotationId: number;
50
+ quotationName: string;
51
+ customerIds: string[];
52
+ customers: QuotationCustomer[];
53
+ }
54
+ export interface QuotationCustomerScopeInfo {
55
+ quotationCount: number;
56
+ hasCustomerScopedQuotations: boolean;
57
+ allQuotationsCustomerScoped: boolean;
58
+ customerIds: string[];
59
+ customers: QuotationCustomer[];
60
+ quotationScopes: QuotationCustomerScope[];
61
+ }
@@ -0,0 +1,50 @@
1
+ export declare enum ResourceHooks {
2
+ OnResourceSelect = "resource:onResourceSelect",
3
+ OnResourceChange = "resource:onResourceChange",
4
+ OnAvailabilityCheck = "resource:onAvailabilityCheck"
5
+ }
6
+ /**
7
+ * 资源可用时间段
8
+ */
9
+ export interface ResourceTimeSlot {
10
+ start: Date;
11
+ end: Date;
12
+ capacity: number;
13
+ availableCapacity: number;
14
+ }
15
+ /**
16
+ * 资源信息
17
+ */
18
+ export interface Resource {
19
+ like_status: 'common' | 'like';
20
+ id: string | number;
21
+ main_field: string;
22
+ form_id: string | number;
23
+ type: string;
24
+ capacity: number;
25
+ timeSlots: ResourceTimeSlot[];
26
+ metadata?: Record<string, any>;
27
+ startTime?: string;
28
+ endTime?: string;
29
+ resourceType?: string;
30
+ children?: Resource[];
31
+ }
32
+ /**
33
+ * 资源列表状态
34
+ */
35
+ export interface ResourceState {
36
+ list: Resource[];
37
+ selectedResource: Resource | null;
38
+ }
39
+ /**
40
+ * 资源列表模块 API
41
+ */
42
+ export interface ResourceListModuleAPI {
43
+ getResources: () => Promise<Resource[]>;
44
+ selectResource: (resourceId: string) => Promise<void>;
45
+ getSelectedResource: () => Resource | null;
46
+ checkAvailability: (resourceId: string, start: Date, end: Date) => Promise<boolean>;
47
+ getAvailableTimeSlots: (resourceId: string) => Promise<ResourceTimeSlot[]>;
48
+ getAvailableCapacity: (resourceId: string, timeSlot: ResourceTimeSlot) => number;
49
+ updateResource: (resourceId: string, updates: Partial<Resource>) => Promise<void>;
50
+ }
@@ -0,0 +1,23 @@
1
+ interface Resource {
2
+ id: string;
3
+ [key: string]: any;
4
+ }
5
+ /**
6
+ * @title: 获取资源map
7
+ * @description:
8
+ * @param {any} resourceList
9
+ * @return {*}
10
+ * @Author: zhiwei.Wang
11
+ */
12
+ export declare const getResourcesMap: (resourceList: Resource[]) => Record<string, Resource>;
13
+ /**
14
+ * @title: 根据ids筛选资源列表
15
+ * @description:
16
+ * @param {any} resourcesMap
17
+ * @param {any} ids
18
+ * @return {*}
19
+ * @Author: zhiwei.Wang
20
+ * @Date: 2024-09-19 20:23
21
+ */
22
+ export declare const getResourcesByIds: (resourcesMap: Record<string, Resource>, ids: number[]) => Resource[];
23
+ export {};
@@ -0,0 +1,33 @@
1
+ export interface LocalDateParts {
2
+ year: number;
3
+ month: number;
4
+ day: number;
5
+ }
6
+ export interface LocalDateTimeParts extends LocalDateParts {
7
+ hour: number;
8
+ minute: number;
9
+ second: number;
10
+ }
11
+ type LocalDateInput = string | LocalDateParts;
12
+ type LocalDateTimeInput = string | number | LocalDateTimeParts;
13
+ export declare function parseLocalDate(value: string): LocalDateParts;
14
+ export declare function parseLocalDateTime(value: string): LocalDateTimeParts;
15
+ export declare function extractFixedOffsetMinutes(value: string | null | undefined): number | null;
16
+ export declare function captureRuntimeOffsetMinutes(value?: Date): number;
17
+ export declare function formatFixedOffset(offsetMinutes: number | null | undefined): string;
18
+ export declare function localDateTimeToScalar(value: LocalDateTimeParts): number;
19
+ export declare function localDateToScalar(value: Date): number;
20
+ export declare function localDateToScalarStart(value: LocalDateInput): number;
21
+ export declare function scalarToLocalDateParts(value: number): LocalDateParts;
22
+ export declare function scalarToLocalDateTimeParts(value: number): LocalDateTimeParts;
23
+ export declare function dateOrdinalFromLocalDate(value: LocalDateInput): number;
24
+ export declare function weekdayFromLocalDate(value: LocalDateInput): number;
25
+ export declare function formatLocalDate(value: LocalDateInput | number): string;
26
+ export declare function formatLocalTime(value: LocalDateTimeInput, includeSeconds?: boolean): string;
27
+ export declare function formatLocalDateTime(value: LocalDateTimeInput, fixedOffsetMinutes?: number | null): string;
28
+ export declare function addLocalMinutes(value: number, minutes: number): number;
29
+ export declare function addLocalHours(value: number, hours: number): number;
30
+ export declare function addLocalCalendarDays(value: number, days: number): number;
31
+ export declare function nextDate(value: LocalDateInput): string;
32
+ export declare function ceilLocalScalarToTenMinutes(value: number): number;
33
+ export {};
@@ -560,6 +560,11 @@ function buildCellKey(params) {
560
560
  return [String(params.productId), params.groupId, String(params.resourceId), params.start, params.end].join(':');
561
561
  }
562
562
  function dedupeOccupancyRefKey(occupancy) {
563
+ var _occupancy$raw;
564
+ var sessionKey = (_occupancy$raw = occupancy.raw) === null || _occupancy$raw === void 0 ? void 0 : _occupancy$raw.__availabilitySessionOccupancyKey;
565
+ if (typeof sessionKey === 'string' && sessionKey) {
566
+ return "session:".concat(JSON.stringify([String(occupancy.resourceId), sessionKey]));
567
+ }
563
568
  if (occupancy.scheduleEventId !== undefined && occupancy.scheduleEventId !== null) {
564
569
  return "scheduleEvent:".concat(String(occupancy.resourceId), ":").concat(String(occupancy.scheduleEventId));
565
570
  }
@@ -0,0 +1,69 @@
1
+ export interface SalesSummaryProduct {
2
+ order_detail_id?: number | string | null;
3
+ product_id: number | null;
4
+ product_variant_id: number;
5
+ num: number;
6
+ /** 券后单品单价(订单域成交单价),由 OrderModule 维护。 */
7
+ selling_price: string;
8
+ /** 券前单品单价(店铺售价)。 */
9
+ original_price: string;
10
+ tax_fee: string;
11
+ is_charge_tax?: number;
12
+ product_sku?: Record<string, any> & {
13
+ option?: any[];
14
+ };
15
+ discount_list?: any[];
16
+ product_bundle?: any[];
17
+ metadata?: Record<string, any>;
18
+ _origin?: Record<string, any>;
19
+ }
20
+ export interface DepositPolicyData {
21
+ id: number;
22
+ title: string;
23
+ }
24
+ export interface DepositInfo {
25
+ total: string;
26
+ deposit_policy_ids: number[];
27
+ deposit_policy_data: DepositPolicyData[];
28
+ hasDeposit: boolean;
29
+ }
30
+ export interface SalesSummaryData {
31
+ product_quantity: number;
32
+ product_original_amount: string;
33
+ product_amount: string;
34
+ product_expect_amount: string;
35
+ product_tax_fee: string;
36
+ shipping_fee: string;
37
+ shipping_tax_fee: string;
38
+ tax_fee: string;
39
+ surcharge_fee: string;
40
+ surcharges: any[];
41
+ discount_amount: string;
42
+ deposit_amount: string;
43
+ deposit?: DepositInfo;
44
+ expect_amount: string;
45
+ total_amount: string;
46
+ total_refund_amount: string;
47
+ customer_paid_amount: string;
48
+ order_paid_amount: string;
49
+ amount_gap: string;
50
+ rounding_amount: string;
51
+ pay_service_charge_amount: string;
52
+ is_price_include_tax?: number;
53
+ tax_title?: string;
54
+ tax_rate?: number;
55
+ }
56
+ export interface SalesSummaryState {
57
+ surchargeList: any[];
58
+ summary: SalesSummaryData;
59
+ }
60
+ export interface SalesSummaryModuleAPI {
61
+ getSummary(params: {
62
+ products: SalesSummaryProduct[];
63
+ isPriceIncludeTax?: number;
64
+ taxRate?: number;
65
+ shopDiscount?: string | number;
66
+ channel?: string;
67
+ virtualSettlementMode?: boolean;
68
+ }): Promise<SalesSummaryData>;
69
+ }
@@ -0,0 +1,2 @@
1
+ import { ScanOrderLoggerProvider } from '../types';
2
+ export declare const feishuLoggerProvider: ScanOrderLoggerProvider;
@@ -0,0 +1,2 @@
1
+ import { ScanOrderLoggerProvider } from '../types';
2
+ export declare const grafanaLoggerProvider: ScanOrderLoggerProvider;
@@ -0,0 +1,53 @@
1
+ export type ScanOrderLogLevel = 'info' | 'warning' | 'error' | 'debug';
2
+ export type ScanOrderLoggerProviderType = 'feishu' | 'grafana';
3
+ export interface ScanOrderLoggerProviderFeishuConfig {
4
+ webhook?: string;
5
+ errorHook?: string;
6
+ /**
7
+ * 节流窗口毫秒数,默认 3000ms
8
+ * - >0:首条日志进入队列并启动定时器,窗口结束后合并成一条 Feishu post 统一发送
9
+ * - <=0:关闭节流,保持每条日志立即单独发送
10
+ */
11
+ throttleMs?: number;
12
+ }
13
+ export interface ScanOrderLoggerProviderGrafanaConfig {
14
+ endpoint?: string;
15
+ headers?: Record<string, string>;
16
+ }
17
+ export interface ScanOrderLoggerProviderConfig {
18
+ feishu?: ScanOrderLoggerProviderFeishuConfig;
19
+ grafana?: ScanOrderLoggerProviderGrafanaConfig;
20
+ }
21
+ export interface ScanOrderLoggerContext {
22
+ cacheId?: string;
23
+ solutionName?: string;
24
+ moduleName?: string;
25
+ [key: string]: any;
26
+ }
27
+ export interface ScanOrderLogInput {
28
+ level?: ScanOrderLogLevel;
29
+ title: string;
30
+ payload?: Record<string, any>;
31
+ extra?: Record<string, any>;
32
+ timestamp?: string;
33
+ }
34
+ export interface ScanOrderLogRecord {
35
+ level: ScanOrderLogLevel;
36
+ title: string;
37
+ timestamp: string;
38
+ payload: Record<string, any>;
39
+ extra: Record<string, any>;
40
+ context: ScanOrderLoggerContext;
41
+ }
42
+ export interface ScanOrderLoggerDispatchPayload {
43
+ record: ScanOrderLogRecord;
44
+ providerConfig?: ScanOrderLoggerProviderConfig;
45
+ }
46
+ export interface ScanOrderLoggerProvider {
47
+ send: (payload: ScanOrderLoggerDispatchPayload) => Promise<void>;
48
+ }
49
+ export interface ScanOrderLoggerState {
50
+ provider: ScanOrderLoggerProviderType;
51
+ providerConfig: ScanOrderLoggerProviderConfig;
52
+ context: ScanOrderLoggerContext;
53
+ }
@@ -0,0 +1,32 @@
1
+ import dayjs from "dayjs";
2
+ import { ScheduleItem } from "./types";
3
+ export declare const getDateIsInSchedule: (dateTime: string, scheduleList: ScheduleItem[]) => boolean;
4
+ export type ScheduleTimeSlot = {
5
+ /** 开始时间 HH:mm */
6
+ start_time: string;
7
+ /** 结束时间 HH:mm */
8
+ end_time: string;
9
+ /** 开始日期时间 YYYY-MM-DD HH:mm:ss */
10
+ start_at: dayjs.Dayjs;
11
+ /** 结束日期时间 YYYY-MM-DD HH:mm:ss */
12
+ end_at: dayjs.Dayjs;
13
+ };
14
+ /**
15
+ * 获取当前日期日程时间点
16
+ * @param date 日期 YYYY-MM-DD
17
+ * @param scheduleList 日程列表
18
+ * @returns 当前日期日程时间点 结构,数组 [{
19
+ *
20
+ * // HH:mm
21
+ * end_time: string,
22
+ * // HH:mm
23
+ * start_time: string,
24
+ * // 日期时间
25
+ * // YYYY-MM-DD HH:mm:ss
26
+ * end_at: Dayjs,
27
+ * // YYYY-MM-DD HH:mm:ss
28
+ * start_at: Dayjs,
29
+ *
30
+ * }]
31
+ */
32
+ export declare const getScheduleStartEndTimePoints: (date: string, scheduleList: ScheduleItem[]) => ScheduleTimeSlot[];