@pisell/pisellos 2.2.291 → 2.2.293

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/dist/core/index.d.ts +7 -0
  2. package/dist/core/index.js +108 -65
  3. package/dist/model/strategy/adapter/itemRule/adapter.d.ts +4 -1
  4. package/dist/model/strategy/adapter/itemRule/adapter.js +135 -35
  5. package/dist/model/strategy/adapter/itemRule/evaluator.d.ts +8 -1
  6. package/dist/model/strategy/adapter/itemRule/evaluator.js +25 -1
  7. package/dist/model/strategy/adapter/itemRule/type.d.ts +44 -0
  8. package/dist/model/strategy/adapter/itemRule/type.js +19 -1
  9. package/dist/model/strategy/adapter/promotion/index.js +0 -9
  10. package/dist/modules/BookingContext/index.d.ts +3 -0
  11. package/dist/modules/BookingContext/index.js +42 -13
  12. package/dist/modules/BookingContext/types.d.ts +4 -4
  13. package/dist/modules/BookingContext/types.js +3 -3
  14. package/dist/modules/OpenData/types.d.ts +1 -0
  15. package/dist/modules/Order/index.d.ts +18 -3
  16. package/dist/modules/Order/index.js +885 -485
  17. package/dist/modules/Order/salesNotes.d.ts +31 -0
  18. package/dist/modules/Order/salesNotes.js +492 -0
  19. package/dist/modules/Order/types.d.ts +93 -5
  20. package/dist/modules/Order/types.js +5 -0
  21. package/dist/modules/Order/utils.d.ts +12 -0
  22. package/dist/modules/Order/utils.js +96 -31
  23. package/dist/modules/Product/types.d.ts +2 -0
  24. package/dist/modules/ProductList/clientDataVariants.d.ts +50 -0
  25. package/dist/modules/ProductList/clientDataVariants.js +216 -0
  26. package/dist/modules/ProductList/index.d.ts +18 -3
  27. package/dist/modules/ProductList/index.js +220 -38
  28. package/dist/modules/ProductList/types.d.ts +10 -0
  29. package/dist/modules/Quotation/index.d.ts +22 -0
  30. package/dist/modules/Quotation/index.js +293 -28
  31. package/dist/modules/ResourcePlanner/index.d.ts +0 -22
  32. package/dist/modules/ResourcePlanner/index.js +1 -180
  33. package/dist/modules/ResourcePlanner/localClock.d.ts +33 -0
  34. package/dist/modules/ResourcePlanner/localClock.js +183 -0
  35. package/dist/modules/ResourcePlanner/planner.d.ts +5 -14
  36. package/dist/modules/ResourcePlanner/planner.js +2111 -958
  37. package/dist/modules/ResourcePlanner/types.d.ts +359 -187
  38. package/dist/modules/ResourcePlanner/types.js +33 -1
  39. package/dist/plugins/request.d.ts +1 -0
  40. package/dist/server/index.d.ts +17 -2
  41. package/dist/server/index.js +1134 -932
  42. package/dist/server/modules/floor-plan/index.d.ts +4 -0
  43. package/dist/server/modules/floor-plan/index.js +240 -98
  44. package/dist/server/modules/menu/index.js +48 -23
  45. package/dist/server/modules/order/index.d.ts +17 -7
  46. package/dist/server/modules/order/index.js +419 -207
  47. package/dist/server/modules/products/index.d.ts +10 -4
  48. package/dist/server/modules/products/index.js +177 -84
  49. package/dist/server/modules/resource/index.js +21 -13
  50. package/dist/server/utils/product.d.ts +1 -1
  51. package/dist/server/utils/product.js +186 -22
  52. package/dist/server/utils/small-ticket.d.ts +9 -1
  53. package/dist/server/utils/small-ticket.js +131 -84
  54. package/dist/solution/BaseSales/index.d.ts +26 -3
  55. package/dist/solution/BaseSales/index.js +1384 -905
  56. package/dist/solution/BaseSales/types.d.ts +2 -0
  57. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +3 -0
  58. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +10 -3
  59. package/dist/solution/BaseSales/utils.js +6 -3
  60. package/dist/solution/BookingByStep/index.d.ts +4 -4
  61. package/dist/solution/BookingTicket/index.d.ts +1 -1
  62. package/dist/solution/BookingTicket/index.js +4 -2
  63. package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +2 -1
  64. package/dist/solution/BookingTicket/utils/addProductDecision.js +6 -3
  65. package/dist/solution/BookingTicket/utils/orderCustomer.js +3 -2
  66. package/dist/solution/RegisterAndLogin/config.d.ts +9 -3
  67. package/dist/solution/RegisterAndLogin/config.js +95 -40
  68. package/dist/solution/RegisterAndLogin/index.js +4 -1
  69. package/dist/solution/ScanOrder/index.d.ts +1 -0
  70. package/dist/solution/ScanOrder/index.js +31 -27
  71. package/dist/solution/ScanOrder/types.d.ts +2 -0
  72. package/dist/solution/ScanOrder/utils.d.ts +1 -0
  73. package/dist/solution/ScanOrder/utils.js +8 -3
  74. package/dist/solution/UnifiedBookingSales/index.d.ts +128 -74
  75. package/dist/solution/UnifiedBookingSales/index.js +3877 -963
  76. package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +49 -0
  77. package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.js +430 -0
  78. package/dist/solution/UnifiedBookingSales/types.d.ts +161 -77
  79. package/dist/solution/UnifiedBookingSales/types.js +4 -9
  80. package/dist/solution/VenueBooking/index.d.ts +3 -0
  81. package/dist/solution/VenueBooking/index.js +549 -497
  82. package/dist/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
  83. package/dist/solution/VenueBooking/utils/dateSummary.js +3 -1
  84. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +2 -0
  85. package/dist/solution/VenueBooking/utils/slotMerge.js +3 -1
  86. package/dist/utils/platform.d.ts +8 -0
  87. package/dist/utils/platform.js +15 -0
  88. package/lib/core/index.d.ts +7 -0
  89. package/lib/core/index.js +20 -2
  90. package/lib/model/strategy/adapter/itemRule/adapter.d.ts +4 -1
  91. package/lib/model/strategy/adapter/itemRule/adapter.js +73 -4
  92. package/lib/model/strategy/adapter/itemRule/evaluator.d.ts +8 -1
  93. package/lib/model/strategy/adapter/itemRule/evaluator.js +23 -1
  94. package/lib/model/strategy/adapter/itemRule/type.d.ts +44 -0
  95. package/lib/model/strategy/adapter/itemRule/type.js +19 -1
  96. package/lib/modules/BookingContext/index.d.ts +3 -0
  97. package/lib/modules/BookingContext/index.js +35 -8
  98. package/lib/modules/BookingContext/types.d.ts +4 -4
  99. package/lib/modules/BookingContext/types.js +3 -3
  100. package/lib/modules/OpenData/types.d.ts +1 -0
  101. package/lib/modules/Order/index.d.ts +18 -3
  102. package/lib/modules/Order/index.js +325 -28
  103. package/lib/modules/Order/salesNotes.d.ts +31 -0
  104. package/lib/modules/Order/salesNotes.js +382 -0
  105. package/lib/modules/Order/types.d.ts +93 -5
  106. package/lib/modules/Order/types.js +4 -0
  107. package/lib/modules/Order/utils.d.ts +12 -0
  108. package/lib/modules/Order/utils.js +85 -16
  109. package/lib/modules/Product/types.d.ts +2 -0
  110. package/lib/modules/ProductList/clientDataVariants.d.ts +50 -0
  111. package/lib/modules/ProductList/clientDataVariants.js +204 -0
  112. package/lib/modules/ProductList/index.d.ts +18 -3
  113. package/lib/modules/ProductList/index.js +137 -8
  114. package/lib/modules/ProductList/types.d.ts +10 -0
  115. package/lib/modules/Quotation/index.d.ts +22 -0
  116. package/lib/modules/Quotation/index.js +158 -11
  117. package/lib/modules/ResourcePlanner/index.d.ts +0 -22
  118. package/lib/modules/ResourcePlanner/index.js +9 -129
  119. package/lib/modules/ResourcePlanner/localClock.d.ts +33 -0
  120. package/lib/modules/ResourcePlanner/localClock.js +205 -0
  121. package/lib/modules/ResourcePlanner/planner.d.ts +5 -14
  122. package/lib/modules/ResourcePlanner/planner.js +1807 -783
  123. package/lib/modules/ResourcePlanner/types.d.ts +359 -187
  124. package/lib/modules/ResourcePlanner/types.js +13 -1
  125. package/lib/plugins/request.d.ts +1 -0
  126. package/lib/server/index.d.ts +17 -2
  127. package/lib/server/index.js +149 -21
  128. package/lib/server/modules/floor-plan/index.d.ts +4 -0
  129. package/lib/server/modules/floor-plan/index.js +60 -7
  130. package/lib/server/modules/menu/index.js +26 -4
  131. package/lib/server/modules/order/index.d.ts +17 -7
  132. package/lib/server/modules/order/index.js +194 -57
  133. package/lib/server/modules/products/index.d.ts +10 -4
  134. package/lib/server/modules/products/index.js +93 -23
  135. package/lib/server/modules/resource/index.js +12 -2
  136. package/lib/server/utils/product.d.ts +1 -1
  137. package/lib/server/utils/product.js +163 -3
  138. package/lib/server/utils/small-ticket.d.ts +9 -1
  139. package/lib/server/utils/small-ticket.js +123 -79
  140. package/lib/solution/BaseSales/index.d.ts +26 -3
  141. package/lib/solution/BaseSales/index.js +396 -70
  142. package/lib/solution/BaseSales/types.d.ts +2 -0
  143. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +3 -0
  144. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +9 -2
  145. package/lib/solution/BaseSales/utils.js +3 -0
  146. package/lib/solution/BookingByStep/index.d.ts +4 -4
  147. package/lib/solution/BookingTicket/index.d.ts +1 -1
  148. package/lib/solution/BookingTicket/index.js +2 -1
  149. package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +2 -1
  150. package/lib/solution/BookingTicket/utils/addProductDecision.js +5 -2
  151. package/lib/solution/BookingTicket/utils/orderCustomer.js +2 -1
  152. package/lib/solution/RegisterAndLogin/config.d.ts +9 -3
  153. package/lib/solution/RegisterAndLogin/config.js +49 -8
  154. package/lib/solution/RegisterAndLogin/index.js +4 -1
  155. package/lib/solution/ScanOrder/index.d.ts +1 -0
  156. package/lib/solution/ScanOrder/index.js +5 -1
  157. package/lib/solution/ScanOrder/types.d.ts +2 -0
  158. package/lib/solution/ScanOrder/utils.d.ts +1 -0
  159. package/lib/solution/ScanOrder/utils.js +4 -0
  160. package/lib/solution/UnifiedBookingSales/index.d.ts +128 -74
  161. package/lib/solution/UnifiedBookingSales/index.js +2592 -424
  162. package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +49 -0
  163. package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.js +316 -0
  164. package/lib/solution/UnifiedBookingSales/types.d.ts +161 -77
  165. package/lib/solution/UnifiedBookingSales/types.js +4 -6
  166. package/lib/solution/VenueBooking/index.d.ts +3 -0
  167. package/lib/solution/VenueBooking/index.js +33 -9
  168. package/lib/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
  169. package/lib/solution/VenueBooking/utils/dateSummary.js +3 -1
  170. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +2 -0
  171. package/lib/solution/VenueBooking/utils/slotMerge.js +3 -1
  172. package/lib/utils/platform.d.ts +8 -0
  173. package/lib/utils/platform.js +22 -0
  174. package/package.json +1 -1
