@pisell/pisellos 2.1.166 → 2.1.168

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 (81) hide show
  1. package/dist/index.d.ts +0 -1
  2. package/dist/index.js +0 -3
  3. package/dist/model/strategy/adapter/index.d.ts +0 -4
  4. package/dist/model/strategy/adapter/index.js +1 -5
  5. package/dist/model/strategy/adapter/promotion/index.js +9 -0
  6. package/dist/modules/Cart/utils/changePrice.js +16 -9
  7. package/dist/modules/Discount/index.d.ts +2 -5
  8. package/dist/modules/Discount/index.js +1 -21
  9. package/dist/modules/Discount/types.d.ts +0 -4
  10. package/dist/modules/Order/index.d.ts +0 -1
  11. package/dist/modules/Order/index.js +6 -18
  12. package/dist/modules/Order/types.d.ts +0 -2
  13. package/dist/modules/ProductList/index.d.ts +1 -3
  14. package/dist/modules/ProductList/index.js +11 -22
  15. package/dist/modules/Schedule/getDateIsInSchedule.js +0 -5
  16. package/dist/solution/BookingByStep/index.d.ts +2 -2
  17. package/dist/solution/ScanOrder/index.js +1 -1
  18. package/dist/solution/ShopDiscount/index.js +15 -16
  19. package/dist/solution/VenueBooking/index.d.ts +3 -40
  20. package/dist/solution/VenueBooking/index.js +261 -394
  21. package/dist/solution/VenueBooking/types.d.ts +1 -3
  22. package/dist/solution/VenueBooking/types.js +0 -1
  23. package/dist/solution/VenueBooking/utils/dateSummary.d.ts +2 -2
  24. package/dist/solution/VenueBooking/utils/dateSummary.js +25 -12
  25. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +6 -0
  26. package/dist/solution/VenueBooking/utils/slotMerge.js +9 -3
  27. package/dist/solution/VenueBooking/utils/timeSlot.d.ts +0 -2
  28. package/dist/solution/VenueBooking/utils/timeSlot.js +4 -9
  29. package/lib/index.d.ts +0 -1
  30. package/lib/index.js +0 -3
  31. package/lib/model/strategy/adapter/index.d.ts +0 -4
  32. package/lib/model/strategy/adapter/index.js +2 -13
  33. package/lib/model/strategy/adapter/promotion/index.js +0 -49
  34. package/lib/modules/Cart/utils/changePrice.js +13 -9
  35. package/lib/modules/Discount/index.d.ts +2 -5
  36. package/lib/modules/Discount/index.js +1 -11
  37. package/lib/modules/Discount/types.d.ts +0 -4
  38. package/lib/modules/Order/index.d.ts +0 -1
  39. package/lib/modules/Order/index.js +1 -11
  40. package/lib/modules/Order/types.d.ts +0 -2
  41. package/lib/modules/ProductList/index.d.ts +1 -3
  42. package/lib/modules/ProductList/index.js +39 -45
  43. package/lib/modules/Schedule/getDateIsInSchedule.js +0 -4
  44. package/lib/solution/BookingByStep/index.d.ts +2 -2
  45. package/lib/solution/ScanOrder/index.js +1 -1
  46. package/lib/solution/ShopDiscount/index.js +2 -3
  47. package/lib/solution/VenueBooking/index.d.ts +3 -40
  48. package/lib/solution/VenueBooking/index.js +111 -257
  49. package/lib/solution/VenueBooking/types.d.ts +1 -3
  50. package/lib/solution/VenueBooking/types.js +0 -1
  51. package/lib/solution/VenueBooking/utils/dateSummary.d.ts +2 -2
  52. package/lib/solution/VenueBooking/utils/dateSummary.js +10 -5
  53. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +6 -0
  54. package/lib/solution/VenueBooking/utils/slotMerge.js +4 -3
  55. package/lib/solution/VenueBooking/utils/timeSlot.d.ts +0 -2
  56. package/lib/solution/VenueBooking/utils/timeSlot.js +3 -7
  57. package/package.json +1 -1
  58. package/dist/model/strategy/adapter/dataVariant/adapter.d.ts +0 -50
  59. package/dist/model/strategy/adapter/dataVariant/adapter.js +0 -167
  60. package/dist/model/strategy/adapter/dataVariant/evaluator.d.ts +0 -89
  61. package/dist/model/strategy/adapter/dataVariant/evaluator.js +0 -780
  62. package/dist/model/strategy/adapter/dataVariant/examples.d.ts +0 -39
  63. package/dist/model/strategy/adapter/dataVariant/examples.js +0 -277
  64. package/dist/model/strategy/adapter/dataVariant/index.d.ts +0 -4
  65. package/dist/model/strategy/adapter/dataVariant/index.js +0 -4
  66. package/dist/model/strategy/adapter/dataVariant/type.d.ts +0 -148
  67. package/dist/model/strategy/adapter/dataVariant/type.js +0 -54
  68. package/dist/solution/VenueBooking/utils/smartPricing.d.ts +0 -70
  69. package/dist/solution/VenueBooking/utils/smartPricing.js +0 -233
  70. package/lib/model/strategy/adapter/dataVariant/adapter.d.ts +0 -50
  71. package/lib/model/strategy/adapter/dataVariant/adapter.js +0 -149
  72. package/lib/model/strategy/adapter/dataVariant/evaluator.d.ts +0 -89
  73. package/lib/model/strategy/adapter/dataVariant/evaluator.js +0 -583
  74. package/lib/model/strategy/adapter/dataVariant/examples.d.ts +0 -39
  75. package/lib/model/strategy/adapter/dataVariant/examples.js +0 -293
  76. package/lib/model/strategy/adapter/dataVariant/index.d.ts +0 -4
  77. package/lib/model/strategy/adapter/dataVariant/index.js +0 -38
  78. package/lib/model/strategy/adapter/dataVariant/type.d.ts +0 -148
  79. package/lib/model/strategy/adapter/dataVariant/type.js +0 -31
  80. package/lib/solution/VenueBooking/utils/smartPricing.d.ts +0 -70
  81. package/lib/solution/VenueBooking/utils/smartPricing.js +0 -180
