@pisell/pisellos 2.2.294 → 2.2.295

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 (69) hide show
  1. package/dist/model/strategy/adapter/itemRule/adapter.d.ts +1 -4
  2. package/dist/model/strategy/adapter/itemRule/adapter.js +35 -135
  3. package/dist/model/strategy/adapter/itemRule/evaluator.d.ts +1 -8
  4. package/dist/model/strategy/adapter/itemRule/evaluator.js +1 -25
  5. package/dist/model/strategy/adapter/itemRule/type.d.ts +0 -44
  6. package/dist/model/strategy/adapter/itemRule/type.js +1 -19
  7. package/dist/modules/Order/index.d.ts +3 -18
  8. package/dist/modules/Order/index.js +485 -885
  9. package/dist/modules/Order/types.d.ts +5 -91
  10. package/dist/modules/Order/types.js +0 -5
  11. package/dist/modules/Order/utils.js +10 -22
  12. package/dist/modules/ProductList/index.d.ts +1 -2
  13. package/dist/modules/ProductList/index.js +20 -100
  14. package/dist/modules/ProductList/types.d.ts +0 -10
  15. package/dist/server/index.d.ts +0 -6
  16. package/dist/server/index.js +3 -43
  17. package/dist/solution/BaseSales/index.d.ts +1 -9
  18. package/dist/solution/BaseSales/index.js +706 -894
  19. package/dist/solution/BookingByStep/index.d.ts +2 -2
  20. package/dist/solution/BookingTicket/utils/orderCustomer.js +2 -3
  21. package/dist/solution/RegisterAndLogin/config.d.ts +3 -9
  22. package/dist/solution/RegisterAndLogin/config.js +40 -95
  23. package/dist/solution/RegisterAndLogin/index.js +1 -4
  24. package/dist/solution/ScanOrder/index.d.ts +0 -1
  25. package/dist/solution/ScanOrder/index.js +27 -31
  26. package/dist/solution/ScanOrder/utils.d.ts +0 -1
  27. package/dist/solution/ScanOrder/utils.js +0 -2
  28. package/dist/solution/UnifiedBookingSales/index.d.ts +2 -15
  29. package/dist/solution/UnifiedBookingSales/index.js +484 -752
  30. package/dist/solution/UnifiedBookingSales/types.d.ts +1 -14
  31. package/dist/solution/VenueBooking/index.d.ts +0 -1
  32. package/dist/solution/VenueBooking/index.js +4 -8
  33. package/lib/model/strategy/adapter/itemRule/adapter.d.ts +1 -4
  34. package/lib/model/strategy/adapter/itemRule/adapter.js +4 -73
  35. package/lib/model/strategy/adapter/itemRule/evaluator.d.ts +1 -8
  36. package/lib/model/strategy/adapter/itemRule/evaluator.js +1 -23
  37. package/lib/model/strategy/adapter/itemRule/type.d.ts +0 -44
  38. package/lib/model/strategy/adapter/itemRule/type.js +1 -19
  39. package/lib/modules/Order/index.d.ts +3 -18
  40. package/lib/modules/Order/index.js +28 -325
  41. package/lib/modules/Order/types.d.ts +5 -91
  42. package/lib/modules/Order/types.js +0 -4
  43. package/lib/modules/Order/utils.js +1 -13
  44. package/lib/modules/ProductList/index.d.ts +1 -2
  45. package/lib/modules/ProductList/index.js +2 -47
  46. package/lib/modules/ProductList/types.d.ts +0 -10
  47. package/lib/server/index.d.ts +0 -6
  48. package/lib/server/index.js +3 -37
  49. package/lib/solution/BaseSales/index.d.ts +1 -9
  50. package/lib/solution/BaseSales/index.js +1 -105
  51. package/lib/solution/BookingByStep/index.d.ts +2 -2
  52. package/lib/solution/BookingTicket/utils/orderCustomer.js +1 -2
  53. package/lib/solution/RegisterAndLogin/config.d.ts +3 -9
  54. package/lib/solution/RegisterAndLogin/config.js +8 -49
  55. package/lib/solution/RegisterAndLogin/index.js +1 -4
  56. package/lib/solution/ScanOrder/index.d.ts +0 -1
  57. package/lib/solution/ScanOrder/index.js +1 -5
  58. package/lib/solution/ScanOrder/utils.d.ts +0 -1
  59. package/lib/solution/ScanOrder/utils.js +0 -1
  60. package/lib/solution/UnifiedBookingSales/index.d.ts +2 -15
  61. package/lib/solution/UnifiedBookingSales/index.js +1 -125
  62. package/lib/solution/UnifiedBookingSales/types.d.ts +1 -14
  63. package/lib/solution/VenueBooking/index.d.ts +0 -1
  64. package/lib/solution/VenueBooking/index.js +1 -5
  65. package/package.json +1 -1
  66. package/dist/modules/Order/salesNotes.d.ts +0 -31
  67. package/dist/modules/Order/salesNotes.js +0 -492
  68. package/lib/modules/Order/salesNotes.d.ts +0 -31
  69. package/lib/modules/Order/salesNotes.js +0 -382
@@ -8,13 +8,6 @@ import type { PaymentItem } from '../Payment/types';
8
8
  import type { ICustomer } from '../AccountList/types';
9
9
  import type { OrderProductDiscountItem } from '../../server/modules/order/types';
