@pisell/pisellos 2.2.174 → 2.2.175

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 (162) hide show
  1. package/dist/modules/Customer/index.d.ts +0 -6
  2. package/dist/modules/Customer/index.js +83 -129
  3. package/dist/modules/Customer/types.d.ts +0 -2
  4. package/dist/modules/Discount/index.d.ts +4 -2
  5. package/dist/modules/Discount/index.js +93 -8
  6. package/dist/modules/Discount/types.d.ts +7 -1
  7. package/dist/modules/Order/index.d.ts +17 -33
  8. package/dist/modules/Order/index.js +395 -757
  9. package/dist/modules/Order/types.d.ts +17 -58
  10. package/dist/modules/Order/types.js +0 -2
  11. package/dist/modules/Order/utils.d.ts +1 -39
  12. package/dist/modules/Order/utils.js +31 -220
  13. package/dist/modules/Quotation/index.d.ts +1 -0
  14. package/dist/modules/Quotation/index.js +21 -23
  15. package/dist/modules/Rules/index.d.ts +0 -4
  16. package/dist/modules/Rules/index.js +10 -26
  17. package/dist/modules/SalesSummary/index.js +2 -4
  18. package/dist/modules/Schedule/index.js +2 -6
  19. package/dist/modules/index.d.ts +0 -1
  20. package/dist/modules/index.js +1 -2
  21. package/dist/server/index.js +6 -10
  22. package/dist/server/modules/order/utils/filterOrders.js +6 -20
  23. package/dist/server/modules/products/index.d.ts +1 -1
  24. package/dist/server/modules/products/index.js +113 -130
  25. package/dist/server/modules/schedule/index.js +6 -13
  26. package/dist/solution/BaseSales/index.d.ts +7 -53
  27. package/dist/solution/BaseSales/index.js +340 -1165
  28. package/dist/solution/BaseSales/types.d.ts +1 -67
  29. package/dist/solution/BaseSales/types.js +1 -3
  30. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +16 -68
  31. package/dist/solution/BaseSales/utils.js +8 -46
  32. package/dist/solution/BookingByStep/index.d.ts +1 -1
  33. package/dist/solution/BookingTicket/index.d.ts +1 -133
  34. package/dist/solution/BookingTicket/index.js +175 -776
  35. package/dist/solution/BookingTicket/types.d.ts +0 -2
  36. package/dist/solution/BookingTicket/types.js +0 -3
  37. package/dist/solution/ScanOrder/index.d.ts +3 -9
  38. package/dist/solution/ScanOrder/index.js +128 -231
  39. package/dist/solution/ScanOrder/utils.js +8 -46
  40. package/dist/solution/ShopDiscount/index.d.ts +1 -0
  41. package/dist/solution/ShopDiscount/index.js +23 -18
  42. package/dist/solution/VenueBooking/index.d.ts +9 -5
  43. package/dist/solution/VenueBooking/index.js +55 -103
  44. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +0 -4
  45. package/dist/solution/VenueBooking/utils/slotMerge.js +0 -10
  46. package/lib/modules/Customer/index.d.ts +0 -6
  47. package/lib/modules/Customer/index.js +11 -26
  48. package/lib/modules/Customer/types.d.ts +0 -2
  49. package/lib/modules/Discount/index.d.ts +4 -2
  50. package/lib/modules/Discount/index.js +63 -8
  51. package/lib/modules/Discount/types.d.ts +7 -1
  52. package/lib/modules/Order/index.d.ts +17 -33
  53. package/lib/modules/Order/index.js +148 -402
  54. package/lib/modules/Order/types.d.ts +17 -58
  55. package/lib/modules/Order/utils.d.ts +1 -39
  56. package/lib/modules/Order/utils.js +22 -198
  57. package/lib/modules/Quotation/index.d.ts +1 -0
  58. package/lib/modules/Quotation/index.js +15 -18
  59. package/lib/modules/Rules/index.d.ts +0 -4
  60. package/lib/modules/Rules/index.js +14 -22
  61. package/lib/modules/SalesSummary/index.js +2 -4
  62. package/lib/modules/Schedule/index.js +1 -3
  63. package/lib/modules/index.d.ts +0 -1
  64. package/lib/modules/index.js +1 -3
  65. package/lib/server/index.js +0 -2
  66. package/lib/server/modules/order/utils/filterOrders.js +4 -12
  67. package/lib/server/modules/products/index.d.ts +1 -1
  68. package/lib/server/modules/products/index.js +20 -30
  69. package/lib/server/modules/schedule/index.js +1 -2
  70. package/lib/solution/BaseSales/index.d.ts +7 -53
  71. package/lib/solution/BaseSales/index.js +22 -530
  72. package/lib/solution/BaseSales/types.d.ts +1 -67
  73. package/lib/solution/BaseSales/types.js +1 -3
  74. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +12 -71
  75. package/lib/solution/BaseSales/utils.js +6 -46
  76. package/lib/solution/BookingByStep/index.d.ts +1 -1
  77. package/lib/solution/BookingTicket/index.d.ts +1 -133
  78. package/lib/solution/BookingTicket/index.js +8 -349
  79. package/lib/solution/BookingTicket/types.d.ts +0 -2
  80. package/lib/solution/BookingTicket/types.js +0 -6
  81. package/lib/solution/ScanOrder/index.d.ts +3 -9
  82. package/lib/solution/ScanOrder/index.js +66 -147
  83. package/lib/solution/ScanOrder/utils.js +6 -46
  84. package/lib/solution/ShopDiscount/index.d.ts +1 -0
  85. package/lib/solution/ShopDiscount/index.js +4 -2
  86. package/lib/solution/VenueBooking/index.d.ts +9 -5
  87. package/lib/solution/VenueBooking/index.js +14 -50
  88. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +0 -4
  89. package/lib/solution/VenueBooking/utils/slotMerge.js +0 -10
  90. package/package.json +2 -2
  91. package/dist/modules/BookingContext/index.d.ts +0 -37
  92. package/dist/modules/BookingContext/index.js +0 -436
  93. package/dist/modules/BookingContext/types.d.ts +0 -102
  94. package/dist/modules/BookingContext/types.js +0 -51
  95. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +0 -16
  96. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +0 -193
  97. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +0 -8
  98. package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +0 -137
  99. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +0 -75
  100. package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +0 -215
  101. package/dist/modules/BookingContext/utils/flexible.d.ts +0 -28
  102. package/dist/modules/BookingContext/utils/flexible.js +0 -56
  103. package/dist/modules/BookingContext/utils/formatResourceList.d.ts +0 -8
  104. package/dist/modules/BookingContext/utils/formatResourceList.js +0 -38
  105. package/dist/modules/BookingContext/utils/index.d.ts +0 -11
  106. package/dist/modules/BookingContext/utils/index.js +0 -11
  107. package/dist/modules/BookingContext/utils/noResource.d.ts +0 -13
  108. package/dist/modules/BookingContext/utils/noResource.js +0 -77
  109. package/dist/modules/BookingContext/utils/productExtend.d.ts +0 -72
  110. package/dist/modules/BookingContext/utils/productExtend.js +0 -339
  111. package/dist/modules/BookingContext/utils/resourceErrors.d.ts +0 -41
  112. package/dist/modules/BookingContext/utils/resourceErrors.js +0 -74
  113. package/dist/modules/BookingContext/utils/resourceSelection.d.ts +0 -7
  114. package/dist/modules/BookingContext/utils/resourceSelection.js +0 -24
  115. package/dist/modules/BookingContext/utils/resources.d.ts +0 -80
  116. package/dist/modules/BookingContext/utils/resources.js +0 -486
  117. package/dist/modules/BookingContext/utils/serviceTimes.d.ts +0 -55
  118. package/dist/modules/BookingContext/utils/serviceTimes.js +0 -151
  119. package/dist/modules/BookingContext/utils/timeSlices.d.ts +0 -42
  120. package/dist/modules/BookingContext/utils/timeSlices.js +0 -100
  121. package/dist/modules/Order/utils/manualProductDiscount.d.ts +0 -106
  122. package/dist/modules/Order/utils/manualProductDiscount.js +0 -212
  123. package/dist/solution/BaseSales/utils/quotationPrice.d.ts +0 -7
  124. package/dist/solution/BaseSales/utils/quotationPrice.js +0 -237
  125. package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +0 -113
  126. package/dist/solution/BookingTicket/utils/addProductDecision.js +0 -346
  127. package/lib/modules/BookingContext/index.d.ts +0 -37
  128. package/lib/modules/BookingContext/index.js +0 -297
  129. package/lib/modules/BookingContext/types.d.ts +0 -102
  130. package/lib/modules/BookingContext/types.js +0 -34
  131. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +0 -16
  132. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +0 -207
  133. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +0 -8
  134. package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +0 -141
  135. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +0 -75
  136. package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +0 -198
  137. package/lib/modules/BookingContext/utils/flexible.d.ts +0 -28
  138. package/lib/modules/BookingContext/utils/flexible.js +0 -80
  139. package/lib/modules/BookingContext/utils/formatResourceList.d.ts +0 -8
  140. package/lib/modules/BookingContext/utils/formatResourceList.js +0 -50
  141. package/lib/modules/BookingContext/utils/index.d.ts +0 -11
  142. package/lib/modules/BookingContext/utils/index.js +0 -43
  143. package/lib/modules/BookingContext/utils/noResource.d.ts +0 -13
  144. package/lib/modules/BookingContext/utils/noResource.js +0 -90
  145. package/lib/modules/BookingContext/utils/productExtend.d.ts +0 -72
  146. package/lib/modules/BookingContext/utils/productExtend.js +0 -283
  147. package/lib/modules/BookingContext/utils/resourceErrors.d.ts +0 -41
  148. package/lib/modules/BookingContext/utils/resourceErrors.js +0 -80
  149. package/lib/modules/BookingContext/utils/resourceSelection.d.ts +0 -7
  150. package/lib/modules/BookingContext/utils/resourceSelection.js +0 -46
  151. package/lib/modules/BookingContext/utils/resources.d.ts +0 -80
  152. package/lib/modules/BookingContext/utils/resources.js +0 -377
  153. package/lib/modules/BookingContext/utils/serviceTimes.d.ts +0 -55
  154. package/lib/modules/BookingContext/utils/serviceTimes.js +0 -162
  155. package/lib/modules/BookingContext/utils/timeSlices.d.ts +0 -42
  156. package/lib/modules/BookingContext/utils/timeSlices.js +0 -124
  157. package/lib/modules/Order/utils/manualProductDiscount.d.ts +0 -106
  158. package/lib/modules/Order/utils/manualProductDiscount.js +0 -207
  159. package/lib/solution/BaseSales/utils/quotationPrice.d.ts +0 -7
  160. package/lib/solution/BaseSales/utils/quotationPrice.js +0 -277
  161. package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +0 -113
  162. package/lib/solution/BookingTicket/utils/addProductDecision.js +0 -318