@@ -34,10 +34,6 @@ __export(getDateIsInSchedule_exports, {
34
34
  });
35
35
  module.exports = __toCommonJS(getDateIsInSchedule_exports);
36
36
  var import_dayjs = __toESM(require("dayjs"));
37
- var import_isSameOrAfter = __toESM(require("dayjs/plugin/isSameOrAfter"));
38
- var import_isSameOrBefore = __toESM(require("dayjs/plugin/isSameOrBefore"));
39
- import_dayjs.default.extend(import_isSameOrAfter.default);
40
- import_dayjs.default.extend(import_isSameOrBefore.default);
41
37
  var getDateIsInSchedule = (dateTime, scheduleList) => {
42
38
  if (!dateTime || !scheduleList || scheduleList.length === 0) {
43
39
  return false;
@@ -310,7 +310,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
310
310
  date: string;
311
311
  status: string;
312
312
  week: string;
313
- weekNum: 0 | 1 | 5 | 4 | 2 | 3 | 6;
313
+ weekNum: 0 | 2 | 1 | 5 | 4 | 3 | 6;
314
314
  }[]>;
315
315
  submitTimeSlot(timeSlots: TimeSliceItem): void;
316
316
  private getScheduleDataByIds;
@@ -329,7 +329,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
329
329
  count: number;
330
330
  left: number;
331
331
  summaryCount: number;
332
- status: "sold_out" | "lots_of_space" | "filling_up_fast";
332
+ status: "lots_of_space" | "filling_up_fast" | "sold_out";
333
333
  }[];
