@pisell/pisellos 2.2.323 → 2.2.324

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 (195) hide show
  1. package/dist/index.d.ts +1 -0
  2. package/dist/index.js +1 -0
  3. package/dist/inventory/index.d.ts +92 -0
  4. package/dist/inventory/index.js +509 -0
  5. package/dist/modules/BookingContext/index.d.ts +2 -2
  6. package/dist/modules/BookingContext/index.js +55 -25
  7. package/dist/modules/BookingContext/types.d.ts +2 -0
  8. package/dist/modules/BookingContext/utils/calendarBooking.d.ts +15 -0
  9. package/dist/modules/BookingContext/utils/calendarBooking.js +207 -0
  10. package/dist/modules/BookingContext/utils/index.d.ts +1 -0
  11. package/dist/modules/BookingContext/utils/index.js +1 -0
  12. package/dist/modules/BookingContext/utils/productExtend.d.ts +20 -1
  13. package/dist/modules/BookingContext/utils/productExtend.js +122 -29
  14. package/dist/modules/Date/index.d.ts +1 -1
  15. package/dist/modules/Date/index.js +60 -14
  16. package/dist/modules/Date/types.d.ts +5 -0
  17. package/dist/modules/Discount/index.js +1 -0
  18. package/dist/modules/OpenData/index.d.ts +1 -0
  19. package/dist/modules/OpenData/index.js +1 -0
  20. package/dist/modules/OpenData/salesSettings.d.ts +32 -0
  21. package/dist/modules/OpenData/salesSettings.js +80 -0
  22. package/dist/modules/OpenData/types.d.ts +16 -0
  23. package/dist/modules/OpenData/utils.d.ts +1 -1
  24. package/dist/modules/OpenData/utils.js +3 -2
  25. package/dist/modules/Order/index.d.ts +54 -11
  26. package/dist/modules/Order/index.js +2699 -1411
  27. package/dist/modules/Order/types.d.ts +43 -5
  28. package/dist/modules/Order/types.js +4 -0
  29. package/dist/modules/Order/unpaidAmountGap.d.ts +6 -0
  30. package/dist/modules/Order/unpaidAmountGap.js +72 -0
  31. package/dist/modules/Order/utils/discountProductLineIdentity.js +2 -2
  32. package/dist/modules/Order/utils/productVoucherGroups.d.ts +15 -0
  33. package/dist/modules/Order/utils/productVoucherGroups.js +115 -0
  34. package/dist/modules/Order/utils.d.ts +3 -1
  35. package/dist/modules/Order/utils.js +6 -2
  36. package/dist/modules/ProductList/clientDataVariants.js +6 -2
  37. package/dist/modules/ProductList/index.d.ts +2 -0
  38. package/dist/modules/ProductList/index.js +161 -51
  39. package/dist/modules/ResourcePlanner/planner.js +58 -2
  40. package/dist/modules/ResourcePlanner/types.d.ts +13 -0
  41. package/dist/modules/Rules/index.d.ts +2 -0
  42. package/dist/modules/Rules/index.js +58 -39
  43. package/dist/modules/Schedule/index.d.ts +7 -1
  44. package/dist/modules/Schedule/index.js +155 -39
  45. package/dist/modules/Schedule/types.d.ts +2 -0
  46. package/dist/modules/bookingReadValidation.d.ts +6 -0
  47. package/dist/modules/bookingReadValidation.js +72 -0
  48. package/dist/plugins/request.d.ts +2 -0
  49. package/dist/server/index.d.ts +5 -0
  50. package/dist/server/index.js +1312 -1154
  51. package/dist/server/modules/order/index.js +2 -1
  52. package/dist/shared/receipt/customerInvoiceLanguages.d.ts +1 -1
  53. package/dist/shared/receipt/customerInvoiceLanguages.js +5 -3
  54. package/dist/shared/receipt/small-ticket.d.ts +4 -0
  55. package/dist/shared/receipt/small-ticket.js +70 -12
  56. package/dist/solution/BaseSales/index.d.ts +39 -5
  57. package/dist/solution/BaseSales/index.js +1828 -1462
  58. package/dist/solution/BaseSales/types.d.ts +1 -0
  59. package/dist/solution/BaseSales/types.js +1 -0
  60. package/dist/solution/BookingByStep/index.d.ts +17 -3
  61. package/dist/solution/BookingByStep/index.js +676 -361
  62. package/dist/solution/BookingByStep/utils/resources.d.ts +10 -0
  63. package/dist/solution/BookingByStep/utils/resources.js +117 -76
  64. package/dist/solution/BookingTicket/index.d.ts +15 -3
  65. package/dist/solution/BookingTicket/index.js +249 -135
  66. package/dist/solution/BookingTicket/types.d.ts +14 -2
  67. package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +3 -1
  68. package/dist/solution/BookingTicket/utils/addProductDecision.js +39 -11
  69. package/dist/solution/BookingTicket/utils/resolveUniqueCartDetail.d.ts +8 -0
  70. package/dist/solution/BookingTicket/utils/resolveUniqueCartDetail.js +188 -0
  71. package/dist/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.d.ts +8 -0
  72. package/dist/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.js +88 -0
  73. package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +1 -0
  74. package/dist/solution/BookingTicket/utils/scan/handleScan.js +2 -1
  75. package/dist/solution/OrderInvoicePreview/index.js +14 -8
  76. package/dist/solution/ScanOrder/index.d.ts +2 -0
  77. package/dist/solution/ScanOrder/index.js +166 -67
  78. package/dist/solution/ScanOrder/menuAvailability.d.ts +24 -0
  79. package/dist/solution/ScanOrder/menuAvailability.js +363 -0
  80. package/dist/solution/UnifiedBookingSales/catalogQueryBatch.d.ts +21 -0
  81. package/dist/solution/UnifiedBookingSales/catalogQueryBatch.js +202 -0
  82. package/dist/solution/UnifiedBookingSales/index.d.ts +96 -4
  83. package/dist/solution/UnifiedBookingSales/index.js +3374 -1177
  84. package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +2 -0
  85. package/dist/solution/UnifiedBookingSales/remoteOccupancyCache.js +4 -0
  86. package/dist/solution/UnifiedBookingSales/salesSettings.d.ts +16 -0
  87. package/dist/solution/UnifiedBookingSales/salesSettings.js +81 -0
  88. package/dist/solution/UnifiedBookingSales/sessionResourceCache.d.ts +27 -0
  89. package/dist/solution/UnifiedBookingSales/sessionResourceCache.js +271 -0
  90. package/dist/solution/UnifiedBookingSales/types.d.ts +71 -2
  91. package/dist/solution/UnifiedBookingSales/types.js +7 -1
  92. package/dist/solution/UnifiedBookingSales/venueCatalogSession.d.ts +32 -0
  93. package/dist/solution/UnifiedBookingSales/venueCatalogSession.js +283 -0
  94. package/dist/utils/platform.d.ts +2 -0
  95. package/dist/utils/platform.js +6 -0
  96. package/dist/utils/pos-receipt-auto-print.d.ts +4 -0
  97. package/dist/utils/pos-receipt-auto-print.js +14 -0
  98. package/lib/index.d.ts +1 -0
  99. package/lib/index.js +12 -0
  100. package/lib/inventory/index.d.ts +92 -0
  101. package/lib/inventory/index.js +287 -0
  102. package/lib/modules/BookingContext/index.d.ts +2 -2
  103. package/lib/modules/BookingContext/index.js +42 -10
  104. package/lib/modules/BookingContext/types.d.ts +2 -0
  105. package/lib/modules/BookingContext/utils/calendarBooking.d.ts +15 -0
  106. package/lib/modules/BookingContext/utils/calendarBooking.js +156 -0
  107. package/lib/modules/BookingContext/utils/index.d.ts +1 -0
  108. package/lib/modules/BookingContext/utils/index.js +11 -0
  109. package/lib/modules/BookingContext/utils/productExtend.d.ts +20 -1
  110. package/lib/modules/BookingContext/utils/productExtend.js +96 -7
  111. package/lib/modules/Date/index.d.ts +1 -1
  112. package/lib/modules/Date/index.js +28 -5
  113. package/lib/modules/Date/types.d.ts +5 -0
  114. package/lib/modules/Discount/index.js +1 -0
  115. package/lib/modules/OpenData/index.d.ts +1 -0
  116. package/lib/modules/OpenData/index.js +12 -0
  117. package/lib/modules/OpenData/salesSettings.d.ts +32 -0
  118. package/lib/modules/OpenData/salesSettings.js +70 -0
  119. package/lib/modules/OpenData/types.d.ts +16 -0
  120. package/lib/modules/OpenData/utils.d.ts +1 -1
  121. package/lib/modules/OpenData/utils.js +3 -2
  122. package/lib/modules/Order/index.d.ts +54 -11
  123. package/lib/modules/Order/index.js +659 -80
  124. package/lib/modules/Order/types.d.ts +43 -5
  125. package/lib/modules/Order/types.js +2 -0
  126. package/lib/modules/Order/unpaidAmountGap.d.ts +6 -0
  127. package/lib/modules/Order/unpaidAmountGap.js +60 -0
  128. package/lib/modules/Order/utils/discountProductLineIdentity.js +1 -1
  129. package/lib/modules/Order/utils/productVoucherGroups.d.ts +15 -0
  130. package/lib/modules/Order/utils/productVoucherGroups.js +64 -0
  131. package/lib/modules/Order/utils.d.ts +3 -1
  132. package/lib/modules/Order/utils.js +6 -2
  133. package/lib/modules/ProductList/clientDataVariants.js +6 -2
  134. package/lib/modules/ProductList/index.d.ts +2 -0
  135. package/lib/modules/ProductList/index.js +74 -0
  136. package/lib/modules/ResourcePlanner/planner.js +52 -1
  137. package/lib/modules/ResourcePlanner/types.d.ts +13 -0
  138. package/lib/modules/Rules/index.d.ts +2 -0
  139. package/lib/modules/Rules/index.js +25 -9
  140. package/lib/modules/Schedule/index.d.ts +7 -1
  141. package/lib/modules/Schedule/index.js +68 -4
  142. package/lib/modules/Schedule/types.d.ts +2 -0
  143. package/lib/modules/bookingReadValidation.d.ts +6 -0
  144. package/lib/modules/bookingReadValidation.js +56 -0
  145. package/lib/plugins/request.d.ts +2 -0
  146. package/lib/server/index.d.ts +5 -0
  147. package/lib/server/index.js +124 -16
  148. package/lib/server/modules/order/index.js +2 -1
  149. package/lib/shared/receipt/customerInvoiceLanguages.d.ts +1 -1
  150. package/lib/shared/receipt/customerInvoiceLanguages.js +5 -3
  151. package/lib/shared/receipt/small-ticket.d.ts +4 -0
  152. package/lib/shared/receipt/small-ticket.js +63 -8
  153. package/lib/solution/BaseSales/index.d.ts +39 -5
  154. package/lib/solution/BaseSales/index.js +212 -18
  155. package/lib/solution/BaseSales/types.d.ts +1 -0
  156. package/lib/solution/BaseSales/types.js +1 -0
  157. package/lib/solution/BookingByStep/index.d.ts +17 -3
  158. package/lib/solution/BookingByStep/index.js +222 -14
  159. package/lib/solution/BookingByStep/utils/resources.d.ts +10 -0
  160. package/lib/solution/BookingByStep/utils/resources.js +25 -15
  161. package/lib/solution/BookingTicket/index.d.ts +15 -3
  162. package/lib/solution/BookingTicket/index.js +47 -4
  163. package/lib/solution/BookingTicket/types.d.ts +14 -2
  164. package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +3 -1
  165. package/lib/solution/BookingTicket/utils/addProductDecision.js +37 -6
  166. package/lib/solution/BookingTicket/utils/resolveUniqueCartDetail.d.ts +8 -0
  167. package/lib/solution/BookingTicket/utils/resolveUniqueCartDetail.js +136 -0
  168. package/lib/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.d.ts +8 -0
  169. package/lib/solution/BookingTicket/utils/scan/applyProductVoucherCollectionScan.js +54 -0
  170. package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +1 -0
  171. package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -1
  172. package/lib/solution/OrderInvoicePreview/index.js +7 -1
  173. package/lib/solution/ScanOrder/index.d.ts +2 -0
  174. package/lib/solution/ScanOrder/index.js +72 -2
  175. package/lib/solution/ScanOrder/menuAvailability.d.ts +24 -0
  176. package/lib/solution/ScanOrder/menuAvailability.js +203 -0
  177. package/lib/solution/UnifiedBookingSales/catalogQueryBatch.d.ts +21 -0
  178. package/lib/solution/UnifiedBookingSales/catalogQueryBatch.js +109 -0
  179. package/lib/solution/UnifiedBookingSales/index.d.ts +96 -4
  180. package/lib/solution/UnifiedBookingSales/index.js +1316 -73
  181. package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.d.ts +2 -0
  182. package/lib/solution/UnifiedBookingSales/remoteOccupancyCache.js +2 -0
  183. package/lib/solution/UnifiedBookingSales/salesSettings.d.ts +16 -0
  184. package/lib/solution/UnifiedBookingSales/salesSettings.js +72 -0
  185. package/lib/solution/UnifiedBookingSales/sessionResourceCache.d.ts +27 -0
  186. package/lib/solution/UnifiedBookingSales/sessionResourceCache.js +199 -0
  187. package/lib/solution/UnifiedBookingSales/types.d.ts +71 -2
  188. package/lib/solution/UnifiedBookingSales/types.js +4 -1
  189. package/lib/solution/UnifiedBookingSales/venueCatalogSession.d.ts +32 -0
  190. package/lib/solution/UnifiedBookingSales/venueCatalogSession.js +155 -0
  191. package/lib/utils/platform.d.ts +2 -0
  192. package/lib/utils/platform.js +7 -0
  193. package/lib/utils/pos-receipt-auto-print.d.ts +4 -0
  194. package/lib/utils/pos-receipt-auto-print.js +13 -0
  195. package/package.json +1 -1
