@pisell/pisellos 2.3.67 → 2.3.69

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 (61) hide show
  1. package/dist/model/strategy/adapter/walletPass/evaluator.js +0 -1
  2. package/dist/model/strategy/adapter/walletPass/utils.js +0 -2
  3. package/dist/modules/BaseModule.d.ts +1 -0
  4. package/dist/modules/BaseModule.js +24 -28
  5. package/dist/modules/Customer/index.d.ts +4 -0
  6. package/dist/modules/Customer/index.js +91 -59
  7. package/dist/modules/Customer/types.d.ts +2 -0
  8. package/dist/modules/Order/index.d.ts +22 -2
  9. package/dist/modules/Order/index.js +313 -142
  10. package/dist/modules/Order/types.d.ts +13 -1
  11. package/dist/modules/Order/utils/orderCollectionIdentity.d.ts +15 -0
  12. package/dist/modules/Order/utils/orderCollectionIdentity.js +75 -0
  13. package/dist/modules/Order/utils.js +0 -1
  14. package/dist/modules/Payment/index.d.ts +4 -0
  15. package/dist/modules/Payment/index.js +14 -4
  16. package/dist/modules/Payment/walletpass.js +52 -18
  17. package/dist/modules/Rules/index.js +46 -31
  18. package/dist/server/index.js +3 -6
  19. package/dist/server/modules/order/index.d.ts +1 -0
  20. package/dist/server/modules/order/index.js +252 -93
  21. package/dist/server/utils/small-ticket.js +2 -1
  22. package/dist/solution/BaseSales/index.d.ts +13 -1
  23. package/dist/solution/BaseSales/index.js +903 -831
  24. package/dist/solution/BaseSales/utils.js +31 -20
  25. package/dist/solution/BookingTicket/index.d.ts +7 -1
  26. package/dist/solution/BookingTicket/index.js +310 -224
  27. package/dist/solution/ScanOrder/utils.js +31 -20
  28. package/dist/solution/UnifiedBookingSales/index.d.ts +25 -0
  29. package/dist/solution/UnifiedBookingSales/index.js +640 -321
  30. package/dist/solution/UnifiedBookingSales/types.d.ts +7 -0
  31. package/lib/model/strategy/adapter/walletPass/evaluator.js +0 -1
  32. package/lib/model/strategy/adapter/walletPass/utils.js +0 -1
  33. package/lib/modules/BaseModule.d.ts +1 -0
  34. package/lib/modules/BaseModule.js +24 -37
  35. package/lib/modules/Customer/index.d.ts +4 -0
  36. package/lib/modules/Customer/index.js +11 -0
  37. package/lib/modules/Customer/types.d.ts +2 -0
  38. package/lib/modules/Order/index.d.ts +22 -2
  39. package/lib/modules/Order/index.js +212 -54
  40. package/lib/modules/Order/types.d.ts +13 -1
  41. package/lib/modules/Order/utils/orderCollectionIdentity.d.ts +15 -0
  42. package/lib/modules/Order/utils/orderCollectionIdentity.js +70 -0
  43. package/lib/modules/Order/utils.js +0 -1
  44. package/lib/modules/Payment/index.d.ts +4 -0
  45. package/lib/modules/Payment/index.js +7 -0
  46. package/lib/modules/Payment/walletpass.js +27 -2
  47. package/lib/modules/Rules/index.js +17 -1
  48. package/lib/server/index.js +3 -6
  49. package/lib/server/modules/order/index.d.ts +1 -0
  50. package/lib/server/modules/order/index.js +66 -2
  51. package/lib/server/utils/small-ticket.js +1 -1
  52. package/lib/solution/BaseSales/index.d.ts +13 -1
  53. package/lib/solution/BaseSales/index.js +61 -18
  54. package/lib/solution/BaseSales/utils.js +29 -18
  55. package/lib/solution/BookingTicket/index.d.ts +7 -1
  56. package/lib/solution/BookingTicket/index.js +65 -14
  57. package/lib/solution/ScanOrder/utils.js +29 -18
  58. package/lib/solution/UnifiedBookingSales/index.d.ts +25 -0
  59. package/lib/solution/UnifiedBookingSales/index.js +188 -0
  60. package/lib/solution/UnifiedBookingSales/types.d.ts +7 -0
  61. package/package.json +1 -1