334
334
  /**
335
335
  * 找到多个资源的公共可用时间段
@@ -563,7 +563,7 @@ var _ScanOrderImpl = class extends import_BaseModule.BaseModule {
563
563
  ...tempOrder.metadata || {},
564
564
  shop_service_data: {
565
565
  ...(tempOrder.metadata || {}).shop_service_data || {},
566
- service_type: ((_a = this.otherParams) == null ? void 0 : _a.businessCode) === "dine_in" ? "dine_in" : "",
566
+ service_type: ((_a = this.otherParams) == null ? void 0 : _a.businessCode) === "dine_in" ? "dine_in" : "take_away",
567
567
  pickup_reference_mode: mode
568
568
  }
569
569
  };
@@ -511,7 +511,7 @@ var ShopDiscountImpl = class extends import_BaseModule.BaseModule {
511
511
  try {
512
512
  const orderId = this.store.orderId;
513
513
  const customerId = params.customerId || ((_a = this.getCustomer()) == null ? void 0 : _a.id);
514
- const prepareConfig = await ((_b = this.store.discount) == null ? void 0 : _b.loadPrepareConfig({
514
+ const goodPassList = await ((_b = this.store.discount) == null ? void 0 : _b.loadPrepareConfig({
515
515
  customer_id: customerId,
516
516
  action: orderId ? "edit" : "create",
517
517
  with_good_pass: 1,
@@ -520,12 +520,11 @@ var ShopDiscountImpl = class extends import_BaseModule.BaseModule {
520
520
  request_timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
521
521
  ...orderId ? { order_id: orderId } : {}
522
522
  }));
523
- const goodPassList = (prepareConfig == null ? void 0 : prepareConfig.discountList) || [];
524
523
  const scanDiscount = (_c = this.getDiscountList()) == null ? void 0 : _c.filter(
525
524
  (item) => item.isScan
526
525
  );
527
526
  const scanDiscountIds = scanDiscount.map((n) => n.id);
528
- const newGoodPassList = goodPassList.filter((n) => !scanDiscountIds.includes(n.id));
527
+ const newGoodPassList = goodPassList == null ? void 0 : goodPassList.filter((n) => !scanDiscountIds.includes(n.id));
529
528
  const newDiscountList = [...scanDiscount, ...newGoodPassList || []];
530
529
  this.store.originalDiscountList = newDiscountList;
531
530
  await ((_d = this.store.discount) == null ? void 0 : _d.setOriginalDiscountList(newDiscountList));
@@ -3,7 +3,6 @@ import { BaseModule } from '../../modules/BaseModule';
3
3
  import { VenueBookingAddLogParams, VenueBookingSlotConfig, VenueDateSummaryItem, VenueSlotSelection, VenueTimeSlotGrid } from './types';
4
4
  import type { ScanOrderOrderProduct, ScanOrderOrderProductIdentity } from '../ScanOrder/types';
5
5
  import type { UpdateProductInOrderParams } from '../../modules/Order/types';
6
- import type { ScheduleItem } from '../../modules/Schedule/types';
7
6
  import type { OpenDataAvailabilityResult } from '../../modules/OpenData';
8
7
  import type { ProductData } from '../../modules/Product/types';
9
8
  import { type CartItemSummary, type PaxInfo, type QuantityCheckResult, type QuantityLimitResult } from '../../model/strategy/adapter/itemRule';
@@ -37,17 +36,10 @@ export declare class VenueBookingImpl extends BaseModule implements Module {
37
36
  private loginEffectDisposers;
38
37
  private customerLoginRefreshInFlight;
39
38
  private customerLoginRefreshIdInFlight;
40
- /** 最近一次确认登录的客户;登录事件与 user 插件更新之间可能存在时序差。 */
41
- private smartPricingCustomerId;
42
39
  private loadAllProductsInFlight;
43
40
  private productsLoaded;
44
41
  private loadOpenDataConfigInFlight;
45
42
  private static readonly OPEN_DATA_CACHE_TTL;
46
- /** 按日期缓存 slot 智能定价 Map,避免同周重复 resolveProducts */
47
- private slotPriceMapCache;
48
- /** loadProducts 后缓存的全量商品(venue + addon),供分段算价复用 */
49
- private smartPricingProductCatalog;
50
- private static readonly PISELL1_LOGIN_SUCCESS;
51
43
  private getLoggerContext;
