@pisell/pisellos 2.3.50 → 2.3.53

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 (177) hide show
  1. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +12 -10
  2. package/dist/modules/Discount/index.d.ts +0 -1
  3. package/dist/modules/Discount/index.js +11 -40
  4. package/dist/modules/Discount/types.d.ts +0 -1
  5. package/dist/modules/OpenData/index.js +2 -2
  6. package/dist/modules/Order/index.d.ts +6 -8
  7. package/dist/modules/Order/index.js +165 -140
  8. package/dist/modules/Order/types.d.ts +21 -12
  9. package/dist/modules/Order/types.js +11 -0
  10. package/dist/modules/Order/utils.d.ts +0 -10
  11. package/dist/modules/Order/utils.js +3 -35
  12. package/dist/modules/Payment/types.d.ts +8 -0
  13. package/dist/modules/Payment/walletpass.d.ts +7 -1
  14. package/dist/modules/Payment/walletpass.js +155 -45
  15. package/dist/modules/Product/types.d.ts +0 -1
  16. package/dist/modules/ProductList/index.js +14 -33
  17. package/dist/modules/Quotation/index.d.ts +1 -1
  18. package/dist/modules/Quotation/index.js +2 -2
  19. package/dist/modules/Rules/index.js +32 -56
  20. package/dist/modules/SalesSummary/index.js +13 -12
  21. package/dist/modules/SalesSummary/utils.js +7 -1
  22. package/dist/modules/ScanOrderLogger/index.d.ts +0 -2
  23. package/dist/modules/ScanOrderLogger/index.js +2 -15
  24. package/dist/modules/ScanOrderLogger/providers/feishu.js +27 -45
  25. package/dist/modules/ScanOrderLogger/types.d.ts +0 -1
  26. package/dist/modules/Schedule/index.d.ts +1 -3
  27. package/dist/modules/Schedule/index.js +16 -21
  28. package/dist/modules/Summary/utils.js +13 -38
  29. package/dist/modules/index.d.ts +0 -2
  30. package/dist/modules/index.js +1 -3
  31. package/dist/plugins/window.d.ts +0 -1
  32. package/dist/server/index.d.ts +0 -14
  33. package/dist/server/index.js +793 -907
  34. package/dist/server/modules/index.d.ts +1 -1
  35. package/dist/server/modules/order/index.d.ts +16 -0
  36. package/dist/server/modules/order/index.js +964 -776
  37. package/dist/server/modules/order/types.d.ts +14 -0
  38. package/dist/server/modules/order/types.js +6 -0
  39. package/dist/solution/BaseSales/index.d.ts +18 -13
  40. package/dist/solution/BaseSales/index.js +202 -178
  41. package/dist/solution/BaseSales/utils/cartPromotion.js +5 -3
  42. package/dist/solution/BookingByStep/index.d.ts +2 -17
  43. package/dist/solution/BookingByStep/index.js +215 -294
  44. package/dist/solution/BookingByStep/types.d.ts +1 -2
  45. package/dist/solution/BookingByStep/types.js +1 -3
  46. package/dist/solution/BookingByStep/utils/capacity.js +1 -17
  47. package/dist/solution/BookingByStep/utils/timeslots.d.ts +1 -3
  48. package/dist/solution/BookingByStep/utils/timeslots.js +12 -19
  49. package/dist/solution/BookingTicket/index.d.ts +1 -13
  50. package/dist/solution/BookingTicket/index.js +2 -2
  51. package/dist/solution/BookingTicket/types.d.ts +3 -0
  52. package/dist/solution/BookingTicket/utils/cartView.js +44 -32
  53. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +1 -3
  54. package/dist/solution/BookingTicket/utils/scan/handleScan.js +2 -10
  55. package/dist/solution/Sales/index.d.ts +1 -0
  56. package/dist/solution/Sales/index.js +16 -2
  57. package/dist/solution/ScanOrder/index.d.ts +14 -26
  58. package/dist/solution/ScanOrder/index.js +739 -1142
  59. package/dist/solution/ScanOrder/types.d.ts +1 -21
  60. package/dist/solution/ScanOrder/utils.d.ts +0 -8
  61. package/dist/solution/ScanOrder/utils.js +25 -66
  62. package/dist/solution/ShopDiscount/index.d.ts +0 -1
  63. package/dist/solution/ShopDiscount/index.js +87 -125
  64. package/dist/solution/VenueBooking/index.d.ts +11 -39
  65. package/dist/solution/VenueBooking/index.js +841 -1167
  66. package/dist/solution/VenueBooking/types.d.ts +0 -3
  67. package/dist/solution/VenueBooking/utils/resource.js +0 -1
  68. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
  69. package/dist/solution/VenueBooking/utils/slotMerge.js +5 -10
  70. package/dist/solution/index.d.ts +0 -1
  71. package/dist/solution/index.js +1 -2
  72. package/dist/types/index.d.ts +0 -1
  73. package/lib/model/strategy/adapter/promotion/index.js +0 -51
  74. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +3 -1
  75. package/lib/modules/Discount/index.d.ts +0 -1
  76. package/lib/modules/Discount/index.js +0 -9
  77. package/lib/modules/Discount/types.d.ts +0 -1
  78. package/lib/modules/OpenData/index.js +1 -1
  79. package/lib/modules/Order/index.d.ts +6 -8
  80. package/lib/modules/Order/index.js +89 -38
  81. package/lib/modules/Order/types.d.ts +21 -12
  82. package/lib/modules/Order/utils.d.ts +0 -10
  83. package/lib/modules/Order/utils.js +5 -36
  84. package/lib/modules/Payment/types.d.ts +8 -0
  85. package/lib/modules/Payment/walletpass.d.ts +7 -1
  86. package/lib/modules/Payment/walletpass.js +107 -9
  87. package/lib/modules/Product/types.d.ts +0 -1
  88. package/lib/modules/ProductList/index.js +31 -40
  89. package/lib/modules/Quotation/index.d.ts +1 -1
  90. package/lib/modules/Quotation/index.js +2 -2
  91. package/lib/modules/Rules/index.js +32 -44
  92. package/lib/modules/SalesSummary/index.js +7 -6
  93. package/lib/modules/SalesSummary/utils.js +5 -1
  94. package/lib/modules/ScanOrderLogger/index.d.ts +0 -2
  95. package/lib/modules/ScanOrderLogger/index.js +1 -13
  96. package/lib/modules/ScanOrderLogger/providers/feishu.js +6 -15
  97. package/lib/modules/ScanOrderLogger/types.d.ts +0 -1
  98. package/lib/modules/Schedule/index.d.ts +1 -3
  99. package/lib/modules/Schedule/index.js +8 -10
  100. package/lib/modules/Summary/utils.js +1 -21
  101. package/lib/modules/index.d.ts +0 -2
  102. package/lib/modules/index.js +1 -5
  103. package/lib/plugins/window.d.ts +0 -1
  104. package/lib/server/index.d.ts +0 -14
  105. package/lib/server/index.js +15 -72
  106. package/lib/server/modules/index.d.ts +1 -1
  107. package/lib/server/modules/order/index.d.ts +16 -0
  108. package/lib/server/modules/order/index.js +140 -4
  109. package/lib/server/modules/order/types.d.ts +14 -0
  110. package/lib/server/modules/order/types.js +1 -0
  111. package/lib/solution/BaseSales/index.d.ts +18 -13
  112. package/lib/solution/BaseSales/index.js +58 -35
  113. package/lib/solution/BaseSales/utils/cartPromotion.js +5 -2
  114. package/lib/solution/BookingByStep/index.d.ts +2 -17
  115. package/lib/solution/BookingByStep/index.js +18 -60
  116. package/lib/solution/BookingByStep/types.d.ts +1 -2
  117. package/lib/solution/BookingByStep/types.js +0 -5
  118. package/lib/solution/BookingByStep/utils/capacity.js +1 -20
  119. package/lib/solution/BookingByStep/utils/timeslots.d.ts +1 -3
  120. package/lib/solution/BookingByStep/utils/timeslots.js +11 -19
  121. package/lib/solution/BookingTicket/index.d.ts +1 -13
  122. package/lib/solution/BookingTicket/index.js +2 -10
  123. package/lib/solution/BookingTicket/types.d.ts +3 -0
  124. package/lib/solution/BookingTicket/utils/cartView.js +43 -30
  125. package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +1 -3
  126. package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -2
  127. package/lib/solution/Sales/index.d.ts +1 -0
  128. package/lib/solution/Sales/index.js +15 -3
  129. package/lib/solution/ScanOrder/index.d.ts +14 -26
  130. package/lib/solution/ScanOrder/index.js +182 -449
  131. package/lib/solution/ScanOrder/types.d.ts +1 -21
  132. package/lib/solution/ScanOrder/utils.d.ts +0 -8
  133. package/lib/solution/ScanOrder/utils.js +0 -31
  134. package/lib/solution/ShopDiscount/index.d.ts +0 -1
  135. package/lib/solution/ShopDiscount/index.js +0 -14
  136. package/lib/solution/VenueBooking/index.d.ts +11 -39
  137. package/lib/solution/VenueBooking/index.js +110 -322
  138. package/lib/solution/VenueBooking/types.d.ts +0 -3
  139. package/lib/solution/VenueBooking/utils/resource.js +0 -1
  140. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
  141. package/lib/solution/VenueBooking/utils/slotMerge.js +4 -6
  142. package/lib/solution/index.d.ts +0 -1
  143. package/lib/solution/index.js +1 -3
  144. package/lib/types/index.d.ts +0 -1
  145. package/package.json +1 -1
  146. package/dist/modules/Holder/index.d.ts +0 -48
  147. package/dist/modules/Holder/index.js +0 -640
  148. package/dist/modules/Holder/types.d.ts +0 -123
  149. package/dist/modules/Holder/types.js +0 -1
  150. package/dist/modules/Holder/utils.d.ts +0 -13
  151. package/dist/modules/Holder/utils.js +0 -34
  152. package/dist/modules/ResourcePlanner/index.d.ts +0 -24
  153. package/dist/modules/ResourcePlanner/index.js +0 -181
  154. package/dist/modules/ResourcePlanner/planner.d.ts +0 -14
  155. package/dist/modules/ResourcePlanner/planner.js +0 -1069
  156. package/dist/modules/ResourcePlanner/types.d.ts +0 -227
  157. package/dist/modules/ResourcePlanner/types.js +0 -1
  158. package/dist/solution/UnifiedBookingSales/index.d.ts +0 -183
  159. package/dist/solution/UnifiedBookingSales/index.js +0 -1891
  160. package/dist/solution/UnifiedBookingSales/types.d.ts +0 -143
  161. package/dist/solution/UnifiedBookingSales/types.js +0 -11
  162. package/lib/modules/Holder/index.d.ts +0 -48
  163. package/lib/modules/Holder/index.js +0 -402
  164. package/lib/modules/Holder/types.d.ts +0 -123
  165. package/lib/modules/Holder/types.js +0 -17
  166. package/lib/modules/Holder/utils.d.ts +0 -13
  167. package/lib/modules/Holder/utils.js +0 -71
  168. package/lib/modules/ResourcePlanner/index.d.ts +0 -24
  169. package/lib/modules/ResourcePlanner/index.js +0 -148
  170. package/lib/modules/ResourcePlanner/planner.d.ts +0 -14
  171. package/lib/modules/ResourcePlanner/planner.js +0 -933
  172. package/lib/modules/ResourcePlanner/types.d.ts +0 -227
  173. package/lib/modules/ResourcePlanner/types.js +0 -17
  174. package/lib/solution/UnifiedBookingSales/index.d.ts +0 -183
  175. package/lib/solution/UnifiedBookingSales/index.js +0 -1084
  176. package/lib/solution/UnifiedBookingSales/types.d.ts +0 -143
  177. package/lib/solution/UnifiedBookingSales/types.js +0 -33
