@pisell/pisellos 0.10.82 → 0.10.84

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.
@@ -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 | 2 | 1 | 3 | 5 | 6 | 4;
329
+ weekNum: 0 | 2 | 1 | 3 | 4 | 5 | 6;
330
330
  }[]>;
331
331
  submitTimeSlot(timeSlots: TimeSliceItem): void;
332
332
  private getScheduleDataByIds;
@@ -373,7 +373,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
373
373
  };
374
374
  setOtherData(key: string, value: any): void;
375
375
  getOtherData(key: string): any;
376
- getProductTypeById(id: number): Promise<"normal" | "duration" | "session">;
376
+ getProductTypeById(id: number): Promise<"duration" | "session" | "normal">;
377
377
  /**
378
378
  * 提供给 UI 的方法,减轻 UI 层的计算压力,UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
379
379
  *
@@ -360,7 +360,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
360
360
  * 获取当前的客户搜索条件
361
361
  * @returns 当前搜索条件
362
362
  */
363
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
363
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
364
364
  /**
365
365
  * 获取客户列表状态(包含滚动加载相关状态)
366
366
  * @returns 客户状态
@@ -479,19 +479,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
479
479
  * 加车两阶段主决策(规格弹窗 / 资源编辑 / 直接加车)。
480
480
  * 与 ticketBooking `handleSelectProduct` + `handleBooking4Service` 等价。
481
481
  */
482
- decideAddProduct(item: any, options?: Partial<AddProductDecideContext>): {
483
- action: "reloadCatalog";
484
- } | {
485
- action: "add";
486
- cacheItem: any;
487
- } | {
488
- action: "requiresDetail";
489
- payload: AddProductRequiresDetailPayload;
490
- } | {
491
- action: "requiresBookingEdit";
492
- cacheItem: any;
493
- payload: import("./utils/addProductDecision").AddProductRequiresBookingEditPayload;
494
- };
482
+ decideAddProduct(item: any, options?: Partial<AddProductDecideContext>): import("./utils/addProductDecision").AddProductDecision;
495
483
  /** 规格弹窗 callback 后的第二段决策。 */
496
484
  decideAfterDetail(cacheItem: any, options?: Partial<AddProductDecideContext>): import("./utils/addProductDecision").AddProductDecision;
497
485
  /**
@@ -109,6 +109,9 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
109
109
  protected getSubModuleHooks(moduleName: string): any;
110
110
  private createAvailabilityFacadeError;
111
111
  private getAvailabilityScopeDescriptor;
112
+ /** Kiosk keeps its device/channel semantics; only explicit Venue templates opt in. */
113
+ private isVenueKioskPlatform;
114
+ private supportsVenueSelectionSnapshot;
112
115
  private normalizeAvailabilityIdList;
113
116
  private normalizeAvailabilityStringList;
114
117
  private normalizeAvailabilityPrepareDescriptor;
@@ -1407,9 +1407,20 @@ class UnifiedBookingSalesImpl extends _BookingTicket.BookingTicket {
1407
1407
  businessCode: String(otherParams.businessCode ?? otherParams.business_code ?? ''),
1408
1408
  channel: String(otherParams.channel ?? ''),
1409
1409
  platform: String(otherParams.platform ?? ''),
1410
- businessTimezone: String(otherParams.businessTimezone ?? '')
1410
+ businessTimezone: String(otherParams.businessTimezone ?? ''),
1411
+ ...(this.isVenueKioskPlatform(otherParams) ? {
1412
+ venueBookingMode: otherParams.venueBookingMode
1413
+ } : {})
1411
1414
  };
1412
1415
  }
