@pisell/pisellos 2.3.132 → 2.3.134

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 (27) hide show
  1. package/dist/model/strategy/adapter/promotion/index.js +9 -0
  2. package/dist/modules/Order/index.d.ts +1 -1
  3. package/dist/solution/BookingByStep/index.d.ts +1 -1
  4. package/dist/solution/VenueBooking/index.d.ts +15 -2
  5. package/dist/solution/VenueBooking/index.js +1036 -760
  6. package/dist/solution/VenueBooking/types.d.ts +2 -1
  7. package/dist/solution/VenueBooking/types.js +1 -0
  8. package/dist/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
  9. package/dist/solution/VenueBooking/utils/dateSummary.js +7 -4
  10. package/dist/solution/VenueBooking/utils/smartPricing.d.ts +71 -0
  11. package/dist/solution/VenueBooking/utils/smartPricing.js +273 -0
  12. package/dist/solution/VenueBooking/utils/timeSlot.d.ts +1 -0
  13. package/dist/solution/VenueBooking/utils/timeSlot.js +6 -3
  14. package/lib/model/strategy/adapter/promotion/index.js +46 -1
  15. package/lib/modules/Order/index.d.ts +1 -1
  16. package/lib/solution/BookingByStep/index.d.ts +1 -1
  17. package/lib/solution/VenueBooking/index.d.ts +15 -2
  18. package/lib/solution/VenueBooking/index.js +234 -88
  19. package/lib/solution/VenueBooking/types.d.ts +2 -1
  20. package/lib/solution/VenueBooking/types.js +1 -0
  21. package/lib/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
  22. package/lib/solution/VenueBooking/utils/dateSummary.js +7 -4
  23. package/lib/solution/VenueBooking/utils/smartPricing.d.ts +71 -0
  24. package/lib/solution/VenueBooking/utils/smartPricing.js +224 -0
  25. package/lib/solution/VenueBooking/utils/timeSlot.d.ts +1 -0
  26. package/lib/solution/VenueBooking/utils/timeSlot.js +5 -2
  27. package/package.json +1 -1
@@ -0,0 +1,9 @@
1
+ // 导出评估器
2
+ export { PromotionEvaluator } from "./evaluator";
3
+
4
+ // 导出适配器
5
+ export { PromotionAdapter } from "./adapter";
6
+ export { default } from "./adapter";
7
+
8
+ // 导出策略配置示例常量
9
+ export { X_ITEMS_FOR_Y_PRICE_STRATEGY, BUY_X_GET_Y_FREE_STRATEGY, ITEM_REWARD_STRATEGY } from "./examples";
@@ -592,7 +592,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
592
592
  generateIdempotencyToken(): string;
593
593
  syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
594
594
  createOrder(params: CommitOrderParams['query']): {
595
- type: "virtual" | "appointment_booking";
595
+ type: "appointment_booking" | "virtual";
596
596
  platform: string;
597
597
  sales_channel: string;
598
598
  order_sales_channel: string;
@@ -326,7 +326,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
326
326
  date: string;
327
327
  status: string;
328
328
  week: string;
329
- weekNum: 0 | 1 | 2 | 3 | 5 | 4 | 6;
329
+ weekNum: 0 | 2 | 1 | 3 | 4 | 5 | 6;
330
330
  }[]>;
331
331
  submitTimeSlot(timeSlots: TimeSliceItem): void;
332
332
  private getScheduleDataByIds;
@@ -41,6 +41,11 @@ export declare class VenueBookingImpl extends BaseSalesImpl implements Module {
41
41
  private customerLoginRefreshIdInFlight;
42
42
  private loadAllProductsInFlight;
43
43
  private productsLoaded;
44
+ private smartPricingCustomerId;
45
+ private smartPricingProductCatalog;
46
+ private slotPriceMapCache;
47
+ private slotPriceStrategyConfigs;
48
+ private slotPriceScheduleList;
44
49
  private loadOpenDataConfigInFlight;
45
50
  private static readonly OPEN_DATA_CACHE_TTL;
46
51
  private getLoggerContext;
@@ -69,7 +74,7 @@ export declare class VenueBookingImpl extends BaseSalesImpl implements Module {
69
74
  private clearLoginEffectListeners;
70
75
  private registerLoginEffect;
71
76
  private registerCustomerLoginListeners;
72
- private refreshOrderMarketingAfterLogin;
77
+ private refreshOrderMarketingForCustomer;
73
78
  initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
74
79
  destroy(): Promise<void>;
75
80
  retryInit(): Promise<void>;
@@ -82,6 +87,11 @@ export declare class VenueBookingImpl extends BaseSalesImpl implements Module {
82
87
  passed: boolean | null;
83
88
  failures: QuantityCheckResult[];
84
89
  };
90
+ private resolveCustomerIdForSmartPricing;
91
+ private buildSmartPricingContext;
92
+ private buildSlotPriceMapForDate;
93
+ /** 规则或客户上下文更新后,同步商品展示、已选时段和订单汇总。 */
94
+ refreshSmartPricing(): Promise<void>;
85
95
  loadAllProducts(): Promise<{
86
96
  venueProducts: ProductData[];
87
97
  addonProducts: ProductData[];
@@ -167,7 +177,10 @@ export declare class VenueBookingImpl extends BaseSalesImpl implements Module {
167
177
  onCustomerLogin(params: {
168
178
  customerId: number;
169
179
  }): Promise<void>;
170
- private recalculateOrderPricesFromQuotation;
180
+ /** 宿主退出登录或以匿名身份重新进入时,清理客户资产并恢复匿名价格。 */
181
+ onCustomerLogout(): Promise<void>;
182
+ private recalculateOrderPricesFromSmartPricing;
183
+ private resetProductPriceForSmartPricing;
171
184
  scanCode(code: string, customerId?: number): Promise<{
172
185
  isAvailable: boolean;
173
186
  isAccepted?: boolean | undefined;