@@ -568,6 +568,19 @@ export interface OrderChangedPayload {
568
568
  /** 触发来源,便于订阅者区分 pubsub / 远端覆盖 / 清空等场景 */
569
569
  source?: string;
570
570
  }
571
+ export type RemoteProductMembershipChangeSource = 'pubsub.bodyUpsert' | 'pubsub.httpRefresh';
572
+ /**
573
+ * 远端订单快照相对本地订单产生商品成员增删时的广播载荷。
574
+ * 只表达商品行成员关系变化,不包含数量、价格、备注等字段级修改。
575
+ */
576
+ export interface RemoteProductMembershipChangedPayload {
577
+ order_id: OrderId;
578
+ source: RemoteProductMembershipChangeSource;
579
+ added_product_keys: string[];
580
+ removed_product_keys: string[];
581
+ previous_product_count: number;
582
+ current_product_count: number;
583
+ }
571
584
  /**
572
585
  * OrderSyncMessage - pubsub 同步消息结构
573
586
  */
@@ -605,5 +618,6 @@ export interface OrderState {
605
618
  export declare enum OrderHooks {
606
619
  onOrdersLoaded = "order:onOrdersLoaded",
607
620
  onOrdersChanged = "order:onOrdersChanged",
621
+ onRemoteProductMembershipChanged = "order:onRemoteProductMembershipChanged",
608
622
  onOrdersSyncCompleted = "order:onOrdersSyncCompleted"
609
623
  }
@@ -135,6 +135,11 @@
135
135
  * const changedOrders = payload.changedOrders
136
136
  */
137
137
 
138
+ /**
139
+ * 远端订单快照相对本地订单产生商品成员增删时的广播载荷。
140
+ * 只表达商品行成员关系变化,不包含数量、价格、备注等字段级修改。
141
+ */
142
+
138
143
  /**
139
144
  * OrderSyncMessage - pubsub 同步消息结构
140
145
  */
@@ -149,6 +154,7 @@
149
154
  export var OrderHooks = /*#__PURE__*/function (OrderHooks) {
150
155
  OrderHooks["onOrdersLoaded"] = "order:onOrdersLoaded";
151
156
  OrderHooks["onOrdersChanged"] = "order:onOrdersChanged";
157
+ OrderHooks["onRemoteProductMembershipChanged"] = "order:onRemoteProductMembershipChanged";
152
158
  OrderHooks["onOrdersSyncCompleted"] = "order:onOrdersSyncCompleted";
153
159
  return OrderHooks;
154
160
  }({});
@@ -2,14 +2,14 @@ import { Module, ModuleOptions, PisellCore } from '../../types';
2
2
  import { BaseModule } from '../../modules/BaseModule';
3
3
  import { BaseSalesOrderProduct, BaseSalesOrderProductIdentity, BaseSalesPaymentStatus, BaseSalesUpdateOrderProductQuantityParams, BaseSalesCalculateProductBookingPriceParams, BaseSalesPriceRecalculationContextChange, BaseSalesProductBookingPriceResult, BaseSalesQuotationCustomerScopeInfo, BaseSalesScanCodeResult, BaseSalesCashPaymentConfig, BaseSalesPayCashParams, BaseSalesPayCashResult, BaseSalesCommitPaymentMethodParams, BaseSalesCommitPaymentMethodResult, BaseSalesConfirmWalletPaymentResult } from './types';
4
4
  import { OrderModule } from '../../modules/Order';
5
- import type { AddProductBookingInput, LoadSalesDetailParams, OrderPaymentData, OrderPaymentUpdateOptions, OrderPaymentUpdateResult, OrderPaymentSource, SendCustomerPayLinkParams, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, UpdateTempOrderCustomerInput, UpdateOrderBookingParams, UpdateOrderProductParams, OrderTempOrder, OrderSummary, OrderPromotionEvaluator, OrderGiftSelectResolver, OrderUnfulfilledPromotion, OrderLastGiftActions } from '../../modules/Order/types';
5
+ import type { AddProductBookingInput, AddProductToOrderOptions, LoadSalesDetailParams, OrderPaymentData, OrderPaymentUpdateOptions, OrderPaymentUpdateResult, OrderPaymentSource, SendCustomerPayLinkParams, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, UpdateTempOrderCustomerInput, UpdateOrderBookingParams, UpdateOrderProductParams, OrderTempOrder, OrderSummary, OrderPromotionEvaluator, OrderGiftSelectResolver, OrderUnfulfilledPromotion, OrderLastGiftActions, RemoveProductsFromOrderOptions, ReplaceTempOrderOptions } from '../../modules/Order/types';
6
6
  import type { SubmitPayloadEnhancer } from '../../modules/Order/utils';
7
7
  import type { Discount } from '../../modules/Discount/types';
8
8
  import { RequestPlugin, WindowPlugin } from '../../plugins';
9
9
  export * from './types';
10
10
  import { ProductList } from '../../modules/ProductList';
11
11
  import { PaymentModule } from '../../modules/Payment';
12
- import type { PaymentMethod, RoundingResult, WalletAssetId, WalletAssetsSnapshot, WalletAssetsState, WalletAssetSelectionSource, ScanWalletAssetResult } from '../../modules/Payment/types';
12
+ import type { PaymentMethod, RoundingResult, WalletAssetId, WalletAssetsBehaviorOptions, WalletAssetsSnapshot, WalletAssetsState, WalletAssetSelectionSource, ScanWalletAssetResult } from '../../modules/Payment/types';
13
13
  import type { SalesSummaryModule } from '../../modules/SalesSummary';
14
14
  import type { ScheduleModule } from '../../modules/Schedule';
15
15
  import { QuotationModule } from '../../modules/Quotation';
@@ -109,6 +109,16 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
109
109
  private applyQuotationScheduleResolver;
110
110
  private loadQuotationForPriceQuery;
111
111
  private getPriceQueryProductId;
112
+ /**
113
+ * Change Time / customer reprice 必须沿用商品列表的渠道口径。
114
+ * SalesSdk Provider 通常将渠道存为 platform,因此不能只读取 otherParams.channel。
115
+ */
116
+ private getPriceQueryChannel;
117
+ /**
118
+ * /product/query 的智能定价评估只读取 strategy_context;
119
+ * application_code 仅作为接口兼容字段,不能替代 channel / business_code。
120
+ */
121
+ private getPriceQueryStrategyContext;
112
122
  private getPriceQuerySchedule;
113
123
  private loadProductsForPriceQuery;
114
124
  private loadProductForPriceQuery;
@@ -180,7 +190,7 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
180
190
  /** 获取附加费用(运费/服务费/税费等)。 */
181
191
  getSurcharges(): ISalesSurcharge[];
182
192
  getTempOrder(): OrderTempOrder | null;
183
- replaceTempOrder(tempOrder: OrderTempOrder): Promise<OrderTempOrder>;
193
+ replaceTempOrder(tempOrder: OrderTempOrder, options?: ReplaceTempOrderOptions): Promise<OrderTempOrder>;
184
194
  getOrderIdentity(): import("../../modules/Order/types").OrderIdentitySnapshot | null;
185
195
  getOrderSnapshot(): import("../../modules/Order/types").OrderSnapshot | null;
186
196
  getOrderSyncState(): import("../../modules/Order/types").OrderSyncState;
@@ -280,13 +290,6 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
280
290
  confirmPendingVoucherPayments?: boolean;
281
291
  enhancePayload?: SubmitPayloadEnhancer;
282
292
  }): Promise<T>;