@@ -388,35 +388,46 @@ export function attachItemRuleLimitsToTopLevelProducts(productList, limits) {
388
388
  * 数组元素先按主键排序再序列化,避免顺序差异导致误判为不同行。
389
389
  */
390
390
  export function buildProductLineFingerprint(productOptionItem, productBundle) {
391
- var optArr = Array.isArray(productOptionItem) ? productOptionItem : [];
392
- var normalizedOpts = optArr.map(function (item) {
393
- var _ref, _item$add_price;
394
- return {
395
- option_group_item_id: Number(item === null || item === void 0 ? void 0 : item.option_group_item_id) || 0,
396
- option_group_id: Number(item === null || item === void 0 ? void 0 : item.option_group_id) || 0,
397
- num: typeof (item === null || item === void 0 ? void 0 : item.num) === 'number' && !Number.isNaN(item.num) ? Math.max(1, Math.floor(item.num)) : 1,
398
- price: String((_ref = (_item$add_price = item === null || item === void 0 ? void 0 : item.add_price) !== null && _item$add_price !== void 0 ? _item$add_price : item === null || item === void 0 ? void 0 : item.price) !== null && _ref !== void 0 ? _ref : '')
399
- };
400
- }).sort(function (p, q) {
401
- if (p.option_group_item_id !== q.option_group_item_id) {
402
- return p.option_group_item_id - q.option_group_item_id;
403
- }
404
- if (p.option_group_id !== q.option_group_id) return p.option_group_id - q.option_group_id;
405
- if (p.num !== q.num) return p.num - q.num;
406
- return p.price.localeCompare(q.price);
407
- });
391
+ var normalizeOptions = function normalizeOptions(options) {
392
+ var optionArr = Array.isArray(options) ? options : [];
393
+ return optionArr.map(function (item) {
394
+ var _ref, _item$add_price;
395
+ return {
396
+ option_group_item_id: Number(item === null || item === void 0 ? void 0 : item.option_group_item_id) || 0,
397
+ option_group_id: Number(item === null || item === void 0 ? void 0 : item.option_group_id) || 0,
398
+ num: typeof (item === null || item === void 0 ? void 0 : item.num) === 'number' && !Number.isNaN(item.num) ? Math.max(1, Math.floor(item.num)) : 1,
399
+ price: String((_ref = (_item$add_price = item === null || item === void 0 ? void 0 : item.add_price) !== null && _item$add_price !== void 0 ? _item$add_price : item === null || item === void 0 ? void 0 : item.price) !== null && _ref !== void 0 ? _ref : '')
400
+ };
401
+ }).sort(function (p, q) {
402
+ if (p.option_group_item_id !== q.option_group_item_id) {
403
+ return p.option_group_item_id - q.option_group_item_id;
404
+ }
405
+ if (p.option_group_id !== q.option_group_id) {
406
+ return p.option_group_id - q.option_group_id;
407
+ }
408
+ if (p.num !== q.num) return p.num - q.num;
409
+ return p.price.localeCompare(q.price);
410
+ });
411
+ };
412
+ var normalizedOpts = normalizeOptions(productOptionItem);
408
413
  var bundleArr = Array.isArray(productBundle) ? productBundle : [];
409
414
  var normalizedBundles = bundleArr.map(function (item) {
410
- var _ref2, _item$bundle_id;
415
+ var _ref2, _item$bundle_id, _item$bundle_variant_;
411
416
  return {
412
417
  bundle_id: Number((_ref2 = (_item$bundle_id = item === null || item === void 0 ? void 0 : item.bundle_id) !== null && _item$bundle_id !== void 0 ? _item$bundle_id : item === null || item === void 0 ? void 0 : item.id) !== null && _ref2 !== void 0 ? _ref2 : 0) || 0,
413
418
  product_id: Number(item === null || item === void 0 ? void 0 : item.product_id) || 0,
414
- num: typeof (item === null || item === void 0 ? void 0 : item.num) === 'number' && !Number.isNaN(item.num) ? Math.max(1, Math.floor(item.num)) : 1
419
+ product_variant_id: Number((_item$bundle_variant_ = item === null || item === void 0 ? void 0 : item.bundle_variant_id) !== null && _item$bundle_variant_ !== void 0 ? _item$bundle_variant_ : item === null || item === void 0 ? void 0 : item.product_variant_id) || 0,
420
+ num: typeof (item === null || item === void 0 ? void 0 : item.num) === 'number' && !Number.isNaN(item.num) ? Math.max(1, Math.floor(item.num)) : 1,
421
+ option: normalizeOptions(item === null || item === void 0 ? void 0 : item.option)
415
422
  };
416
423
  }).sort(function (p, q) {
417
424
  if (p.bundle_id !== q.bundle_id) return p.bundle_id - q.bundle_id;
418
425
  if (p.product_id !== q.product_id) return p.product_id - q.product_id;
419
- return p.num - q.num;
426
+ if (p.product_variant_id !== q.product_variant_id) {
427
+ return p.product_variant_id - q.product_variant_id;
428
+ }
429
+ if (p.num !== q.num) return p.num - q.num;
430
+ return JSON.stringify(p.option).localeCompare(JSON.stringify(q.option));
420
431
  });
421
432
  return JSON.stringify([normalizedOpts, normalizedBundles]);
422
433
  }
@@ -63,6 +63,24 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
63
63
  private openDataTarget;
64
64
  private loadOpenDataInFlight;
65
65
  private loadOpenDataInFlightTarget;
66
+ protected getSubmitOrderSalesChannel(): string;
67
+ protected isSessionStoragePersistEnabled(): boolean;
68
+ protected shouldUseSessionStorageForSubModule(moduleName?: string): boolean;
69
+ /**
70
+ * 读取与当前 cacheId 同分桶的 Solution 会话状态。
71
+ * 该状态独立于 otherParams,适合页面皮肤保存短生命周期 UI 状态。
72
+ */
73
+ getSessionStateValue<T = unknown>(key: string): T | undefined;
74
+ /**
75
+ * 写入与当前 cacheId 同分桶的 Solution 会话状态。
76
+ * value 为 undefined 时删除该 key;存储失败不阻断业务流程。
77
+ */
78
+ setSessionStateValue(key: string, value: unknown): void;
79
+ /**
80
+ * 清除当前 cacheId 的可恢复订单快照,同时保留 Solution UI sessionState。
81
+ * 用于支付跳转等终态场景,避免浏览器返回时恢复已提交订单。
82
+ */
83
+ clearSessionStorageOrderSnapshot(): void;
66
84
  /**
67
85
  * Kiosk 不能把已收款订单留在本地等待重试:默认直接等待云端 checkout。
68
86
  * 兼容仍需要 WebPOS 待同步模式的入口可显式传 checkoutSyncTaskEnabled: true。
@@ -72,6 +90,13 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
72
90
  protected getDefaultCheckoutSmallTicketDataFlag(): number;
73
91
  protected getRegisteredModuleNames(): readonly string[];
74
92
  protected createSubModule(moduleName: string): Module | null;
93
+ addNewOrder(): Promise<import("../../modules/Order/types").OrderTempOrder>;
94
+ syncAuthenticatedOrderCustomer(): Promise<boolean>;
95
+ private isAuthenticatedCustomerUserPlatform;
96
+ private resolveDiscountOrderIdentity;
97
+ private resolveDiscountAction;
98
+ private resetCachedCustomerDiscountState;
99
+ private refreshLegacySessionCustomerDiscounts;
75
100
  /**
76
101
  * Loads OpenData without borrowing BookingTicket. Cache ownership is tied to the exact
77
102
  * business/channel target so a reused solution instance cannot leak another entry's menus.