@pisell/pisellos 0.10.20 → 0.10.22

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 (88) hide show
  1. package/dist/model/strategy/adapter/promotion/index.js +0 -9
  2. package/dist/modules/BookingContext/index.d.ts +3 -0
  3. package/dist/modules/BookingContext/index.js +42 -13
  4. package/dist/modules/BookingContext/types.d.ts +4 -4
  5. package/dist/modules/BookingContext/types.js +3 -3
  6. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +10 -7
  7. package/dist/modules/OpenData/index.d.ts +10 -1
  8. package/dist/modules/OpenData/index.js +268 -14
  9. package/dist/modules/OpenData/types.d.ts +14 -1
  10. package/dist/modules/OpenData/utils.d.ts +1 -0
  11. package/dist/modules/OpenData/utils.js +8 -5
  12. package/dist/modules/Order/index.d.ts +6 -1
  13. package/dist/modules/Order/index.js +148 -84
  14. package/dist/modules/ProductList/clientDataVariants.d.ts +50 -0
  15. package/dist/modules/ProductList/clientDataVariants.js +216 -0
  16. package/dist/modules/ProductList/index.d.ts +14 -13
  17. package/dist/modules/ProductList/index.js +105 -77
  18. package/dist/modules/Quotation/index.d.ts +16 -0
  19. package/dist/modules/Quotation/index.js +240 -27
  20. package/dist/modules/ResourcePlanner/planner.d.ts +2 -2
  21. package/dist/modules/ResourcePlanner/planner.js +88 -21
  22. package/dist/modules/ResourcePlanner/types.d.ts +12 -0
  23. package/dist/modules/Rules/index.d.ts +5 -0
  24. package/dist/modules/Rules/index.js +27 -12
  25. package/dist/plugins/request.d.ts +2 -1
  26. package/dist/plugins/request.js +4 -2
  27. package/dist/server/index.js +33 -16
  28. package/dist/solution/BaseSales/index.d.ts +16 -1
  29. package/dist/solution/BaseSales/index.js +690 -349
  30. package/dist/solution/BookingByStep/index.d.ts +1 -1
  31. package/dist/solution/BookingTicket/index.d.ts +14 -2
  32. package/dist/solution/BookingTicket/index.js +25 -18
  33. package/dist/solution/Sales/index.js +29 -22
  34. package/dist/solution/UnifiedBookingSales/index.d.ts +1 -1
  35. package/dist/solution/UnifiedBookingSales/index.js +315 -99
  36. package/dist/solution/UnifiedBookingSales/types.d.ts +4 -0
  37. package/dist/solution/VenueBooking/index.d.ts +2 -0
  38. package/dist/solution/VenueBooking/index.js +542 -494
  39. package/dist/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
  40. package/dist/solution/VenueBooking/utils/dateSummary.js +3 -1
  41. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +2 -0
  42. package/dist/solution/VenueBooking/utils/slotMerge.js +3 -1
  43. package/dist/utils/platform.d.ts +8 -0
  44. package/dist/utils/platform.js +15 -0
  45. package/lib/modules/BookingContext/index.d.ts +3 -0
  46. package/lib/modules/BookingContext/index.js +35 -8
  47. package/lib/modules/BookingContext/types.d.ts +4 -4
  48. package/lib/modules/BookingContext/types.js +3 -3
  49. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +4 -0
  50. package/lib/modules/OpenData/index.d.ts +10 -1
  51. package/lib/modules/OpenData/index.js +162 -2
  52. package/lib/modules/OpenData/types.d.ts +14 -1
  53. package/lib/modules/OpenData/utils.d.ts +1 -0
  54. package/lib/modules/OpenData/utils.js +9 -5
  55. package/lib/modules/Order/index.d.ts +6 -1
  56. package/lib/modules/Order/index.js +65 -8
  57. package/lib/modules/ProductList/clientDataVariants.d.ts +50 -0
  58. package/lib/modules/ProductList/clientDataVariants.js +204 -0
  59. package/lib/modules/ProductList/index.d.ts +14 -13
  60. package/lib/modules/ProductList/index.js +77 -58
  61. package/lib/modules/Quotation/index.d.ts +16 -0
  62. package/lib/modules/Quotation/index.js +112 -9
  63. package/lib/modules/ResourcePlanner/planner.d.ts +2 -2
  64. package/lib/modules/ResourcePlanner/planner.js +80 -20
  65. package/lib/modules/ResourcePlanner/types.d.ts +12 -0
  66. package/lib/modules/Rules/index.d.ts +5 -0
  67. package/lib/modules/Rules/index.js +20 -11
  68. package/lib/plugins/request.d.ts +2 -1
  69. package/lib/plugins/request.js +3 -2
  70. package/lib/server/index.js +16 -1
  71. package/lib/solution/BaseSales/index.d.ts +16 -1
  72. package/lib/solution/BaseSales/index.js +314 -66
  73. package/lib/solution/BookingByStep/index.d.ts +1 -1
  74. package/lib/solution/BookingTicket/index.d.ts +14 -2
  75. package/lib/solution/BookingTicket/index.js +3 -0
  76. package/lib/solution/Sales/index.js +3 -0
  77. package/lib/solution/UnifiedBookingSales/index.d.ts +1 -1
  78. package/lib/solution/UnifiedBookingSales/index.js +228 -20
  79. package/lib/solution/UnifiedBookingSales/types.d.ts +4 -0
  80. package/lib/solution/VenueBooking/index.d.ts +2 -0
  81. package/lib/solution/VenueBooking/index.js +28 -8
  82. package/lib/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
  83. package/lib/solution/VenueBooking/utils/dateSummary.js +3 -1
  84. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +2 -0
  85. package/lib/solution/VenueBooking/utils/slotMerge.js +3 -1
  86. package/lib/utils/platform.d.ts +8 -0
  87. package/lib/utils/platform.js +22 -0
  88. package/package.json +1 -1
