@pisell/pisellos 2.3.43 → 2.3.45

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 (160) hide show
  1. package/dist/modules/Discount/index.d.ts +0 -1
  2. package/dist/modules/Discount/index.js +11 -40
  3. package/dist/modules/Discount/types.d.ts +0 -1
  4. package/dist/modules/OpenData/index.js +2 -2
  5. package/dist/modules/Order/index.d.ts +2 -3
  6. package/dist/modules/Order/index.js +98 -82
  7. package/dist/modules/Order/types.d.ts +2 -9
  8. package/dist/modules/Order/utils.d.ts +0 -10
  9. package/dist/modules/Order/utils.js +3 -35
  10. package/dist/modules/Payment/walletpass.d.ts +10 -3
  11. package/dist/modules/Payment/walletpass.js +425 -282
  12. package/dist/modules/Product/types.d.ts +0 -1
  13. package/dist/modules/ProductList/index.js +14 -33
  14. package/dist/modules/Quotation/index.d.ts +1 -1
  15. package/dist/modules/Quotation/index.js +2 -2
  16. package/dist/modules/Rules/index.d.ts +2 -0
  17. package/dist/modules/Rules/index.js +72 -102
  18. package/dist/modules/SalesSummary/index.js +13 -12
  19. package/dist/modules/ScanOrderLogger/index.d.ts +0 -2
  20. package/dist/modules/ScanOrderLogger/index.js +2 -15
  21. package/dist/modules/ScanOrderLogger/providers/feishu.js +27 -45
  22. package/dist/modules/ScanOrderLogger/types.d.ts +0 -1
  23. package/dist/modules/Schedule/index.d.ts +1 -3
  24. package/dist/modules/Schedule/index.js +16 -21
  25. package/dist/modules/Summary/utils.js +13 -38
  26. package/dist/modules/index.d.ts +0 -2
  27. package/dist/modules/index.js +1 -3
  28. package/dist/plugins/window.d.ts +0 -1
  29. package/dist/server/index.d.ts +0 -14
  30. package/dist/server/index.js +657 -772
  31. package/dist/solution/BaseSales/index.d.ts +0 -7
  32. package/dist/solution/BaseSales/index.js +48 -67
  33. package/dist/solution/BaseSales/types.d.ts +3 -1
  34. package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +6 -3
  35. package/dist/solution/BookingByStep/index.d.ts +1 -16
  36. package/dist/solution/BookingByStep/index.js +215 -294
  37. package/dist/solution/BookingByStep/types.d.ts +1 -2
  38. package/dist/solution/BookingByStep/types.js +1 -3
  39. package/dist/solution/BookingByStep/utils/capacity.js +1 -17
  40. package/dist/solution/BookingByStep/utils/timeslots.d.ts +1 -3
  41. package/dist/solution/BookingByStep/utils/timeslots.js +12 -19
  42. package/dist/solution/BookingTicket/index.d.ts +1 -13
  43. package/dist/solution/BookingTicket/index.js +8 -5
  44. package/dist/solution/BookingTicket/types.d.ts +1 -0
  45. package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +3 -3
  46. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +1 -3
  47. package/dist/solution/BookingTicket/utils/scan/handleScan.js +2 -10
  48. package/dist/solution/ScanOrder/index.d.ts +14 -26
  49. package/dist/solution/ScanOrder/index.js +739 -1142
  50. package/dist/solution/ScanOrder/types.d.ts +1 -21
  51. package/dist/solution/ScanOrder/utils.d.ts +0 -8
  52. package/dist/solution/ScanOrder/utils.js +25 -66
  53. package/dist/solution/ShopDiscount/index.d.ts +0 -1
  54. package/dist/solution/ShopDiscount/index.js +87 -125
  55. package/dist/solution/VenueBooking/index.d.ts +12 -39
  56. package/dist/solution/VenueBooking/index.js +841 -1167
  57. package/dist/solution/VenueBooking/types.d.ts +0 -3
  58. package/dist/solution/VenueBooking/utils/resource.js +0 -1
  59. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
  60. package/dist/solution/VenueBooking/utils/slotMerge.js +5 -10
  61. package/dist/solution/index.d.ts +0 -1
  62. package/dist/solution/index.js +1 -2
  63. package/dist/types/index.d.ts +0 -1
  64. package/lib/model/strategy/adapter/promotion/index.js +51 -0
  65. package/lib/modules/Discount/index.d.ts +0 -1
  66. package/lib/modules/Discount/index.js +0 -9
  67. package/lib/modules/Discount/types.d.ts +0 -1
  68. package/lib/modules/OpenData/index.js +1 -1
  69. package/lib/modules/Order/index.d.ts +2 -3
  70. package/lib/modules/Order/index.js +56 -33
  71. package/lib/modules/Order/types.d.ts +2 -9
  72. package/lib/modules/Order/utils.d.ts +0 -10
  73. package/lib/modules/Order/utils.js +5 -36
  74. package/lib/modules/Payment/walletpass.d.ts +10 -3
  75. package/lib/modules/Payment/walletpass.js +218 -56
  76. package/lib/modules/Product/types.d.ts +0 -1
  77. package/lib/modules/ProductList/index.js +31 -40
  78. package/lib/modules/Quotation/index.d.ts +1 -1
  79. package/lib/modules/Quotation/index.js +2 -2
  80. package/lib/modules/Rules/index.d.ts +2 -0
  81. package/lib/modules/Rules/index.js +24 -36
  82. package/lib/modules/SalesSummary/index.js +7 -6
  83. package/lib/modules/ScanOrderLogger/index.d.ts +0 -2
  84. package/lib/modules/ScanOrderLogger/index.js +1 -13
  85. package/lib/modules/ScanOrderLogger/providers/feishu.js +6 -15
  86. package/lib/modules/ScanOrderLogger/types.d.ts +0 -1
  87. package/lib/modules/Schedule/index.d.ts +1 -3
  88. package/lib/modules/Schedule/index.js +8 -10
  89. package/lib/modules/Summary/utils.js +1 -21
  90. package/lib/modules/index.d.ts +0 -2
  91. package/lib/modules/index.js +1 -5
  92. package/lib/plugins/window.d.ts +0 -1
  93. package/lib/server/index.d.ts +0 -14
  94. package/lib/server/index.js +5 -65
  95. package/lib/solution/BaseSales/index.d.ts +0 -7
  96. package/lib/solution/BaseSales/index.js +9 -24
  97. package/lib/solution/BaseSales/types.d.ts +3 -1
  98. package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +3 -2
  99. package/lib/solution/BookingByStep/index.d.ts +1 -16
  100. package/lib/solution/BookingByStep/index.js +18 -60
  101. package/lib/solution/BookingByStep/types.d.ts +1 -2
  102. package/lib/solution/BookingByStep/types.js +0 -5
  103. package/lib/solution/BookingByStep/utils/capacity.js +1 -20
  104. package/lib/solution/BookingByStep/utils/timeslots.d.ts +1 -3
  105. package/lib/solution/BookingByStep/utils/timeslots.js +11 -19
  106. package/lib/solution/BookingTicket/index.d.ts +1 -13
  107. package/lib/solution/BookingTicket/index.js +3 -10
  108. package/lib/solution/BookingTicket/types.d.ts +1 -0
  109. package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +2 -2
  110. package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +1 -3
  111. package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -2
  112. package/lib/solution/ScanOrder/index.d.ts +14 -26
  113. package/lib/solution/ScanOrder/index.js +182 -449
  114. package/lib/solution/ScanOrder/types.d.ts +1 -21
  115. package/lib/solution/ScanOrder/utils.d.ts +0 -8
  116. package/lib/solution/ScanOrder/utils.js +0 -31
  117. package/lib/solution/ShopDiscount/index.d.ts +0 -1
  118. package/lib/solution/ShopDiscount/index.js +0 -14
  119. package/lib/solution/VenueBooking/index.d.ts +12 -39
  120. package/lib/solution/VenueBooking/index.js +110 -322
  121. package/lib/solution/VenueBooking/types.d.ts +0 -3
  122. package/lib/solution/VenueBooking/utils/resource.js +0 -1
  123. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
  124. package/lib/solution/VenueBooking/utils/slotMerge.js +4 -6
  125. package/lib/solution/index.d.ts +0 -1
  126. package/lib/solution/index.js +1 -3
  127. package/lib/types/index.d.ts +0 -1
  128. package/package.json +1 -1
  129. package/dist/modules/Holder/index.d.ts +0 -48
  130. package/dist/modules/Holder/index.js +0 -640
  131. package/dist/modules/Holder/types.d.ts +0 -123
  132. package/dist/modules/Holder/types.js +0 -1
  133. package/dist/modules/Holder/utils.d.ts +0 -13
  134. package/dist/modules/Holder/utils.js +0 -34
  135. package/dist/modules/ResourcePlanner/index.d.ts +0 -24
  136. package/dist/modules/ResourcePlanner/index.js +0 -181
  137. package/dist/modules/ResourcePlanner/planner.d.ts +0 -14
  138. package/dist/modules/ResourcePlanner/planner.js +0 -1069
  139. package/dist/modules/ResourcePlanner/types.d.ts +0 -227
  140. package/dist/modules/ResourcePlanner/types.js +0 -1
  141. package/dist/solution/UnifiedBookingSales/index.d.ts +0 -183
  142. package/dist/solution/UnifiedBookingSales/index.js +0 -1891
  143. package/dist/solution/UnifiedBookingSales/types.d.ts +0 -143
  144. package/dist/solution/UnifiedBookingSales/types.js +0 -11
  145. package/lib/modules/Holder/index.d.ts +0 -48
  146. package/lib/modules/Holder/index.js +0 -402
  147. package/lib/modules/Holder/types.d.ts +0 -123
  148. package/lib/modules/Holder/types.js +0 -17
  149. package/lib/modules/Holder/utils.d.ts +0 -13
  150. package/lib/modules/Holder/utils.js +0 -71
  151. package/lib/modules/ResourcePlanner/index.d.ts +0 -24
  152. package/lib/modules/ResourcePlanner/index.js +0 -148
  153. package/lib/modules/ResourcePlanner/planner.d.ts +0 -14
  154. package/lib/modules/ResourcePlanner/planner.js +0 -933
  155. package/lib/modules/ResourcePlanner/types.d.ts +0 -227
  156. package/lib/modules/ResourcePlanner/types.js +0 -17
  157. package/lib/solution/UnifiedBookingSales/index.d.ts +0 -183
  158. package/lib/solution/UnifiedBookingSales/index.js +0 -1084
  159. package/lib/solution/UnifiedBookingSales/types.d.ts +0 -143
  160. package/lib/solution/UnifiedBookingSales/types.js +0 -33