@@ -1,4 +1,4 @@
1
- import { OrderModule, ProductList, QuotationModule, SalesSummaryModule, ScanOrderLoggerModule as BaseSalesLoggerModule, ScheduleModule } from '../../modules';
1
+ import { OrderModule, ProductList, SalesSummaryModule, ScanOrderLoggerModule as BaseSalesLoggerModule, ScheduleModule } from '../../modules';
2
2
  import type { ScanOrderLogInput as BaseSalesLogInput, ScanOrderLoggerProviderConfig as BaseSalesLoggerProviderConfig, ScanOrderLoggerProviderType as BaseSalesLoggerProviderType } from '../../modules/ScanOrderLogger/types';
3
3
  import type { QuantityCheckResult, QuantityLimitResult } from '../../model/strategy/adapter/itemRule';
4
4
  /**
@@ -11,8 +11,6 @@ export declare const BaseSalesHookNames: {
11
11
  readonly onRetryInit: "onRetryInit";
12
12
  readonly onRefresh: "onRefresh";
13
13
  readonly onCartValidationChanged: "onCartValidationChanged";
14
- readonly onPaymentSyncStart: "onPaymentSyncStart";
15
- readonly onPaymentSyncEnd: "onPaymentSyncEnd";
16
14
  };
17
15
  export type BaseSalesHookName = typeof BaseSalesHookNames[keyof typeof BaseSalesHookNames];
18
16
  export declare function createBaseSalesHook(moduleName: string, hookName: BaseSalesHookName): string;
@@ -44,9 +42,6 @@ export interface BaseSalesOrderProductIdentity {
44
42
  product_option_item?: any[];
45
43
  product_bundle?: any[];
46
44
  }
47
- export interface BaseSalesUpdateOrderProductQuantityParams extends BaseSalesOrderProductIdentity {
48
- num: number;
49
- }
50
45
  export interface BaseSalesOrderProduct extends BaseSalesOrderProductIdentity {
51
46
  order_detail_id: number | null;
52
47
  num: number;
@@ -208,66 +203,6 @@ export interface BaseSalesSubmitPayload extends Omit<BaseSalesTempOrder, 'platfo
208
203
  }>;
209
204
  products: BaseSalesSubmitProduct[];
210
205
  }
211
- export interface BaseSalesQuotationDurationConfig {
212
- type: string;
213
- value: number;
214
- flexible_config?: {
215
- is_enable_minimum_duration?: 0 | 1;
216
- warning_threshold?: number;
217
- block_threshold?: number;
218
- };
219
- }
220
- export interface BaseSalesCalculateProductBookingPriceParams {
221
- product: Record<string, any>;
222
- booking?: {
223
- start_date?: string;
224
- start_time?: string;
225
- end_date?: string;
226
- end_time?: string;
227
- [key: string]: any;
228
- };
229
- duration?: BaseSalesQuotationDurationConfig;
230
- customer_id?: number | string;
231
- fallback_price?: number | string;
232
- datetime?: string;
233
- channel?: string;
234
- }
235
- export type BaseSalesProductBookingPriceSegmentSource = 'quotation' | 'fallback';
236
- export interface BaseSalesProductBookingPriceSegment {
237
- start_datetime: string;
238
- end_datetime?: string;
239
- time_point: string;
240
- unit_price: string;
241
- quantity: number;
242
- total_price: string;
243
- quotation_shelf_id: number;
244
- source: BaseSalesProductBookingPriceSegmentSource;
245
- }
246
- export interface BaseSalesBundleProductBookingPriceResult {
247
- bundle_id?: number;
248
- group_id?: number;
249
- bundle_group_id?: number;
250
- bundle_product_id: number | null;
251
- bundle_variant_id: number;
252
- unit_price: string;
253
- total_price: string;
254
- quantity: number;
255
- quotation_shelf_id: number;
256
- source: BaseSalesProductBookingPriceSegmentSource;
257
- segments: BaseSalesProductBookingPriceSegment[];
258
- }
259
- export interface BaseSalesProductBookingPriceResult {
260
- product_id: number | null;
261
- product_variant_id: number;
262
- customer_id?: number | string;
263
- unit_price: string;
264
- total_price: string;
265
- quantity: number;
266
- duration?: BaseSalesQuotationDurationConfig;
267
- quotation_shelf_id: number;
268
- segments: BaseSalesProductBookingPriceSegment[];
269
- product_bundle?: BaseSalesBundleProductBookingPriceResult[];
270
- }
271
206
  export type BaseSalesAvailabilityMode = 'idle' | 'shop_closed' | 'submit_disabled' | 'resource_busy' | 'additional_order_with_code' | 'additional_order';
272
207
  export interface BaseSalesTableFormRecord {
273
208
  policy?: string | null;
@@ -346,7 +281,6 @@ export interface BaseSalesState {
346
281
  error: string | null;
347
282
  products?: ProductList;
348
283
  order?: OrderModule;
349
- quotation?: QuotationModule;
350
284
  salesSummary?: SalesSummaryModule;
351
285
  baseSalesLogger?: BaseSalesLoggerModule;
352
286
  schedule?: ScheduleModule;
@@ -7,9 +7,7 @@ export var BaseSalesHookNames = {
7
7
  onDestroy: 'onDestroy',
8
8
  onRetryInit: 'onRetryInit',
9
9
  onRefresh: 'onRefresh',
10
- onCartValidationChanged: 'onCartValidationChanged',
11
- onPaymentSyncStart: 'onPaymentSyncStart',
12
- onPaymentSyncEnd: 'onPaymentSyncEnd'
10
+ onCartValidationChanged: 'onCartValidationChanged'
13
11
  };
14
12
  export function createBaseSalesHook(moduleName, hookName) {
15
13
  return "".concat(moduleName, ":").concat(hookName);
@@ -4,7 +4,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
- import { buildManualProductDiscountItem, mergeManualProductDiscountIntoList, resolveManualDiscountOriginTotal, resolveManualDiscountReasonFromSources, shouldBuildManualProductDiscount } from "../../../modules/Order/utils/manualProductDiscount";
8
7
  function toNumber(value) {
9
8
  var fallback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
10
9
  var parsedValue = Number(value);
@@ -44,19 +43,9 @@ function normalizeOptionItems(optionItems) {
44
43
  });
45
44
  }
46
45
  function normalizeBundleItems(bundleItems) {
47
- var preferPriceField = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
48
46
  if (!Array.isArray(bundleItems)) return [];
49
47
  return bundleItems.map(function (bundleItem) {
50
- var _ref2, _ref3, _ref4, _bundleItem$price, _ref5, _ref6, _ref7, _bundleItem$bundle_se, _bundleItem$num, _bundleItem$quantity, _bundleItem$price2, _ref8, _ref9, _bundleItem$original_;
51
- var unitSelling = preferPriceField ? (_ref2 = (_ref3 = (_ref4 = (_bundleItem$price = bundleItem.price) !== null && _bundleItem$price !== void 0 ? _bundleItem$price : bundleItem.bundle_selling_price) !== null && _ref4 !== void 0 ? _ref4 : bundleItem.custom_price) !== null && _ref3 !== void 0 ? _ref3 : bundleItem.product_price) !== null && _ref2 !== void 0 ? _ref2 : '0' : (_ref5 = (_ref6 = (_ref7 = (_bundleItem$bundle_se = bundleItem.bundle_selling_price) !== null && _bundleItem$bundle_se !== void 0 ? _bundleItem$bundle_se : bundleItem.price) !== null && _ref7 !== void 0 ? _ref7 : bundleItem.custom_price) !== null && _ref6 !== void 0 ? _ref6 : bundleItem.product_price) !== null && _ref5 !== void 0 ? _ref5 : '0';
52
- var unitStr = toPriceString(unitSelling, '0.00');
53
- var num = toSafePositiveInt((_bundleItem$num = bundleItem === null || bundleItem === void 0 ? void 0 : bundleItem.num) !== null && _bundleItem$num !== void 0 ? _bundleItem$num : bundleItem === null || bundleItem === void 0 ? void 0 : bundleItem.quantity, 1);
54
48
  return _objectSpread(_objectSpread({}, bundleItem), {}, {
55
- num: num,
56
- quantity: (_bundleItem$quantity = bundleItem === null || bundleItem === void 0 ? void 0 : bundleItem.quantity) !== null && _bundleItem$quantity !== void 0 ? _bundleItem$quantity : num,
57
- price: (_bundleItem$price2 = bundleItem.price) !== null && _bundleItem$price2 !== void 0 ? _bundleItem$price2 : unitStr,
58
- bundle_selling_price: unitStr,
59
- original_price: (_ref8 = (_ref9 = (_bundleItem$original_ = bundleItem.original_price) !== null && _bundleItem$original_ !== void 0 ? _bundleItem$original_ : bundleItem.product_price) !== null && _ref9 !== void 0 ? _ref9 : bundleItem.price) !== null && _ref8 !== void 0 ? _ref8 : unitStr,
60
49
  option: normalizeOptionItems(bundleItem === null || bundleItem === void 0 ? void 0 : bundleItem.option)
61
50
  });
62
51
  });
@@ -75,55 +64,23 @@ function findVariantById(origin, variantId) {
75
64
  * 注意:这里不生成 identity,缺省时由 OrderModule 自动补齐。
76
65
  */
