@pisell/pisellos 2.2.152 → 2.2.154

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 (92) hide show
  1. package/dist/core/index.js +1 -0
  2. package/dist/model/strategy/adapter/promotion/index.js +9 -0
  3. package/dist/modules/Cart/utils/cartProduct.js +1 -1
  4. package/dist/modules/Discount/index.d.ts +6 -2
  5. package/dist/modules/Discount/index.js +14 -8
  6. package/dist/modules/Order/index.d.ts +2 -0
  7. package/dist/modules/Order/index.js +234 -161
  8. package/dist/modules/Order/types.d.ts +19 -0
  9. package/dist/modules/Order/utils.js +7 -6
  10. package/dist/modules/Payment/index.d.ts +4 -0
  11. package/dist/modules/Payment/index.js +567 -505
  12. package/dist/modules/Payment/types.d.ts +29 -9
  13. package/dist/modules/SalesSummary/index.d.ts +7 -5
  14. package/dist/modules/SalesSummary/index.js +35 -11
  15. package/dist/plugins/app.d.ts +2 -0
  16. package/dist/server/index.d.ts +2 -5
  17. package/dist/server/index.js +58 -66
  18. package/dist/server/modules/index.d.ts +1 -1
  19. package/dist/server/modules/products/index.d.ts +12 -1
  20. package/dist/server/modules/products/index.js +169 -78
  21. package/dist/server/modules/products/types.d.ts +11 -0
  22. package/dist/server/modules/products/types.js +4 -0
  23. package/dist/server/utils/product.js +2 -2
  24. package/dist/solution/BaseSales/index.d.ts +26 -2
  25. package/dist/solution/BaseSales/index.js +342 -112
  26. package/dist/solution/BaseSales/types.d.ts +4 -4
  27. package/dist/solution/BaseSales/types.js +4 -4
  28. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +62 -0
  29. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +116 -0
  30. package/dist/solution/BaseSales/utils.js +3 -3
  31. package/dist/solution/BookingByStep/index.d.ts +1 -1
  32. package/dist/solution/BookingTicket/index.d.ts +11 -13
  33. package/dist/solution/BookingTicket/index.js +23 -37
  34. package/dist/solution/BookingTicket/types.d.ts +9 -6
  35. package/dist/solution/BookingTicket/types.js +6 -3
  36. package/dist/solution/BookingTicket/utils/cartView.d.ts +7 -12
  37. package/dist/solution/BookingTicket/utils/cartView.js +52 -14
  38. package/dist/solution/BookingTicket/utils/orderCustomer.d.ts +4 -0
  39. package/dist/solution/BookingTicket/utils/orderCustomer.js +31 -0
  40. package/dist/solution/Sales/index.d.ts +3 -0
  41. package/dist/solution/Sales/index.js +85 -43
  42. package/dist/solution/Sales/types.d.ts +3 -0
  43. package/dist/solution/ScanOrder/types.d.ts +4 -4
  44. package/dist/solution/ScanOrder/types.js +4 -4
  45. package/dist/solution/ScanOrder/utils.js +3 -3
  46. package/dist/solution/ShopDiscount/index.d.ts +2 -1
  47. package/dist/solution/ShopDiscount/index.js +32 -20
  48. package/dist/solution/ShopDiscount/types.d.ts +1 -0
  49. package/lib/core/index.js +1 -0
  50. package/lib/modules/Cart/utils/cartProduct.js +1 -1
  51. package/lib/modules/Discount/index.d.ts +6 -2
  52. package/lib/modules/Discount/index.js +3 -1
  53. package/lib/modules/Order/index.d.ts +2 -0
  54. package/lib/modules/Order/index.js +40 -8
  55. package/lib/modules/Order/types.d.ts +19 -0
  56. package/lib/modules/Order/utils.js +4 -2
  57. package/lib/modules/Payment/index.d.ts +4 -0
  58. package/lib/modules/Payment/index.js +26 -2
  59. package/lib/modules/Payment/types.d.ts +29 -9
  60. package/lib/modules/SalesSummary/index.d.ts +7 -5
  61. package/lib/modules/SalesSummary/index.js +29 -9
  62. package/lib/plugins/app.d.ts +2 -0
  63. package/lib/server/index.d.ts +2 -5
  64. package/lib/server/index.js +38 -58
  65. package/lib/server/modules/index.d.ts +1 -1
  66. package/lib/server/modules/products/index.d.ts +12 -1
  67. package/lib/server/modules/products/index.js +69 -9
  68. package/lib/server/modules/products/types.d.ts +11 -0
  69. package/lib/server/utils/product.js +2 -2
  70. package/lib/solution/BaseSales/index.d.ts +26 -2
  71. package/lib/solution/BaseSales/index.js +169 -3
  72. package/lib/solution/BaseSales/types.d.ts +4 -4
  73. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +62 -0
  74. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +155 -0
  75. package/lib/solution/BaseSales/utils.js +3 -3
  76. package/lib/solution/BookingByStep/index.d.ts +1 -1
  77. package/lib/solution/BookingTicket/index.d.ts +11 -13
  78. package/lib/solution/BookingTicket/index.js +17 -27
  79. package/lib/solution/BookingTicket/types.d.ts +9 -6
  80. package/lib/solution/BookingTicket/utils/cartView.d.ts +7 -12
  81. package/lib/solution/BookingTicket/utils/cartView.js +44 -18
  82. package/lib/solution/BookingTicket/utils/orderCustomer.d.ts +4 -0
  83. package/lib/solution/BookingTicket/utils/orderCustomer.js +58 -0
  84. package/lib/solution/Sales/index.d.ts +3 -0
  85. package/lib/solution/Sales/index.js +50 -15
  86. package/lib/solution/Sales/types.d.ts +3 -0
  87. package/lib/solution/ScanOrder/types.d.ts +4 -4
  88. package/lib/solution/ScanOrder/utils.js +3 -3
  89. package/lib/solution/ShopDiscount/index.d.ts +2 -1
  90. package/lib/solution/ShopDiscount/index.js +10 -4
  91. package/lib/solution/ShopDiscount/types.d.ts +1 -0
  92. package/package.json +1 -1