10
10
  export type { OrderProductDiscountItem } from '../../server/modules/order/types';
11
- export type PickupReferenceMode = 'counter_pickup' | 'table_service';
12
- export type ShopServiceType = 'dine_in' | 'takeaway';
13
- export interface ShopServiceData {
14
- pickup_reference_mode?: PickupReferenceMode;
15
- service_type?: ShopServiceType | '';
16
- [key: string]: any;
17
- }
18
11
  export declare enum OrderHooks {
19
12
  OnOrderCreate = "order:onOrderCreate",
20
13
  OnOrderUpdate = "order:onOrderUpdate",
@@ -245,72 +238,6 @@ export interface OrderSummary {
245
238
  tax_title?: string;
246
239
  tax_rate?: number;
247
240
  }
248
- export type SalesNoteRelationType = 'about' | 'related_to';
249
- export type SalesNoteTargetType = 'order' | 'order_detail';
250
- export type SalesNoteLocalizedText = string | Record<string, string>;
251
- export interface SalesNoteLocalizedSelection {
252
- id: string;
253
- label: SalesNoteLocalizedText;
254
- }
255
- export type SalesNoteTextInput = {
256
- kind: 'localizedSelections';
257
- selections: SalesNoteLocalizedSelection[];
258
- locale: string;
259
- input?: string;
260
- } | {
261
- kind: 'plain';
262
- input: string;
263
- } | {
264
- kind: 'resolved';
265
- text: Record<string, string>;
266
- };
267
- export interface SalesNoteRelation {
268
- uuid: string;
269
- relation_type: SalesNoteRelationType;
270
- target_type: SalesNoteTargetType;
271
- target_uuid: string;
272
- is_primary: 0 | 1;
273
- }
274
- export interface SalesNote {
275
- uuid: string;
276
- note_type: string;
277
- content: {
278
- text: Record<string, string>;
279
- };
280
- importance: string;
281
- note_relations: SalesNoteRelation[];
282
- }
283
- export interface SalesNoteTarget {
284
- target_type: 'order_detail';
285
- target_uuid: string;
286
- }
287
- export interface SetSalesNoteInput {
288
- note_type: string;
289
- target: SalesNoteTarget;
290
- text: SalesNoteTextInput;
291
- }
292
- export interface SalesNoteDraftInput {
293
- note_type: string;
294
- text: SalesNoteTextInput;
295
- }
296
- export interface SalesNotesRuntimeState {
297
- loaded: boolean;
298
- dirty: boolean;
299
- }
300
- /**
301
- * Sales Notes 乐观写入前的可恢复快照。
302
- * 该对象应视为 opaque token,只用于原样传回 restoreSalesNotesMutationSnapshot。
303
- */
304
- export interface SalesNotesMutationSnapshot {
305
- orderIdentity: {
306
- orderId: number | string | null;
307
- externalSaleNumber: string;
308
- };
309
- notes: SalesNote[];
310
- state: SalesNotesRuntimeState;
311
- }
312
- export type SalesNoteProtocolRelation = SalesNoteRelation;
313
- export type SalesNoteProtocol = SalesNote;
314
241
  export interface OrderTempOrder {
315
242
  order_id: number | null;
316
243
  external_sale_number: string;
@@ -350,7 +277,6 @@ export interface OrderTempOrder {
350
277
  created_at: string | undefined;
351
278
  request_unique_idempotency_token?: string;
352
279
  products: OrderProduct[];
353
- notes: SalesNote[];
354
280
  bookings: any[];
355
281
  payments: any[];
356
282
  surcharges: any[];
@@ -363,7 +289,6 @@ export interface OrderTempOrder {
363
289
  summary?: OrderSummary;
364
290
  _extend?: {
365
291
  productsByUid?: Record<string, Record<string, any>>;
366
- salesNotesState?: SalesNotesRuntimeState;
367
292
  [key: string]: any;
368
293
  };
369
294
  }
@@ -372,7 +297,7 @@ export interface OrderSubmitProduct extends Omit<OrderProduct, 'unique_identific
372
297
  payment_price: string;
373
298
  product_sku: OrderProductSku;
374
299
  }
375
- export interface OrderSubmitPayload extends Omit<OrderTempOrder, 'platform' | 'products' | 'notes' | '_extend' | 'customer' | 'discount_list' | 'created_at'> {
300
+ export interface OrderSubmitPayload extends Omit<OrderTempOrder, 'platform' | 'products' | '_extend' | 'customer' | 'discount_list' | 'created_at'> {
376
301
  platform: string;
377
302
  created_at?: string | undefined;
378
303
  request_unique_idempotency_token?: string;
@@ -381,7 +306,6 @@ export interface OrderSubmitPayload extends Omit<OrderTempOrder, 'platform' | 'p
381
306
  form_record_id: number | string;
382
307
  }>;
383
308
  products: OrderSubmitProduct[];
384
- notes?: SalesNoteProtocol[];
385
309
  summary?: OrderSummary;
386
310
  small_ticket_data_flag?: number;
387
311
  }
@@ -410,8 +334,6 @@ export interface AddProductToOrderOptions {
410
334
  insertAfterProductUid?: string;
411
335
  /** 跳过同商品/规格匹配,始终新增购物车行。 */
412
336
  disableMerge?: boolean;
413
- /** 商品行 UID 落定后,由 OrderModule 原子绑定到该行的 Sales Notes 草稿。 */
414
- salesNotes?: SalesNoteDraftInput[];
415
337
  }
416
338
  /**
417
339
  * 删除商品后的可选位置保持策略。
@@ -827,17 +749,9 @@ export interface OrderModuleAPI {
827
749
  updateTempOrderShopDiscount: (amount: string | number) => string;
828
750
  updateTempOrderDepositAmount: (amount: string | number) => OrderSummary;
829
751
  updateTempOrderCustomer: (customer: UpdateTempOrderCustomerInput) => OrderSnapshot['customer'];
830
- updateTempOrderPickupReferenceMode: (mode: PickupReferenceMode) => ShopServiceData;
831
- updateTempOrderServiceType: (serviceType: ShopServiceType) => ShopServiceData;
832
752
  updateTempOrderBuzzer: (buzzer: string) => string;
833
753
  updateTempOrderContactsInfo: (contactsInfo: Record<string, any> | null) => Record<string, any> | null;
834
754
  addProductToOrder: (product: Partial<OrderProduct> & OrderProductIdentity, booking?: AddProductBookingInput, options?: AddProductToOrderOptions) => Promise<OrderProduct[]>;
835
- getSalesNotes: () => SalesNote[];
836
- createSalesNotesMutationSnapshot: () => SalesNotesMutationSnapshot;
837
- restoreSalesNotesMutationSnapshot: (snapshot: SalesNotesMutationSnapshot) => void;
838
- setSalesNote: (input: SetSalesNoteInput) => Promise<SalesNote>;
839
- removeSalesNote: (uuid: string) => Promise<void>;
840
- clearSalesNotes: () => Promise<void>;
841
755
  updateOrderProduct: (params: UpdateOrderProductParams) => Promise<OrderProduct[]>;
842
756
  /** 批量更新购物车行,末尾仅触发一次促销重算与 summary 刷新 */
843
757
  updateOrderProducts: (paramsList: UpdateOrderProductParams[]) => Promise<OrderProduct[]>;
@@ -985,10 +899,10 @@ export interface OrderModuleAPI {
985
899
  /** 读取上次 applyPromotion 产出的赠品操作 diff(toAdd / toReduce / toRemove) */
986
900
  getLastGiftActions: () => OrderLastGiftActions | null;
987
901
  /**
988
- * 取消订单
989
- * @param params 取消订单参数
990
- * @returns 后端返回结果
991
- */
902
+ * 取消订单
903
+ * @param params 取消订单参数
904
+ * @returns 后端返回结果
905
+ */
992
906
  cancelOrder: (params: CancelOrderParams) => Promise<any>;
993
907
  /**
994
908
  * 变更预约状态
@@ -64,11 +64,6 @@ export var OrderHooks = /*#__PURE__*/function (OrderHooks) {
64
64
  * 清空时整个 payload 为 null。
65
65
  */
66
66
 
67
- /**
68
- * Sales Notes 乐观写入前的可恢复快照。
69
- * 该对象应视为 opaque token,只用于原样传回 restoreSalesNotesMutationSnapshot。
70
- */
71
-
72
67
  /**
73
68
  * 添加商品行时的顺序控制。
74
69
  * 默认追加到 products 尾部;预约数量同步可插入到既有预约组的最新行之后,
@@ -1,7 +1,7 @@
1
1
  var _excluded = ["custom_product_bundle_map_id"],
2
2
  _excluded2 = ["unique_identification_number"],
3
3
  _excluded3 = ["num", "surcharge_fee", "discount_amount", "discount_type", "discountway", "product_discount_reason", "discount_per", "production_code"],
4
- _excluded4 = ["_extend", "relation_id", "table_form_id", "resource_id", "summary", "lastOrderInfo", "paid_amount", "shop_id", "shop_note", "shop_service_type", "start_time", "customer", "discount_list", "tax_fee", "total_amount", "total_refund_amount", "create_date", "holder_id", "notes"],
4
+ _excluded4 = ["_extend", "relation_id", "table_form_id", "resource_id", "summary", "lastOrderInfo", "paid_amount", "shop_id", "shop_note", "shop_service_type", "start_time", "customer", "discount_list", "tax_fee", "total_amount", "total_refund_amount", "create_date", "holder_id"],
5
5
  _excluded5 = ["collect_pax", "table_occupancy_duration"];
6
6
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
7
7
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
@@ -23,7 +23,6 @@ import Decimal from 'decimal.js';
23
23
  import { getProductHolderConfig } from "../Holder/utils";
24
24
  import { buildProductLineFingerprint, createEmptySummary } from "../../solution/ScanOrder/utils";
25
25
  import { createUuidV4 } from "./utils/orderCollectionIdentity";
26
- import { encodeSalesNotes } from "./salesNotes";
27
26
  /**
28
27
  * 把"含 option 的主商品单价"与 bundle 合成"单行 composite 单价"。
29
28
  *
@@ -1089,7 +1088,6 @@ export function createDefaultTempOrder(params) {
1089
1088
  request_unique_idempotency_token: '',
1090
1089
  vouchers: [],
1091
1090
  products: [],
1092
- notes: [],
1093
1091
  bookings: [],
1094
1092
  payments: [],
1095
1093
  surcharges: [],
@@ -1099,11 +1097,7 @@ export function createDefaultTempOrder(params) {
1099
1097
  holder: null,
1100
1098
  metadata: {},
1101
1099
  _extend: {
1102
- productsByUid: {},
1103
- salesNotesState: {
1104
- loaded: true,
1105
- dirty: false
1106
- }
1100
+ productsByUid: {}
1107
1101
  }
1108
1102
  };
1109
1103
  }
@@ -1151,7 +1145,7 @@ export function resolveSubmitOrderType(params) {
1151
1145
  return 'virtual';
1152
1146
  }
1153
1147
  export function buildSubmitPayload(params) {
1154
- var _tempOrder$customer_i, _tempOrder$country_ca, _tempOrder$phone, _tempOrder$email, _tempOrder$order_numb, _tempOrder$shop_order, _tempOrder$shop_full_, _ref31, _tempOrder$is_price_i, _tempOrder$is_deposit, _tempOrder$_extend, _enhancedPayload$summ;
1148
+ var _tempOrder$customer_i, _tempOrder$country_ca, _tempOrder$phone, _tempOrder$email, _tempOrder$order_numb, _tempOrder$shop_order, _tempOrder$shop_full_, _ref31, _tempOrder$is_price_i, _tempOrder$is_deposit, _enhancedPayload$summ;
1155
1149
  var tempOrder = params.tempOrder,
1156
1150
  cacheId = params.cacheId,
1157
1151
  _params$now = params.now,
@@ -1183,7 +1177,6 @@ export function buildSubmitPayload(params) {
1183
1177
  _totalRefundAmount = _ref30.total_refund_amount,
1184
1178
  _createDate = _ref30.create_date,
1185
1179
  _holderId = _ref30.holder_id,
1186
- _notes = _ref30.notes,
1187
1180
  tempOrderRest = _objectWithoutProperties(_ref30, _excluded4);
1188
1181
  var resolvedBusinessCode = businessCode !== null && businessCode !== void 0 ? businessCode : tempOrder.business_code;
1189
1182
  var submitType = resolveSubmitOrderType({
@@ -1194,7 +1187,7 @@ export function buildSubmitPayload(params) {
1194
1187
  tempOrderBusinessCode: tempOrder.business_code,
1195
1188
  bookings: tempOrder.bookings
1196
1189
  });
1197
- var payload = _objectSpread(_objectSpread(_objectSpread({}, tempOrderRest), {}, {
1190
+ var payload = _objectSpread(_objectSpread({}, tempOrderRest), {}, {
1198
1191
  customer_id: (_tempOrder$customer_i = tempOrder.customer_id) !== null && _tempOrder$customer_i !== void 0 ? _tempOrder$customer_i : 1,
1199
1192
  customer_name: tempOrder.customer_name || 'Walk-In',
1200
1193
  country_calling_code: String((_tempOrder$country_ca = tempOrder.country_calling_code) !== null && _tempOrder$country_ca !== void 0 ? _tempOrder$country_ca : ''),
@@ -1239,12 +1232,7 @@ export function buildSubmitPayload(params) {
1239
1232
  _tableOccupancyDuration = _ref32.table_occupancy_duration,
1240
1233
  rest = _objectWithoutProperties(_ref32, _excluded5);
1241
1234
  return _objectSpread({}, rest);
1242
- }()
1243
- }, (_tempOrder$_extend = tempOrder._extend) !== null && _tempOrder$_extend !== void 0 && (_tempOrder$_extend = _tempOrder$_extend.salesNotesState) !== null && _tempOrder$_extend !== void 0 && _tempOrder$_extend.dirty ? {
1244
- notes: encodeSalesNotes(tempOrder.notes || [], {
1245
- allowUnresolvedOrderTarget: true
1246
- })
1247
- } : {}), {}, {
1235
+ }(),
1248
1236
  products: (tempOrder.products || []).map(function (product) {
1249
1237
  return normalizeSubmitProduct(product);
1250
1238
  })
@@ -1372,7 +1360,7 @@ export function hasAssignedHolderId(value) {
1372
1360
  * clearTempOrderHolderAssignments(tempOrder);
1373
1361
  */
1374
1362
  export function clearTempOrderHolderAssignments(tempOrder) {
1375
- var _tempOrder$_extend2;
1363
+ var _tempOrder$_extend;
1376
1364
  var changed = false;
1377
1365
  var resetHolderField = function resetHolderField(target) {
1378
1366
  var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'holder_id';
@@ -1413,7 +1401,7 @@ export function clearTempOrderHolderAssignments(tempOrder) {
1413
1401
  } finally {
1414
1402
  _iterator9.f();
1415
1403
  }
1416
- var productsByUid = (_tempOrder$_extend2 = tempOrder._extend) === null || _tempOrder$_extend2 === void 0 ? void 0 : _tempOrder$_extend2.productsByUid;
1404
+ var productsByUid = (_tempOrder$_extend = tempOrder._extend) === null || _tempOrder$_extend === void 0 ? void 0 : _tempOrder$_extend.productsByUid;
1417
1405
  if (productsByUid && _typeof(productsByUid) === 'object') {
1418
1406
  for (var _i4 = 0, _Object$values = Object.values(productsByUid); _i4 < _Object$values.length; _i4++) {
1419
1407
  var entry = _Object$values[_i4];
@@ -1444,9 +1432,9 @@ export function getOrderProductLineUid(product) {
1444
1432
  return String(uid);
1445
1433
  }
1446
1434
  export function getRuntimeProductOrigin(tempOrder, product) {
1447
- var _tempOrder$_extend3, _tempOrder$_extend4;
1435
+ var _tempOrder$_extend2, _tempOrder$_extend3;
1448
1436
  var uid = getOrderProductLineUid(product);
1449
- if (uid && tempOrder !== null && tempOrder !== void 0 && (_tempOrder$_extend3 = tempOrder._extend) !== null && _tempOrder$_extend3 !== void 0 && (_tempOrder$_extend3 = _tempOrder$_extend3.productsByUid) !== null && _tempOrder$_extend3 !== void 0 && (_tempOrder$_extend3 = _tempOrder$_extend3[uid]) !== null && _tempOrder$_extend3 !== void 0 && _tempOrder$_extend3.origin) {
1437
+ if (uid && tempOrder !== null && tempOrder !== void 0 && (_tempOrder$_extend2 = tempOrder._extend) !== null && _tempOrder$_extend2 !== void 0 && (_tempOrder$_extend2 = _tempOrder$_extend2.productsByUid) !== null && _tempOrder$_extend2 !== void 0 && (_tempOrder$_extend2 = _tempOrder$_extend2[uid]) !== null && _tempOrder$_extend2 !== void 0 && _tempOrder$_extend2.origin) {
1450
1438
  return tempOrder._extend.productsByUid[uid].origin;
1451
1439
  }
1452
1440
  var matchedProduct = ((tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.products) || []).find(function (item) {
@@ -1454,7 +1442,7 @@ export function getRuntimeProductOrigin(tempOrder, product) {
1454
1442
  return item === product || getOrderProductLineUid(item) === uid || String((_ref33 = (_item$product_id = item === null || item === void 0 ? void 0 : item.product_id) !== null && _item$product_id !== void 0 ? _item$product_id : item === null || item === void 0 ? void 0 : item.id) !== null && _ref33 !== void 0 ? _ref33 : '') === String((_ref34 = (_product$product_id = product === null || product === void 0 ? void 0 : product.product_id) !== null && _product$product_id !== void 0 ? _product$product_id : product === null || product === void 0 ? void 0 : product.id) !== null && _ref34 !== void 0 ? _ref34 : '');
1455
1443
  });
1456
1444
  var matchedUid = matchedProduct ? getOrderProductLineUid(matchedProduct) : '';
1457
- return matchedUid ? (tempOrder === null || tempOrder === void 0 || (_tempOrder$_extend4 = tempOrder._extend) === null || _tempOrder$_extend4 === void 0 || (_tempOrder$_extend4 = _tempOrder$_extend4.productsByUid) === null || _tempOrder$_extend4 === void 0 || (_tempOrder$_extend4 = _tempOrder$_extend4[matchedUid]) === null || _tempOrder$_extend4 === void 0 ? void 0 : _tempOrder$_extend4.origin) || null : null;
1445
+ return matchedUid ? (tempOrder === null || tempOrder === void 0 || (_tempOrder$_extend3 = tempOrder._extend) === null || _tempOrder$_extend3 === void 0 || (_tempOrder$_extend3 = _tempOrder$_extend3.productsByUid) === null || _tempOrder$_extend3 === void 0 || (_tempOrder$_extend3 = _tempOrder$_extend3[matchedUid]) === null || _tempOrder$_extend3 === void 0 ? void 0 : _tempOrder$_extend3.origin) || null : null;
1458
1446
  }
1459
1447
  export function isHolderConfigRequired(holderConfig) {
1460
1448
  if (!holderConfig || _typeof(holderConfig) !== 'object') return false;
@@ -1,6 +1,6 @@
1
1
  import { Module, PisellCore } from '../../types';
2
2
  import { BaseModule } from '../BaseModule';
3
- import { ProductListLoadProductsParams, ProductListStoreQueryParams } from './types';
3
+ import { ProductListLoadProductsParams } from './types';
4
4
  import { ProductData } from '../Product/types';
5
5
  export * from './types';
6
6
  export declare class ProductList extends BaseModule implements Module {
@@ -52,7 +52,6 @@ export declare class ProductList extends BaseModule implements Module {
52
52
  getRawProductPriceSources(ids: number[]): Map<number, ProductData>;
53
53
  getProducts(): Promise<ProductData[]>;
54
54
  getProduct(id: number): Promise<ProductData | undefined>;
55
- queryProducts(params?: ProductListStoreQueryParams): Promise<ProductData[]>;
56
55
  getProductByIds(ids: number[]): Promise<ProductData[] | undefined>;
57
56
  addProduct(products: ProductData[]): Promise<void>;
58
57
  selectProducts(products: ProductData[]): Promise<void>;
@@ -29,19 +29,6 @@ import dayjs from 'dayjs';
29
29
  import { isProductQueryHandledByOsServer, PRODUCT_QUERY_DATA_VARIANT_RELATIONS, resolveClientDataVariants } from "./clientDataVariants";
30
30
  import { isCustomerUserPlatform } from "../../utils/platform";
31
31
  export * from "./types";
32
- function normalizeQuerySet(values) {
33
- if (!Array.isArray(values) || values.length === 0) return null;
34
- var normalized = values.map(function (value) {
35
- return String(value !== null && value !== void 0 ? value : '').trim();
36
- }).filter(Boolean);
37
- return normalized.length ? new Set(normalized) : null;
38
- }
39
- function matchesAny(values, querySet) {
40
- if (!querySet) return true;
41
- return values.some(function (value) {
42
- return querySet.has(String(value !== null && value !== void 0 ? value : '').trim());
43
- });
44
- }
45
32
  export var ProductList = /*#__PURE__*/function (_BaseModule) {
46
33
  _inherits(ProductList, _BaseModule);
47
34
  var _super = _createSuper(ProductList);
@@ -481,93 +468,26 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
481
468
  return getProduct;
482
469
  }()
483
470
  }, {
484
- key: "queryProducts",
471
+ key: "getProductByIds",
485
472
  value: function () {
486
- var _queryProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
487
- var params,
488
- includeIds,
489
- excludeIds,
490
- categoryIds,
491
- collectionIds,
492
- extensionTypes,
493
- statuses,
494
- channelApplications,
495
- codeOrBarcode,
496
- products,
497
- _args9 = arguments;
473
+ var _getProductByIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(ids) {
474
+ var products;
498
475
  return _regeneratorRuntime().wrap(function _callee9$(_context9) {
499
476
  while (1) switch (_context9.prev = _context9.next) {
500
477
  case 0:
501
- params = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : {};
502
- includeIds = normalizeQuerySet(params.includeIds);
503
- excludeIds = normalizeQuerySet(params.excludeIds);
504
- categoryIds = normalizeQuerySet(params.categoryIds);
505
- collectionIds = normalizeQuerySet(params.collectionIds);
506
- extensionTypes = normalizeQuerySet(params.extensionTypes);
507
- statuses = normalizeQuerySet(params.statuses);
508
- channelApplications = normalizeQuerySet(params.channelApplications);
509
- codeOrBarcode = typeof params.codeOrBarcode === 'string' ? params.codeOrBarcode.trim() : '';
510
- products = (this.store.list || []).filter(function (product) {
511
- var _product$id, _product$extension_ty, _product$status;
512
- var productId = String((_product$id = product.id) !== null && _product$id !== void 0 ? _product$id : '').trim();
513
- if (includeIds && !includeIds.has(productId)) return false;
514
- if (excludeIds && excludeIds.has(productId)) return false;
515
- if (categoryIds) {
516
- var productCategoryIds = (product.categories || []).flatMap(function (category) {
517
- var _category$pivot;
518
- return [category === null || category === void 0 ? void 0 : category.id, category === null || category === void 0 || (_category$pivot = category.pivot) === null || _category$pivot === void 0 ? void 0 : _category$pivot.product_category_id];
519
- });
520
- if (!matchesAny(productCategoryIds, categoryIds)) return false;
521
- }
522
- if (collectionIds) {
523
- var productCollectionIds = (product.collection || []).map(function (collection) {
524
- return collection === null || collection === void 0 ? void 0 : collection.id;
525
- });
526
- if (!matchesAny(productCollectionIds, collectionIds)) return false;
527
- }
528
- if (extensionTypes && !extensionTypes.has(String((_product$extension_ty = product.extension_type) !== null && _product$extension_ty !== void 0 ? _product$extension_ty : '').trim())) return false;
529
- if (statuses && !statuses.has(String((_product$status = product.status) !== null && _product$status !== void 0 ? _product$status : '').trim())) return false;
530
- if (channelApplications) {
531
- if (!matchesAny(product.channel_application || [], channelApplications)) return false;
532
- }
533
- if (codeOrBarcode) {
534
- var code = typeof product.code === 'string' ? product.code.trim() : '';
535
- var barcode = typeof product.barcode === 'string' ? product.barcode.trim() : '';
536
- if (code !== codeOrBarcode && barcode !== codeOrBarcode) return false;
537
- }
538
- return true;
478
+ _context9.next = 2;
479
+ return this.core.effects.emit("".concat(this.name, ":onGetProductByIds"), this.store.list);
480
+ case 2:
481
+ products = this.store.list.filter(function (product) {
482
+ return ids.includes(product.id);
539
483
  });
540
- return _context9.abrupt("return", cloneDeep(products));
541
- case 11:
484
+ return _context9.abrupt("return", products);
485
+ case 4:
542
486
  case "end":
543
487
  return _context9.stop();
544
488
  }
545
489
  }, _callee9, this);
546
490
  }));
547
- function queryProducts() {
548
- return _queryProducts.apply(this, arguments);
549
- }
550
- return queryProducts;
551
- }()
552
- }, {
553
- key: "getProductByIds",
554
- value: function () {
555
- var _getProductByIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(ids) {
556
- return _regeneratorRuntime().wrap(function _callee10$(_context10) {
557
- while (1) switch (_context10.prev = _context10.next) {
558
- case 0:
559
- _context10.next = 2;
560
- return this.core.effects.emit("".concat(this.name, ":onGetProductByIds"), this.store.list);
561
- case 2:
562
- return _context10.abrupt("return", this.queryProducts({
563
- includeIds: ids
564
- }));
565
- case 3:
566
- case "end":
567
- return _context10.stop();
568
- }
569
- }, _callee10, this);
570
- }));
571
491
  function getProductByIds(_x8) {
572
492
  return _getProductByIds.apply(this, arguments);
573
493
  }
@@ -576,10 +496,10 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
576
496
  }, {
577
497
  key: "addProduct",
578
498
  value: function () {
579
- var _addProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(products) {
499
+ var _addProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(products) {
580
500
  var _this6 = this;
581
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
582
- while (1) switch (_context11.prev = _context11.next) {
501
+ return _regeneratorRuntime().wrap(function _callee10$(_context10) {
502
+ while (1) switch (_context10.prev = _context10.next) {
583
503
  case 0:
584
504
  // list 需要根据 id 去重
585
505
  if (!this.store.list) {
@@ -602,9 +522,9 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
602
522
  this.core.effects.emit("".concat(this.name, ":changed"), this.store.list);
603
523
  case 4:
604
524
  case "end":
605
- return _context11.stop();
525
+ return _context10.stop();
606
526
  }
607
- }, _callee11, this);
527
+ }, _callee10, this);
608
528
  }));
609
529
  function addProduct(_x9) {
610
530
  return _addProduct.apply(this, arguments);
@@ -614,16 +534,16 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
614
534
  }, {
615
535
  key: "selectProducts",
616
536
  value: function () {
617
- var _selectProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(products) {
618
- return _regeneratorRuntime().wrap(function _callee12$(_context12) {
619
- while (1) switch (_context12.prev = _context12.next) {
537
+ var _selectProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(products) {
538
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
539
+ while (1) switch (_context11.prev = _context11.next) {
620
540
  case 0:
621
541
  this.store.selectProducts = products;
622
542
  case 1:
623
543
  case "end":
624
- return _context12.stop();
544
+ return _context11.stop();
625
545
  }
626
- }, _callee12, this);
546
+ }, _callee11, this);
627
547
  }));
628
548
  function selectProducts(_x10) {
629
549
  return _selectProducts.apply(this, arguments);
@@ -15,16 +15,6 @@ export interface ProductListLoadProductsParams {
15
15
  /** 智能定价条件上下文,仅影响策略命中,不参与商品集合筛选 */
16
16
  strategy_context?: Record<string, any>;
17
17
  }
18
- export interface ProductListStoreQueryParams {
19
- includeIds?: Array<number | string>;
20
- excludeIds?: Array<number | string>;
21
- categoryIds?: Array<number | string>;
22
- collectionIds?: Array<number | string>;
23
- extensionTypes?: string[];
24
- statuses?: ProductData['status'][];
25
- channelApplications?: string[];
26
- codeOrBarcode?: string;
27
- }
28
18
  export interface ProductListData {
29
19
  list: ProductData[];
30
20
  selectProducts: ProductData[];
@@ -520,12 +520,6 @@ declare class Server {
520
520
  private stringifyCheckoutResourceIdentifier;
521
521
  private normalizeCheckoutSubmitData;
522
522
  private ensureCheckoutOrderNumbers;
523
- /**
524
- * Notes 允许在本地草稿阶段暂存空订单目标;checkout 的统一出口负责用最终
525
- * shop_order_number 完成绑定并校验,保证后端请求、pending、设备任务和打印
526
- * 都使用同一份完整快照。
527
- */
528
- private finalizeCheckoutSalesNotes;
529
523
  private dispatchCheckoutSyncTask;
530
524
  private dispatchPrintOtherReceiptTask;
531
525
  private buildPrintOtherReceiptIdempotencyKey;
@@ -43,7 +43,6 @@ import { filterBookingsFromOrders, sortBookings } from "./modules/order/utils/fi
43
43
  import { buildSmallTicketData, hasSmallTicketData } from "./utils/small-ticket";
44
44
  import { BaseSalesImpl } from "../solution/BaseSales";
45
45
  import { getOrderPaymentIdentityKeys, isIdentifiedPendingOrderPayment, isPendingOrderPayment, mergeOrderPaymentListsByIdentity } from "../modules/Order/payment-utils";
46
- import { finalizeSalesNotesForCheckout } from "../modules/Order/salesNotes";
47
46
  var OS_FULFILLMENT_REF_MODE_FIELD = '_os_fulfillment_ref_mode';
48
47
 
49
48
  // 重新导出类型供外部使用
@@ -5684,7 +5683,7 @@ var Server = /*#__PURE__*/function () {
5684
5683
  _context56.next = 7;
5685
5684
  break;
5686
5685
  }
5687
- return _context56.abrupt("return", this.finalizeCheckoutSalesNotes(next, title));
5686
+ return _context56.abrupt("return", next);
5688
5687
  case 7:
5689
5688
  idGenerator = this.getIdGeneratorPlugin();
5690
5689
  if (idGenerator) {
@@ -5695,7 +5694,7 @@ var Server = /*#__PURE__*/function () {
5695
5694
  needsShopOrderNumber: needsShopOrderNumber,
5696
5695
  needsShopFullOrderNumber: needsShopFullOrderNumber
5697
5696
  });
5698
- return _context56.abrupt("return", this.finalizeCheckoutSalesNotes(next, title));
5697
+ return _context56.abrupt("return", next);
5699
5698
  case 11:
5700
5699
  _context56.prev = 11;
5701
5700
  if (!(needsShopOrderNumber && idGenerator.generateShopOrderNumber)) {
@@ -5733,7 +5732,7 @@ var Server = /*#__PURE__*/function () {
5733
5732
  error: _context56.t0 instanceof Error ? _context56.t0.message : String(_context56.t0)
5734
5733
  });
5735
5734
  case 26:
5736
- return _context56.abrupt("return", this.finalizeCheckoutSalesNotes(next, title));
5735
+ return _context56.abrupt("return", next);
5737
5736
  case 27:
5738
5737
  case "end":
5739
5738
  return _context56.stop();
@@ -5745,45 +5744,6 @@ var Server = /*#__PURE__*/function () {
5745
5744
  }
5746
5745
  return ensureCheckoutOrderNumbers;
5747
5746
  }()
5748
- /**
5749
- * Notes 允许在本地草稿阶段暂存空订单目标;checkout 的统一出口负责用最终
5750
- * shop_order_number 完成绑定并校验,保证后端请求、pending、设备任务和打印
5751
- * 都使用同一份完整快照。
5752
- */
5753
- }, {
5754
- key: "finalizeCheckoutSalesNotes",
5755
- value: function finalizeCheckoutSalesNotes(data, title) {
5756
- var _data$shop_order_numb;
5757
- if (!data || _typeof(data) !== 'object') return data;
5758
- if (!Object.prototype.hasOwnProperty.call(data, 'notes')) return data;
5759
- if (data.notes === undefined || data.notes === null) return data;
5760
- if (!Array.isArray(data.notes)) {
5761
- throw new Error('[Order Notes] checkout notes 必须为数组');
5762
- }
5763
- if (data.notes.length === 0) return data;
5764
- var productTargetUuids = (Array.isArray(data.products) ? data.products : []).map(function (product) {
5765
- var _product$metadata$uni, _product$metadata;
5766
- return (_product$metadata$uni = product === null || product === void 0 || (_product$metadata = product.metadata) === null || _product$metadata === void 0 ? void 0 : _product$metadata.unique_identification_number) !== null && _product$metadata$uni !== void 0 ? _product$metadata$uni : product === null || product === void 0 ? void 0 : product.unique_identification_number;
5767
- }).filter(function (targetUuid) {
5768
- return targetUuid !== undefined && targetUuid !== null && String(targetUuid).trim().length > 0;
5769
- }).map(function (targetUuid) {
5770
- return String(targetUuid);
5771
- });
5772
- var shopOrderNumber = String((_data$shop_order_numb = data.shop_order_number) !== null && _data$shop_order_numb !== void 0 ? _data$shop_order_numb : '').trim();
5773
- var notes = finalizeSalesNotesForCheckout({
5774
- notes: data.notes,
5775
- shopOrderNumber: shopOrderNumber,
5776
- productTargetUuids: productTargetUuids
5777
- });
5778
- this.logInfo("".concat(title, ": checkout Notes \u5DF2\u7ED1\u5B9A\u8BA2\u5355\u53F7"), {
5779
- shop_order_number: shopOrderNumber,
5780
- note_count: notes.length
5781
- });
5782
- return _objectSpread(_objectSpread({}, data), {}, {
5783
- shop_order_number: shopOrderNumber,
5784
- notes: notes
5785
- });
5786
- }
5787
5747
  }, {
5788
5748
  key: "dispatchCheckoutSyncTask",
5789
5749
  value: function () {
@@ -2,7 +2,7 @@ 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, AddProductToOrderOptions, LoadSalesDetailParams, OrderPaymentData, OrderPaymentUpdateOptions, OrderPaymentUpdateResult, OrderPaymentSource, SendCustomerPayLinkParams, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, UpdateTempOrderCustomerInput, UpdateOrderBookingParams, UpdateOrderProductParams, OrderTempOrder, OrderSummary, OrderPromotionEvaluator, OrderGiftSelectResolver, OrderUnfulfilledPromotion, OrderLastGiftActions, RemoveProductsFromOrderOptions, ReplaceTempOrderOptions, SalesNote, SalesNotesMutationSnapshot, SetSalesNoteInput, PickupReferenceMode, ShopServiceData, ShopServiceType } 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';
@@ -225,20 +225,12 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
225
225
  getOrderSyncState(): import("../../modules/Order/types").OrderSyncState;
226
226
  getOrderAmountSnapshot(): import("../../modules/Order/types").OrderAmountSnapshot | null;
227
227
  getTempOrderNote(): string;
228
- getSalesNotes(): SalesNote[];
229
- createSalesNotesMutationSnapshot(): SalesNotesMutationSnapshot;
230
- restoreSalesNotesMutationSnapshot(snapshot: SalesNotesMutationSnapshot): void;
231
- setSalesNote(input: SetSalesNoteInput): Promise<SalesNote>;
232
- removeSalesNote(uuid: string): Promise<void>;
233
- clearSalesNotes(): Promise<void>;
234
228
  updateTempOrderNote(note: string): string;
235
229
  updateTempOrderNote(note: string, sync: true): Promise<string>;
236
230
  updateTempOrderNote(note: string, sync: boolean): string | Promise<string>;
237
231
  updateRemoteOrderNote(orderId: number | string, note: string): void;
238
232
  updateTempOrderShopDiscount(amount: string | number): string;
239
233
  updateTempOrderDepositAmount(amount: string | number): OrderSummary;
240
- setPickupReferenceMode(mode: PickupReferenceMode): ShopServiceData;
241
- setServiceType(serviceType: ShopServiceType): ShopServiceData;
242
234
  updateTempOrderContactsInfo(contactsInfo: Record<string, any> | null): Record<string, any> | null;
243
235
  /** @deprecated OrderModule 不再负责 tempOrder localStorage 持久化。 */
244
236
  setEnableTempOrderPersist(enabled: boolean): void;