@@ -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 | 5 | 4 | 3 | 6;
329
+ weekNum: 0 | 1 | 2 | 3 | 4 | 5 | 6;
330
330
  }[]>;
331
331
  submitTimeSlot(timeSlots: TimeSliceItem): void;
332
332
  private getScheduleDataByIds;
@@ -339,7 +339,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
339
339
  * 获取当前的客户搜索条件
340
340
  * @returns 当前搜索条件
341
341
  */
342
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
342
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
343
343
  /**
344
344
  * 获取客户列表状态(包含滚动加载相关状态)
345
345
  * @returns 客户状态
@@ -458,7 +458,19 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
458
458
  * 加车两阶段主决策(规格弹窗 / 资源编辑 / 直接加车)。
459
459
  * 与 ticketBooking `handleSelectProduct` + `handleBooking4Service` 等价。
460
460
  */
461
- decideAddProduct(item: any, options?: Partial<AddProductDecideContext>): import("./utils/addProductDecision").AddProductDecision;
461
+ decideAddProduct(item: any, options?: Partial<AddProductDecideContext>): {
462
+ action: "reloadCatalog";
463
+ } | {
464
+ action: "add";
465
+ cacheItem: any;
466
+ } | {
467
+ action: "requiresDetail";
468
+ payload: AddProductRequiresDetailPayload;
469
+ } | {
470
+ action: "requiresBookingEdit";
471
+ cacheItem: any;
472
+ payload: import("./utils/addProductDecision").AddProductRequiresBookingEditPayload;
473
+ };
462
474
  /** 规格弹窗 callback 后的第二段决策。 */
463
475
  decideAfterDetail(cacheItem: any, options?: Partial<AddProductDecideContext>): import("./utils/addProductDecision").AddProductDecision;