@@ -186,6 +186,25 @@ export interface UpdateProductInOrderParams {
186
186
  product_bundle?: any[];
187
187
  }
188
188
  export type AddProductBookingInput = Record<string, any>;
189
+ export interface OrderProductMergeDecisionContext {
190
+ incomingProduct: Partial<OrderProduct> & OrderProductIdentity;
191
+ normalizedIncoming: OrderProduct;
192
+ matchedProduct: OrderProduct;
193
+ matchedIndex: number;
194
+ incomingFingerprint: string;
195
+ existedFingerprint: string;
196
+ tempOrder: OrderTempOrder;
197
+ booking?: AddProductBookingInput;
198
+ defaultShouldMerge: boolean;
199
+ }
200
+ export type OrderProductMergeDecisionResult = boolean | {
201
+ shouldMerge: boolean;
202
+ reason?: string;
203
+ [key: string]: any;
204
+ };
205
+ export interface OrderHooksConfig {
206
+ onBeforeMergeProductToOrder?: (context: OrderProductMergeDecisionContext) => OrderProductMergeDecisionResult | Promise<OrderProductMergeDecisionResult>;
207
+ }
189
208
  /**
190
209
  * 订单信息
191
210
  */
@@ -306,16 +306,14 @@ function normalizeSubmitPlatform(platform) {
306
306
  return value;
307
307
  }
308
308
 
309
- // 出站重命名:后端 checkout 协议字段 option_group_item_id;
310
- // tempOrder / UI 运行时一律使用 product_option_item_id。仅保留后端契约字段,
311
- // 与 src/modules/Cart/utils/cartProduct.ts#formatOptionsToOrigin 形状一致。
309
+ // 后端 checkout 协议字段 option_group_item_id;tempOrder 内部也保持同一字段名。
312
310
  function formatSubmitOptionItems(options) {
313
311
  if (!Array.isArray(options)) return [];
314
312
  return options.map(function (d) {
315
- var _d$option_group_item_, _d$add_price;
313
+ var _d$add_price;
316
314
  var option = {
317
315
  num: d === null || d === void 0 ? void 0 : d.num,
318
- option_group_item_id: (_d$option_group_item_ = d === null || d === void 0 ? void 0 : d.option_group_item_id) !== null && _d$option_group_item_ !== void 0 ? _d$option_group_item_ : d === null || d === void 0 ? void 0 : d.product_option_item_id,
316
+ option_group_item_id: d === null || d === void 0 ? void 0 : d.option_group_item_id,
319
317
  option_group_id: d === null || d === void 0 ? void 0 : d.option_group_id
320
318
  };
321
319
  var addPrice = (_d$add_price = d === null || d === void 0 ? void 0 : d.add_price) !== null && _d$add_price !== void 0 ? _d$add_price : d === null || d === void 0 ? void 0 : d.price;
@@ -602,7 +600,10 @@ export function buildSubmitPayload(params) {
602
600
  delivery_type: tempOrder.delivery_type || 'nil',
603
601
  schedule_date: scheduleDate,
604
602
  created_at: tempOrder.created_at || formatDateTime(now),
605
- bookings: (tempOrder.bookings || []).map(function (booking) {
603
+ bookings: (tempOrder.bookings || []).filter(function (booking) {
604
+ var _parent_id;
605
+ return Number((_parent_id = booking.parent_id) !== null && _parent_id !== void 0 ? _parent_id : 0) !== 0;
606
+ }).map(function (booking) {
606
607
  return normalizeSubmitBooking(booking);
607
608
  }),
608
609
  payments: tempOrder.payments || [],
@@ -25,6 +25,9 @@ export declare class PaymentModule extends BaseModule implements Module, Payment
25
25
  private dbManager;
26
26
  private logger;
27
27
  private voucherUpdateLockByOrderUuid;
28
+ private payMethodMemoryCache;
29
+ private payMethodListInFlight;
30
+ private isRefreshingPaymentMethods;
28
31
  protected otherParams: any;
29
32
  cash: CashPayment;
30
33
  eftpos: EftposPayment;
@@ -59,6 +62,7 @@ export declare class PaymentModule extends BaseModule implements Module, Payment
59
62
  * 获取支付方式列表
60
63
  */
61
64
  getPayMethodListAsync(): Promise<PaymentMethod[]>;
65
+ private loadPayMethodListAsync;
62
66
  /**
63
67
  * 后台刷新支付方式列表
64
68
  */