@@ -1,4 +1,6 @@
1
1
  import type { ScheduleItem } from '../Schedule/types';
2
+ import type { PosReceiptAutoPrintPaymentStatus } from '../../utils/pos-receipt-auto-print';
3
+ export type { PosReceiptAutoPrintPaymentStatus } from '../../utils/pos-receipt-auto-print';
2
4
  export interface MultiLangObject {
3
5
  en?: string;
4
6
  ja?: string;
@@ -67,7 +69,20 @@ export interface OpenDataConfig {
67
69
  'reservation.auto_confirm_mode'?: string;
68
70
  'reservation.auto_confirm_delay_seconds'?: number;
69
71
  'reservation.time_slice'?: number | string;
72
+ 'reservation.multiple_booking_scheduling'?: 'one_after_another' | 'same_start_time';
73
+ 'reservation.resource_setting'?: Record<string, {
74
+ name?: string | MultiLangObject;
75
+ resourceSelectionMode?: 'customer_optional' | 'customer_required' | 'automatic';
76
+ skipResourceSelectionIfSingle?: boolean;
77
+ autoAssignmentRule?: 'optimal_idle_time';
78
+ }>;
79
+ 'interface.show_product_image'?: boolean;
80
+ 'interface.show_remove_button'?: boolean;
70
81
  'sale.allow_item_notes'?: boolean;
82
+ 'sale.check_required_options'?: boolean;
83
+ 'sale.stock_settings'?: boolean;
84
+ 'sale.allow_adding_insufficient_stock'?: boolean;
85
+ 'sale.show_option'?: boolean;
71
86
  'sale.allow_order_notes'?: boolean;
72
87
  'sale.enable_contact_info'?: boolean;
73
88
  'sale.first_name.visible'?: boolean;
@@ -113,6 +128,7 @@ export interface OpenDataConfig {
113
128
  }>;
114
129
  'documents.invoice_template'?: string | number;
115
130
  'documents.invoice_edit'?: RawInvoiceEditConfig;
131
+ 'documents.pos_receipt_auto_print_payment_statuses'?: PosReceiptAutoPrintPaymentStatus[];
116
132
  /** @deprecated 仅保留旧调用方的类型兼容,Invoice 读取逻辑不再消费该字段。 */
117
133
  'documents.invoice'?: RawInvoiceLayoutConfig;
118
134
  /** @deprecated Invoice 读取逻辑只消费扁平的 documents.invoice_* 字段。 */
@@ -3,7 +3,7 @@ export declare function getDefaultInvoiceLayoutConfig(): InvoiceLayoutConfig;
3
3
  export declare function getDefaultInvoiceTemplateSettings(): InvoiceTemplateSettings;
4
4
  /**
5
5
  * 将非 DEFAULT Invoice 模板启用的语言转换为 small_ticket_data locale。
6
- * cn_en 是中英组合打印模式,因此展开为 en 与 zh_CN 两份数据。
6
+ * 双语打印模式展开为各语言的数据;展示顺序仍由 template_settings.language 决定。
7
7
  */
8
8
  export declare function resolveInvoiceReceiptLocales(settings?: InvoiceTemplateSettings | null): string[];
9
9
  /**
@@ -51,12 +51,13 @@ var INVOICE_RECEIPT_LOCALE_MAPPING = {
51
51
  zh_hk: ['zh_HK'],
52
52
  ja: ['ja'],
53
53
  pt: ['pt'],
54
- cn_en: ['en', 'zh_CN']
54
+ cn_en: ['en', 'zh_CN'],
55
+ ja_en: ['ja', 'en']
55
56
  };
56
57
 
57
58
  /**
58
59
  * 将非 DEFAULT Invoice 模板启用的语言转换为 small_ticket_data locale。
59
- * cn_en 是中英组合打印模式,因此展开为 en 与 zh_CN 两份数据。
60
+ * 双语打印模式展开为各语言的数据;展示顺序仍由 template_settings.language 决定。
60
61
  */
61
62
  export function resolveInvoiceReceiptLocales(settings) {
62
63
  if (typeof (settings === null || settings === void 0 ? void 0 : settings.template) !== 'string' || settings.template.trim().length === 0 || settings.template.trim().toUpperCase() === 'DEFAULT' || !isRecord(settings.language)) {
@@ -1,10 +1,11 @@
1
1
  import { Module, PisellCore, ModuleOptions } from '../../types';
2
2
  import { BaseModule } from '../BaseModule';
3
- import { OrderModuleAPI, CommitOrderParams, UpdateOrderBookingParams, UpdateOrderProductParams, UpdateOrderProductQuantityParams, CancelOrderParams, ChangeBookingStatusParams, CheckoutOrderParams } from './types';
3
+ import { OrderModuleAPI, CommitOrderParams, UpdateOrderBookingParams, UpdateOrderProductParams, UpdateOrderProductsOptions, UpdateOrderProductQuantityParams, CancelOrderParams, ChangeBookingStatusParams, CheckoutOrderParams } from './types';
4
4
  import { CartItem } from '../Cart/types';
5
5
  import { type SubmitPayloadEnhancer } from './utils';
6
6
  import { type PickupTimingBooking, type PickupTimingBookingInput } from './pickupTiming';
7
- import type { OrderAmountSnapshot, AddProductBookingInput, AddProductToOrderOptions, OrderIdentitySnapshot, OrderPaymentSource, OrderSnapshot, OrderSyncState, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, SubmitSalesOrderParams, OrderProduct, OrderProductIdentity, OrderSummary, OrderTempOrder, OrderPaymentData, OrderPaymentUpdateOptions, OrderPaymentUpdateResult, SendCustomerPayLinkParams, UpdateTempOrderCustomerInput, OrderCustomerPatch, OrderCustomerView, OrderCartIntentCommitContext, ReplaceTempOrderOptions, OrderPromotionEvaluator, OrderGiftSelectResolver, OrderUnfulfilledPromotion, OrderLastGiftActions, RemoveProductsFromOrderOptions, SalesNote, SalesNotesMutationSnapshot, SetSalesNoteInput, PickupReferenceMode, PointCardSnapshotMergeContext, PointCardSnapshotItem, ShopServiceData, ShopServiceType } from './types';
7
+ import { type ProductVoucherGroup } from './utils/productVoucherGroups';
8
+ import type { OrderAmountSnapshot, AddProductBookingInput, AddProductToOrderOptions, ReplaceBookingProductWithRelatedRetailParams, OrderIdentitySnapshot, OrderPaymentSource, OrderSnapshot, OrderSyncState, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, SubmitSalesOrderParams, OrderProduct, OrderProductIdentity, OrderSummary, OrderTempOrder, OrderPaymentData, OrderPaymentUpdateOptions, OrderPaymentUpdateResult, SendCustomerPayLinkParams, UpdateTempOrderCustomerInput, OrderCustomerPatch, OrderCustomerView, OrderHooksConfig, OrderCartIntentCommitContext, ReplaceTempOrderOptions, HydrateTempOrderOptions, OrderPromotionEvaluator, OrderGiftSelectResolver, OrderUnfulfilledPromotion, OrderLastGiftActions, RemoveProductsFromOrderOptions, SalesNote, SalesNotesMutationSnapshot, SetSalesNoteInput, PickupReferenceMode, PointCardSnapshotMergeContext, PointCardSnapshotItem, ShopServiceData, ShopServiceType } from './types';
8
9
  import type { ICustomer } from '../AccountList/types';
9
10
  import type { Discount } from '../Discount/types';
10
11
  import { UnavailableReason } from '../Rules/types';
@@ -21,6 +22,10 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
21
22
  private openCache;
22
23
  private sessionStoragePersistEnabled;
23
24
  private sessionStorageRestoreRecord;
25
+ private orderSessionId;
26
+ private orderSessionDestroyed;
27
+ private orderSessionAliases;
28
+ private orderReplacement;
24
29
  /** 只允许当前订单最新的 prepare/config 请求回写客户资产态。 */
25
30
  private customerWalletPrepareConfigEpoch;
26
31
  /** Payment 可能早于 prepare/config 返回;先按实例 ID 暂存卡号等待 Snapshot。 */
@@ -29,6 +34,12 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
29
34
  private rulesHooksOverride?;
30
35
  private moduleHooksOverride?;
31
36
  private orderHooks?;
37
+ private cartCommandQueue;
38
+ private queueCartCommand;
39
+ /** Use the exact Order normalizers/merge rules on a private draft, not a second projection. */
40
+ private beginCartMutation;
41
+ /** Serializes checkout preparation with local cart commands; hydration remains outside this guard. */
42
+ prepareCheckout<T>(prepare: (items: OrderProduct[]) => Promise<T>): Promise<T>;
32
43
  private otherParams?;
33
44
  /** 评估器引用;由 SalesSdkProvider 注入,未注入时 applyPromotion 静默跳过 */
34
45
  private promotionEvaluator;
@@ -66,7 +77,11 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
66
77
  * @example
67
78
  * orderModule.updateOtherParams({ cacheId: 'cache-2', channel: 'pos' });
68
79
  */
69
- updateOtherParams(params: Record<string, any>): void;
80
+ updateOtherParams(params: Record<string, any>, options?: {
81
+ hooks?: OrderHooksConfig;
82
+ changedParams?: Record<string, any>;
83
+ cover?: boolean;
84
+ }): void;
70
85
  /** Internal intent boundary shared with asynchronous scanner/detail flows. */
71
86
  createCartIntentCommitGuard(action: OrderCartIntentCommitContext['action'], tempOrder?: OrderTempOrder | null): () => void;
72
87
  /** PC/H5 属于在线店铺;其它或缺失平台统一沿用 POS 行为。 */
@@ -84,6 +99,8 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
84
99
  */
85
100
  private logError;
86
101
  private registerDiscountModules;
102
+ setProductVoucherGroups(groups: ProductVoucherGroup[]): void;
103
+ validateProductVoucherSelection(): void;
87
104
  private createDefaultRulesHooks;
88
105
  /**
89
106
  * Stable across notifyTempOrderChanged's immutable copy, but changes when a
@@ -102,7 +119,9 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
102
119
  getCustomerWalletPrepareConfigEpoch(): number;
103
120
  private syncScannedDiscountsToOriginalDiscountList;
104
121
  private ensureEditDiscountConfigForProductChange;
105
- scanCode(code: string, customerId?: number): Promise<{
122
+ scanCode(code: string, customerId?: number, options?: {
123
+ productVouchersOnly?: boolean;
124
+ }): Promise<{
106
125
  isAvailable: boolean;
107
126
  isAccepted?: boolean;
108
127
  discountList: Discount[];
@@ -190,6 +209,14 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
190
209
  clearSessionStoragePersistedTempOrder(): void;
191
210
  consumeSessionStorageRestore(): Record<string, any> | null;
192
211
  notifyTempOrderChanged(): void;
212
+ private getOrderSessionAliases;
213
+ private publishOrderSession;
214
+ getOrderSessionId(): string | null;
215
+ isOrderSessionCurrent(sessionId: string): boolean;
216
+ private beginOrderReplacement;
217
+ private assertOrderReplacementCurrent;
218
+ private completeOrderReplacement;
219
+ private rollbackOrderReplacement;
193
220
  private createDefaultTempOrderInstance;
194
221
  private clearTempOrderCustomerWalletSnapshots;
195
222
  private clearCustomerWalletState;
@@ -216,6 +243,9 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
216
243
  private calculatePaymentTotal;
217
244
  private calculateOrderPaidPaymentTotal;
218
245
  private getDepositAmount;
246
+ private isDepositSelectionDisabled;
247
+ /** Cap only the active target; product rules, manual intent and saved snapshots stay raw. */
248
+ private applyEffectiveDepositSummary;
219
249
  private normalizeDepositAmount;
220
250
  private normalizeDepositFlag;
221
251
  private getHistoricalDepositSnapshot;
@@ -482,6 +512,14 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
482
512
  * // → tempOrder.products 新增 3 行,每行 num=1,bookings 3 条
483
513
  */
484
514
  addProductToOrder(product: Partial<OrderProduct> & OrderProductIdentity, booking?: AddProductBookingInput, options?: AddProductToOrderOptions): Promise<OrderProduct[]>;
515
+ private addProductToOrderDraft;
516
+ /**
517
+ * Replaces one local Party booking and its confirmed children on a detached draft.
518
+ * All fallible preparation precedes a guarded synchronous publication; never rolls
519
+ * an old whole-order snapshot over concurrent edits or a newly selected order.
520
+ */
521
+ replaceBookingProductWithRelatedRetail(params: ReplaceBookingProductWithRelatedRetailParams): Promise<OrderProduct[]>;
522
+ private replaceBookingProductWithRelatedRetailDraft;
485
523
  /**
486
524
  * 批量添加商品行,所有行追加完成后只触发一次促销、折扣、summary 重算与持久化。
487
525
  *
@@ -497,6 +535,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
497
535
  }>, options?: {
498
536
  skipEditDiscountConfigRefresh?: boolean;
499
537
  }): Promise<OrderProduct[]>;
538
+ private addProductsToOrderDraft;
500
539
  private getFullCoveragePassDiscounts;
501
540
  private hasEntitlementPassDiscount;
502
541
  private hasGoodPassDiscount;
@@ -508,10 +547,14 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
508
547
  private isRestrictedCartProductUpdate;
509
548
  private applyOrderProductUpdateToTempOrder;
510
549
  updateOrderProduct(params: UpdateOrderProductParams): Promise<OrderProduct[]>;
511
- updateOrderProducts(paramsList: UpdateOrderProductParams[]): Promise<OrderProduct[]>;
550
+ private updateOrderProductDraft;
551
+ updateOrderProducts(paramsList: UpdateOrderProductParams[], options?: UpdateOrderProductsOptions): Promise<OrderProduct[]>;
552
+ private updateOrderProductsDraft;
553
+ private updateOrderProductsGuarded;
512
554
  updateOrderProductQuantity(params: UpdateOrderProductQuantityParams, options?: {
513
555
  isCurrentOrder?: () => boolean;
514
556
  }): Promise<OrderProduct[]>;
557
+ private updateOrderProductQuantityDraft;
515
558
  updateOrderBooking(params: UpdateOrderBookingParams): any[];
516
559
  /**
517
560
  * 商品行写路径收尾:促销 → 折扣 → 清洗 → summary → 持久化。
@@ -528,12 +571,14 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
528
571
  * await order.removeProductsFromOrder([identityA, identityB]);
529
572
  */
530
573
  removeProductsFromOrder(identities: OrderProductIdentity[], options?: RemoveProductsFromOrderOptions): Promise<OrderProduct[]>;
574
+ private removeProductsFromOrderDraft;
531
575
  removeProductFromOrder(identity: OrderProductIdentity, options?: RemoveProductsFromOrderOptions): Promise<OrderProduct[]>;
532
576
  /**
533
- * 仅清空购物车行(products / bookings),不重置整单。
577
+ * 清空购物车行(products / bookings)及整单折扣,不重置整单。
534
578
  * 普通整单 note 保持不变;以商品行为主体的 Sales Notes 同步删除。
535
579
  */
536
580
  clearOrderCartLines(): Promise<OrderTempOrder>;
581
+ private clearOrderCartLinesDraft;
537
582
  /**
538
583
  * 切换购物车结算单位时清理所有会影响新币种的订单状态,但保留当前客户。
539
584
  */
@@ -644,10 +689,8 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
644
689
  * 数据源应尽量返回 tempOrder 所需结构;这里仅做 SDK 运行必须字段兜底,
645
690
  * 例如数组字段、商品行唯一值、价格 metadata、summary 派生状态和 _extend。
646
691
  */
647
- hydrateTempOrderFromRecord(record: Record<string, any>, options?: {
648
- recalcOnHydrate?: boolean;
649
- source?: 'salesDetail' | 'mergedSalesDetail' | 'sessionStorage';
650
- }): Promise<OrderTempOrder>;
692
+ hydrateTempOrderFromRecord(record: Record<string, any>, options?: HydrateTempOrderOptions): Promise<OrderTempOrder>;
693
+ private prepareHydratedTempOrder;
651
694
  /**
652
695
  * 兼容后端详情将 holder 放在 metadata.holder 的历史形态,统一补到运行时展示路径。
653
696
  *
@@ -673,6 +716,6 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
673
716
  getOrderInfo(order_id: number): Promise<any>;
674
717
  getVouchers(): any[];
675
718
  }
676
- export type { OrderHolderRelation, AddProductToOrderOptions, OrderMetaList, PointCardSnapshotItem, VirtualCurrencySnapshotItem, RemoveProductsFromOrderOptions, SalesNote, SalesNoteDraftInput, SalesNoteLocalizedSelection, SalesNoteLocalizedText, SalesNoteRelation, SalesNoteTextInput, SetSalesNoteInput, UpdateOrderBookingParams, UpdateOrderProductParams, UpdateOrderProductQuantityParams, } from './types';
719
+ export type { OrderHolderRelation, AddProductToOrderOptions, OrderMetaList, PointCardSnapshotItem, VirtualCurrencySnapshotItem, RemoveProductsFromOrderOptions, SalesNote, SalesNoteDraftInput, SalesNoteLocalizedSelection, SalesNoteLocalizedText, SalesNoteRelation, SalesNoteTextInput, SetSalesNoteInput, UpdateOrderBookingParams, UpdateOrderProductParams, UpdateOrderProductsOptions, UpdateOrderProductQuantityParams, } from './types';
677
720
  export { isFulfillmentTimingBooking } from './pickupTiming';
678
721
  export type { PickupTimingBooking, PickupTimingBookingInput, PickupTimingBookingMetadata, PickupTimingSelectionMode, PickupTimingSource, } from './pickupTiming';