@pisell/pisellos 2.3.76 → 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/BookingByStep/index.d.ts +2 -2
- package/dist/solution/BookingTicket/index.d.ts +2 -14
- package/dist/solution/UnifiedBookingSales/index.d.ts +5 -1
- package/dist/solution/UnifiedBookingSales/index.js +459 -415
- 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/BookingByStep/index.d.ts +2 -2
- package/lib/solution/BookingTicket/index.d.ts +2 -14
- package/lib/solution/UnifiedBookingSales/index.d.ts +5 -1
- package/lib/solution/UnifiedBookingSales/index.js +29 -3
- 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;
|
|
@@ -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 |
|
|
329
|
+
weekNum: 0 | 1 | 2 | 5 | 4 | 3 | 6;
|
|
330
330
|
}[]>;
|
|
331
331
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
332
332
|
private getScheduleDataByIds;
|
|
@@ -345,7 +345,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
345
345
|
count: number;
|
|
346
346
|
left: number;
|
|
347
347
|
summaryCount: number;
|
|
348
|
-
status: "
|
|
348
|
+
status: "sold_out" | "lots_of_space" | "filling_up_fast";
|
|
349
349
|
}[];
|
|
350
350
|
/**
|
|
351
351
|
* 找到多个资源的公共可用时间段
|
|
@@ -334,7 +334,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
334
334
|
* 获取当前的客户搜索条件
|
|
335
335
|
* @returns 当前搜索条件
|
|
336
336
|
*/
|
|
337
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
337
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
|
|
338
338
|
/**
|
|
339
339
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
340
340
|
* @returns 客户状态
|
|
@@ -453,19 +453,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
453
453
|
* 加车两阶段主决策(规格弹窗 / 资源编辑 / 直接加车)。
|
|
454
454
|
* 与 ticketBooking `handleSelectProduct` + `handleBooking4Service` 等价。
|
|
455
455
|
*/
|
|
456
|
-
decideAddProduct(item: any, options?: Partial<AddProductDecideContext>):
|
|
457
|
-
action: "reloadCatalog";
|
|
458
|
-
} | {
|
|
459
|
-
action: "add";
|
|
460
|
-
cacheItem: any;
|
|
461
|
-
} | {
|
|
462
|
-
action: "requiresDetail";
|
|
463
|
-
payload: AddProductRequiresDetailPayload;
|
|
464
|
-
} | {
|
|
465
|
-
action: "requiresBookingEdit";
|
|
466
|
-
cacheItem: any;
|
|
467
|
-
payload: import("./utils/addProductDecision").AddProductRequiresBookingEditPayload;
|
|
468
|
-
};
|
|
456
|
+
decideAddProduct(item: any, options?: Partial<AddProductDecideContext>): import("./utils/addProductDecision").AddProductDecision;
|
|
469
457
|
/** 规格弹窗 callback 后的第二段决策。 */
|
|
470
458
|
decideAfterDetail(cacheItem: any, options?: Partial<AddProductDecideContext>): import("./utils/addProductDecision").AddProductDecision;
|
|
471
459
|
/**
|
|
@@ -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.
|