283
- /**
284
- * 默认保持 WebPOS 的本地待同步订单模式;需要云端确认后才算成功的渠道可覆盖此策略。
285
- * otherParams.checkoutSyncTaskEnabled 优先,便于同一 solution 按入口恢复旧行为。
286
- */
287
- protected shouldUseCheckoutSyncTask(): boolean;
288
- /** 可由特定 solution 为真实 checkout 补充默认收据数据请求。 */
289
- protected getDefaultCheckoutSmallTicketDataFlag(): number | undefined;
290
293
  printLocalOrderReceipt<T = any>(lookup?: BaseSalesPrintLocalOrderReceiptParams): Promise<T>;
291
294
  private getSubmitPaymentStatus;
292
295
  syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
@@ -333,6 +336,8 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
333
336
  getWalletAssetsState(): WalletAssetsState;
334
337
  /** 导出 Shared Checkout 跨运行时恢复所需的钱包状态与搜索缓存。 */
335
338
  exportWalletAssetsSnapshot(): WalletAssetsSnapshot;
339
+ /** 配置仅影响 Wallet Assets,不改变 Promotion/Voucher 选择流程。 */
340
+ configureWalletAssetsBehavior(options: WalletAssetsBehaviorOptions): void;
336
341
  /**
337
342
  * 恢复 Shared Checkout 钱包快照,并把选择重新同步为订单 pending payment。
338
343
  */
