@pisell/pisellos 0.10.73 → 0.10.74
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.
- package/dist/modules/Order/index.js +8 -7
- package/dist/modules/Product/index.d.ts +1 -1
- package/dist/modules/ProductList/clientDataVariants.js +6 -2
- package/dist/solution/BookingByStep/index.d.ts +2 -2
- package/dist/solution/BookingTicket/index.d.ts +1 -13
- package/dist/solution/UnifiedBookingSales/index.d.ts +6 -1
- package/dist/solution/UnifiedBookingSales/index.js +498 -316
- package/dist/solution/UnifiedBookingSales/types.d.ts +16 -1
- package/dist/solution/UnifiedBookingSales/types.js +3 -1
- package/lib/modules/Order/index.js +4 -3
- package/lib/modules/Product/index.d.ts +1 -1
- package/lib/modules/ProductList/clientDataVariants.js +6 -2
- package/lib/solution/BookingByStep/index.d.ts +2 -2
- package/lib/solution/BookingTicket/index.d.ts +1 -13
- package/lib/solution/UnifiedBookingSales/index.d.ts +6 -1
- package/lib/solution/UnifiedBookingSales/index.js +123 -6
- package/lib/solution/UnifiedBookingSales/types.d.ts +16 -1
- package/lib/solution/UnifiedBookingSales/types.js +2 -1
- package/package.json +1 -1
|
@@ -5866,21 +5866,22 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5866
5866
|
_context32.prev = 24;
|
|
5867
5867
|
_loop3 = /*#__PURE__*/_regeneratorRuntime().mark(function _loop3() {
|
|
5868
5868
|
var _child$metadata, _child$metadata2, _child$metadata3, _child$metadata4, _child$num;
|
|
5869
|
-
var child, childUid,
|
|
5869
|
+
var child, childUid, purchaseDatetime, normalizedPurchaseDatetime, previous, _live$_extend, _rawChild$_origin, previousForms, rawChild;
|
|
5870
5870
|
return _regeneratorRuntime().wrap(function _loop3$(_context31) {
|
|
5871
5871
|
while (1) switch (_context31.prev = _context31.next) {
|
|
5872
5872
|
case 0:
|
|
5873
5873
|
child = _step22.value;
|
|
5874
5874
|
childUid = getUid(child);
|
|
5875
|
-
|
|
5876
|
-
|
|
5875
|
+
purchaseDatetime = String(((_child$metadata = child.metadata) === null || _child$metadata === void 0 ? void 0 : _child$metadata.venue_booking_service_datetime) || '');
|
|
5876
|
+
normalizedPurchaseDatetime = purchaseDatetime.length === 16 ? "".concat(purchaseDatetime, ":00") : purchaseDatetime;
|
|
5877
|
+
if (!(((_child$metadata2 = child.metadata) === null || _child$metadata2 === void 0 ? void 0 : _child$metadata2.venue_booking_role) !== 'party_extra' || String(((_child$metadata3 = child.metadata) === null || _child$metadata3 === void 0 ? void 0 : _child$metadata3.venue_booking_parent_uid) || '') !== uid || ((_child$metadata4 = child.metadata) === null || _child$metadata4 === void 0 ? void 0 : _child$metadata4.venue_booking_scope_key) !== scopeKey || !/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}(:\d{2})?$/.test(purchaseDatetime) || !dayjs(purchaseDatetime).isValid() || dayjs(purchaseDatetime).format('YYYY-MM-DD HH:mm:ss') !== normalizedPurchaseDatetime || _this40.hasLinkedBookingUid(child) || child.order_detail_id != null || childUid && (nextUids.has(childUid) || live.products.some(function (line) {
|
|
5877
5878
|
return getUid(line) === childUid && !ownedUids.has(childUid);
|
|
5878
5879
|
})))) {
|
|
5879
|
-
_context31.next =
|
|
5880
|
+
_context31.next = 6;
|
|
5880
5881
|
break;
|
|
5881
5882
|
}
|
|
5882
|
-
throw new Error('[Order] Invalid Party extra ownership, identity, or
|
|
5883
|
-
case
|
|
5883
|
+
throw new Error('[Order] Invalid Party extra ownership, identity, or purchase quote datetime');
|
|
5884
|
+
case 6:
|
|
5884
5885
|
if (childUid) nextUids.add(childUid);
|
|
5885
5886
|
previous = children.find(function (line) {
|
|
5886
5887
|
return getUid(line) === childUid;
|
|
@@ -5896,7 +5897,7 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
5896
5897
|
});
|
|
5897
5898
|
}
|
|
5898
5899
|
}
|
|
5899
|
-
case
|
|
5900
|
+
case 9:
|
|
5900
5901
|
case "end":
|
|
5901
5902
|
return _context31.stop();
|
|
5902
5903
|
}
|
|
@@ -49,5 +49,5 @@ export declare class Product extends BaseModule implements Module {
|
|
|
49
49
|
getCategories(): ProductCategory[];
|
|
50
50
|
setOtherParams(key: string, value: any): void;
|
|
51
51
|
getOtherParams(): any;
|
|
52
|
-
getProductType(): "
|
|
52
|
+
getProductType(): "duration" | "session" | "normal";
|
|
53
53
|
}
|
|
@@ -39,7 +39,9 @@ function collectReferencedRuleIds(products) {
|
|
|
39
39
|
variants.forEach(function (variant) {
|
|
40
40
|
var _variant$data_variant;
|
|
41
41
|
var id = String((_variant$data_variant = variant === null || variant === void 0 ? void 0 : variant.data_variant_rule_id) !== null && _variant$data_variant !== void 0 ? _variant$data_variant : '').trim();
|
|
42
|
-
|
|
42
|
+
// Rule 0 is the default-variant sentinel, not a strategy to load.
|
|
43
|
+
// Keep the evaluator responsible for its pricing/settlement semantics.
|
|
44
|
+
if (id && Number(id) !== 0) ids.add(id);
|
|
43
45
|
});
|
|
44
46
|
};
|
|
45
47
|
products.forEach(function (product) {
|
|
@@ -60,13 +62,15 @@ function isEvaluatorReady(evaluator, products) {
|
|
|
60
62
|
// A referenced Data Variant cannot be evaluated authoritatively until those
|
|
61
63
|
// configs have arrived. Evaluators without this capability remain compatible.
|
|
62
64
|
if (typeof evaluator.getStrategyConfigs === 'function') {
|
|
65
|
+
var referencedRuleIds = collectReferencedRuleIds(products);
|
|
66
|
+
if (referencedRuleIds.size === 0) return true;
|
|
63
67
|
var configs = evaluator.getStrategyConfigs();
|
|
64
68
|
if (!Array.isArray(configs) || configs.length === 0) return false;
|
|
65
69
|
var availableRuleIds = new Set(configs.map(function (config) {
|
|
66
70
|
var _config$metadata$id, _config$metadata;
|
|
67
71
|
return String((_config$metadata$id = config === null || config === void 0 || (_config$metadata = config.metadata) === null || _config$metadata === void 0 ? void 0 : _config$metadata.id) !== null && _config$metadata$id !== void 0 ? _config$metadata$id : '').trim();
|
|
68
72
|
}).filter(Boolean));
|
|
69
|
-
return Array.from(
|
|
73
|
+
return Array.from(referencedRuleIds).every(function (id) {
|
|
70
74
|
return availableRuleIds.has(id);
|
|
71
75
|
});
|
|
72
76
|
}
|
|
@@ -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 |
|
|
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<"
|
|
376
|
+
getProductTypeById(id: number): Promise<"duration" | "session" | "normal">;
|
|
377
377
|
/**
|
|
378
378
|
* 提供给 UI 的方法,减轻 UI 层的计算压力,UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
|
|
379
379
|
*
|
|
@@ -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
|
/**
|
|
@@ -6,7 +6,7 @@ import { type InvoiceLayoutConfig, type InvoiceTemplateSettings, type OpenDataCo
|
|
|
6
6
|
import type { LoadScheduleAvailableDateParams, ScheduleItem } from '../../modules/Schedule/types';
|
|
7
7
|
import type { ProductListLoadProductsParams, ProductListStoreQueryParams } from '../../modules/ProductList';
|
|
8
8
|
import type { AvailabilityDateRange, AvailabilityOccupancy, AvailabilityProduct, AvailabilityResource, GetProductTimeRangesRequest } from '../../modules/ResourcePlanner';
|
|
9
|
-
import type { AvailabilityContextRef, ContextualAvailabilityQuery, ContextualAvailabilityQueryResult, ContextualCommitAvailabilitySelectionParams, ContextualProductTimeRangeGroup, UnifiedBookingSalesAddRetailProductParams, UnifiedBookingSalesApplyPlannerDiscountsParams, UnifiedBookingSalesCommitAvailabilitySelectionResult, UnifiedBookingSalesDiscountResult, UnifiedBookingSalesLoadProductsByScheduleDateParams, UnifiedBookingSalesLoadOpenDataParams, UnifiedBookingSalesPrepareAvailabilityProjectionParams, UnifiedBookingSalesPolicyResponse, UnifiedBookingSalesResolveProductAllergyRequirementParams, UnifiedBookingSalesStageRetailProductsParams, UnifiedBookingSalesState } from './types';
|
|
9
|
+
import type { AvailabilityContextRef, ContextualAvailabilityQuery, ContextualAvailabilityQueryResult, ContextualCommitAvailabilitySelectionParams, ContextualProductTimeRangeGroup, UnifiedBookingSalesAddRetailProductParams, UnifiedBookingSalesApplyPlannerDiscountsParams, UnifiedBookingSalesCommitAvailabilitySelectionResult, UnifiedBookingSalesDiscountResult, UnifiedBookingSalesLoadProductsByScheduleDateParams, UnifiedBookingSalesLoadOpenDataParams, UnifiedBookingSalesPrepareAvailabilityProjectionParams, UnifiedBookingSalesPolicyResponse, UnifiedBookingSalesQueryBookingResourceDetailsParams, UnifiedBookingSalesResourceDetail, UnifiedBookingSalesResolveProductAllergyRequirementParams, UnifiedBookingSalesStageRetailProductsParams, UnifiedBookingSalesState } from './types';
|
|
10
10
|
import type { BusinessAvailability } from '../../modules/BusinessAvailability';
|
|
11
11
|
import { BookingTicket } from '../BookingTicket';
|
|
12
12
|
import type { AllergyRequirement } from '../../model/strategy/adapter/itemRule';
|
|
@@ -71,6 +71,7 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
|
|
|
71
71
|
private runtimeOpenDataModule;
|
|
72
72
|
private runtimeOpenDataCore;
|
|
73
73
|
private runtimeOpenDataGeneration;
|
|
74
|
+
private runtimeInitializationGeneration;
|
|
74
75
|
private runtimeOpenDataDestroyed;
|
|
75
76
|
private unifiedProductCatalog;
|
|
76
77
|
private availabilityRuntimeOffsetMinutes;
|
|
@@ -257,6 +258,8 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
|
|
|
257
258
|
* Its staged lines have separate ownership so planner and retail skins can coexist safely.
|
|
258
259
|
*/
|
|
259
260
|
stageRetailProducts(params: UnifiedBookingSalesStageRetailProductsParams): Promise<Record<string, any> | null>;
|
|
261
|
+
/** Explicit capability: order-scoped Tickets extras use guarded writes without implicit SKU merging. */
|
|
262
|
+
supportsVenueTicketExtras(): boolean;
|
|
260
263
|
/**
|
|
261
264
|
* Adds one retail line without replacing the cart's existing retail selection.
|
|
262
265
|
* This is intentionally separate from stageRetailProducts(), whose contract is
|
|
@@ -276,6 +279,8 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
|
|
|
276
279
|
* resource dates endpoint.
|
|
277
280
|
*/
|
|
278
281
|
private fetchAvailabilityResourcesV2;
|
|
282
|
+
/** Fresh read-only metadata for confirmation forms/policies; does not create a projection or mutate BookingContext. */
|
|
283
|
+
queryBookingResourceDetails(params: UnifiedBookingSalesQueryBookingResourceDetailsParams): Promise<UnifiedBookingSalesResourceDetail[]>;
|
|
279
284
|
private fetchAndPublishAvailabilityResourcesV2;
|
|
280
285
|
private refreshAvailabilityRemoteResourceQuery;
|
|
281
286
|
private loadAvailabilityResources;
|