77
66
  export function transformBaseProductToOrderProduct(params) {
78
- var _ref10, _ref11, _ref12, _payload$product_id, _ref13, _ref14, _payload$product_vari, _payload$_origin, _payload$_origin2, _ref15, _findVariantById, _ref16, _ref17, _ref18, _ref19, _ref20, _ref21, _ref22, _payload$price, _ref23, _payload$line_total, _payload$_extend, _ref24, _payload$option, _payload$bundle, _payload$quantity, _payload$_extend2, _extend, _extend2, _ref25, _ref26, _origin$base_price, _ref27, _ref28, _payload$line_total2, _payload$_extend3, _payload$_extend4, _extend3, _payload$_extend5, _payload$_extend6, _ref29, _ref30, _payload$tax_fee, _ref31, _ref32, _payload$is_charge_ta;
67
+ var _ref2, _ref3, _ref4, _payload$product_id, _ref5, _ref6, _payload$product_vari, _payload$_origin, _payload$_origin2, _ref7, _findVariantById, _ref8, _ref9, _ref10, _ref11, _ref12, _ref13, _ref14, _payload$price, _ref15, _payload$option, _payload$bundle, _payload$unique_ident, _payload$quantity, _ref16, _ref17, _payload$tax_fee, _ref18, _ref19, _payload$is_charge_ta;
79
68
  var payload = params.payload,
80
69
  _params$fallbackProdu = params.fallbackProductId,
81
70
  fallbackProductId = _params$fallbackProdu === void 0 ? null : _params$fallbackProdu;
82
71
  if (!payload || _typeof(payload) !== 'object') return null;
83
72
  var sourceProduct = params.sourceProduct || params.sourceItem || {};
84
- var productId = toProductId((_ref10 = (_ref11 = (_ref12 = (_payload$product_id = payload.product_id) !== null && _payload$product_id !== void 0 ? _payload$product_id : payload.id) !== null && _ref12 !== void 0 ? _ref12 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.product_id) !== null && _ref11 !== void 0 ? _ref11 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.id) !== null && _ref10 !== void 0 ? _ref10 : fallbackProductId);
73
+ var productId = toProductId((_ref2 = (_ref3 = (_ref4 = (_payload$product_id = payload.product_id) !== null && _payload$product_id !== void 0 ? _payload$product_id : payload.id) !== null && _ref4 !== void 0 ? _ref4 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.product_id) !== null && _ref3 !== void 0 ? _ref3 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.id) !== null && _ref2 !== void 0 ? _ref2 : fallbackProductId);
85
74
  if (productId === null) return null;
86
- var productVariantId = toNumber((_ref13 = (_ref14 = (_payload$product_vari = payload.product_variant_id) !== null && _payload$product_vari !== void 0 ? _payload$product_vari : payload.variant_id) !== null && _ref14 !== void 0 ? _ref14 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.product_variant_id) !== null && _ref13 !== void 0 ? _ref13 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.variant_id, 0);
75
+ var productVariantId = toNumber((_ref5 = (_ref6 = (_payload$product_vari = payload.product_variant_id) !== null && _payload$product_vari !== void 0 ? _payload$product_vari : payload.variant_id) !== null && _ref6 !== void 0 ? _ref6 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.product_variant_id) !== null && _ref5 !== void 0 ? _ref5 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.variant_id, 0);
87
76
  var callbackOrigin = payload.origin || ((_payload$_origin = payload._origin) === null || _payload$_origin === void 0 ? void 0 : _payload$_origin.sourceProduct) || ((_payload$_origin2 = payload._origin) === null || _payload$_origin2 === void 0 ? void 0 : _payload$_origin2.sourceItem) || payload._origin || {};
88
77
  var origin = _objectSpread(_objectSpread({}, sourceProduct || {}), callbackOrigin || {});
89
- var matchedVariant = (_ref15 = (_findVariantById = findVariantById(callbackOrigin, productVariantId)) !== null && _findVariantById !== void 0 ? _findVariantById : findVariantById(sourceProduct, productVariantId)) !== null && _ref15 !== void 0 ? _ref15 : findVariantById(origin, productVariantId);
90
- var sourceProductPrice = toPriceString((_ref16 = (_ref17 = (_ref18 = (_ref19 = (_ref20 = (_ref21 = (_ref22 = (_payload$price = payload.price) !== null && _payload$price !== void 0 ? _payload$price : payload.selling_price) !== null && _ref22 !== void 0 ? _ref22 : matchedVariant === null || matchedVariant === void 0 ? void 0 : matchedVariant.price) !== null && _ref21 !== void 0 ? _ref21 : matchedVariant === null || matchedVariant === void 0 ? void 0 : matchedVariant.base_price) !== null && _ref20 !== void 0 ? _ref20 : origin === null || origin === void 0 ? void 0 : origin.price) !== null && _ref19 !== void 0 ? _ref19 : origin === null || origin === void 0 ? void 0 : origin.base_price) !== null && _ref18 !== void 0 ? _ref18 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.price) !== null && _ref17 !== void 0 ? _ref17 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.selling_price) !== null && _ref16 !== void 0 ? _ref16 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.base_price, '0.00');
91
- var lineCompositeTotal = toPriceString((_ref23 = (_payload$line_total = payload.line_total) !== null && _payload$line_total !== void 0 ? _payload$line_total : payload.total) !== null && _ref23 !== void 0 ? _ref23 : (_payload$_extend = payload._extend) === null || _payload$_extend === void 0 ? void 0 : _payload$_extend.total, sourceProductPrice);
92
- var hasPriceOverride = payload.price_override !== undefined && payload.price_override !== null && payload.price_override !== '';
93
- var productOptionItem = normalizeOptionItems((_ref24 = (_payload$option = payload.option) !== null && _payload$option !== void 0 ? _payload$option : payload.options) !== null && _ref24 !== void 0 ? _ref24 : payload.product_option_item);
94
- var productBundle = normalizeBundleItems((_payload$bundle = payload.bundle) !== null && _payload$bundle !== void 0 ? _payload$bundle : payload.product_bundle, hasPriceOverride);
95
- // `payload.unique` 是业务侧商品/票务标识,可能在连续加同一商品时重复;
96
- // 行级唯一值只接受显式协议字段,缺省交给 OrderModule 生成。
97
- var uniqueIdentificationNumber = payload.unique_identification_number;
98
- var resolvedQuantity = toSafePositiveInt((_payload$quantity = payload.quantity) !== null && _payload$quantity !== void 0 ? _payload$quantity : payload.num, 1);
99
- var originTotal = resolveManualDiscountOriginTotal({
100
- originTotal: payload.origin_total,
101
- extendOriginTotal: (_payload$_extend2 = payload._extend) === null || _payload$_extend2 === void 0 ? void 0 : _payload$_extend2.origin_total,
102
- originExtendOriginTotal: origin === null || origin === void 0 || (_extend = origin._extend) === null || _extend === void 0 ? void 0 : _extend.origin_total,
103
- sourceExtendOriginTotal: sourceProduct === null || sourceProduct === void 0 || (_extend2 = sourceProduct._extend) === null || _extend2 === void 0 ? void 0 : _extend2.origin_total,
104
- catalogUnitPrice: (_ref25 = (_ref26 = (_origin$base_price = origin === null || origin === void 0 ? void 0 : origin.base_price) !== null && _origin$base_price !== void 0 ? _origin$base_price : origin === null || origin === void 0 ? void 0 : origin.price) !== null && _ref26 !== void 0 ? _ref26 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.base_price) !== null && _ref25 !== void 0 ? _ref25 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.price,
105
- quantity: resolvedQuantity
106
- });
107
- var sellingTotal = Number((_ref27 = (_ref28 = (_payload$line_total2 = payload.line_total) !== null && _payload$line_total2 !== void 0 ? _payload$line_total2 : payload.total) !== null && _ref28 !== void 0 ? _ref28 : (_payload$_extend3 = payload._extend) === null || _payload$_extend3 === void 0 ? void 0 : _payload$_extend3.total) !== null && _ref27 !== void 0 ? _ref27 : lineCompositeTotal);
108
- var discountReason = resolveManualDiscountReasonFromSources({
109
- discountReason: payload.discount_reason,
110
- extendDiscountReason: (_payload$_extend4 = payload._extend) === null || _payload$_extend4 === void 0 ? void 0 : _payload$_extend4.discount_reason,
111
- originExtendDiscountReason: origin === null || origin === void 0 || (_extend3 = origin._extend) === null || _extend3 === void 0 ? void 0 : _extend3.discount_reason
112
- });
113
- var lineOriginalPrice = hasPriceOverride && Number.isFinite(originTotal) ? toPriceString(originTotal) : lineCompositeTotal;
114
- var manualDiscountList = shouldBuildManualProductDiscount({
115
- hasPriceOverride: hasPriceOverride,
116
- originTotal: originTotal,
117
- sellingTotal: sellingTotal
118
- }) ? mergeManualProductDiscountIntoList(payload.discount_list, buildManualProductDiscountItem({
119
- originTotal: Number.isFinite(originTotal) ? originTotal : Number(lineOriginalPrice),
120
- sellingTotal: Number.isFinite(sellingTotal) ? sellingTotal : Number(lineCompositeTotal),
121
- quantity: resolvedQuantity,
122
- message: discountReason,
123
- discountway: (_payload$_extend5 = payload._extend) === null || _payload$_extend5 === void 0 ? void 0 : _payload$_extend5.discountway,
124
- discount_per: (_payload$_extend6 = payload._extend) === null || _payload$_extend6 === void 0 ? void 0 : _payload$_extend6.discount_per
125
- })) : payload.discount_list || [];
126
- var metadata = _objectSpread(_objectSpread({
78
+ var matchedVariant = (_ref7 = (_findVariantById = findVariantById(callbackOrigin, productVariantId)) !== null && _findVariantById !== void 0 ? _findVariantById : findVariantById(sourceProduct, productVariantId)) !== null && _ref7 !== void 0 ? _ref7 : findVariantById(origin, productVariantId);
79
+ var sourceProductPrice = toPriceString((_ref8 = (_ref9 = (_ref10 = (_ref11 = (_ref12 = (_ref13 = (_ref14 = (_payload$price = payload.price) !== null && _payload$price !== void 0 ? _payload$price : payload.selling_price) !== null && _ref14 !== void 0 ? _ref14 : matchedVariant === null || matchedVariant === void 0 ? void 0 : matchedVariant.price) !== null && _ref13 !== void 0 ? _ref13 : matchedVariant === null || matchedVariant === void 0 ? void 0 : matchedVariant.base_price) !== null && _ref12 !== void 0 ? _ref12 : origin === null || origin === void 0 ? void 0 : origin.price) !== null && _ref11 !== void 0 ? _ref11 : origin === null || origin === void 0 ? void 0 : origin.base_price) !== null && _ref10 !== void 0 ? _ref10 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.price) !== null && _ref9 !== void 0 ? _ref9 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.selling_price) !== null && _ref8 !== void 0 ? _ref8 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.base_price, '0.00');
80
+ var productOptionItem = normalizeOptionItems((_ref15 = (_payload$option = payload.option) !== null && _payload$option !== void 0 ? _payload$option : payload.options) !== null && _ref15 !== void 0 ? _ref15 : payload.product_option_item);
81
+ var productBundle = normalizeBundleItems((_payload$bundle = payload.bundle) !== null && _payload$bundle !== void 0 ? _payload$bundle : payload.product_bundle);
82
+ var uniqueIdentificationNumber = (_payload$unique_ident = payload.unique_identification_number) !== null && _payload$unique_ident !== void 0 ? _payload$unique_ident : payload.unique;
83
+ var metadata = {
127
84
  unique: payload.unique,
128
85
  session: payload.session,
129
86
  form: payload.form,
@@ -134,15 +91,8 @@ export function transformBaseProductToOrderProduct(params) {
134
91
  policy_id: payload.policy_id,
135
92
  source_shop_id: payload.source_shop_id,
136
93
  origin: origin,
137
- source_product_price: sourceProductPrice,
138
- main_product_selling_price: sourceProductPrice,
139
- main_product_original_price: sourceProductPrice
140
- }, hasPriceOverride ? {
141
- price_override: String(payload.price_override),
142
- is_manual_discount: 1
143
- } : {}), payload.bundle_edit !== undefined ? {
144
- bundle_edit: payload.bundle_edit
145
- } : {});
94
+ source_product_price: sourceProductPrice
95
+ };
146
96
  if (uniqueIdentificationNumber) {
147
97
  metadata.unique_identification_number = String(uniqueIdentificationNumber);
148
98
  }
@@ -150,15 +100,13 @@ export function transformBaseProductToOrderProduct(params) {
150
100
  product_id: productId,
151
101
  product_variant_id: productVariantId,
152
102
  unique_identification_number: uniqueIdentificationNumber ? String(uniqueIdentificationNumber) : undefined,
153
- num: resolvedQuantity,
103
+ num: toSafePositiveInt((_payload$quantity = payload.quantity) !== null && _payload$quantity !== void 0 ? _payload$quantity : payload.num, 1),
154
104
  product_option_item: productOptionItem,
155
105
  product_bundle: productBundle,
156
- discount_list: manualDiscountList,
157
- // 折后行价由 normalizeOrderProduct 按 main + bundle 合成;手动改价时 bundle 已为分摊后单价
158
- selling_price: lineCompositeTotal,
159
- original_price: lineOriginalPrice,
160
- tax_fee: toPriceString((_ref29 = (_ref30 = (_payload$tax_fee = payload.tax_fee) !== null && _payload$tax_fee !== void 0 ? _payload$tax_fee : matchedVariant === null || matchedVariant === void 0 ? void 0 : matchedVariant.tax_fee) !== null && _ref30 !== void 0 ? _ref30 : origin === null || origin === void 0 ? void 0 : origin.tax_fee) !== null && _ref29 !== void 0 ? _ref29 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.tax_fee, '0.00'),
161
- is_charge_tax: toNumber((_ref31 = (_ref32 = (_payload$is_charge_ta = payload.is_charge_tax) !== null && _payload$is_charge_ta !== void 0 ? _payload$is_charge_ta : matchedVariant === null || matchedVariant === void 0 ? void 0 : matchedVariant.is_charge_tax) !== null && _ref32 !== void 0 ? _ref32 : origin === null || origin === void 0 ? void 0 : origin.is_charge_tax) !== null && _ref31 !== void 0 ? _ref31 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.is_charge_tax, 0),
106
+ selling_price: sourceProductPrice,
107
+ original_price: sourceProductPrice,
108
+ tax_fee: toPriceString((_ref16 = (_ref17 = (_payload$tax_fee = payload.tax_fee) !== null && _payload$tax_fee !== void 0 ? _payload$tax_fee : matchedVariant === null || matchedVariant === void 0 ? void 0 : matchedVariant.tax_fee) !== null && _ref17 !== void 0 ? _ref17 : origin === null || origin === void 0 ? void 0 : origin.tax_fee) !== null && _ref16 !== void 0 ? _ref16 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.tax_fee, '0.00'),
109
+ is_charge_tax: toNumber((_ref18 = (_ref19 = (_payload$is_charge_ta = payload.is_charge_tax) !== null && _payload$is_charge_ta !== void 0 ? _payload$is_charge_ta : matchedVariant === null || matchedVariant === void 0 ? void 0 : matchedVariant.is_charge_tax) !== null && _ref19 !== void 0 ? _ref19 : origin === null || origin === void 0 ? void 0 : origin.is_charge_tax) !== null && _ref18 !== void 0 ? _ref18 : sourceProduct === null || sourceProduct === void 0 ? void 0 : sourceProduct.is_charge_tax, 0),
162
110
  metadata: metadata,
163
111
  note: payload.note != null ? String(payload.note) : '',
164
112
  _origin: _objectSpread(_objectSpread({}, sourceProduct || {}), {}, {
@@ -5,8 +5,7 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
7
  import Decimal from 'decimal.js';
8
- import { composeLinePrice, createUuidV4, resolveManualOverrideLineOriginalPrice, sumOptionUnitPrice } from "../../modules/Order/utils";
9
- import { ensureManualProductDiscountList } from "../../modules/Order/utils/manualProductDiscount";
8
+ import { composeLinePrice, createUuidV4, sumOptionUnitPrice } from "../../modules/Order/utils";
10
9
 
11
10
  /**
12
11
  * 构建金额全为 0 的空 summary。
@@ -107,42 +106,17 @@ export function isSkuOnlyDeleteIdentity(x) {
107
106
  * - 因此多次 normalize 不会重复叠加 option/bundle。
108
107
  */
109
108
  export function normalizeOrderProduct(product) {
110
- var _product$metadata, _metadata$origin, _metadata$origin2, _variantList$find, _product$is_charge_ta;
109
+ var _product$metadata, _metadata$origin, _variantList$find, _product$is_charge_ta;
111
110
  var metadata = _objectSpread({}, product.metadata || {});
112
111
  // 不透明 identity 契约:每条订单行必须带 identity_key。
113
112
  // 调用方未传时由 SDK 自动生成 UUID,后续 update/remove 只做严格比对,避免猜测合成 key。
114
113
  var resolvedIdentityKey = (_product$metadata = product.metadata) !== null && _product$metadata !== void 0 && _product$metadata.unique_identification_number ? String(product.metadata.unique_identification_number) : product.unique_identification_number && String(product.unique_identification_number).length > 0 ? String(product.unique_identification_number) : product.identity_key && String(product.identity_key).length > 0 ? String(product.identity_key) : createUuidV4();
115
114
  metadata.unique_identification_number = resolvedIdentityKey;
116
- var priceOverride = metadata.price_override;
117
- var originOtherBundle = (_metadata$origin = metadata.origin) === null || _metadata$origin === void 0 || (_metadata$origin = _metadata$origin._extend) === null || _metadata$origin === void 0 || (_metadata$origin = _metadata$origin.other) === null || _metadata$origin === void 0 ? void 0 : _metadata$origin.bundle;
118
- var bundleInput = product.product_bundle || [];
119
- if (priceOverride !== undefined && priceOverride !== null && priceOverride !== '' && Array.isArray(originOtherBundle) && originOtherBundle.length > 0) {
120
- var priceById = new Map();
121
- originOtherBundle.forEach(function (item) {
122
- var _item$price2;
123
- if ((item === null || item === void 0 ? void 0 : item.id) == null) return;
124
- var unit = (_item$price2 = item.price) !== null && _item$price2 !== void 0 ? _item$price2 : item.bundle_selling_price;
125
- if (unit === undefined || unit === null) return;
126
- priceById.set(String(item.id), String(unit));
127
- });
128
- var base = Array.isArray(bundleInput) && bundleInput.length > 0 ? bundleInput : originOtherBundle;
129
- bundleInput = base.map(function (item) {
130
- var unit = priceById.get(String(item === null || item === void 0 ? void 0 : item.id));
131
- if (unit === undefined) return item;
132
- return _objectSpread(_objectSpread({}, item), {}, {
133
- price: unit,
134
- bundle_selling_price: unit
135
- });
136
- });
137
- }
138
- var normalizedBundle = bundleInput.map(function (item) {
139
- var _item$bundle_id2, _item$bundle_product_, _item$bundle_group_id, _ref2, _item$bundle_selling_, _ref3, _ref4, _item$price3, _ref5, _item$price_type, _ref6, _item$price_type_ext;
115
+ var normalizedBundle = (product.product_bundle || []).map(function (item) {
116
+ var _ref2, _item$bundle_selling_, _ref3, _ref4, _item$price2, _ref5, _item$price_type, _ref6, _item$price_type_ext;
140
117
  return _objectSpread(_objectSpread({}, item), {}, {
141
- bundle_id: (_item$bundle_id2 = item.bundle_id) !== null && _item$bundle_id2 !== void 0 ? _item$bundle_id2 : item.id,
142
- bundle_product_id: (_item$bundle_product_ = item.bundle_product_id) !== null && _item$bundle_product_ !== void 0 ? _item$bundle_product_ : item._bundle_product_id,
143
- bundle_group_id: (_item$bundle_group_id = item.bundle_group_id) !== null && _item$bundle_group_id !== void 0 ? _item$bundle_group_id : item.group_id,
144
118
  bundle_selling_price: (_ref2 = (_item$bundle_selling_ = item.bundle_selling_price) !== null && _item$bundle_selling_ !== void 0 ? _item$bundle_selling_ : item.price) !== null && _ref2 !== void 0 ? _ref2 : '0.00',
145
- price: (_ref3 = (_ref4 = (_item$price3 = item.price) !== null && _item$price3 !== void 0 ? _item$price3 : item.custom_price) !== null && _ref4 !== void 0 ? _ref4 : item.bundle_selling_price) !== null && _ref3 !== void 0 ? _ref3 : '0.00',
119
+ price: (_ref3 = (_ref4 = (_item$price2 = item.price) !== null && _item$price2 !== void 0 ? _item$price2 : item.custom_price) !== null && _ref4 !== void 0 ? _ref4 : item.bundle_selling_price) !== null && _ref3 !== void 0 ? _ref3 : '0.00',
146
120
  price_type: (_ref5 = (_item$price_type = item.price_type) !== null && _item$price_type !== void 0 ? _item$price_type : item.custom_price_type) !== null && _ref5 !== void 0 ? _ref5 : '',
147
121
  price_type_ext: (_ref6 = (_item$price_type_ext = item.price_type_ext) !== null && _item$price_type_ext !== void 0 ? _item$price_type_ext : item.custom_price_type_ext) !== null && _ref6 !== void 0 ? _ref6 : ''
148
122
  });
@@ -160,7 +134,7 @@ export function normalizeOrderProduct(product) {
160
134
  // 6) 入参 selling_price(最末兜底,新添加路径 caller 只给 selling_price)
161
135
  var isV2 = metadata.price_schema_version === 2 || metadata.price_schema_version === '2';
162
136
  var variantId = Number(product.product_variant_id || 0);
163
- var variantList = variantId ? metadata === null || metadata === void 0 || (_metadata$origin2 = metadata.origin) === null || _metadata$origin2 === void 0 ? void 0 : _metadata$origin2.variant : null;
137
+ var variantList = variantId ? metadata === null || metadata === void 0 || (_metadata$origin = metadata.origin) === null || _metadata$origin === void 0 ? void 0 : _metadata$origin.variant : null;
164
138
  var variantPrice = Array.isArray(variantList) ? (_variantList$find = variantList.find(function (v) {
165
139
  return Number(v === null || v === void 0 ? void 0 : v.id) === variantId;
166
140
  })) === null || _variantList$find === void 0 ? void 0 : _variantList$find.price : undefined;
@@ -230,18 +204,6 @@ export function normalizeOrderProduct(product) {
230
204
  bundle: normalizedBundle,
231
205
  useOriginalBundle: true
232
206
  });
233
- var finalOriginalPrice = resolveManualOverrideLineOriginalPrice({
234
- num: product.num,
235
- metadata: metadata,
236
- lineOriginalPrice: product.original_price
237
- }, composedOriginalPrice);
238
- var discountList = ensureManualProductDiscountList({
239
- discountList: product.discount_list,
240
- metadata: metadata,
241
- originalPrice: finalOriginalPrice,
242
- sellingPrice: composedSellingPrice,
243
- quantity: getSafeProductNum(product.num)
244
- });
245
207
  return {
246
208
  order_detail_id: product.order_detail_id || null,
247
209
  product_id: product.product_id,
@@ -249,10 +211,10 @@ export function normalizeOrderProduct(product) {
249
211
  product_variant_id: product.product_variant_id,
250
212
  product_option_item: normalizedOptions,
251
213
  selling_price: composedSellingPrice,
252
- original_price: finalOriginalPrice,
214
+ original_price: composedOriginalPrice,
253
215
  tax_fee: product.tax_fee || '0.00',
254
216
  is_charge_tax: (_product$is_charge_ta = product.is_charge_tax) !== null && _product$is_charge_ta !== void 0 ? _product$is_charge_ta : 0,
255
- discount_list: discountList,
217
+ discount_list: product.discount_list || [],
256
218
  product_bundle: normalizedBundle,
257
219
  metadata: metadata,
258
220
  note: product.note != null ? String(product.note) : ''
@@ -311,7 +311,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
311
311
  date: string;
312
312
  status: string;
313
313
  week: string;
314
- weekNum: 0 | 1 | 2 | 6 | 3 | 5 | 4;
314
+ weekNum: 0 | 2 | 1 | 5 | 3 | 4 | 6;
315
315
  }[]>;
316
316
  submitTimeSlot(timeSlots: TimeSliceItem): void;
317
317
  private getScheduleDataByIds;
@@ -1,16 +1,10 @@
1
1
  import { Module, ModuleOptions, PisellCore } from '../../types';
2
2
  import { BookingTicketCartView, BookingTicketProductCatalogView, BookingTicketState, IGetCustomerListParams, ICustomer, ILoadProductsParams, ILoadProductDetailParams, IScanResult } from './types';
3
3
  import type { ProductData } from '../../modules';
4
- import { type BookingContextConfig, type BookingContextDateInput, type BookingContextResource, type BookingContextResourceMap, type BookingContextState, type InitBookingContextParams, type LoadBookingConfigParams, type LoadBookingResourcesParams, type ResourceError, type BookingCalcContext } from '../../modules/BookingContext';
5
4
  import type { OrderCustomerView } from '../../modules/Order/types';
6
5
  import { BaseSalesImpl } from '../BaseSales';
7
- import type { BaseSalesScanCodeResult } from '../BaseSales/types';
8
6
  import type { ISalesDetail } from '../BaseSales/utils/parseSalesResponse';
9
7
  import type { LoadSalesDetailParams } from '../../modules/Order/types';
10
- import { AddProductDecideContext, AddProductRequiresDetailPayload } from './utils/addProductDecision';
11
- import { type BuildCacheItemFromOrderLineInput } from '../../modules/BookingContext/utils/buildCacheItemFromOrderLine';
12
- import { type BuildNormalProductCacheItemFromOrderLineInput } from '../../modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine';
13
- import type { AddProductBookingInput, OrderProduct, OrderProductIdentity, UpdateOrderProductParams } from '../../modules/Order/types';
14
8
  export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
15
9
  protected defaultName: string;
16
10
  protected defaultVersion: string;
@@ -22,14 +16,10 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
22
16
  private platform;
23
17
  private scan;
24
18
  private productCatalog;
25
- private orderCustomerDiscountRefreshInFlight;
26
- private orderCustomerDiscountRefreshCustomerId;
27
19
  /**
28
- * 在 BaseSales 默认模块清单(products/order/salesSummary/schedule)基础上追加 customer + bookingContext
29
- * bookingContext 是 SalesSdk 加车下沉所需的「预约 UI 上下文」(bookingConfig / resourcesOrigin / date)。
20
+ * 在 BaseSales 默认模块清单(products/order/salesSummary/schedule)基础上追加 customer。
30
21
  */
31
22
  protected getRegisteredModuleNames(): readonly string[];
32
- protected getSubmitOrderSalesChannel(): string;
33
23
  /**
34
24
  * 业务侧子模块工厂:BookingTicket 自带的 createBookingTicketModule 优先匹配;
35
25
  * 未识别的模块名(如 BookingByStep 公共类型)回退到父类工厂。
@@ -44,14 +34,6 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
44
34
  * 让现有 setActiveCustomer / getActiveCustomer 调用方零成本拿到详情态客户。
45
35
  */
46
36
  loadSalesDetail(orderIdOrParams: number | string | LoadSalesDetailParams): Promise<ISalesDetail>;
47
- scanPromotionCode(code: string, customerId?: number): Promise<BaseSalesScanCodeResult>;
48
- private hydrateOrderCustomerFromScanDiscounts;
49
- private getDiscountCustomerId;
50
- private resolveCustomerByDiscountCustomerId;
51
- private findCustomerById;
52
- private normalizeCustomer;
53
- private getRawCustomerId;
54
- private hasUsableCustomerDetails;
55
37
  /**
56
38
  * 更新当前预约的 appointment_status。
57
39
  *
@@ -204,19 +186,8 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
204
186
  * 清空下单客户(协议字段 + snapshot)。
205
187
  */
206
188
  clearOrderCustomer(): void;
207
- /**
208
- * 重置 tempOrder,并同步清空下单客户运行态。
209
- *
210
- * OrderModule.restoreOrder 会重建空单(customer_id 已为 null),但不会:
211
- * - emit BookingTicket `onOrderCustomerChange`
212
- * - 重置 CustomerModule.selectedCustomer(老路 getActiveCustomer)
213
- *
214
- * 因此在 super.restoreOrder 之后显式清客户,保证 SalesSdk / ticketBooking 订阅方与 tempOrder 一致。
215
- */
216
- restoreOrder(): Promise<import("../../modules/Order/types").OrderTempOrder>;
217
189
  /** 内部:基于 OrderModule 当前状态构造一份 OrderCustomerChangePayload。 */
218
190
  private buildOrderCustomerPayload;
219
- private refreshDiscountConfigAfterOrderCustomerChange;
220
191
  /**
221
192
  * 获取客户分页信息
222
193
  * @returns 分页信息
@@ -320,109 +291,6 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
320
291
  * @returns 其他参数
321
292
  */
322
293
  getOtherParams(): Promise<Record<string, any>>;
323
- /** 拉取 board config 并写入 BookingContext。 */
324
- loadBookingConfig(params?: LoadBookingConfigParams): Promise<BookingContextConfig | null>;
325
- /** 拉取资源全集并写入 BookingContext。 */
326
- loadBookingResources(params?: LoadBookingResourcesParams): Promise<BookingContextResource[]>;
327
- /** 初始化 BookingContext(date + config + resources)。 */
328
- initBookingContext(params?: InitBookingContextParams): Promise<BookingContextState>;
329
- /** 当前 store 是否已具备与入参等价的 config / resources(无需再请求接口)。 */
330
- isBookingContextReady(params?: InitBookingContextParams): boolean;
331
- /** 写入 booking config(来源:`/core/board/management/config`)。 */
332
- setBookingConfig(config: BookingContextConfig | null): void;
333
- /** 读取当前 booking config。 */
334
- getBookingConfig(): BookingContextConfig | null;
335
- /** 写入资源全集(来源:`/form/schedule`),同步派生 resourcesOriginMap。 */
336
- setResources(resources: BookingContextResource[] | null | undefined): void;
337
- /** 读取资源全集(浅克隆)。 */
338
- getResourcesOrigin(): BookingContextResource[];
339
- /** 读取资源全集 map(id → resource)。 */
340
- getResourcesOriginMap(): BookingContextResourceMap;
341
- /** 写入当前选择的日期;支持 dayjs / Date / string。 */
342
- setBookingDate(date: BookingContextDateInput): void;
343
- /** 读取当前选择的日期(统一 string)。 */
344
- getBookingDate(): string | null;
345
- /** 读取 BookingContext 完整 store(调试 / 测试 / 透传给 SDK 使用)。 */
346
- getBookingContextState(): BookingContextState;
347
- /** 清空 BookingContext(切租户 / destroy 场景)。 */
348
- clearBookingContext(): void;
349
- /**
350
- * 构造 BookingContext 计算上下文(供 getProductExtend / getResourceByIds 等读 API 复用)。
351
- */
352
- private buildBookingCalcContext;
353
- /**
354
- * 取商品当前可选资源列表(透传 OS BookingContext utils#getResourceByIds)。
355
- * `extraResources` 用于把拖入未绑定的资源也展示出来。
356
- */
357
- getResourcesForProduct(product: any, options?: {
358
- extraResources?: Array<{
359
- form_id: number | string;
360
- id: number;
361
- }>;
362
- }): any[];
363
- /**
364
- * 拼装 cacheItem 的 _extend / _data(资源 / 容量 / timeObj),与 info2 `getProductExtend` 等价。
365
- */
366
- getProductExtend(cacheItem: any, extra?: Partial<BookingCalcContext>): any;
367
- /**
368
- * 取资源不可用原因列表(结构化 enum + params,i18n 文案由 UI 渲染)。
369
- */
370
- getResourceErrors(resource: any, cacheItem: any): ResourceError[];
371
- /**
372
- * 拼装 addProductDecision 通用上下文(从 store 自取)。
373
- */
374
- private buildAddProductCtx;
375
- /**
376
- * 加车两阶段主决策(规格弹窗 / 资源编辑 / 直接加车)。
377
- * 与 ticketBooking `handleSelectProduct` + `handleBooking4Service` 等价。
378
- */
379
- decideAddProduct(item: any, options?: Partial<AddProductDecideContext>): import("./utils/addProductDecision").AddProductDecision;
380
- /** 规格弹窗 callback 后的第二段决策。 */
381
- decideAfterDetail(cacheItem: any, options?: Partial<AddProductDecideContext>): import("./utils/addProductDecision").AddProductDecision;
382
- /**
383
- * @deprecated 请用 `decideAddProduct`;`autoClose=true` 仅当 action=add。
384
- */
385
- decideAutoClose(item: any, options?: Partial<AddProductDecideContext>): {
386
- autoClose: boolean;
387
- cacheItem?: any;
388
- };
389
- /** 替代 info2 `getIsEject`:商品是否需要弹窗(0/1)。 */
390
- getIsEject(item: any, type?: 'select' | 'detail'): 0 | 1;
391
- /** 仅 session 商品(无 variant/option/package)→ true。 */
392
- getIsOnlySession(item: any): boolean;
393
- /**
394
- * 拼装 requiresDetail payload(给 SDK 直接 return 给 UI 用)。
395
- */
396
- buildRequiresDetailPayload(item: any, options?: Partial<AddProductDecideContext>): AddProductRequiresDetailPayload;
397
- /**
398
- * 把 detail 弹窗回调结果(e, extension_type, detail)转换为 `(product, booking)` 入参。
399
- * 内部会先拼 cacheItem,再走 cacheItemToBookingInput 严格协议对齐。
400
- */
401
- transformDetailToProductAndBooking(input: {
402
- item: any;
403
- cacheItem?: any;
404
- detailResult?: {
405
- e: any;
406
- extension_type?: any;
407
- detail?: any;
408
- };
409
- options?: Partial<AddProductDecideContext>;
410
- }): {
411
- product: Partial<OrderProduct> & OrderProductIdentity;
412
- booking?: AddProductBookingInput;
413
- cacheItem: any;
414
- };
415
- /**
416
- * 从已加车的 order line + booking 反查资源编辑抽屉所需的 cacheItem。
417
- * 供 SalesSdk「编辑资源」等场景使用;字段语义与 buildCacheItemFromDetail 产出对齐。
418
- */
419
- buildCacheItemFromOrderLine(input: BuildCacheItemFromOrderLineInput): Record<string, any>;
420
- /**
421
- * 从已加车的普通商品 order line 反查 SkuDetailModal edit 所需的 cacheItem。
422
- */
423
- buildNormalProductCacheItemFromOrderLine(input: BuildNormalProductCacheItemFromOrderLineInput): Record<string, any>;
424
- /** 文档别名:与 OrderModule.updateOrderProduct 一致。 */
425
- updateProductInOrder(params: UpdateOrderProductParams): Promise<OrderProduct[]>;
426
294
  /**
427
295
  * 销毁模块:先调用父类(销毁所有 store 内子模块 + emit destroy + super.destroy()),
428
296
  * 再清理 BookingTicket 自有资源(scan 监听 + scan 内存缓存)。