@@ -419,7 +424,7 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
419
424
  getQuotationCustomerScopeInfo(): BaseSalesQuotationCustomerScopeInfo;
420
425
  shouldRecalculateProductBookingPricesForContextChange(params: BaseSalesPriceRecalculationContextChange): boolean;
421
426
  calculateProductBookingPrices(paramsList: BaseSalesCalculateProductBookingPriceParams[]): Promise<BaseSalesProductBookingPriceResult[]>;
422
- addProductToOrder(product: Partial<BaseSalesOrderProduct> & BaseSalesOrderProductIdentity, booking?: AddProductBookingInput): Promise<import("../../modules/Order/types").OrderProduct[]>;
427
+ addProductToOrder(product: Partial<BaseSalesOrderProduct> & BaseSalesOrderProductIdentity, booking?: AddProductBookingInput, options?: AddProductToOrderOptions): Promise<import("../../modules/Order/types").OrderProduct[]>;
423
428
  updateOrderProduct(params: UpdateOrderProductParams): Promise<import("../../modules/Order/types").OrderProduct[]>;
424
429
  updateOrderProducts(paramsList: UpdateOrderProductParams[]): Promise<import("../../modules/Order/types").OrderProduct[]>;
425
430
  updateOrderProductQuantity(params: BaseSalesUpdateOrderProductQuantityParams): Promise<import("../../modules/Order/types").OrderProduct[]>;
@@ -435,8 +440,8 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
435
440
  * @example
436
441
  * await baseSales.removeProductsFromOrder([identityA, identityB]);
437
442
  */
438
- removeProductsFromOrder(identities: BaseSalesOrderProductIdentity[]): Promise<import("../../modules/Order/types").OrderProduct[]>;
439
- removeProductFromOrder(identity: BaseSalesOrderProductIdentity): Promise<import("../../modules/Order/types").OrderProduct[]>;
443
+ removeProductsFromOrder(identities: BaseSalesOrderProductIdentity[], options?: RemoveProductsFromOrderOptions): Promise<import("../../modules/Order/types").OrderProduct[]>;
444
+ removeProductFromOrder(identity: BaseSalesOrderProductIdentity, options?: RemoveProductsFromOrderOptions): Promise<import("../../modules/Order/types").OrderProduct[]>;
440
445
  /**
441
446
  * 注入促销评估器到底层 OrderModule。
442
447
  *