@pisell/pisellos 2.3.77 → 2.3.78
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/model/strategy/adapter/promotion/index.js +0 -9
- package/dist/modules/ResourcePlanner/planner.js +4 -1
- package/dist/modules/ResourcePlanner/types.d.ts +1 -0
- package/dist/solution/UnifiedBookingSales/index.d.ts +5 -1
- package/dist/solution/UnifiedBookingSales/index.js +435 -404
- package/dist/solution/UnifiedBookingSales/types.d.ts +10 -0
- package/lib/model/strategy/adapter/promotion/index.js +46 -1
- package/lib/modules/ResourcePlanner/planner.js +2 -0
- package/lib/modules/ResourcePlanner/types.d.ts +1 -0
- package/lib/solution/UnifiedBookingSales/index.d.ts +5 -1
- package/lib/solution/UnifiedBookingSales/index.js +11 -0
- package/lib/solution/UnifiedBookingSales/types.d.ts +10 -0
- package/package.json +1 -1
|
@@ -1,9 +0,0 @@
|
|
|
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";
|
|
@@ -1525,14 +1525,16 @@ function evaluateCandidate(projection, candidate, request) {
|
|
|
1525
1525
|
});
|
|
1526
1526
|
});
|
|
1527
1527
|
var options = matchedResources.map(function (resource) {
|
|
1528
|
-
var _request$cellIndex;
|
|
1528
|
+
var _request$cellIndex, _resource$raw2;
|
|
1529
1529
|
var matchedCell = aggregateMatchedCells(product.id, requirementGroup.id, resource.id, candidateRange, ((_request$cellIndex = request.cellIndex) === null || _request$cellIndex === void 0 ? void 0 : _request$cellIndex.get([String(product.id), requirementGroup.id, String(resource.id)].join(':'))) || []);
|
|
1530
1530
|
if (!matchedCell) {
|
|
1531
|
+
var _resource$raw;
|
|
1531
1532
|
var _isPast = candidateRange.endMs <= evaluationContext.evaluatedAtMs;
|
|
1532
1533
|
return {
|
|
1533
1534
|
resourceId: resource.id,
|
|
1534
1535
|
resourceName: resource.name,
|
|
1535
1536
|
resourceFormId: resource.formId,
|
|
1537
|
+
policyId: (_resource$raw = resource.raw) === null || _resource$raw === void 0 ? void 0 : _resource$raw.policy_id,
|
|
1536
1538
|
resourceType: resource.resourceType,
|
|
1537
1539
|
status: _isPast ? 'past' : 'unavailable',
|
|
1538
1540
|
maxPartySize: 0,
|
|
@@ -1555,6 +1557,7 @@ function evaluateCandidate(projection, candidate, request) {
|
|
|
1555
1557
|
resourceId: resource.id,
|
|
1556
1558
|
resourceName: resource.name,
|
|
1557
1559
|
resourceFormId: resource.formId,
|
|
1560
|
+
policyId: (_resource$raw2 = resource.raw) === null || _resource$raw2 === void 0 ? void 0 : _resource$raw2.policy_id,
|
|
1558
1561
|
resourceType: resource.resourceType,
|
|
1559
1562
|
status: status,
|
|
1560
1563
|
remainingCapacity: remainingCapacity,
|
|
@@ -258,6 +258,7 @@ export interface AvailabilityResourceOption {
|
|
|
258
258
|
resourceId: AvailabilityId;
|
|
259
259
|
resourceName?: string;
|
|
260
260
|
resourceFormId?: AvailabilityId;
|
|
261
|
+
policyId?: AvailabilityId;
|
|
261
262
|
resourceType: AvailabilityResourceType;
|
|
262
263
|
status: AvailabilityStatus;
|
|
263
264
|
remainingCapacity?: number;
|
|
@@ -4,7 +4,7 @@ import type { OpenDataConfig } from '../../modules/OpenData';
|
|
|
4
4
|
import type { LoadScheduleAvailableDateParams, ScheduleItem } from '../../modules/Schedule/types';
|
|
5
5
|
import type { ProductListLoadProductsParams } from '../../modules/ProductList';
|
|
6
6
|
import type { AvailabilityDateRange, AvailabilityOccupancy, AvailabilityProduct, AvailabilityResource, GetProductTimeRangesRequest } from '../../modules/ResourcePlanner';
|
|
7
|
-
import type { AvailabilityContextRef, ContextualAvailabilityQuery, ContextualAvailabilityQueryResult, ContextualCommitAvailabilitySelectionParams, ContextualProductTimeRangeGroup, UnifiedBookingSalesAddRetailProductParams, UnifiedBookingSalesApplyPlannerDiscountsParams, UnifiedBookingSalesCommitAvailabilitySelectionResult, UnifiedBookingSalesDiscountResult, UnifiedBookingSalesLoadProductsByScheduleDateParams, UnifiedBookingSalesLoadOpenDataParams, UnifiedBookingSalesPrepareAvailabilityProjectionParams, UnifiedBookingSalesStageRetailProductsParams, UnifiedBookingSalesState } from './types';
|
|
7
|
+
import type { AvailabilityContextRef, ContextualAvailabilityQuery, ContextualAvailabilityQueryResult, ContextualCommitAvailabilitySelectionParams, ContextualProductTimeRangeGroup, UnifiedBookingSalesAddRetailProductParams, UnifiedBookingSalesApplyPlannerDiscountsParams, UnifiedBookingSalesCommitAvailabilitySelectionResult, UnifiedBookingSalesDiscountResult, UnifiedBookingSalesLoadProductsByScheduleDateParams, UnifiedBookingSalesLoadOpenDataParams, UnifiedBookingSalesPrepareAvailabilityProjectionParams, UnifiedBookingSalesPolicyResponse, UnifiedBookingSalesStageRetailProductsParams, UnifiedBookingSalesState } from './types';
|
|
8
8
|
import { BookingTicket } from '../BookingTicket';
|
|
9
9
|
export * from './types';
|
|
10
10
|
export { AvailabilityError } from '../../modules/ResourcePlanner';
|
|
@@ -147,6 +147,10 @@ export declare class UnifiedBookingSalesImpl extends BookingTicket {
|
|
|
147
147
|
*/
|
|
148
148
|
loadOpenData(params: UnifiedBookingSalesLoadOpenDataParams): Promise<OpenDataConfig>;
|
|
149
149
|
getOpenData(): Promise<OpenDataConfig | null>;
|
|
150
|
+
/**
|
|
151
|
+
* Load a resource policy without depending on the legacy appointmentBooking solution.
|
|
152
|
+
*/
|
|
153
|
+
getProtocol(policyId: string | number): Promise<UnifiedBookingSalesPolicyResponse>;
|
|
150
154
|
/**
|
|
151
155
|
* Loads the product catalog used by both UI and Planner. Schedule data is requested with each
|
|
152
156
|
* product because session products carry their fixed intervals there.
|