464
476
  /**
@@ -298,30 +298,37 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
298
298
  lastFetchedAt = this.store.openData.getLastFetchedAt();
299
299
  cachedData = this.store.openData.getOpenData();
300
300
  if (!(cachedData && this.openDataTarget === target && lastFetchedAt && Date.now() - lastFetchedAt < OPEN_DATA_CACHE_TTL)) {
301
- _context2.next = 13;
301
+ _context2.next = 16;
302
302
  break;
303
303
  }
304
+ if (!(typeof this.store.openData.ensureInvoiceTemplateSettings === 'function')) {
305
+ _context2.next = 14;
306
+ break;
307
+ }
308
+ _context2.next = 14;
309
+ return this.store.openData.ensureInvoiceTemplateSettings(target);
310
+ case 14:
304
311
  this.otherParams.openData = cachedData;
305
312
  return _context2.abrupt("return", cachedData);
306
- case 13:
313
+ case 16:
307
314
  if (!this.loadOpenDataInFlight) {
308
- _context2.next = 21;
315
+ _context2.next = 24;
309
316
  break;
310
317
  }
311
318
  if (!(this.loadOpenDataInFlightTarget === target)) {
312
- _context2.next = 18;
319
+ _context2.next = 21;
313
320
  break;
314
321
  }
315
- _context2.next = 17;
316
- return this.loadOpenDataInFlight;
317
- case 17:
318
- return _context2.abrupt("return", _context2.sent);
319
- case 18:
320
322
  _context2.next = 20;
321
323
  return this.loadOpenDataInFlight;
322
324
  case 20:
323
- return _context2.abrupt("return", this.loadOpenDataConfig());
325
+ return _context2.abrupt("return", _context2.sent);
324
326
  case 21:
327
+ _context2.next = 23;
328
+ return this.loadOpenDataInFlight;
329
+ case 23:
330
+ return _context2.abrupt("return", this.loadOpenDataConfig());
331
+ case 24:
325
332
  this.loadOpenDataInFlightTarget = target;
326
333
  request = this.store.openData.fetchOpenData({
327
334
  scope: 'board',
@@ -330,10 +337,10 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
330
337
  section_code: [].concat(OPEN_DATA_SECTION_CODES)
331
338
  });
332
339
  this.loadOpenDataInFlight = request;
333
- _context2.prev = 24;
334
- _context2.next = 27;
340
+ _context2.prev = 27;
341
+ _context2.next = 30;
335
342
  return request;
336
- case 27:
343
+ case 30:
337
344
  openDataConfig = _context2.sent;
338
345
  // clearOpenDataCache() 或新请求已接管时,旧响应只能返回给原调用方,不能复活缓存归属。
339
346
  if (this.loadOpenDataInFlight === request) {
@@ -341,18 +348,18 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
341
348
  this.otherParams.openData = openDataConfig;
342
349
  }
343
350
  return _context2.abrupt("return", openDataConfig);
344
- case 30:
345
- _context2.prev = 30;
351
+ case 33:
352
+ _context2.prev = 33;
346
353
  if (this.loadOpenDataInFlight === request) {
347
354
  this.loadOpenDataInFlight = null;
348
355
  this.loadOpenDataInFlightTarget = null;
349
356
  }
350
- return _context2.finish(30);
351
- case 33:
357
+ return _context2.finish(33);
358
+ case 36:
352
359
  case "end":
353
360
  return _context2.stop();
354
361
  }
355
- }, _callee2, this, [[24,, 30, 33]]);
362
+ }, _callee2, this, [[27,, 33, 36]]);
356
363
  }));
357
364
  function loadOpenDataConfig() {
358
365
  return _loadOpenDataConfig.apply(this, arguments);
@@ -275,33 +275,40 @@ export var SalesImpl = /*#__PURE__*/function (_BaseModule) {
275
275
  cachedData = this.invoiceOpenDataModule.getOpenData();
276
276
  lastFetchedAt = this.invoiceOpenDataModule.getLastFetchedAt();
277
277
  if (!(cachedData && this.invoiceOpenDataTarget === target && typeof lastFetchedAt === 'number' && Date.now() - lastFetchedAt < INVOICE_OPEN_DATA_CACHE_TTL)) {
278
- _context4.next = 7;
278
+ _context4.next = 10;
279
+ break;
280
+ }
281
+ if (!(typeof this.invoiceOpenDataModule.ensureInvoiceTemplateSettings === 'function')) {
282
+ _context4.next = 9;
279
283
  break;
280
284
  }
285
+ _context4.next = 9;
286
+ return this.invoiceOpenDataModule.ensureInvoiceTemplateSettings(target);
287
+ case 9:
281
288
  return _context4.abrupt("return", cachedData);
282
- case 7:
289
+ case 10:
283
290
  if (!this.invoiceOpenDataInFlight) {
284
- _context4.next = 18;
291
+ _context4.next = 21;
285
292
  break;
286
293
  }
287
294
  if (!(this.invoiceOpenDataInFlightTarget === target)) {
288
- _context4.next = 10;
295
+ _context4.next = 13;
289
296
  break;
290
297
  }
291
298
  return _context4.abrupt("return", this.invoiceOpenDataInFlight);
292
- case 10:
293
- _context4.prev = 10;
294
- _context4.next = 13;
295
- return this.invoiceOpenDataInFlight;
296
299
  case 13:
297
- _context4.next = 17;
300
+ _context4.prev = 13;
301
+ _context4.next = 16;
302
+ return this.invoiceOpenDataInFlight;
303
+ case 16:
304
+ _context4.next = 20;
298
305
  break;
299
- case 15:
300
- _context4.prev = 15;
301
- _context4.t0 = _context4["catch"](10);
302
- case 17:
303
- return _context4.abrupt("return", this.loadInvoiceOpenData(businessCode, channel));
304
306
  case 18:
307
+ _context4.prev = 18;
308
+ _context4.t0 = _context4["catch"](13);
309
+ case 20:
310
+ return _context4.abrupt("return", this.loadInvoiceOpenData(businessCode, channel));
311
+ case 21:
305
312
  request = this.invoiceOpenDataModule.fetchOpenData({
306
313
  scope: 'board',
307
314
  target: target,
@@ -309,28 +316,28 @@ export var SalesImpl = /*#__PURE__*/function (_BaseModule) {
309
316
  });
310
317
  this.invoiceOpenDataInFlight = request;
311
318
  this.invoiceOpenDataInFlightTarget = target;
312
- _context4.prev = 21;
313
- _context4.next = 24;
319
+ _context4.prev = 24;
320
+ _context4.next = 27;
314
321
  return request;
315
- case 24:
322
+ case 27:
316
323
  openData = _context4.sent;
317
324
  // clearOpenDataCache() 或后续请求接管后,旧响应不得复活 target 归属。
318
325
  if (this.invoiceOpenDataInFlight === request) {
319
326
  this.invoiceOpenDataTarget = target;
320
327
  }
321
328
  return _context4.abrupt("return", openData);
322
- case 27:
323
- _context4.prev = 27;
329
+ case 30:
330
+ _context4.prev = 30;
324
331
  if (this.invoiceOpenDataInFlight === request) {
325
332
  this.invoiceOpenDataInFlight = null;
326
333
  this.invoiceOpenDataInFlightTarget = null;
327
334
  }
328
- return _context4.finish(27);
329
- case 30:
335
+ return _context4.finish(30);
336
+ case 33:
330
337
  case "end":
331
338
  return _context4.stop();
332
339
  }
333
- }, _callee4, this, [[10, 15], [21,, 27, 30]]);
340
+ }, _callee4, this, [[13, 18], [24,, 30, 33]]);
334
341
  }));
335
342
  function loadInvoiceOpenData(_x4, _x5) {
336
343
  return _loadInvoiceOpenData.apply(this, arguments);
@@ -232,7 +232,7 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
232
232
  private releaseAvailabilityCommitLock;
233
233
  /** IO boundary: loads catalog, schedules, resources, occupancies, and registers one context. */
234
234
  prepareAvailabilityProjection(params: UnifiedBookingSalesPrepareAvailabilityProjectionParams): Promise<AvailabilityContextRef>;
235
- /** Pure configuration calculation over the current context projection. */
235
+ /** Candidate calculation over the current context projection and runtime minute. */
236
236
  getProductTimeRanges(contextId: string, request?: GetProductTimeRangesRequest): Promise<ContextualProductTimeRangeGroup[]>;
237
237
  /** Thin facade: auto-refresh on cart drift, then delegate to the pure projection query. */
238
238
  queryBookingAvailability(contextId: string, request: ContextualAvailabilityQuery): Promise<ContextualAvailabilityQueryResult>;