@@ -257,6 +257,9 @@ function normalizeOrderProduct(product) {
257
257
  product_id: product.product_id,
258
258
  num: getSafeProductNum(product.num),
259
259
  product_variant_id: product.product_variant_id,
260
+ ...(product.production_code !== undefined && product.production_code !== null ? {
261
+ production_code: String(product.production_code).trim()
262
+ } : {}),
260
263
  product_sku: productSku,
261
264
  selling_price: composedSellingPrice,
262
265
  original_price: finalOriginalPrice,
@@ -67,7 +67,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
67
67
  product_ids?: number[];
68
68
  collection?: number | string[];
69
69
  schedule_date?: string;
70
- }): Promise<any>;
70
+ }): Promise<ProductData[]>;
71
71
  /**
72
72
  * 通过 schedule 来读取商品,适用于 session 类商品
73
73
  *
@@ -87,7 +87,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
87
87
  date: string;
88
88
  product_ids?: number[];
89
89
  category_ids?: number[];
90
- }): Promise<any>;
90
+ }): Promise<ProductData[]>;
91
91
  /**
92
92
  * 更新完商品数据、切换日期、或者在较后的流程里登录了,检测当前购物车里是否有商品,如果有,则需要更新购物车里的商品价格
93
93
  *
@@ -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 | 1 | 2 | 5 | 4 | 3 | 6;
329
+ weekNum: 0 | 5 | 3 | 1 | 2 | 4 | 6;
330
330
  }[]>;
331
331
  submitTimeSlot(timeSlots: TimeSliceItem): void;
332
332
  private getScheduleDataByIds;
@@ -345,7 +345,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
345
345
  count: number;
346
346
  left: number;
347
347
  summaryCount: number;
348
- status: "lots_of_space" | "filling_up_fast" | "sold_out";
348
+ status: "sold_out" | "lots_of_space" | "filling_up_fast";
349
349
  }[];
350
350
  /**
351
351
  * 找到多个资源的公共可用时间段
@@ -128,7 +128,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
128
128
  loadProducts(params?: ILoadProductsParams, options?: {
129
129
  callback?: (result: any) => void;
130
130
  subscriberId?: string;
131
- }): Promise<any>;
131
+ }): Promise<ProductData[]>;
132
132
  /**
133
133
  * 获取加时商品列表。
134
134
  *
@@ -1475,7 +1475,8 @@ class BookingTicketImpl extends _BaseSales.BaseSalesImpl {
1475
1475
  date,
1476
1476
  presetStartTime: extra?.presetStartTime ?? (0, _BookingContext.derivePresetStartTimeFromDate)(date),
1477
1477
  customerId: orderCustomerId,
1478
- ...(extra || {})
1478
+ ...(extra || {}),
1479
+ channel: this.getSubmitOrderSalesChannel()
1479
1480
  };
1480
1481
  }
1481
1482
 
@@ -5,7 +5,7 @@ import type { OrderProduct, OrderProductIdentity, AddProductBookingInput } from
5
5
  * cart.addProduct 两阶段决策(与 ticketBooking `handleSelectProduct` 对齐):
6
6
  *
7
7
  * 1. `requiresDetail`:规格 / SKU / 套餐 / Session / 称重弹窗(门禁:`isOpenDetailModal` / `cartDetailValue` / `open_sold_weight`)
8
- * 2. `requiresBookingEdit`:资源 / 时间编辑抽屉(门禁:`getIsAutoClose` on prepared cacheItem)
8
+ * 2. `requiresBookingEdit`:资源 / 时间编辑抽屉(kiosk 强制进入;其他渠道由 `getIsAutoClose` 决定)
9
9
  * 3. `add`:两关均通过,直接 transform + 加车
10
10
  */
