@pisell/pisellos 0.10.74 → 0.10.76

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 (201) hide show
  1. package/dist/modules/Product/index.d.ts +1 -1
  2. package/dist/server/index.js +14 -9
  3. package/dist/shared/receipt/small-ticket.d.ts +3 -0
  4. package/dist/shared/receipt/small-ticket.js +23 -2
  5. package/dist/solution/BookingByStep/index.d.ts +2 -2
  6. package/dist/solution/BookingTicket/index.d.ts +13 -1
  7. package/dist/solution/OrderInvoicePreview/index.js +13 -8
  8. package/dist/solution/UnifiedBookingSales/catalogQueryBatch.d.ts +21 -0
  9. package/dist/solution/UnifiedBookingSales/catalogQueryBatch.js +202 -0
  10. package/dist/solution/UnifiedBookingSales/index.d.ts +8 -1
  11. package/dist/solution/UnifiedBookingSales/index.js +680 -557
  12. package/dist/solution/UnifiedBookingSales/types.d.ts +9 -0
  13. package/dist/solution/UnifiedBookingSales/types.js +2 -0
  14. package/lib/modules/Product/index.d.ts +1 -1
  15. package/lib/server/index.js +5 -0
  16. package/lib/shared/receipt/small-ticket.d.ts +3 -0
  17. package/lib/shared/receipt/small-ticket.js +21 -0
  18. package/lib/solution/BookingByStep/index.d.ts +2 -2
  19. package/lib/solution/BookingTicket/index.d.ts +13 -1
  20. package/lib/solution/OrderInvoicePreview/index.js +6 -1
  21. package/lib/solution/UnifiedBookingSales/catalogQueryBatch.d.ts +21 -0
  22. package/lib/solution/UnifiedBookingSales/catalogQueryBatch.js +109 -0
  23. package/lib/solution/UnifiedBookingSales/index.d.ts +8 -1
  24. package/lib/solution/UnifiedBookingSales/index.js +96 -1
  25. package/lib/solution/UnifiedBookingSales/types.d.ts +9 -0
  26. package/lib/solution/UnifiedBookingSales/types.js +1 -0
  27. package/package.json +1 -1
  28. package/dist/apis/picoding.d.ts +0 -0
  29. package/dist/effects/index.d.ts +0 -19
  30. package/dist/model/strategy/adapter/dataVariant/adapter.d.ts +0 -50
  31. package/dist/model/strategy/adapter/dataVariant/evaluator.d.ts +0 -105
  32. package/dist/model/strategy/adapter/dataVariant/examples.d.ts +0 -39
  33. package/dist/model/strategy/adapter/dataVariant/index.d.ts +0 -4
  34. package/dist/model/strategy/adapter/dataVariant/type.d.ts +0 -173
  35. package/dist/model/strategy/adapter/promotion/adapter.d.ts +0 -70
  36. package/dist/model/strategy/adapter/promotion/examples.d.ts +0 -224
  37. package/dist/model/strategy/adapter/promotion/type.d.ts +0 -535
  38. package/dist/model/strategy/adapter/type.d.ts +0 -28
  39. package/dist/model/strategy/adapter/walletPass/index.d.ts +0 -32
  40. package/dist/model/strategy/adapter/walletPass/locales.d.ts +0 -1
  41. package/dist/model/strategy/adapter/walletPass/type.d.ts +0 -192
  42. package/dist/model/strategy/adapter/walletPass/utils.d.ts +0 -50
  43. package/dist/model/strategy/engine.d.ts +0 -119
  44. package/dist/model/strategy/type.d.ts +0 -245
  45. package/dist/modules/Account/types.d.ts +0 -56
  46. package/dist/modules/BookingContext/types.d.ts +0 -104
  47. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +0 -76
  48. package/dist/modules/BookingContext/utils/flexible.d.ts +0 -28
  49. package/dist/modules/BookingContext/utils/formatResourceList.d.ts +0 -8
  50. package/dist/modules/BookingContext/utils/noResource.d.ts +0 -13
  51. package/dist/modules/BookingContext/utils/orderLineDisplay.d.ts +0 -1
  52. package/dist/modules/BookingContext/utils/resourceErrors.d.ts +0 -41
  53. package/dist/modules/BookingContext/utils/resourceSelection.d.ts +0 -7
  54. package/dist/modules/BookingContext/utils/serviceTimes.d.ts +0 -55
  55. package/dist/modules/BookingContext/utils/timeSlices.d.ts +0 -42
  56. package/dist/modules/Customer/constants.d.ts +0 -7
  57. package/dist/modules/Date/types.d.ts +0 -84
  58. package/dist/modules/Date/utils.d.ts +0 -36
  59. package/dist/modules/FulfillmentTiming/index.d.ts +0 -11
  60. package/dist/modules/FulfillmentTiming/types.d.ts +0 -67
  61. package/dist/modules/Order/payment-utils.d.ts +0 -26
  62. package/dist/modules/Order/pickupTiming.d.ts +0 -46
  63. package/dist/modules/Order/utils/manualProductDiscount.d.ts +0 -106
  64. package/dist/modules/Order/utils/orderCollectionIdentity.d.ts +0 -68
  65. package/dist/modules/Order/utils/weighedProduct.d.ts +0 -12
  66. package/dist/modules/Payment/cashRecommendationAlgorithm.d.ts +0 -21
  67. package/dist/modules/Payment/mx51.d.ts +0 -0
  68. package/dist/modules/Payment/types.d.ts +0 -943
  69. package/dist/modules/Payment/utils.d.ts +0 -19
  70. package/dist/modules/Quotation/types.d.ts +0 -61
  71. package/dist/modules/Resource/types.d.ts +0 -50
  72. package/dist/modules/Resource/utils.d.ts +0 -23
  73. package/dist/modules/ResourcePlanner/localClock.d.ts +0 -33
  74. package/dist/modules/SalesSummary/types.d.ts +0 -69
  75. package/dist/modules/ScanOrderLogger/providers/feishu.d.ts +0 -2
  76. package/dist/modules/ScanOrderLogger/providers/grafana.d.ts +0 -2
  77. package/dist/modules/ScanOrderLogger/types.d.ts +0 -53
  78. package/dist/modules/Schedule/getDateIsInSchedule.d.ts +0 -32
  79. package/dist/modules/Schedule/type.d.ts +0 -157
  80. package/dist/modules/Schedule/types.d.ts +0 -201
  81. package/dist/modules/Schedule/utils.d.ts +0 -67
  82. package/dist/modules/Step/tyeps.d.ts +0 -20
  83. package/dist/modules/SurchargeList/types.d.ts +0 -15
  84. package/dist/plugins/app.d.ts +0 -10
  85. package/dist/plugins/shopStore.d.ts +0 -4
  86. package/dist/plugins/user.d.ts +0 -7
  87. package/dist/server/modules/floor-plan/types.d.ts +0 -43
  88. package/dist/server/modules/menu/types.d.ts +0 -68
  89. package/dist/server/modules/payment/types.d.ts +0 -9
  90. package/dist/server/modules/quotation/types.d.ts +0 -50
  91. package/dist/server/modules/resource/types.d.ts +0 -121
  92. package/dist/server/modules/schedule/types.d.ts +0 -1
  93. package/dist/server/modules/schedule/utils.d.ts +0 -32
  94. package/dist/server/types.d.ts +0 -66
  95. package/dist/server/utils/index.d.ts +0 -5
  96. package/dist/server/utils/schedule.d.ts +0 -14
  97. package/dist/server/utils/time.d.ts +0 -18
  98. package/dist/solution/BookingTicket/utils/bookingStatus.d.ts +0 -77
  99. package/dist/solution/BookingTicket/utils/exampleData.d.ts +0 -123
  100. package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +0 -185
  101. package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +0 -38
  102. package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts +0 -78
  103. package/dist/solution/BookingTicket/utils/scan/scanProductValues.d.ts +0 -21
  104. package/dist/solution/BookingTicket/utils/weighingProductSku.d.ts +0 -5
  105. package/dist/solution/PlaceOrder/index.d.ts +0 -0
  106. package/dist/solution/RegisterAndLogin/config.d.ts +0 -93
  107. package/dist/solution/RegisterAndLogin/types.d.ts +0 -445
  108. package/dist/solution/RegisterAndLogin/utils.d.ts +0 -103
  109. package/dist/store/createStore.d.ts +0 -3
  110. package/dist/types/index.d.ts +0 -132
  111. package/dist/utils/os-private-payload.d.ts +0 -5
  112. package/dist/utils/payment-number.d.ts +0 -9
  113. package/dist/utils/task.d.ts +0 -40
  114. package/dist/utils/watch.d.ts +0 -102
  115. package/lib/apis/picoding.d.ts +0 -0
  116. package/lib/effects/index.d.ts +0 -19
  117. package/lib/model/strategy/adapter/dataVariant/adapter.d.ts +0 -50
  118. package/lib/model/strategy/adapter/dataVariant/evaluator.d.ts +0 -105
  119. package/lib/model/strategy/adapter/dataVariant/examples.d.ts +0 -39
  120. package/lib/model/strategy/adapter/dataVariant/index.d.ts +0 -4
  121. package/lib/model/strategy/adapter/dataVariant/type.d.ts +0 -173
  122. package/lib/model/strategy/adapter/promotion/adapter.d.ts +0 -70
  123. package/lib/model/strategy/adapter/promotion/examples.d.ts +0 -224
  124. package/lib/model/strategy/adapter/promotion/type.d.ts +0 -535
  125. package/lib/model/strategy/adapter/type.d.ts +0 -28
  126. package/lib/model/strategy/adapter/walletPass/index.d.ts +0 -32
  127. package/lib/model/strategy/adapter/walletPass/locales.d.ts +0 -1
  128. package/lib/model/strategy/adapter/walletPass/type.d.ts +0 -192
  129. package/lib/model/strategy/adapter/walletPass/utils.d.ts +0 -50
  130. package/lib/model/strategy/engine.d.ts +0 -119
  131. package/lib/model/strategy/type.d.ts +0 -245
  132. package/lib/modules/Account/types.d.ts +0 -56
  133. package/lib/modules/BookingContext/types.d.ts +0 -104
  134. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +0 -76
  135. package/lib/modules/BookingContext/utils/flexible.d.ts +0 -28
  136. package/lib/modules/BookingContext/utils/formatResourceList.d.ts +0 -8
  137. package/lib/modules/BookingContext/utils/noResource.d.ts +0 -13
  138. package/lib/modules/BookingContext/utils/orderLineDisplay.d.ts +0 -1
  139. package/lib/modules/BookingContext/utils/resourceErrors.d.ts +0 -41
  140. package/lib/modules/BookingContext/utils/resourceSelection.d.ts +0 -7
  141. package/lib/modules/BookingContext/utils/serviceTimes.d.ts +0 -55
  142. package/lib/modules/BookingContext/utils/timeSlices.d.ts +0 -42
  143. package/lib/modules/Customer/constants.d.ts +0 -7
  144. package/lib/modules/Date/types.d.ts +0 -84
  145. package/lib/modules/Date/utils.d.ts +0 -36
  146. package/lib/modules/FulfillmentTiming/index.d.ts +0 -11
  147. package/lib/modules/FulfillmentTiming/types.d.ts +0 -67
  148. package/lib/modules/Order/payment-utils.d.ts +0 -26
  149. package/lib/modules/Order/pickupTiming.d.ts +0 -46
  150. package/lib/modules/Order/utils/manualProductDiscount.d.ts +0 -106
  151. package/lib/modules/Order/utils/orderCollectionIdentity.d.ts +0 -68
  152. package/lib/modules/Order/utils/weighedProduct.d.ts +0 -12
  153. package/lib/modules/Payment/cashRecommendationAlgorithm.d.ts +0 -21
  154. package/lib/modules/Payment/mx51.d.ts +0 -0
  155. package/lib/modules/Payment/types.d.ts +0 -943
  156. package/lib/modules/Payment/utils.d.ts +0 -19
  157. package/lib/modules/Quotation/types.d.ts +0 -61
  158. package/lib/modules/Resource/types.d.ts +0 -50
  159. package/lib/modules/Resource/utils.d.ts +0 -23
  160. package/lib/modules/ResourcePlanner/localClock.d.ts +0 -33
  161. package/lib/modules/SalesSummary/types.d.ts +0 -69
  162. package/lib/modules/ScanOrderLogger/providers/feishu.d.ts +0 -2
  163. package/lib/modules/ScanOrderLogger/providers/grafana.d.ts +0 -2
  164. package/lib/modules/ScanOrderLogger/types.d.ts +0 -53
  165. package/lib/modules/Schedule/getDateIsInSchedule.d.ts +0 -32
  166. package/lib/modules/Schedule/type.d.ts +0 -157
  167. package/lib/modules/Schedule/types.d.ts +0 -201
  168. package/lib/modules/Schedule/utils.d.ts +0 -67
  169. package/lib/modules/Step/tyeps.d.ts +0 -20
  170. package/lib/modules/SurchargeList/types.d.ts +0 -15
  171. package/lib/plugins/app.d.ts +0 -10
  172. package/lib/plugins/shopStore.d.ts +0 -4
  173. package/lib/plugins/user.d.ts +0 -7
  174. package/lib/server/modules/floor-plan/types.d.ts +0 -43
  175. package/lib/server/modules/menu/types.d.ts +0 -68
  176. package/lib/server/modules/payment/types.d.ts +0 -9
  177. package/lib/server/modules/quotation/types.d.ts +0 -50
  178. package/lib/server/modules/resource/types.d.ts +0 -121
  179. package/lib/server/modules/schedule/types.d.ts +0 -1
  180. package/lib/server/modules/schedule/utils.d.ts +0 -32
  181. package/lib/server/types.d.ts +0 -66
  182. package/lib/server/utils/index.d.ts +0 -5
  183. package/lib/server/utils/schedule.d.ts +0 -14
  184. package/lib/server/utils/time.d.ts +0 -18
  185. package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +0 -77
  186. package/lib/solution/BookingTicket/utils/exampleData.d.ts +0 -123
  187. package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +0 -185
  188. package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +0 -38
  189. package/lib/solution/BookingTicket/utils/scan/scanCache.d.ts +0 -78
  190. package/lib/solution/BookingTicket/utils/scan/scanProductValues.d.ts +0 -21
  191. package/lib/solution/BookingTicket/utils/weighingProductSku.d.ts +0 -5
  192. package/lib/solution/PlaceOrder/index.d.ts +0 -0
  193. package/lib/solution/RegisterAndLogin/config.d.ts +0 -93
  194. package/lib/solution/RegisterAndLogin/types.d.ts +0 -445
  195. package/lib/solution/RegisterAndLogin/utils.d.ts +0 -103
  196. package/lib/store/createStore.d.ts +0 -3
  197. package/lib/types/index.d.ts +0 -132
  198. package/lib/utils/os-private-payload.d.ts +0 -5
  199. package/lib/utils/payment-number.d.ts +0 -9
  200. package/lib/utils/task.d.ts +0 -40
  201. package/lib/utils/watch.d.ts +0 -102