1416
+
1417
+ /** Kiosk keeps its device/channel semantics; only explicit Venue templates opt in. */
1418
+ isVenueKioskPlatform(otherParams = this.otherParams || {}) {
1419
+ return (0, _platform.normalizeRuntimePlatform)(otherParams.platform) === 'kiosk' && (otherParams.venueBookingMode === 'tickets' || otherParams.venueBookingMode === 'party');
1420
+ }
1421
+ supportsVenueSelectionSnapshot() {
1422
+ return (0, _platform.isCustomerUserPlatform)(this.otherParams?.platform) || this.isVenueKioskPlatform();
1423
+ }
1413
1424
  normalizeAvailabilityIdList(values) {
1414
1425
  if (!Array.isArray(values) || values.length === 0) return undefined;
1415
1426
  const uniqueMap = new Map();
@@ -1555,7 +1566,7 @@ class UnifiedBookingSalesImpl extends _BookingTicket.BookingTicket {
1555
1566
  if (explicitlySetsOpenData) {
1556
1567
  this.openDataTarget = this.otherParams?.openData && nextScope.businessCode && nextScope.channel ? `${nextScope.businessCode}+${nextScope.channel}` : null;
1557
1568
  }
1558
- const shouldResetAvailabilityState = previousScope.cacheId !== nextScope.cacheId || previousScope.businessCode !== nextScope.businessCode || previousScope.channel !== nextScope.channel || previousScope.platform !== nextScope.platform || previousScope.businessTimezone !== nextScope.businessTimezone;
1569
+ const shouldResetAvailabilityState = previousScope.cacheId !== nextScope.cacheId || previousScope.businessCode !== nextScope.businessCode || previousScope.channel !== nextScope.channel || previousScope.platform !== nextScope.platform || previousScope.businessTimezone !== nextScope.businessTimezone || previousScope.venueBookingMode !== nextScope.venueBookingMode;
1559
1570
  if (shouldResetAvailabilityState) {
1560
1571
  await this.resetAvailabilityProjectionState('set_other_params_reset');
1561
1572
  }
@@ -2505,7 +2516,7 @@ class UnifiedBookingSalesImpl extends _BookingTicket.BookingTicket {
2505
2516
 
2506
2517
  /** One complete raw product query per explicitly configured pool for this page lifetime. */
2507
2518
  createVenueCatalogSession(params) {
2508
- if (!(0, _platform.isCustomerUserPlatform)(this.otherParams?.platform)) {
2519
+ if (!this.supportsVenueSelectionSnapshot()) {
2509
2520
  throw (0, _venueCatalogSession.venueCatalogError)('VENUE_CATALOG_PLATFORM_UNSUPPORTED', 'Venue catalog sessions require a customer platform.');
2510
2521
  }
2511
2522
  const ids = params.menu_list_ids;
@@ -2517,6 +2528,7 @@ class UnifiedBookingSalesImpl extends _BookingTicket.BookingTicket {
2517
2528
  const generation = this.runtimeInitializationGeneration;
2518
2529
  const core = this.core;
2519
2530
  const request = this.request;
2531
+ const venueKioskMode = this.isVenueKioskPlatform() ? this.otherParams.venueBookingMode : undefined;
2520
2532
  const entry = {
2521
2533
  scope,
2522
2534
  generation,
@@ -2537,7 +2549,7 @@ class UnifiedBookingSalesImpl extends _BookingTicket.BookingTicket {
2537
2549
  if (!this.venueCatalogSessions.has(entry)) {
2538
2550
  throw (0, _venueCatalogSession.venueCatalogError)('VENUE_CATALOG_DISPOSED', 'The venue catalog session is closed.');
2539
2551
  }
2540
- if (this.runtimeOpenDataDestroyed || this.core !== core || this.request !== request || generation !== this.runtimeInitializationGeneration || scope !== this.getRuntimeOpenDataScope()) {
2552
+ if (this.runtimeOpenDataDestroyed || this.core !== core || this.request !== request || generation !== this.runtimeInitializationGeneration || scope !== this.getRuntimeOpenDataScope() || !this.supportsVenueSelectionSnapshot() || venueKioskMode !== (this.isVenueKioskPlatform() ? this.otherParams.venueBookingMode : undefined)) {
2541
2553
  throw (0, _venueCatalogSession.venueCatalogError)('VENUE_CATALOG_STALE', 'The venue store context changed. Reopen the booking page.');
2542
2554
  }
2543
2555
  };
@@ -2574,7 +2586,7 @@ class UnifiedBookingSalesImpl extends _BookingTicket.BookingTicket {
2574
2586
  const queryPayload = {
2575
2587
  schedule_date: datetime.slice(0, 10),
2576
2588
  schedule_datetime: datetime,
2577
- customer_id: input.customer_id ?? this.getTempOrder()?.customer_id ?? user?.get?.()?.id,
2589
+ customer_id: input.customer_id ?? this.getTempOrder()?.customer_id ?? (this.isVenueKioskPlatform() ? undefined : user?.get?.()?.id),
2578
2590
  strategy_context: {
2579
2591
  ...this.getPriceQueryStrategyContext(),
2580
2592
  ...(input.strategy_context || {})
@@ -4263,7 +4275,7 @@ class UnifiedBookingSalesImpl extends _BookingTicket.BookingTicket {
4263
4275
 
4264
4276
  /** Thin facade: auto-refresh on cart drift, then delegate to the pure projection query. */
4265
4277
  async queryBookingAvailability(contextId, request) {
4266
- const customerSelectionSnapshot = request.target === 'resource' && request.customerSelectionSnapshot === true && (0, _platform.isCustomerUserPlatform)(this.otherParams?.platform);
4278
+ const customerSelectionSnapshot = request.target === 'resource' && request.customerSelectionSnapshot === true && this.supportsVenueSelectionSnapshot();
4267
4279
  const {
4268
4280
  context,
4269
4281
  projectionEntry,
@@ -4395,7 +4407,7 @@ class UnifiedBookingSalesImpl extends _BookingTicket.BookingTicket {
4395
4407
  if (isPartyReplacement && (!isEditingSelection || !Array.isArray(params.relatedRetailProducts))) {
4396
4408
  throw new _ResourcePlanner.AvailabilityError('INVALID_TARGET_FILTER', 'Party replacement requires edit/replace mode and the confirmed complete extras array');
4397
4409
  }
4398
- const customerSelectionSnapshot = params.customerSelectionSnapshot === true && (0, _platform.isCustomerUserPlatform)(this.otherParams?.platform);
4410
+ const customerSelectionSnapshot = params.customerSelectionSnapshot === true && this.supportsVenueSelectionSnapshot();
4399
4411
  const strictAvailability = this.availabilityContextRegistry.get(normalizedContextId)?.prepareParams.strictAvailability === true;
4400
4412
  const hasCommitGuard = customerSelectionSnapshot || strictAvailability || isPartyReplacement || Boolean(params.availabilityCommitGuard);
4401
4413
  params.availabilityCommitGuard?.();
@@ -59,6 +59,8 @@ export declare enum UnifiedBookingSalesHooks {
59
59
  }
60
60
  export interface UnifiedBookingSalesOtherParams extends Record<string, any> {
61
61
  enableSessionStoragePersist?: boolean;
62
+ /** Explicitly opts the real Kiosk host into the Tickets/Party self-service contracts. */
63
+ venueBookingMode?: 'tickets' | 'party';
62
64
  }
63
65
  export type UnifiedBookingSalesAllergyRequirement = AllergyRequirement;
64
66
  export interface UnifiedBookingSalesResolveProductAllergyRequirementParams {
@@ -145,7 +147,7 @@ export type ContextualAvailabilityQuery = Omit<Extract<AvailabilityQuery, {
145
147
  target: 'resource';
146
148
  }>, 'selectedRanges'> & {
147
149
  selectedRanges: ContextualProductTimeRange[];
148
- /** PC/H5 only: retain the already-selected time while choosing resources in this snapshot. */
150
+ /** PC/H5 and explicitly enabled Venue Kiosk templates retain the already-selected time. */
149
151
  customerSelectionSnapshot?: boolean;
150
152
  });
151
153
  export type ContextualTimeAvailabilityItem = Omit<TimeAvailabilityItem, keyof ProductTimeRange> & ContextualProductTimeRange;
@@ -212,7 +214,7 @@ export interface UnifiedBookingSalesAddRetailProductParams {
212
214
  }
213
215
  export interface ContextualCommitAvailabilitySelectionParams {
214
216
  mode: 'add' | 'edit' | 'replace';
215
- /** PC/H5 only: write the completed UI selection without re-querying availability; checkout is authoritative. */
217
+ /** PC/H5 and enabled Venue Kiosk templates write the selected snapshot; checkout is authoritative. */
216
218
  customerSelectionSnapshot?: boolean;
217
219
  /** Local UI intent guard, checked again immediately before the Order mutation. */
218
220
  availabilityCommitGuard?: () => void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "0.10.82",
4
+ "version": "0.10.84",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",