@@ -165,6 +165,8 @@ export interface OrderCustomerChangePayload {
165
165
  }
166
166
  export interface OrderScanCodeResult {
167
167
  isAvailable: boolean;
168
+ /** 卡券已加入当前订单折扣列表,但不一定能立即应用。 */
169
+ isAccepted?: boolean;
168
170
  discountList: Discount[];
169
171
  scannedDiscountList: Discount[];
170
172
  type: 'server' | 'clientCalc';
@@ -394,7 +396,6 @@ export interface CommitOrderParams {
394
396
  type: 'virtual' | 'appointment_booking';
395
397
  platform?: string;
396
398
  extraData?: Record<string, any>;
397
- business_code?: string;
398
399
  };
399
400
  }
400
401
  export interface OrderSubmitBooking {
@@ -570,12 +571,6 @@ export interface SyncPaymentsToOrderParams {
570
571
  payments: OrderPaymentSource[];
571
572
  paymentStatus?: SubmitSalesOrderParams['query']['payment_status'];
572
573
  submitWhenPaid?: boolean;
573
- /**
574
- * Whether the checkout should be queued as the local `sync_sales` task.
575
- * Defaults to true to preserve the WebPOS retry path. Set to false when
576
- * the caller must wait for the cloud checkout response before proceeding.
577
- */
578
- checkoutSyncTaskEnabled?: boolean;
579
574
  smallTicketDataFlag?: number;
580
575
  businessCode?: string;
581
576
  channel?: string;
@@ -738,8 +733,6 @@ export interface OrderModuleAPI {
738
733
  setEnableTempOrderPersist: (enabled: boolean) => void;
739
734
  /** 是否允许 saveDraft 写入 IndexedDB 草稿。 */
740
735
  isTempOrderPersistEnabled: () => boolean;
741
- /** 提交 tempOrder 变更并触发 `{moduleName}:changed` 事件 */
742
- notifyTempOrderChanged: () => void;
743
736
  submitTempOrder: <T = any>(params?: {
744
737
  cacheId?: string;
745
738
  platform?: string;
@@ -15,7 +15,6 @@ export interface OrderProductsDepositSummary {
15
15
  deposit_policy_ids: number[];
16
16
  hasDeposit: boolean;
17
17
  }
18
- import type { WindowPlugin } from '../../plugins';
19
18
  /**
20
19
  * 把"含 option 的主商品单价"与 bundle 合成"单行 composite 单价"。
21
20
  *
@@ -178,15 +177,6 @@ export declare const mergeRelationForms: (relationForms: {
178
177
  form_id: number;
179
178
  form_record_ids: number[];
180
179
  }[];
181
- export interface CartOrderHolder {
182
- customer_id?: number;
183
- form_id: number | string;
184
- form_record: (number | string)[] | null;
185
- }
186
- /**
187
- * 为购物车行补齐订单所需的 holder 信息(与 cartAccount 结构保持一致)
188
- */
189
- export declare function ensureCartItemOriginHolder(cartItem: CartItem, window?: WindowPlugin): void;
190
180
  export declare const getAllDiscountList: (cartItem: CartItem) => any;
191
181
  export { createUuidV4 };
192
182
  export declare function isTempOrder(data: any): data is OrderTempOrder;
@@ -20,7 +20,6 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
20
20
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
21
21
  import dayjs from "dayjs";
22
22
  import Decimal from 'decimal.js';
23
- import { getProductHolderConfig } from "../Holder/utils";
24
23
  import { buildProductLineFingerprint, createEmptySummary } from "../../solution/ScanOrder/utils";
25
24
  import { createUuidV4 } from "./utils/orderCollectionIdentity";
26
25
  /**
@@ -745,41 +744,10 @@ export var mergeRelationForms = function mergeRelationForms(relationForms) {
745
744
  return item.form_record_ids.length > 0;
746
745
  }); // 过滤掉没有有效记录的表单
747
746
  };
748
- function getCustomerIdFromStorage(window) {
749
- try {
750
- var _window$getLocalStora;
751
- var customer = JSON.parse((window === null || window === void 0 || (_window$getLocalStora = window.getLocalStorage) === null || _window$getLocalStora === void 0 ? void 0 : _window$getLocalStora.call(window, 'customer')) || '{}');
752
- var customerId = Number(customer === null || customer === void 0 ? void 0 : customer.id);
753
- return Number.isFinite(customerId) && customerId > 0 ? customerId : undefined;
754
- } catch (_unused) {
755
- return undefined;
756
- }
757
- }
758
-
759
- /**
760
- * 为购物车行补齐订单所需的 holder 信息(与 cartAccount 结构保持一致)
761
- */
762
- export function ensureCartItemOriginHolder(cartItem, window) {
763
- var _cartItem$_origin, _cartItem$_productIni;
764
- if (cartItem !== null && cartItem !== void 0 && (_cartItem$_origin = cartItem._origin) !== null && _cartItem$_origin !== void 0 && _cartItem$_origin.holder) {
765
- return;
766
- }
767
- var holderConfig = getProductHolderConfig((_cartItem$_productIni = cartItem === null || cartItem === void 0 ? void 0 : cartItem._productInit) !== null && _cartItem$_productIni !== void 0 ? _cartItem$_productIni : cartItem === null || cartItem === void 0 ? void 0 : cartItem._productOrigin);
768
- var formRecordId = cartItem === null || cartItem === void 0 ? void 0 : cartItem.holder_id;
769
- if (!(holderConfig !== null && holderConfig !== void 0 && holderConfig.resource_id) || formRecordId == null) {
770
- return;
771
- }
772
- cartItem._origin.holder = {
773
- customer_id: getCustomerIdFromStorage(window),
774
- form_id: holderConfig.resource_id,
775
- form_record: [formRecordId]
776
- };
777
- }
778
- ;
779
747
  export var getAllDiscountList = function getAllDiscountList(cartItem) {
780
- var _cartItem$_origin2, _cartItem$_origin3;
781
- var discountList = (cartItem === null || cartItem === void 0 || (_cartItem$_origin2 = cartItem._origin) === null || _cartItem$_origin2 === void 0 || (_cartItem$_origin2 = _cartItem$_origin2.product) === null || _cartItem$_origin2 === void 0 ? void 0 : _cartItem$_origin2.discount_list) || [];
782
- ((cartItem === null || cartItem === void 0 || (_cartItem$_origin3 = cartItem._origin) === null || _cartItem$_origin3 === void 0 || (_cartItem$_origin3 = _cartItem$_origin3.product) === null || _cartItem$_origin3 === void 0 ? void 0 : _cartItem$_origin3.product_bundle) || []).forEach(function (item) {
748
+ var _cartItem$_origin, _cartItem$_origin2;
749
+ var discountList = (cartItem === null || cartItem === void 0 || (_cartItem$_origin = cartItem._origin) === null || _cartItem$_origin === void 0 || (_cartItem$_origin = _cartItem$_origin.product) === null || _cartItem$_origin === void 0 ? void 0 : _cartItem$_origin.discount_list) || [];
750
+ ((cartItem === null || cartItem === void 0 || (_cartItem$_origin2 = cartItem._origin) === null || _cartItem$_origin2 === void 0 || (_cartItem$_origin2 = _cartItem$_origin2.product) === null || _cartItem$_origin2 === void 0 ? void 0 : _cartItem$_origin2.product_bundle) || []).forEach(function (item) {
783
751
  discountList = [].concat(_toConsumableArray(discountList), _toConsumableArray((item === null || item === void 0 ? void 0 : item.discount_list) || []));
784
752
  item.discount_list = undefined;
785
753
  });
@@ -21,11 +21,13 @@ export declare class WalletPassPaymentImpl implements WalletPassPayment {
21
21
  private emitEvent;
22
22
  private publishWalletAssetsState;
23
23
  private recalculateWalletAssets;
24
+ /** 获取当前缓存中所有支付类 Wallet 资产的扫码 code。 */
25
+ private getSearchedWalletAssetCodes;
24
26
  /**
25
- * 使用最新订单参数重验扫码搜索过的支付类 Wallet 资产。
26
- * 请求失败或暂时无匹配结果时保留旧资产,避免商品变化造成列表闪空。
27
+ * 用订单重算接口返回的数据更新扫码 Wallet 缓存。
28
+ * 接口暂时缺失某个扫码 code 时继续保留旧值,避免列表闪空。
27
29
  */
28
- private revalidateSearchedWalletAssets;
30
+ private syncSearchedWalletAssets;
29
31
  /**
30
32
  * 生成钱包API默认参数
31
33
  * 根据业务数据生成标准的钱包API参数,并存储在模块中
@@ -67,6 +69,11 @@ export declare class WalletPassPaymentImpl implements WalletPassPayment {
67
69
  noApplicableVoucher: any[];
68
70
  products: any[];
69
71
  }>;
72
+ /**
73
+ * 商品或订单金额变化后,使用聚合接口一次重算已选与剩余 WalletPass。
74
+ * Walk-In 不发送 customer_id;会员才携带真实 customer_id。
75
+ */
76
+ private aggregateRecalculateWalletAssetsAsync;
70
77
  getWalletPassRecommendListAsync(params: WalletDeductionRecommendParams): Promise<WalletRecommendItem[]>;
71
78
  formatWalletPassList2PreparePayments(list: WalletRecommendItem[]): {
72
79
  voucher_id: number;