@@ -10,6 +10,15 @@ export type { ProductListStoreQueryParams } from '../../modules/ProductList';
10
10
  export type { AvailabilityAbsoluteRange, AvailabilityAssignment, AvailabilityCell, AvailabilityDateRange, AvailabilityDisplayRange, AvailabilityErrorCode, AvailabilityId, AvailabilityMode, AvailabilityOccupancy, AvailabilityProduct, AvailabilityProductKind, AvailabilityProjection, AvailabilityProjectionInput, AvailabilityProjectionMeta, AvailabilityQuery, AvailabilityQueryResult, AvailabilityRequirementGroup, AvailabilityRequirementGroupResult, AvailabilityRequirementSelection, AvailabilityResource, AvailabilityResourceOption, AvailabilityResourceType, AvailabilityResourceWindow, AvailabilityScheduleMode, AvailabilityScheduleRef, AvailabilityScheduleRule, AvailabilitySelectionValidationParams, AvailabilitySelectionValidationResult, AvailabilitySessionRange, AvailabilityStatus, DateAvailabilityGroup, DateAvailabilityItem, DateAvailabilityQuery, DateAvailabilityQueryResult, GetProductTimeRangesRequest, ProductAvailabilityGroup, ProductAvailabilityItem, ProductAvailabilityQuery, ProductAvailabilityQueryResult, ProductTimeRange, ProductTimeRangeGroup, QueryAvailabilityBaseRequest, ResourceAvailabilityGroup, ResourceAvailabilityQuery, ResourceAvailabilityQueryResult, ResourceAvailabilityRangeGroup, TimeAvailabilityGroup, TimeAvailabilityItem, TimeAvailabilityQuery, TimeAvailabilityQueryResult, } from '../../modules/ResourcePlanner';