11
11
  export type AddProductDecision = {
@@ -65,6 +65,7 @@ export interface AddProductDecideContext extends BookingCalcContext {
65
65
  type?: 'select' | 'detail';
66
66
  quantity?: number;
67
67
  customerId?: number | string;
68
+ channel?: string;
68
69
  }
69
70
  /**
70
71
  * 统一补齐预约商品的运行态字段。
@@ -22,7 +22,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
22
22
  * cart.addProduct 两阶段决策(与 ticketBooking `handleSelectProduct` 对齐):
23
23
  *
24
24
  * 1. `requiresDetail`:规格 / SKU / 套餐 / Session / 称重弹窗(门禁:`isOpenDetailModal` / `cartDetailValue` / `open_sold_weight`)
25
- * 2. `requiresBookingEdit`:资源 / 时间编辑抽屉(门禁:`getIsAutoClose` on prepared cacheItem)
25
+ * 2. `requiresBookingEdit`:资源 / 时间编辑抽屉(kiosk 强制进入;其他渠道由 `getIsAutoClose` 决定)
26
26
  * 3. `add`:两关均通过,直接 transform + 加车
27
27
  */
28
28
 
@@ -39,10 +39,11 @@ function needsSpecDetailModal(item) {
39
39
  }
40
40
 
41
41
  /**
42
- * 第二段:预约商品是否仍需打开资源 / 时间编辑(与 info2 `cacheItem.autoClose` 等价)。
42
+ * 第二段:预约商品是否仍需打开资源 / 时间编辑(kiosk 强制打开,其他渠道与 info2 `cacheItem.autoClose` 等价)。
43
43
  */
44
44
  function needsBookingEdit(cacheItem, ctx) {
45
45
  if (isNormalBookingProduct(cacheItem)) return false;
46
+ if (ctx?.channel === 'kiosk') return true;
46
47
  const isAutoAllocationOn = ctx?.isAutoAllocationOn || (() => true);
47
48
  return !(0, _BookingContext.getIsAutoClose)(cacheItem, isAutoAllocationOn);
48
49
  }
@@ -335,6 +336,8 @@ function buildBasePayloadFromCacheItem(cacheItem, ctx) {
335
336
  id: cacheItem?.id ?? cacheItem?.product_id,
336
337
  product_id: resolvedPid,
337
338
  variant_id: other?.product_variant_id ?? other?.variant_id ?? 0,
339
+ // SKUOptionsSelection 已按 Product / Variant 解析好主商品编码;显式空串也需保留。
340
+ production_code: other?.production_code ?? cacheItem?.production_code,
338
341
  quantity,
339
342
  // 规格弹窗本次选择是 option 权威源,避免目录/旧订单里的空 option 覆盖它。
340
343
  product_sku: productSku ? {
@@ -23,7 +23,8 @@ function resolveCustomerDisplayName(customer) {
23
23
 
24
24
  /** 将 ICustomer 格式化为写入 tempOrder 的协议字段。 */
25
25
  function formatOrderCustomerPatch(customer) {
26
- const rawId = customer.id;
26
+ const c = customer;
27
+ const rawId = c.customer_id ?? c.customerId ?? customer.id;
27
28
  const numericId = typeof rawId === 'number' ? rawId : rawId !== undefined && rawId !== null && rawId !== '' ? Number(rawId) : null;
28
29
  return {
29
30
  customer_id: Number.isFinite(numericId) ? numericId : null,
@@ -10,7 +10,11 @@ export interface ApiConfig {
10
10
  method: 'GET' | 'POST' | 'PUT' | 'DELETE';
11
11
  transformParams?: (params: any) => any;
12
12
  transformResponse?: (response: any) => any;
13
- options?: Record<string, any>;
13
+ options?: Record<string, any> | ((params: any) => Record<string, any>);
14
+ }
15
+ export interface ApiCallerOptions {
16
+ baseUrl?: string;
17
+ shopDomain?: string;
14
18
  }
15
19
  /**
16
20
  * 渠道配置接口
@@ -65,12 +69,14 @@ export declare function getChannelConfig(channel: string): ChannelConfig;
65
69
  export declare class ApiCaller {
66
70
  private request;
67
71
  private config;
72
+ private options;
68
73
  constructor(request: {
69
74
  get: <T = any>(url: string, data?: any, options?: any) => Promise<T>;
70
75
  post: <T = any>(url: string, data?: any, options?: any) => Promise<T>;
71
76
  put: <T = any>(url: string, data?: any, options?: any) => Promise<T>;
72
77
  delete: <T = any>(url: string, options?: any) => Promise<T>;
73
- }, config: ChannelConfig);
78
+ }, config: ChannelConfig, options?: ApiCallerOptions);
79
+ private resolveUrl;
74
80
  /**
75
81
  * 执行 API 调用
76
82
  */
@@ -84,4 +90,4 @@ export declare function createApiCaller(request: {
84
90
  post: <T = any>(url: string, data?: any, options?: any) => Promise<T>;
85
91
  put: <T = any>(url: string, data?: any, options?: any) => Promise<T>;
86
92
  delete: <T = any>(url: string, options?: any) => Promise<T>;
87
- }, channel: string): ApiCaller;
93
+ }, channel: string, options?: ApiCallerOptions): ApiCaller;
@@ -15,6 +15,8 @@ exports.getChannelConfig = getChannelConfig;
15
15
  * API 配置接口
16
16
  */
17
17
 
18
+ const h5CustomerAuthApiNames = new Set(['sendEmailVerificationCode', 'sendEmailLoginCode', 'sendSmsRegisterCode', 'sendEmailRegisterLink', 'verifyEmailRegistrationLink', 'emailPasswordLogin', 'emailCodeRegister', 'phoneCodeRegister', 'resendEmailRegisterLink', 'checkEmailLinkCode', 'sendSmsLoginCode', 'phoneCodeLogin', 'guestLogin', 'checkEmailExists', 'checkEmailCode', 'checkMobileCode', 'phonePasswordLogin', 'sendPasswordResetEmail', 'sendPasswordResetSms', 'sendResetPasswordLink', 'checkResetPasswordCode', 'resetPasswordByCode', 'resetPasswordByEmail', 'resetPasswordByPhone', 'verifyCode', 'register', 'login', 'oauthLogin', 'facebookLogin', 'appleLogin']);
19
+
18
20
  /**
19
21
  * 渠道配置接口
20
22
  */
@@ -278,6 +280,31 @@ const onlineStoreConfig = {
278
280
  })
279
281
  }
280
282
  };
283
+ function withH5AuthPrefix(config) {
284
+ const nextConfig = {};
285
+ Object.entries(config).forEach(([key, apiConfig]) => {
286
+ if (!apiConfig.url.startsWith('/auth/')) {
287
+ nextConfig[key] = apiConfig;
288
+ return;
289
+ }
290
+ nextConfig[key] = {
291
+ ...apiConfig,
292
+ url: apiConfig.url.startsWith('/h5/') ? apiConfig.url : `/h5${apiConfig.url}`,
293
+ options: params => {
294
+ const {
295
+ withCredentials,
296
+ ...baseOptions
297
+ } = (typeof apiConfig.options === 'function' ? apiConfig.options(params) : apiConfig.options) || {};
298
+ return {
299
+ ...baseOptions,
300
+ prefix: false
301
+ };
302
+ }
303
+ };
304
+ });
305
+ return nextConfig;
306
+ }
307
+ const h5OnlineStoreConfig = withH5AuthPrefix(onlineStoreConfig);
281
308
 
282
309
  /**
283
310
  * 默认配置(通用配置)
@@ -1066,6 +1093,7 @@ const shopWebposConfig = {
1066
1093
  */
1067
1094
  const channelConfigMap = exports.channelConfigMap = {
1068
1095
  'online-store': onlineStoreConfig,
1096
+ 'online-store-h5': h5OnlineStoreConfig,
1069
1097
  'default': defaultConfig,
1070
1098
  'webpos': webposConfig,
1071
1099
  'shop.webpos': shopWebposConfig
@@ -1083,9 +1111,16 @@ function getChannelConfig(channel) {
1083
1111
  * 负责根据配置执行 API 调用
1084
1112
  */
1085
1113
  class ApiCaller {
1086
- constructor(request, config) {
1114
+ constructor(request, config, options = {}) {
1087
1115
  this.request = request;
1088
1116
  this.config = config;
1117
+ this.options = options;
1118
+ }
1119
+ resolveUrl(url) {
1120
+ if (!this.options.baseUrl || !url.startsWith('/h5/auth/')) {
1121
+ return url;
1122
+ }
1123
+ return `${this.options.baseUrl.replace(/\/$/, '')}${url}`;
1089
1124
  }
1090
1125
 
1091
1126
  /**
@@ -1111,6 +1146,12 @@ class ApiCaller {
1111
1146
  ...options,
1112
1147
  ...additionalOptions
1113
1148
  };
1149
+ if (apiConfig.url.startsWith('/h5/auth/') && h5CustomerAuthApiNames.has(apiName)) {
1150
+ requestOptions.h5CustomerAuth = true;
1151
+ if (this.options.shopDomain) {
1152
+ requestOptions.h5AuthShopDomain = this.options.shopDomain;
1153
+ }
1154
+ }
1114
1155
 
1115
1156
  // 处理动态 headers
1116
1157
  if (requestOptions.headers && typeof requestOptions.headers === 'function') {
@@ -1123,19 +1164,19 @@ class ApiCaller {
1123
1164
  switch (apiConfig.method) {
1124
1165
  case 'GET':
1125
1166
  if (transformedParams && Object.keys(transformedParams).length > 0) {
1126
- response = await this.request.get(apiConfig.url, transformedParams, requestOptions);
1167
+ response = await this.request.get(this.resolveUrl(apiConfig.url), transformedParams, requestOptions);
1127
1168
  } else {
1128
- response = await this.request.get(apiConfig.url, undefined, requestOptions);
1169
+ response = await this.request.get(this.resolveUrl(apiConfig.url), undefined, requestOptions);
1129
1170
  }
1130
1171
  break;
1131
1172
  case 'POST':
1132
- response = await this.request.post(apiConfig.url, transformedParams, requestOptions);
1173
+ response = await this.request.post(this.resolveUrl(apiConfig.url), transformedParams, requestOptions);
1133
1174
  break;
1134
1175
  case 'PUT':
1135
- response = await this.request.put(apiConfig.url, transformedParams, requestOptions);
1176
+ response = await this.request.put(this.resolveUrl(apiConfig.url), transformedParams, requestOptions);
1136
1177
  break;
1137
1178
  case 'DELETE':
1138
- response = await this.request.delete(apiConfig.url, requestOptions);
1179
+ response = await this.request.delete(this.resolveUrl(apiConfig.url), requestOptions);
1139
1180
  break;
1140
1181
  default:
1141
1182
  throw new Error(`不支持的 HTTP 方法: ${apiConfig.method}`);
@@ -1150,7 +1191,7 @@ class ApiCaller {
1150
1191
  * 创建 API 调用器
1151
1192
  */
1152
1193
  exports.ApiCaller = ApiCaller;
1153
- function createApiCaller(request, channel) {
1194
+ function createApiCaller(request, channel, options) {
1154
1195
  const config = getChannelConfig(channel);
1155
- return new ApiCaller(request, config);
1196
+ return new ApiCaller(request, config, options);
1156
1197
  }
@@ -227,7 +227,10 @@ class RegisterAndLoginImpl extends _BaseModule.BaseModule {
227
227
  }
228
228
 
229
229
  // 创建 API 调用器
230
- this.apiCaller = (0, _config.createApiCaller)(this.request, this.channel);
230
+ this.apiCaller = (0, _config.createApiCaller)(this.request, this.channel, {
231
+ baseUrl: this.otherParams.h5AuthBaseUrl,
232
+ shopDomain: this.otherParams.h5AuthShopDomain
233
+ });
231
234
 
232
235
  // 尝试从本地存储恢复登录状态
233
236
  await this.restoreLoginState();
@@ -13,6 +13,7 @@ interface ScanOrderItemRuleRuntimeConfig {
13
13
  pax?: Partial<PaxInfo>;
14
14
  historicalItems?: CartItemSummary[];
15
15
  serviceType?: string;
16
+ channel?: string;
16
17
  submissionIndex?: number;
17
18
  custom?: Record<string, any>;
18
19
  }
@@ -1200,7 +1200,11 @@ class ScanOrderImpl extends _BaseSales.BaseSalesImpl {
1200
1200
  return sourceMap;
1201
1201
  }
1202
1202
  getItemRuleRuntimeConfig() {
1203
- return this.itemRuleRuntimeConfig || {};
1203
+ const runtimeConfig = this.itemRuleRuntimeConfig || {};
1204
+ return {
1205
+ ...runtimeConfig,
1206
+ channel: runtimeConfig.channel ?? runtimeConfig.custom?.channel ?? this.otherParams?.channel
1207
+ };
1204
1208
  }
1205
1209
  async ensureItemRuleConfigsLoaded() {
1206
1210
  if (this.itemRuleConfigs.length > 0) return this.itemRuleConfigs;
@@ -44,6 +44,8 @@ export interface ScanOrderProductSku {
44
44
  export interface ScanOrderOrderProduct extends ScanOrderOrderProductIdentity {
45
45
  order_detail_id: number | null;
46
46
  num: number;
47
+ /** Product 或当前 Variant 的生产编码 */
48
+ production_code?: string;
47
49
  product_sku: ScanOrderProductSku;
48
50
  /**
49
51
  * 券后 **行 composite 单价** = `metadata.main_product_selling_price`
@@ -78,6 +78,7 @@ export declare function buildItemRuleBusinessData(params: {
78
78
  pax?: Partial<PaxInfo>;
79
79
  historicalItems?: CartItemSummary[];
80
80
  serviceType?: string;
81
+ channel?: string;
81
82
  submissionIndex?: number;
82
83
  custom?: Record<string, any>;
83
84
  };
@@ -333,6 +333,7 @@ function buildItemRuleBusinessData(params) {
333
333
  cartItems,
334
334
  historicalItems,
335
335
  serviceType: runtimeConfig.serviceType || 'dine-in',
336
+ channel: runtimeConfig.channel ?? runtimeConfig.custom?.channel,
336
337
  submissionIndex: typeof runtimeConfig.submissionIndex === 'number' ? toNonNegativeInt(runtimeConfig.submissionIndex) : tempOrder.order_id ? 1 : 0,
337
338
  custom: runtimeConfig.custom || {},
338
339
  strategyConfigs: itemRuleConfigs
@@ -633,6 +634,9 @@ function normalizeOrderProduct(product) {
633
634
  product_id: product.product_id,
634
635
  num: getSafeProductNum(product.num),
635
636
  product_variant_id: product.product_variant_id,
637
+ ...(product.production_code !== undefined && product.production_code !== null ? {
638
+ production_code: String(product.production_code).trim()
639
+ } : {}),
636
640
  product_sku: productSku,
637
641
  selling_price: composedSellingPrice,
638
642
  original_price: manualOriginalPrice,
@@ -1,12 +1,14 @@
1
- import type { Module } from '../../types';
1
+ import type { Module, ModuleOptions, PisellCore } from '../../types';
2
2
  import type { ProductData } from '../../modules';
3
3
  import type { OpenDataConfig } from '../../modules/OpenData';
4
4
  import type { LoadScheduleAvailableDateParams, ScheduleItem } from '../../modules/Schedule/types';
5
- import type { ProductListLoadProductsParams } from '../../modules/ProductList';
6
- import type { ResourcePlannerAssignment, ResourcePlannerAssignableSlotResult, ResourcePlannerEvent, ResourcePlannerProduct, ResourcePlannerProjection, ResourcePlannerQuery, ResourcePlannerResource, ResourcePlannerSelectionPatch, ResourcePlannerSnapshot, ResourcePlannerValidationResult } from '../../modules/ResourcePlanner';
7
- import type { UnifiedBookingSalesCommitPlannerSelectionParams, UnifiedBookingSalesCommitResult, UnifiedBookingSalesAddRetailProductParams, UnifiedBookingSalesApplyPlannerDiscountsParams, UnifiedBookingSalesDiscountResult, UnifiedBookingSalesLoadProductsByScheduleDateParams, UnifiedBookingSalesLoadPlannerContextParams, UnifiedBookingSalesLoadOpenDataParams, UnifiedBookingSalesStagePlannerProductsParams, UnifiedBookingSalesStageRetailProductsParams, UnifiedBookingSalesState } from './types';
5
+ import type { ProductListLoadProductsParams, ProductListStoreQueryParams } from '../../modules/ProductList';
6
+ import type { AvailabilityDateRange, AvailabilityOccupancy, AvailabilityProduct, AvailabilityResource, GetProductTimeRangesRequest } from '../../modules/ResourcePlanner';
7
+ import type { AvailabilityContextRef, ContextualAvailabilityQuery, ContextualAvailabilityQueryResult, ContextualCommitAvailabilitySelectionParams, ContextualProductTimeRangeGroup, UnifiedBookingSalesAddRetailProductParams, UnifiedBookingSalesApplyPlannerDiscountsParams, UnifiedBookingSalesCommitAvailabilitySelectionResult, UnifiedBookingSalesDiscountResult, UnifiedBookingSalesLoadProductsByScheduleDateParams, UnifiedBookingSalesLoadOpenDataParams, UnifiedBookingSalesPrepareAvailabilityProjectionParams, UnifiedBookingSalesPolicyResponse, UnifiedBookingSalesResolveProductAllergyRequirementParams, UnifiedBookingSalesStageRetailProductsParams, UnifiedBookingSalesState } from './types';
8
8
  import { BookingTicket } from '../BookingTicket';
9
+ import type { AllergyRequirement } from '../../model/strategy/adapter/itemRule';
9
10
  export * from './types';
11
+ export { AvailabilityError } from '../../modules/ResourcePlanner';
10
12
  /**
11
13
  * Converts Rules/Order discount internals into a small UI-facing diagnostic. The result keeps
12
14
  * candidate-card state separate from line-level applications: a selected card is not proof that
@@ -22,39 +24,37 @@ export declare function buildPlannerDiscountResult(params: {
22
24
  preferredDiscountId?: number | string;
23
25
  preferredDiscountFound?: boolean;
24
26
  }): UnifiedBookingSalesDiscountResult;
25
- /** Converts a ProductList record into the pure input shape consumed by ResourcePlanner. */
26
- export declare function normalizeProductForPlanner(product: ProductData | Record<string, any>): ResourcePlannerProduct;
27
+ /** Converts ProductList and schedule records into the pure Availability vocabulary. */
28
+ export declare function normalizeProductForAvailability(product: ProductData | Record<string, any>, scheduleList?: ScheduleItem[], fixedOffsetMinutes?: number): AvailabilityProduct;
27
29
  /**
28
30
  * Materializes resource work windows locally from v2's schedule ids, then keeps its flat
29
- * event_list as planner events. This deliberately avoids the older API's times -> event_list
31
+ * event_list as resource occupancy records. This deliberately avoids the older API's times -> event_list
30
32
  * response nesting and lets one resource response serve any requested date range.
31
33
  */
32
- export declare function buildPlannerResourcesFromV2(params: {
34
+ export declare function buildAvailabilityResourcesFromV2(params: {
33
35
  rawResources: Record<string, any>[];
34
36
  scheduleList: ScheduleItem[];
35
- dateRange?: ResourcePlannerQuery['dateRange'];
37
+ dateRange?: AvailabilityDateRange;
38
+ fixedOffsetMinutes?: number;
36
39
  }): {
37
- resources: ResourcePlannerResource[];
38
- externalEvents: ResourcePlannerEvent[];
40
+ resources: AvailabilityResource[];
41
+ resourceOccupancies: AvailabilityOccupancy[];
39
42
  };
40
43
  /** Combines URL-locked resources with every resource referenced by the selected products. */
41
- export declare function collectPlannerResourceIds(products: ResourcePlannerProduct[], explicitResourceIds?: Array<number | string>): Array<number | string>;
42
- /** Convenience wrapper for the usual one-resource booking case. */
43
- export declare function buildBookingFromAssignment(params: {
44
- assignment: ResourcePlannerAssignment;
45
- product: ResourcePlannerProduct;
44
+ export declare function collectAvailabilityResourceIds(products: AvailabilityProduct[], explicitResourceIds?: Array<number | string>): Array<number | string>;
45
+ export declare function buildAvailabilityLineIdentity(product: Record<string, any>): Record<string, any>;
46
+ export declare function buildBookingFromAvailabilityAssignment(params: {
47
+ assignment: Record<string, any>;
48
+ product: AvailabilityProduct;
49
+ timezone?: string;
50
+ fixedOffsetMinutes?: number;
46
51
  }): Record<string, any>;
47
- /**
48
- * Converts all resources needed by one product/time interval into the one booking expected by
49
- * OrderModule. Callers must group assignments before this function so a multi-form booking does
50
- * not become several competing bookings.
51
- */
52
- export declare function buildBookingFromAssignments(params: {
53
- assignments: ResourcePlannerAssignment[];
54
- product: ResourcePlannerProduct;
52
+ export declare function buildBookingFromAvailabilityAssignments(params: {
53
+ assignments: Record<string, any>[];
54
+ product: AvailabilityProduct;
55
+ timezone?: string;
56
+ fixedOffsetMinutes?: number;
55
57
  }): Record<string, any>;
56
- /** Builds the exact identity BaseSales needs to remove only this solution's order lines. */
57
- export declare function buildPlannerLineIdentity(product: Record<string, any>): Record<string, any>;
58
58
  export declare class UnifiedBookingSalesImpl extends BookingTicket {
59
59
  protected defaultName: string;
60
60
  protected defaultVersion: string;
@@ -63,7 +63,55 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
63
63
  private openDataTarget;
64
64
  private loadOpenDataInFlight;
65
65
  private loadOpenDataInFlightTarget;
66
+ private availabilityRuntimeOffsetMinutes;
67
+ private availabilityScheduleCatalog;
68
+ private availabilityProjectionSequence;
69
+ private availabilityContextSequence;
70
+ private availabilityLifecycleGeneration;
71
+ private availabilityContextRegistry;
72
+ private availabilityProjectionPool;
73
+ private availabilityPrepareInFlight;
74
+ private availabilityProjectionRefreshInFlight;
75
+ private availabilityRemoteOccupancyCache;
76
+ private availabilityRemoteResourceQueryInFlight;
77
+ private availabilityRemoteResourceQuerySequence;
78
+ private availabilityRemoteResourceEpoch;
79
+ private availabilityCommitLocks;
80
+ private allergyItemRuleEvaluator;
81
+ private allergyItemRuleConfigs;
82
+ private allergyItemRuleConfigsPromise;
83
+ initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
66
84
  protected getSubmitOrderSalesChannel(): string;
85
+ private createAvailabilityFacadeError;
86
+ private getAvailabilityScopeDescriptor;
87
+ private normalizeAvailabilityIdList;
88
+ private normalizeAvailabilityStringList;
89
+ private normalizeAvailabilityPrepareDescriptor;
90
+ private resolveAvailabilityPrepareDefaults;
91
+ private buildAvailabilityPrepareKey;
92
+ private clearAvailabilityRemoteResourceState;
93
+ private buildAvailabilityRemoteResourceScopeKey;
94
+ private buildAvailabilityRemoteResourceQueryKey;
95
+ setOtherParams(params: Record<string, any>, { cover }?: {
96
+ cover?: boolean;
97
+ }): Promise<void>;
98
+ destroy(): Promise<void>;
99
+ private createAvailabilityContextId;
100
+ private buildAvailabilityProjectionKey;
101
+ private getAvailabilityRuntimeOffsetMinutes;
102
+ private getAvailabilityRuntimeDateTime;
103
+ private cloneAvailabilityPrepareParams;
104
+ private getAvailabilityDurationCandidateAnchorAt;
105
+ private createAvailabilityContextRef;
106
+ private emitAvailabilityDiagnostic;
107
+ private touchAvailabilityContext;
108
+ private touchAvailabilityProjection;
109
+ private removeAvailabilityProjection;
110
+ private removeAvailabilityContext;
111
+ private evictAvailabilityProjectionPool;
112
+ private evictAvailabilityContextRegistry;
113
+ private invalidateAvailabilityContextsAfterCommit;
114
+ private resetAvailabilityProjectionState;
67
115
  protected isSessionStoragePersistEnabled(): boolean;
68
116
  protected shouldUseSessionStorageForSubModule(moduleName?: string): boolean;
69
117
  /**
@@ -103,6 +151,18 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
103
151
  */
104
152
  loadOpenData(params: UnifiedBookingSalesLoadOpenDataParams): Promise<OpenDataConfig>;
105
153
  getOpenData(): Promise<OpenDataConfig | null>;
154
+ private resetAllergyItemRuleState;
155
+ private fetchAllergyItemRuleConfigs;
156
+ private ensureAllergyItemRuleConfigsLoaded;
157
+ /**
158
+ * 评估当前渠道与商品是否命中 ALLERGY_CHECK。
159
+ * 只返回优先级最高 Action 中当前商品 Target 的 dataSource,不跨商品或 Action 合并。
160
+ */
161
+ resolveProductAllergyRequirement(params: UnifiedBookingSalesResolveProductAllergyRequirementParams): Promise<AllergyRequirement | null>;
162
+ /**
163
+ * Load a resource policy without depending on the legacy appointmentBooking solution.
164
+ */
165
+ getProtocol(policyId: string | number): Promise<UnifiedBookingSalesPolicyResponse>;
106
166
  /**
107
167
  * Loads the product catalog used by both UI and Planner. Schedule data is requested with each
108
168
  * product because session products carry their fixed intervals there.
@@ -111,6 +171,7 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
111
171
  callback?: (result: any) => void;
112
172
  subscriberId?: string;
113
173
  }): Promise<ProductData[]>;
174
+ queryProducts(params?: ProductListStoreQueryParams): Promise<ProductData[]>;
114
175
  /** Date-first entry point. It delegates protocol details and cache ownership to ScheduleModule. */
115
176
  loadScheduleAvailableDate(params: LoadScheduleAvailableDateParams): Promise<import("../../modules/Date/types").ITime[]>;
116
177
  /**
@@ -133,17 +194,10 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
133
194
  * diagnostic boundary for new booking skins: no pricing logic is duplicated in the planner.
134
195
  */
135
196
  applyPlannerDiscounts(params?: UnifiedBookingSalesApplyPlannerDiscountsParams): Promise<UnifiedBookingSalesDiscountResult>;
136
- /** ResourcePlanner is a required child module; fail early instead of producing partial availability. */
137
- private getPlanner;
138
197
  private buildUnifiedOrderProduct;
139
198
  /** Replacing a staged selection is idempotent and never removes unrelated cart lines. */
140
199
  private removeExistingStagedLines;
141
200
  private stageProducts;
142
- /**
143
- * Adds the current product choice to an otherwise clean planner cart without creating bookings.
144
- * This separates "what the customer wants" from the later time/resource confirmation step.
145
- */
146
- stagePlannerProducts(params: UnifiedBookingSalesStagePlannerProductsParams): Promise<Record<string, any> | null>;
147
201
  /**
148
202
  * Adds ordinary retail products without asking ResourcePlanner for booking facts.
149
203
  * Its staged lines have separate ownership so planner and retail skins can coexist safely.
@@ -155,50 +209,50 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
155
209
  * "replace the staged selection" for demo and wizard-like callers.
156
210
  */
157
211
  addRetailProduct(params: UnifiedBookingSalesAddRetailProductParams): Promise<Record<string, any>[]>;
158
- /** Normalizes caller-provided products or loads the catalog before any resource request is made. */
159
- private loadPlannerProducts;
160
- /** Loads the reusable store-level schedule catalog on demand. */
161
- private ensurePlannerSchedulesLoaded;
162
- /**
163
- * v2 resources reference schedule ids rather than expanded work times. Refresh once when the
164
- * cached schedule catalog cannot materialize all referenced ids.
165
- */
166
- private ensurePlannerSchedulesForResources;
212
+ private normalizeAvailabilityDateRange;
213
+ private assertAvailabilityPrepareParams;
214
+ private captureAvailabilityScheduleCatalog;
215
+ /** Returns the solution-lifetime schedule snapshot captured after initialization. */
216
+ private getAvailabilityScheduleCatalog;
217
+ private buildAvailabilityOperatingHoursSnapshot;
218
+ private loadAvailabilityProducts;
167
219
  /**
168
220
  * Fetches resource metadata plus flat occupied events. Work windows are intentionally derived
169
- * locally in buildPlannerResourcesFromV2 from /schedule, rather than requested from the legacy
221
+ * locally in buildAvailabilityResourcesFromV2 from /schedule, rather than requested from the legacy
170
222
  * resource dates endpoint.
171
223
  */
172
- private fetchPlannerResourcesV2;
173
- /**
174
- * Resolves the Planner context in precedence order: explicit normalized context, test raw data,
175
- * then the v2 resource API inferred from selected product requirements and any URL lock.
176
- */
177
- private loadPlannerResources;
178
- /**
179
- * Boundary between IO and pure planning. Once this returns, all later availability/slot calls
180
- * operate on the ResourcePlanner snapshot and do not issue resource requests themselves.
181
- */
182
- loadPlannerContext(params?: UnifiedBookingSalesLoadPlannerContextParams): Promise<ResourcePlannerSnapshot>;
183
- /** Returns cells, date summaries and a derived grid; cells are continuous ranges, not UI slots. */
184
- queryPlannerAvailability(query?: ResourcePlannerQuery): Promise<ResourcePlannerProjection>;
185
- /** Turns compatible availability ranges into user-selectable intervals and ready-to-commit assignments. */
186
- resolveAssignableSlots(query?: ResourcePlannerQuery): ResourcePlannerAssignableSlotResult;
187
- /** Stores a UI choice only. It is deliberately side-effect free with respect to tempOrder. */
188
- setPlannerSelection(patch: ResourcePlannerSelectionPatch): ResourcePlannerSnapshot;
189
- /**
190
- * Legacy-friendly automatic assignment for already fixed intervals. Duration products without a
191
- * start time intentionally remain unresolved; callers offering a picker should use slots.
192
- */
193
- autoAssignPlanner(query?: ResourcePlannerQuery): Promise<ResourcePlannerSnapshot>;
194
- /** Rechecks remote events, capacity and conflicts among the current selection before committing. */
195
- validatePlannerSelection(): ResourcePlannerValidationResult;
196
- /** Read-only snapshot for UI diagnostics and progressive flow steps. */
197
- getPlannerSnapshot(): ResourcePlannerSnapshot;
198
- /**
199
- * Validates then writes assignments to tempOrder. Real order submission is opt-in so UI callers
200
- * can safely preview the cart; pass submitAfterCommit only after an explicit confirmation.
201
- */
202
- commitPlannerSelection(params?: UnifiedBookingSalesCommitPlannerSelectionParams): Promise<UnifiedBookingSalesCommitResult>;
224
+ private fetchAvailabilityResourcesV2;
225
+ private fetchAndPublishAvailabilityResourcesV2;
226
+ private refreshAvailabilityRemoteResourceQuery;
227
+ private loadAvailabilityResources;
228
+ private resolveEditingOccupancyExclusions;
229
+ private occupancyIsExcluded;
230
+ private collectCartResourceOccupancies;
231
+ private getCurrentOrderRevision;
232
+ private getAvailabilityContextEntry;
233
+ private getAvailabilityProjectionByKey;
234
+ private getActiveAvailabilityProjectionEntry;
235
+ private decorateAvailabilityCandidate;
236
+ private assertAvailabilityCandidateFreshness;
237
+ private assertContextualQueryFreshness;
238
+ private storeAvailabilityProjectionEntry;
239
+ private buildAvailabilityProjectionSnapshot;
240
+ private getSharedPreparedAvailabilitySnapshot;
241
+ private refreshAvailabilityContextProjection;
242
+ private ensureAvailabilityContextProjection;
243
+ private tryAcquireAvailabilityCommitLock;
244
+ private releaseAvailabilityCommitLock;
245
+ /** IO boundary: loads catalog, schedules, resources, occupancies, and registers one context. */
246
+ prepareAvailabilityProjection(params: UnifiedBookingSalesPrepareAvailabilityProjectionParams): Promise<AvailabilityContextRef>;
247
+ /** Candidate calculation over the current context projection and runtime minute. */
248
+ getProductTimeRanges(contextId: string, request?: GetProductTimeRangesRequest): Promise<ContextualProductTimeRangeGroup[]>;
249
+ /** Thin facade: auto-refresh on cart drift, then delegate to the pure projection query. */
250
+ queryBookingAvailability(contextId: string, request: ContextualAvailabilityQuery): Promise<ContextualAvailabilityQueryResult>;
251
+ releaseAvailabilityContext(contextId: string): void;
252
+ private assertAvailabilityCommitWriteCAS;
253
+ private findProductLineByUid;
254
+ private findLinkedBooking;
255
+ /** Revalidates against the latest landed occupancy cache, then mutates exactly one product line. */
256
+ commitAvailabilitySelection(contextId: string, params: ContextualCommitAvailabilitySelectionParams): Promise<UnifiedBookingSalesCommitAvailabilitySelectionResult>;
203
257
  }
204
258
  export declare const UnifiedBookingSales: typeof UnifiedBookingSalesImpl;