52
44
  private safeStringify;
53
45
  private pickErrorMessage;
@@ -76,22 +68,6 @@ export declare class VenueBookingImpl extends BaseModule implements Module {
76
68
  passed: boolean | null;
77
69
  failures: QuantityCheckResult[];
78
70
  };
79
- /** 清除 slot 价格分段缓存(商品重载 / 登录后 customerId 变化时调用) */
80
- private clearSlotPriceMapCache;
81
- /** 读取当前登录 customerId */
82
- private resolveCustomerIdForSmartPricing;
83
- private resolveAvailableWalletIdsForSmartPricing;
84
- /** 读取 schedule 全量列表,供智能定价 schedule_match 使用 */
85
- private getScheduleListForSmartPricing;
86
- /** 构建智能定价上下文,对齐 OS Server buildProductFormatterContext */
87
- private buildSmartPricingContext;
88
- /** venue + addon 全量商品,供智能定价评估 */
89
- private getAllProductsForSmartPricing;
90
- private getSlotPriceMapCacheKey;
91
- /**
92
- * 按 schedule 分段构建 slot 价格 Map,带实例级缓存。
93
- */
94
- private buildSlotPriceMapForDate;
95
71
  loadAllProducts(): Promise<{
96
72
  venueProducts: ProductData[];
97
73
  addonProducts: ProductData[];
@@ -164,7 +140,8 @@ export declare class VenueBookingImpl extends BaseModule implements Module {
164
140
  setSlotConfig(config: Partial<VenueBookingSlotConfig>): void;
165
141
  getSlotConfig(): VenueBookingSlotConfig;
166
142
  loadSchedules(): Promise<void>;
167
- getScheduleListByIds(ids: number[]): ScheduleItem[];
143
+ private injectScheduleResolverToQuotation;
144
+ getScheduleListByIds(ids: number[]): import("../../modules/Schedule/types").ScheduleItem[];
168
145
  getTempOrder(): import("./types").ScanOrderTempOrder | null;
169
146
  updateTempOrderNote(note: string): string;
170
147
  updateTempOrderContactsInfo(contactsInfo: any[]): any[];
@@ -172,12 +149,7 @@ export declare class VenueBookingImpl extends BaseModule implements Module {
172
149
  onCustomerLogin(params: {
173
150
  customerId: number;
174
151
  }): Promise<void>;
175
- private recalculateOrderPricesFromSmartPricing;
176
- /**
177
- * DataVariant 重算价格后,同步刷新订单展示、Rules 与 Summary 共用的价格口径。
178
- * Rules 会在本轮结束后根据当前客户的 discountList 重新写入实际折扣。
179
- */
180
- private resetProductPriceForSmartPricing;
152
+ private recalculateOrderPricesFromQuotation;
181
153
  scanCode(code: string, customerId?: number): Promise<{
182
154
  isAvailable: boolean;
183
155
  discountList: import("../../modules/Discount").Discount[];
@@ -192,15 +164,6 @@ export declare class VenueBookingImpl extends BaseModule implements Module {
192
164
  discountId: number;
193
165
  isSelected: boolean;
194
166
  }): Promise<import("../../modules/Discount").Discount[]>;
195
- /**
196
- * 统一 VenueBooking 折扣后的订单行价。
197
- *
198
- * Rules 的 `discount_list.amount` 是已经按适用规则计算出的每件优惠额;它是这里唯一
199
- * 的折扣金额来源。使用智能定价写入的 source_product_price 减去该金额,再同步
200
- * selling_price 与 Summary 使用的 main_product_selling_price,避免 UI 的购物车行价、
201
- * 小计和提交订单各自读取到不同的价格字段。
202
- */
203
- private normalizeDiscountedOrderPrices;
204
167
  addNewOrder(): Promise<import("./types").ScanOrderTempOrder>;
205
168
  getOrderProducts(): ScanOrderOrderProduct[];
206
169
  getSummary(): Promise<import("./types").ScanOrderSummary>;