11
11
  export interface UnifiedBookingSalesState extends BookingTicketState {
12
12
  }
13
+ /** Read-only preview scope; existing solution queries remain fresh for selection and submission. */
14
+ export interface UnifiedBookingSalesCatalogQueryBatch {
15
+ queryCatalogSnapshot(params: ProductListLoadProductsParams): Promise<ProductData[]>;
16
+ queryCatalogProductDetail(params: ProductListLoadProductsParams & {
17
+ product_id: number;
18
+ }): Promise<ProductData | undefined>;
19
+ /** Releases retained results. A disposed batch cannot be reused. */
20
+ dispose(): void;
21
+ }
13
22
  export interface UnifiedBookingSalesPolicy {
14
23
  id?: AvailabilityId;
15
24
  title?: unknown;
@@ -1,3 +1,5 @@
1
+ /** Read-only preview scope; existing solution queries remain fresh for selection and submission. */
2
+
1
3
  export var UnifiedBookingSalesHooks = /*#__PURE__*/function (UnifiedBookingSalesHooks) {
2
4
  UnifiedBookingSalesHooks["onAvailabilityProjectionPrepared"] = "unifiedBookingSales:onAvailabilityProjectionPrepared";
3
5
  UnifiedBookingSalesHooks["onAvailabilitySelectionCommitted"] = "unifiedBookingSales:onAvailabilitySelectionCommitted";
@@ -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(): "duration" | "session" | "normal";
52
+ getProductType(): "normal" | "duration" | "session";
53
53
  }
@@ -3405,8 +3405,13 @@ class Server {
3405
3405
  }
3406
3406
  getSmallTicketShopInfo() {
3407
3407
  const shopInfo = this.getAppData('shop_info') || {};
3408
+ // WebPOS getData does not expose core/default_domain; read the business
3409
+ // shop model directly when the expanded shop_info has not loaded it yet.
3410
+ const shopCore = this.app?.models?.getStore?.().getDataByModel?.('core', 'core') || this.app?.data?.store?.getStore?.().getDataByModel?.('core', 'core') || {};
3408
3411
  return {
3409
3412
  ...shopInfo,
3413
+ default_domain: shopInfo.default_domain || shopCore.default_domain,
3414
+ private_domain_protocol: shopInfo.private_domain_protocol || shopCore.private_domain_protocol,
3410
3415
  currency_symbol: shopInfo.currency_symbol || this.getAppData('shop_symbol') || this.getAppData('currency_symbol'),
3411
3416
  currency_code: shopInfo.currency_code || this.getAppData('shop_currency_code') || this.getAppData('currency_code'),
3412
3417
  tax_title: shopInfo.tax_title || this.getAppData('tax_title'),
@@ -15,6 +15,9 @@ export interface SmallTicketShopInfo {
15
15
  currency_code?: string;
16
16
  primary_locale?: string;
17
17
  timezone?: string;
18
+ /** Customer-facing shop domain, supplied by the host shop context. */
19
+ default_domain?: string;
20
+ private_domain_protocol?: string;
18
21
  [key: string]: any;
19
22
  }
20
23
  export interface BuildSmallTicketDataParams {
@@ -387,10 +387,14 @@ function buildBaseData(params) {
387
387
  financials
388
388
  } = params;
389
389
  const orderNumber = stringify(order.buzzer || order.shop_full_order_number);
390
+ const rewardClaim = buildRewardClaimUrl(shopInfo, order.shop_order_number);
390
391
  return {
391
392
  shop_name: stringify(shopInfo.name || order.shop_name),
392
393
  note: stringify(order.note),
393
394
  shop_order_number: stringify(order.shop_order_number),
395
+ ...(rewardClaim ? {
396
+ reward_claim: rewardClaim
397
+ } : {}),
394
398
  order_number: orderNumber,
395
399
  shop_tax_number: stringify(shopInfo.tax_number || order.shop_tax_number),
396
400
  shop_phone: stringify(shopInfo.phone || order.shop_phone),
@@ -409,6 +413,23 @@ function buildBaseData(params) {
409
413
  } : {})
410
414
  };
411
415
  }
416
+ function buildRewardClaimUrl(shopInfo, shopOrderNumber) {
417
+ const domain = typeof shopInfo.default_domain === 'string' ? shopInfo.default_domain.trim() : '';
418
+ const orderNumber = typeof shopOrderNumber === 'string' ? shopOrderNumber.trim() : typeof shopOrderNumber === 'number' && Number.isFinite(shopOrderNumber) ? String(shopOrderNumber) : '';
419
+ if (!domain || !orderNumber) return undefined;
420
+ try {
421
+ const protocol = shopInfo.private_domain_protocol === 'http' ? 'http' : 'https';
422
+ const base = new URL(/^[a-z][a-z\d+.-]*:\/\//i.test(domain) ? domain : `${protocol}://${domain}`);
423
+ if (!['http:', 'https:'].includes(base.protocol) || base.username || base.password) {
424
+ return undefined;
425
+ }
426
+ const url = new URL('/claim-purchase-rewards', base);
427
+ url.searchParams.set('shop_order_number', orderNumber);
428
+ return url.toString();
429
+ } catch {
430
+ return undefined;
431
+ }
432
+ }
412
433
  function buildProducts(order, locale, productMap) {
413
434
  const products = Array.isArray(order.products) ? order.products : [];
414
435
  const allergyByProductUid = buildProductAllergyMap(order, locale);
@@ -326,7 +326,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
326
326
  date: string;
327
327
  status: string;
328
328
  week: string;
329
- weekNum: 0 | 2 | 1 | 3 | 4 | 5 | 6;
329
+ weekNum: 0 | 2 | 1 | 6 | 4 | 5 | 3;
330
330
  }[]>;
331
331
  submitTimeSlot(timeSlots: TimeSliceItem): void;
332
332
  private getScheduleDataByIds;
@@ -373,7 +373,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
373
373
  };
374
374
  setOtherData(key: string, value: any): void;
375
375
  getOtherData(key: string): any;
376
- getProductTypeById(id: number): Promise<"duration" | "session" | "normal">;
376
+ getProductTypeById(id: number): Promise<"normal" | "duration" | "session">;
377
377
  /**
378
378
  * 提供给 UI 的方法,减轻 UI 层的计算压力,UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
379
379
  *
@@ -479,7 +479,19 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
479
479
  * 加车两阶段主决策(规格弹窗 / 资源编辑 / 直接加车)。
480
480
  * 与 ticketBooking `handleSelectProduct` + `handleBooking4Service` 等价。
481
481
  */
482
- decideAddProduct(item: any, options?: Partial<AddProductDecideContext>): import("./utils/addProductDecision").AddProductDecision;
482
+ decideAddProduct(item: any, options?: Partial<AddProductDecideContext>): {
483
+ action: "reloadCatalog";
484
+ } | {
485
+ action: "add";
486
+ cacheItem: any;
487
+ } | {
488
+ action: "requiresDetail";
489
+ payload: AddProductRequiresDetailPayload;
490
+ } | {
491
+ action: "requiresBookingEdit";
492
+ cacheItem: any;
493
+ payload: import("./utils/addProductDecision").AddProductRequiresBookingEditPayload;
494
+ };
483
495
  /** 规格弹窗 callback 后的第二段决策。 */
484
496
  decideAfterDetail(cacheItem: any, options?: Partial<AddProductDecideContext>): import("./utils/addProductDecision").AddProductDecision;
485
497
  /**
@@ -130,9 +130,12 @@ class OrderInvoicePreviewImpl extends _BaseModule.BaseModule {
130
130
  const task = (async () => {
131
131
  const [snapshot, context, template] = await Promise.all([this.loadSource(input), this.loadContext(input), (0, _loadCustomerInvoiceLayout.loadCustomerInvoiceTemplate)(this.request, input)]);
132
132
  const source = (0, _loadPaymentMethods.withPaymentMethodNames)(snapshot, context.methods);
133
- const getData = this.core.getPlugin('app')?.getData?.();
133
+ const appPlugin = this.core.getPlugin('app');
134
+ const getData = appPlugin?.getData?.();
134
135
  if (getData?.('shop_id') != null && String(getData('shop_id')) !== String(input.shopId)) throw new Error('Invoice shop changed');
135
136
  const coreData = getData?.('core');
137
+ const hostApp = appPlugin?.getApp?.();
138
+ const shopCore = hostApp?.models?.getStore?.().getDataByModel?.('core', 'core') || hostApp?.data?.store?.getStore?.().getDataByModel?.('core', 'core') || coreData?.core || coreData || {};
136
139
  const shop = {
137
140
  ...(coreData?.core?.shop || coreData?.shop || {}),
138
141
  ...(getData?.('shop_info') || {}),
@@ -142,6 +145,8 @@ class OrderInvoicePreviewImpl extends _BaseModule.BaseModule {
142
145
  tax_country_code: getData('tax_country_code')
143
146
  } : {})
144
147
  };
148
+ shop.default_domain || (shop.default_domain = shopCore.default_domain);
149
+ shop.private_domain_protocol || (shop.private_domain_protocol = shopCore.private_domain_protocol);
145
150
  if (generation !== this.generation || this.disposed) throw new Error('Invoice request superseded');
146
151
  const languageOptions = (0, _customerInvoiceLanguages.resolveCustomerInvoiceLanguages)(template.language, input.locale);
147
152
  const remembered = this.languageSelection?.code;
@@ -0,0 +1,21 @@
1
+ import type { ProductListLoadProductsParams } from '../../modules/ProductList';
2
+ import type { ProductData } from '../../modules/Product/types';
3
+ import type { UnifiedBookingSalesCatalogQueryBatch } from './types';
4
+ type DetailParams = ProductListLoadProductsParams & {
5
+ product_id: number;
6
+ };
7
+ export interface CatalogQueryRuntime {
8
+ references: unknown[];
9
+ values: unknown;
10
+ /** Late-loaded pricing/schedule data may refresh within the same owner. */
11
+ refreshValues?: unknown;
12
+ }
13
+ /** Internal adapter: membership loaders are never accepted from public callers. */
14
+ export declare function createCatalogQueryBatchAdapter(options: {
15
+ runtime(): CatalogQueryRuntime;
16
+ normalize(params: ProductListLoadProductsParams, now: number): ProductListLoadProductsParams;
17
+ key(params: ProductListLoadProductsParams): string;
18
+ snapshot(params: ProductListLoadProductsParams): Promise<ProductData[]>;
19
+ detail(params: DetailParams, snapshot: UnifiedBookingSalesCatalogQueryBatch['queryCatalogSnapshot']): Promise<ProductData | undefined>;
20
+ }): UnifiedBookingSalesCatalogQueryBatch;
21
+ export {};
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createCatalogQueryBatchAdapter = createCatalogQueryBatchAdapter;
7
+ var _lodashEs = require("lodash-es");
8
+ const BATCH_MAX_AGE_MS = 60 * 1000;
9
+ // Enough for a 42-day calendar with several product details per day, but bounded.
10
+ const BATCH_MAX_ENTRIES = 512;
11
+
12
+ /** Internal adapter: membership loaders are never accepted from public callers. */
13
+ function createCatalogQueryBatchAdapter(options) {
14
+ let disposed = false;
15
+ let epoch;
16
+ const sameOwner = (left, right) => left.references.length === right.references.length && left.references.every((ref, index) => ref === right.references[index]) && (0, _lodashEs.isEqual)(left.values, right.values);
17
+ const fail = code => Object.assign(new Error(code === 'CATALOG_QUERY_BATCH_DISPOSED' ? 'The catalog query batch is closed. Create a new batch before querying.' : 'The catalog context changed while loading. Please retry.'), {
18
+ code
19
+ });
20
+ const current = () => {
21
+ if (disposed) throw fail('CATALOG_QUERY_BATCH_DISPOSED');
22
+ const now = Date.now();
23
+ const runtime = options.runtime();
24
+ if (!epoch || now < epoch.startedAt || now - epoch.startedAt >= BATCH_MAX_AGE_MS || !sameOwner(runtime, epoch.runtime) || !(0, _lodashEs.isEqual)(runtime.refreshValues, epoch.runtime.refreshValues)) {
25
+ epoch?.entries.clear();
26
+ epoch = {
27
+ runtime: {
28
+ references: [...runtime.references],
29
+ values: (0, _lodashEs.cloneDeep)(runtime.values),
30
+ refreshValues: (0, _lodashEs.cloneDeep)(runtime.refreshValues)
31
+ },
32
+ startedAt: now,
33
+ entries: new Map()
34
+ };
35
+ }
36
+ return epoch;
37
+ };
38
+ const assertEpoch = owner => {
39
+ const next = current();
40
+ if (next !== owner) throw Object.assign(fail('CATALOG_QUERY_BATCH_STALE'), {
41
+ retryable: sameOwner(owner.runtime, next.runtime)
42
+ });
43
+ };
44
+ const run = async load => {
45
+ for (let attempt = 0;; attempt++) {
46
+ try {
47
+ return await load(current());
48
+ } catch (error) {
49
+ const failure = error;
50
+ // Drop the old result and reread under the new configuration. Never replay
51
+ // a network error, disposed batch or a request belonging to a different user/store.
52
+ if (attempt >= 2 || failure?.code !== 'CATALOG_QUERY_BATCH_STALE' || !failure.retryable) throw error;
53
+ }
54
+ }
55
+ };
56
+ const read = async (owner, key, load) => {
57
+ assertEpoch(owner);
58
+ let promise = owner.entries.get(key);
59
+ if (promise) {
60
+ owner.entries.delete(key);
61
+ owner.entries.set(key, promise);
62
+ } else {
63
+ promise = Promise.resolve().then(() => {
64
+ assertEpoch(owner);
65
+ return load();
66
+ }).then(value => (0, _lodashEs.cloneDeep)(value));
67
+ owner.entries.set(key, promise);
68
+ while (owner.entries.size > BATCH_MAX_ENTRIES) owner.entries.delete(owner.entries.keys().next().value);
69
+ }
70
+ try {
71
+ const result = await promise;
72
+ assertEpoch(owner);
73
+ return (0, _lodashEs.cloneDeep)(result);
74
+ } catch (error) {
75
+ if (owner.entries.get(key) === promise) owner.entries.delete(key);
76
+ throw error;
77
+ }
78
+ };
79
+ const snapshotFor = async (owner, input) => {
80
+ assertEpoch(owner);
81
+ const {
82
+ product_ids,
83
+ ...scope
84
+ } = options.normalize((0, _lodashEs.cloneDeep)(input), owner.startedAt);
85
+ // The membership scope is always the whole menu; ID filtering is only a detached view.
86
+ const products = await read(owner, `list:${options.key(scope)}`, () => options.snapshot(scope));
87
+ return product_ids?.length ? products.filter(product => product_ids.some(id => Number(id) === Number(product.id))) : products;
88
+ };
89
+ return {
90
+ queryCatalogSnapshot: params => run(owner => snapshotFor(owner, params)),
91
+ queryCatalogProductDetail: input => run(owner => {
92
+ const {
93
+ product_id,
94
+ product_ids: _ignored,
95
+ ...scope
96
+ } = (0, _lodashEs.cloneDeep)(input);
97
+ const params = {
98
+ ...options.normalize(scope, owner.startedAt),
99
+ product_id
100
+ };
101
+ return read(owner, `detail:${options.key(params)}`, () => options.detail(params, query => snapshotFor(owner, query)));
102
+ }),
103
+ dispose: () => {
104
+ disposed = true;
105
+ epoch?.entries.clear();
106
+ epoch = undefined;
107
+ }
108
+ };
109
+ }
@@ -6,7 +6,7 @@ import { type InvoiceLayoutConfig, type InvoiceTemplateSettings, type OpenDataCo
6
6
  import type { LoadScheduleAvailableDateParams, ScheduleItem } from '../../modules/Schedule/types';
7
7
  import type { ProductListLoadProductsParams, ProductListStoreQueryParams } from '../../modules/ProductList';
8
8
  import type { AvailabilityDateRange, AvailabilityOccupancy, AvailabilityProduct, AvailabilityResource, GetProductTimeRangesRequest } from '../../modules/ResourcePlanner';
9
- import type { AvailabilityContextRef, ContextualAvailabilityQuery, ContextualAvailabilityQueryResult, ContextualCommitAvailabilitySelectionParams, ContextualProductTimeRangeGroup, UnifiedBookingSalesAddRetailProductParams, UnifiedBookingSalesApplyPlannerDiscountsParams, UnifiedBookingSalesCommitAvailabilitySelectionResult, UnifiedBookingSalesDiscountResult, UnifiedBookingSalesLoadProductsByScheduleDateParams, UnifiedBookingSalesLoadOpenDataParams, UnifiedBookingSalesPrepareAvailabilityProjectionParams, UnifiedBookingSalesPolicyResponse, UnifiedBookingSalesQueryBookingResourceDetailsParams, UnifiedBookingSalesResourceDetail, UnifiedBookingSalesResolveProductAllergyRequirementParams, UnifiedBookingSalesStageRetailProductsParams, UnifiedBookingSalesState } from './types';
9
+ import type { AvailabilityContextRef, ContextualAvailabilityQuery, ContextualAvailabilityQueryResult, ContextualCommitAvailabilitySelectionParams, ContextualProductTimeRangeGroup, UnifiedBookingSalesAddRetailProductParams, UnifiedBookingSalesCatalogQueryBatch, UnifiedBookingSalesApplyPlannerDiscountsParams, UnifiedBookingSalesCommitAvailabilitySelectionResult, UnifiedBookingSalesDiscountResult, UnifiedBookingSalesLoadProductsByScheduleDateParams, UnifiedBookingSalesLoadOpenDataParams, UnifiedBookingSalesPrepareAvailabilityProjectionParams, UnifiedBookingSalesPolicyResponse, UnifiedBookingSalesQueryBookingResourceDetailsParams, UnifiedBookingSalesResourceDetail, UnifiedBookingSalesResolveProductAllergyRequirementParams, UnifiedBookingSalesStageRetailProductsParams, UnifiedBookingSalesState } from './types';
10
10
  import type { BusinessAvailability } from '../../modules/BusinessAvailability';
11
11
  import { BookingTicket } from '../BookingTicket';
12
12
  import type { AllergyRequirement } from '../../model/strategy/adapter/itemRule';
@@ -225,6 +225,13 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
225
225
  queryCatalogProductDetail(params: ProductListLoadProductsParams & {
226
226
  product_id: number;
227
227
  }): Promise<ProductData | undefined>;
228
+ /**
229
+ * Opt-in calendar/card preview batching. Results expire after sixty seconds or a
230
+ * runtime change; the next read starts a fresh clock/cache. Selection and submit
231
+ * must keep using the ordinary fresh query methods. Call dispose on owner cleanup.
232
+ */
233
+ createCatalogQueryBatch(): UnifiedBookingSalesCatalogQueryBatch;
234
+ private loadCatalogProductDetail;
228
235
  private loadCatalogProducts;
229
236
  queryProducts(params?: ProductListStoreQueryParams): Promise<ProductData[]>;
230
237
  /** Date-first entry point. It delegates protocol details and cache ownership to ScheduleModule. */
@@ -64,6 +64,7 @@ Object.keys(_types).forEach(function (key) {
64
64
  });
65
65
  var _remoteOccupancyCache = require("./remoteOccupancyCache");
66
66
  var _businessAvailability = require("./businessAvailability");
67
+ var _catalogQueryBatch = require("./catalogQueryBatch");
67
68
  var _BookingTicket = require("../BookingTicket");
68
69
  var _localClock = require("../../modules/ResourcePlanner/localClock");
69
70
  var _platform = require("../../utils/platform");
@@ -2211,6 +2212,100 @@ class UnifiedBookingSalesImpl extends _BookingTicket.BookingTicket {
2211
2212
 
2212
2213
  /** Full SKU/bundle detail, after verifying membership in the explicit day/menu scope. */
2213
2214
  async queryCatalogProductDetail(params) {
2215
+ return this.loadCatalogProductDetail(params, query => this.queryCatalogSnapshot(query));
2216
+ }
2217
+
2218
+ /**
2219
+ * Opt-in calendar/card preview batching. Results expire after sixty seconds or a
2220
+ * runtime change; the next read starts a fresh clock/cache. Selection and submit
2221
+ * must keep using the ordinary fresh query methods. Call dispose on owner cleanup.
2222
+ */
2223
+ createCatalogQueryBatch() {
2224
+ return (0, _catalogQueryBatch.createCatalogQueryBatchAdapter)({
2225
+ runtime: () => {
2226
+ if (this.runtimeOpenDataDestroyed) throw new Error('The booking service is closed.');
2227
+ const user = this.core.getPlugin?.('user');
2228
+ const productParams = this.store.products?.otherParams || this.otherParams || {};
2229
+ const fatherModule = String(productParams.fatherModule || '').trim();
2230
+ const schedule = (fatherModule ? this.core.getModule?.(`${fatherModule}_schedule`) : null) || this.core.getModule?.('schedule');
2231
+ const evaluator = this.core.context?.dataVariantEvaluator;
2232
+ // OpenData hydration is not a catalog input. Its temporary null/reload cycle
2233
+ // must not expire a batch while a parallel preview reads sales settings.
2234
+ const {
2235
+ openData: _openData,
2236
+ ...otherParams
2237
+ } = this.otherParams || {};
2238
+ const {
2239
+ openData: _productOpenData,
2240
+ ...productOtherParams
2241
+ } = productParams;
2242
+ return {
2243
+ references: [this.core, this.request, this.store.products, this.core.server, user, this.appPlugin, this.core.getPlugin?.('request'), this.core.getPlugin?.('app'), schedule, evaluator],
2244
+ values: {
2245
+ initialization: this.runtimeInitializationGeneration,
2246
+ scope: this.getRuntimeOpenDataScope(),
2247
+ requestBaseUrl: this.request.baseUrl,
2248
+ customerId: user?.get?.()?.id,
2249
+ otherParams,
2250
+ productOtherParams
2251
+ },
2252
+ refreshValues: {
2253
+ scheduleList: schedule?.getScheduleList?.(),
2254
+ contextScheduleList: this.core.context?.scheduleList,
2255
+ contextMenuList: this.core.context?.menuList,
2256
+ strategyConfigs: evaluator?.getStrategyConfigs?.()
2257
+ }
2258
+ };
2259
+ },
2260
+ normalize: (params, now) => {
2261
+ const date = params.schedule_date || (0, _dayjs.default)(now).format('YYYY-MM-DD');
2262
+ const user = this.core.getPlugin?.('user');
2263
+ const explicitCustomer = params.customer_id;
2264
+ if (explicitCustomer != null && (!Number.isSafeInteger(Number(explicitCustomer)) || Number(explicitCustomer) <= 0)) {
2265
+ throw new Error('Catalog query customer_id must be a positive integer.');
2266
+ }
2267
+ const fallbackCustomer = user?.get?.()?.id;
2268
+ const customer = explicitCustomer ?? (Number.isSafeInteger(Number(fallbackCustomer)) && Number(fallbackCustomer) > 0 ? Number(fallbackCustomer) : undefined);
2269
+ const productParams = this.store.products?.otherParams || this.otherParams || {};
2270
+ const channelMap = {
2271
+ online_store: 'online-store',
2272
+ scan_to_order: 'online-store',
2273
+ 'scan-to-order': 'online-store',
2274
+ scan_to_order_2: 'online-store',
2275
+ scan_to_order_3: 'scantoorder3'
2276
+ };
2277
+ const channel = channelMap[productParams.channel] || productParams.channel;
2278
+ const businessCode = productParams.businessCode ?? productParams.business_code;
2279
+ const sorted = items => [...new Set(items)].sort((a, b) => String(a).localeCompare(String(b)));
2280
+ return {
2281
+ ...params,
2282
+ menu_list_ids: Array.isArray(params.menu_list_ids) ? sorted(params.menu_list_ids) : params.menu_list_ids,
2283
+ category_ids: sorted(params.category_ids || []),
2284
+ collection: Array.isArray(params.collection) ? sorted(params.collection) : params.collection,
2285
+ extension_type: params.extension_type ? sorted(params.extension_type) : undefined,
2286
+ with_count: sorted(params.with_count ?? ['bundleGroup', 'optionGroup']),
2287
+ with_schedule: params.with_schedule ?? 1,
2288
+ status: params.status ?? 'published',
2289
+ schedule_date: date,
2290
+ schedule_datetime: params.schedule_datetime || `${date} ${(0, _dayjs.default)(now).format('HH:mm:ss')}`,
2291
+ customer_id: customer == null ? undefined : Number(customer),
2292
+ strategy_context: {
2293
+ ...(channel ? {
2294
+ channel
2295
+ } : {}),
2296
+ ...(businessCode ? {
2297
+ business_code: businessCode
2298
+ } : {}),
2299
+ ...(params.strategy_context || {})
2300
+ }
2301
+ };
2302
+ },
2303
+ key: params => JSON.stringify(stableValue(params)),
2304
+ snapshot: params => this.queryCatalogSnapshot(params),
2305
+ detail: (params, snapshot) => this.loadCatalogProductDetail(params, snapshot)
2306
+ });
2307
+ }
2308
+ async loadCatalogProductDetail(params, loadSnapshot) {
2214
2309
  const {
2215
2310
  product_id,
2216
2311
  product_ids: _ignoredIds,
@@ -2224,7 +2319,7 @@ class UnifiedBookingSalesImpl extends _BookingTicket.BookingTicket {
2224
2319
  schedule_date,
2225
2320
  schedule_datetime
2226
2321
  };
2227
- const member = (await this.queryCatalogSnapshot(scopedParams)).find(item => Number(item.id) === product_id);
2322
+ const member = (await loadSnapshot(scopedParams)).find(item => Number(item.id) === product_id);
2228
2323
  if (!member) return undefined;
2229
2324
  const baseUrl = String(this.request.baseUrl || ((0, _platform.isCustomerUserPlatform)(this.otherParams?.platform) ? '/h5' : '/shop')).replace(/\/+$/, '');
2230
2325
  const localPath = `/product/query/${product_id}`;
@@ -10,6 +10,15 @@ export type { ProductListStoreQueryParams } from '../../modules/ProductList';
10
10
  export type { AvailabilityAbsoluteRange, AvailabilityAssignment, AvailabilityCell, AvailabilityDateRange, AvailabilityDisplayRange, AvailabilityErrorCode, AvailabilityId, AvailabilityMode, AvailabilityOccupancy, AvailabilityProduct, AvailabilityProductKind, AvailabilityProjection, AvailabilityProjectionInput, AvailabilityProjectionMeta, AvailabilityQuery, AvailabilityQueryResult, AvailabilityRequirementGroup, AvailabilityRequirementGroupResult, AvailabilityRequirementSelection, AvailabilityResource, AvailabilityResourceOption, AvailabilityResourceType, AvailabilityResourceWindow, AvailabilityScheduleMode, AvailabilityScheduleRef, AvailabilityScheduleRule, AvailabilitySelectionValidationParams, AvailabilitySelectionValidationResult, AvailabilitySessionRange, AvailabilityStatus, DateAvailabilityGroup, DateAvailabilityItem, DateAvailabilityQuery, DateAvailabilityQueryResult, GetProductTimeRangesRequest, ProductAvailabilityGroup, ProductAvailabilityItem, ProductAvailabilityQuery, ProductAvailabilityQueryResult, ProductTimeRange, ProductTimeRangeGroup, QueryAvailabilityBaseRequest, ResourceAvailabilityGroup, ResourceAvailabilityQuery, ResourceAvailabilityQueryResult, ResourceAvailabilityRangeGroup, TimeAvailabilityGroup, TimeAvailabilityItem, TimeAvailabilityQuery, TimeAvailabilityQueryResult, } from '../../modules/ResourcePlanner';
11
11
  export interface UnifiedBookingSalesState extends BookingTicketState {
12
12
  }
13
+ /** Read-only preview scope; existing solution queries remain fresh for selection and submission. */
14
+ export interface UnifiedBookingSalesCatalogQueryBatch {
15
+ queryCatalogSnapshot(params: ProductListLoadProductsParams): Promise<ProductData[]>;
16
+ queryCatalogProductDetail(params: ProductListLoadProductsParams & {
17
+ product_id: number;
18
+ }): Promise<ProductData | undefined>;
19
+ /** Releases retained results. A disposed batch cannot be reused. */
20
+ dispose(): void;
21
+ }
13
22
  export interface UnifiedBookingSalesPolicy {
14
23
  id?: AvailabilityId;
15
24
  title?: unknown;
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.UnifiedBookingSalesHooks = void 0;
7
+ /** Read-only preview scope; existing solution queries remain fresh for selection and submission. */
7
8
  let UnifiedBookingSalesHooks = exports.UnifiedBookingSalesHooks = /*#__PURE__*/function (UnifiedBookingSalesHooks) {
8
9
  UnifiedBookingSalesHooks["onAvailabilityProjectionPrepared"] = "unifiedBookingSales:onAvailabilityProjectionPrepared";
9
10
  UnifiedBookingSalesHooks["onAvailabilitySelectionCommitted"] = "unifiedBookingSales:onAvailabilitySelectionCommitted";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "0.10.74",
4
+ "version": "0.10.76",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
File without changes
@@ -1,19 +0,0 @@
1
- type EffectCallback = (payload: any) => void | Promise<void | {
2
- status: boolean;
3
- message?: string;
4
- }>;
5
- type UnsubscribeFunction = () => void;
6
- declare class EffectsManager {
7
- private listeners;
8
- on(event: string, callback: EffectCallback): UnsubscribeFunction;
9
- only(event: string, callback: EffectCallback): UnsubscribeFunction;
10
- off(event: string, callback: EffectCallback): void;
11
- offByModuleDestroy(module: string): void;
12
- once(event: string, callback: EffectCallback): UnsubscribeFunction;
13
- emit(event: string, payload: any): Promise<{
14
- status: boolean;
15
- data: any;
16
- }>;
17
- clear(): void;
18
- }
19
- export { EffectsManager, UnsubscribeFunction };
@@ -1,50 +0,0 @@
1
- import type { EvaluationResult, RuntimeContext } from '../../type';
2
- import type { BusinessAdapter } from '../type';
3
- import type { DataVariantBusinessData, DataVariantProduct } from './type';
4
- /**
5
- * Data Variant 适配器。
6
- *
7
- * 负责把智能定价运行态数据转换为 StrategyEngine 能识别的 attributes。
8
- */
9
- export declare class DataVariantAdapter implements BusinessAdapter {
10
- name: string;
11
- version: string;
12
- /**
13
- * 准备批量全局上下文。
14
- *
15
- * 这里只放不依赖单个商品的字段,用于预计算 schedule/channel/orderType 等条件。
16
- */
17
- prepareContext(businessData: DataVariantBusinessData): RuntimeContext;
18
- /**
19
- * 准备全局预计算上下文。
20
- */
21
- prepareGlobalContext(businessData: DataVariantBusinessData): RuntimeContext;
22
- /**
23
- * 准备单商品上下文。
24
- *
25
- * 商品级条件只在当前商品 data_variants 引用到对应规则后才评估。
26
- */
27
- prepareProductContext(businessData: DataVariantBusinessData, product: DataVariantProduct): RuntimeContext;
28
- transformResult(result: EvaluationResult): EvaluationResult;
29
- formatConfig(result: EvaluationResult, businessData?: DataVariantBusinessData): {
30
- result: EvaluationResult;
31
- businessData?: DataVariantBusinessData;
32
- };
33
- /**
34
- * 构建 menu_match 使用的轻量商品对象。
35
- *
36
- * collection_ids 来自商品 collection 字段,避免 operator 读取复杂商品对象。
37
- */
38
- buildProductValue(product: DataVariantProduct): {
39
- id: number;
40
- product_variant_id: number;
41
- collection_ids: number[];
42
- };
43
- private toNumber;
44
- /**
45
- * 归一化客户 id:无效值返回 undefined,有效值统一为 number。
46
- */
47
- private normalizeCustomerId;
48
- private normalizeNumberArray;
49
- }
50
- export default DataVariantAdapter;