@pisell/pisellos 0.10.11 → 0.10.13
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/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +1 -13
- package/dist/solution/UnifiedBookingSales/index.js +24 -11
- package/lib/model/strategy/adapter/promotion/index.js +51 -0
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +1 -13
- package/lib/solution/UnifiedBookingSales/index.js +16 -7
- 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 |
|
|
329
|
+
weekNum: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
330
330
|
}[]>;
|
|
331
331
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
332
332
|
private getScheduleDataByIds;
|
|
@@ -451,19 +451,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
451
451
|
* 加车两阶段主决策(规格弹窗 / 资源编辑 / 直接加车)。
|
|
452
452
|
* 与 ticketBooking `handleSelectProduct` + `handleBooking4Service` 等价。
|
|
453
453
|
*/
|
|
454
|
-
decideAddProduct(item: any, options?: Partial<AddProductDecideContext>):
|
|
455
|
-
action: "reloadCatalog";
|
|
456
|
-
} | {
|
|
457
|
-
action: "add";
|
|
458
|
-
cacheItem: any;
|
|
459
|
-
} | {
|
|
460
|
-
action: "requiresDetail";
|
|
461
|
-
payload: AddProductRequiresDetailPayload;
|
|
462
|
-
} | {
|
|
463
|
-
action: "requiresBookingEdit";
|
|
464
|
-
cacheItem: any;
|
|
465
|
-
payload: import("./utils/addProductDecision").AddProductRequiresBookingEditPayload;
|
|
466
|
-
};
|
|
454
|
+
decideAddProduct(item: any, options?: Partial<AddProductDecideContext>): import("./utils/addProductDecision").AddProductDecision;
|
|
467
455
|
/** 规格弹窗 callback 后的第二段决策。 */
|
|
468
456
|
decideAfterDetail(cacheItem: any, options?: Partial<AddProductDecideContext>): import("./utils/addProductDecision").AddProductDecision;
|
|
469
457
|
/**
|
|
@@ -987,7 +987,9 @@ function buildBookingFromAvailabilitySelection(params) {
|
|
|
987
987
|
product = params.product,
|
|
988
988
|
_params$resources = params.resources,
|
|
989
989
|
resources = _params$resources === void 0 ? [] : _params$resources,
|
|
990
|
-
bookingUid = params.bookingUid
|
|
990
|
+
bookingUid = params.bookingUid,
|
|
991
|
+
holder = params.holder,
|
|
992
|
+
holderIds = params.holderIds;
|
|
991
993
|
var bookingStartAt = candidate.bookingStartAt || candidate.startAt;
|
|
992
994
|
var bookingEndAt = candidate.bookingEndAt || candidate.endAt;
|
|
993
995
|
var startScalar = localDateTimeToScalar(parseLocalDateTime(bookingStartAt));
|
|
@@ -1005,14 +1007,19 @@ function buildBookingFromAvailabilitySelection(params) {
|
|
|
1005
1007
|
scheduleRefs: candidate.scheduleRefs
|
|
1006
1008
|
});
|
|
1007
1009
|
}
|
|
1008
|
-
|
|
1010
|
+
var normalizedHolder = holder && _typeof(holder) === 'object' ? cloneDeep(holder) : undefined;
|
|
1011
|
+
var normalizedHolderIds = Array.isArray(holderIds) ? cloneDeep(holderIds) : holderIds;
|
|
1012
|
+
return _objectSpread(_objectSpread({
|
|
1009
1013
|
start_date: bookingStartAt.slice(0, 10),
|
|
1010
1014
|
start_time: bookingStartAt.slice(11, 16),
|
|
1011
1015
|
end_date: bookingEndAt.slice(0, 10),
|
|
1012
1016
|
end_time: bookingEndAt.slice(11, 16),
|
|
1013
1017
|
duration: Math.max(1, Math.trunc((endScalar - startScalar) / (60 * 1000))),
|
|
1014
1018
|
like_status: 'common',
|
|
1015
|
-
schedule_id: scheduleId !== null && scheduleId !== void 0 ? scheduleId : 0
|
|
1019
|
+
schedule_id: scheduleId !== null && scheduleId !== void 0 ? scheduleId : 0
|
|
1020
|
+
}, normalizedHolder ? {
|
|
1021
|
+
holder: normalizedHolder
|
|
1022
|
+
} : {}), {}, {
|
|
1016
1023
|
resources: assignments.map(function (assignment) {
|
|
1017
1024
|
// requirementSelections 的提交协议只携带资源 ID;购物车展示则需要名称。
|
|
1018
1025
|
// commit 此时仍持有本次不可变 projection,因此直接按 ID 取回名称并
|
|
@@ -1035,7 +1042,7 @@ function buildBookingFromAvailabilitySelection(params) {
|
|
|
1035
1042
|
}
|
|
1036
1043
|
} : {});
|
|
1037
1044
|
}),
|
|
1038
|
-
metadata: _objectSpread(_objectSpread(_objectSpread({}, bookingUid ? {
|
|
1045
|
+
metadata: _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, bookingUid ? {
|
|
1039
1046
|
unique_identification_number: bookingUid
|
|
1040
1047
|
} : {}), {}, {
|
|
1041
1048
|
unified_booking_sales: true,
|
|
@@ -1048,8 +1055,12 @@ function buildBookingFromAvailabilitySelection(params) {
|
|
|
1048
1055
|
time_slot_id: timeSlotId
|
|
1049
1056
|
}), {}, {
|
|
1050
1057
|
product_kind: product.kind
|
|
1051
|
-
}
|
|
1052
|
-
|
|
1058
|
+
}, normalizedHolderIds === undefined ? {} : {
|
|
1059
|
+
holder_id: normalizedHolderIds
|
|
1060
|
+
}), normalizedHolder ? {
|
|
1061
|
+
holder: cloneDeep(normalizedHolder)
|
|
1062
|
+
} : {})
|
|
1063
|
+
});
|
|
1053
1064
|
}
|
|
1054
1065
|
export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
1055
1066
|
_inherits(UnifiedBookingSalesImpl, _BookingTicket);
|
|
@@ -4137,7 +4148,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
4137
4148
|
key: "commitAvailabilitySelection",
|
|
4138
4149
|
value: (function () {
|
|
4139
4150
|
var _commitAvailabilitySelection = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee36(contextId, params) {
|
|
4140
|
-
var normalizedContextId, _params$bookingCount, _ref45, _params$orderProduct$, _params$orderProduct, _params$orderProduct2, _params$orderProduct3, _params$orderProduct$2, _params$orderProduct4, _params$orderProduct5, _editingLine$product_, _baseProjection$meta$, _refreshedProjection$, _baseProjection$meta$2, bookingCount, orderProductQuantity, partySize, _yield$this$ensureAva3, context, projectionEntry, refreshed, boundEditingUids, orderProductId, editingLine, _editingLine$product_2, baseProjection, commitWriteGuard, prepareParams, fallbackResources, commitSnapshot, refreshedProjection, _baseProjection$meta$3, latestContext, refreshedRanges, refreshedCandidateBase, validation, capacityConflict, revalidationEntry, revalidatedContext, refreshedCandidate, product, existingBooking, existingBookingUid, booking, transformed, productLineUid, bookingUid, productLineUids, bookingUids, _transformed$product_, _transformed$product_2, _transformed$product_3,
|
|
4151
|
+
var normalizedContextId, _params$bookingCount, _ref45, _params$orderProduct$, _params$orderProduct, _params$orderProduct2, _params$orderProduct3, _params$orderProduct$2, _params$orderProduct4, _params$orderProduct5, _editingLine$product_, _baseProjection$meta$, _refreshedProjection$, _baseProjection$meta$2, _ref46, _params$orderProduct$3, _params$orderProduct6, _existingBooking$meta, _ref47, _ref48, _params$orderProduct$4, _params$orderProduct7, _params$orderProduct8, _existingBooking$meta2, _existingBooking$hold, bookingCount, orderProductQuantity, partySize, _yield$this$ensureAva3, context, projectionEntry, refreshed, boundEditingUids, orderProductId, editingLine, _editingLine$product_2, baseProjection, commitWriteGuard, prepareParams, fallbackResources, commitSnapshot, refreshedProjection, _baseProjection$meta$3, latestContext, refreshedRanges, refreshedCandidateBase, validation, capacityConflict, revalidationEntry, revalidatedContext, refreshedCandidate, product, existingBooking, existingBookingUid, booking, transformed, productLineUid, bookingUid, productLineUids, bookingUids, _transformed$product_, _transformed$product_2, _transformed$product_3, _ref49, _transformed$product_4, _this$getTempOrder4, _this$getTempOrder5, _this$getTempOrder6, beforeProductLineUids, beforeBookingUids, products, addedLines, addedBookings, nextContext, result;
|
|
4141
4152
|
return _regeneratorRuntime().wrap(function _callee36$(_context36) {
|
|
4142
4153
|
while (1) switch (_context36.prev = _context36.next) {
|
|
4143
4154
|
case 0:
|
|
@@ -4464,7 +4475,9 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
4464
4475
|
candidate: refreshedCandidate,
|
|
4465
4476
|
product: product,
|
|
4466
4477
|
resources: refreshedProjection.resources,
|
|
4467
|
-
bookingUid: existingBookingUid || undefined
|
|
4478
|
+
bookingUid: existingBookingUid || undefined,
|
|
4479
|
+
holder: (_ref46 = (_params$orderProduct$3 = (_params$orderProduct6 = params.orderProduct) === null || _params$orderProduct6 === void 0 || (_params$orderProduct6 = _params$orderProduct6._extend) === null || _params$orderProduct6 === void 0 ? void 0 : _params$orderProduct6.holder) !== null && _params$orderProduct$3 !== void 0 ? _params$orderProduct$3 : existingBooking === null || existingBooking === void 0 ? void 0 : existingBooking.holder) !== null && _ref46 !== void 0 ? _ref46 : existingBooking === null || existingBooking === void 0 || (_existingBooking$meta = existingBooking.metadata) === null || _existingBooking$meta === void 0 ? void 0 : _existingBooking$meta.holder,
|
|
4480
|
+
holderIds: (_ref47 = (_ref48 = (_params$orderProduct$4 = (_params$orderProduct7 = params.orderProduct) === null || _params$orderProduct7 === void 0 || (_params$orderProduct7 = _params$orderProduct7._extend) === null || _params$orderProduct7 === void 0 ? void 0 : _params$orderProduct7.holder_id) !== null && _params$orderProduct$4 !== void 0 ? _params$orderProduct$4 : (_params$orderProduct8 = params.orderProduct) === null || _params$orderProduct8 === void 0 || (_params$orderProduct8 = _params$orderProduct8._extend) === null || _params$orderProduct8 === void 0 || (_params$orderProduct8 = _params$orderProduct8.holder) === null || _params$orderProduct8 === void 0 ? void 0 : _params$orderProduct8.form_record) !== null && _ref48 !== void 0 ? _ref48 : existingBooking === null || existingBooking === void 0 || (_existingBooking$meta2 = existingBooking.metadata) === null || _existingBooking$meta2 === void 0 ? void 0 : _existingBooking$meta2.holder_id) !== null && _ref47 !== void 0 ? _ref47 : existingBooking === null || existingBooking === void 0 || (_existingBooking$hold = existingBooking.holder) === null || _existingBooking$hold === void 0 ? void 0 : _existingBooking$hold.form_record
|
|
4468
4481
|
});
|
|
4469
4482
|
transformed = this.buildUnifiedOrderProduct(_objectSpread(_objectSpread({}, params.orderProduct), {}, {
|
|
4470
4483
|
num: bookingCount,
|
|
@@ -4503,7 +4516,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
4503
4516
|
_context36.next = 107;
|
|
4504
4517
|
return this.updateOrderProduct({
|
|
4505
4518
|
product_id: (_transformed$product_3 = transformed.product_id) !== null && _transformed$product_3 !== void 0 ? _transformed$product_3 : editingLine.product_id,
|
|
4506
|
-
product_variant_id: (
|
|
4519
|
+
product_variant_id: (_ref49 = (_transformed$product_4 = transformed.product_variant_id) !== null && _transformed$product_4 !== void 0 ? _transformed$product_4 : editingLine.product_variant_id) !== null && _ref49 !== void 0 ? _ref49 : 0,
|
|
4507
4520
|
unique_identification_number: params.productLineUid,
|
|
4508
4521
|
updates: transformed,
|
|
4509
4522
|
booking: booking
|
|
@@ -4542,8 +4555,8 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
4542
4555
|
}).filter(Boolean);
|
|
4543
4556
|
if (bookingUids.length === 0) {
|
|
4544
4557
|
bookingUids = addedLines.map(function (line) {
|
|
4545
|
-
var
|
|
4546
|
-
return String((
|
|
4558
|
+
var _ref50, _line$booking_uid, _line$metadata2;
|
|
4559
|
+
return String((_ref50 = (_line$booking_uid = line.booking_uid) !== null && _line$booking_uid !== void 0 ? _line$booking_uid : (_line$metadata2 = line.metadata) === null || _line$metadata2 === void 0 ? void 0 : _line$metadata2.booking_uid) !== null && _ref50 !== void 0 ? _ref50 : '');
|
|
4547
4560
|
}).filter(Boolean);
|
|
4548
4561
|
}
|
|
4549
4562
|
productLineUid = productLineUids[productLineUids.length - 1] || '';
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/model/strategy/adapter/promotion/index.ts
|
|
30
|
+
var promotion_exports = {};
|
|
31
|
+
__export(promotion_exports, {
|
|
32
|
+
BUY_X_GET_Y_FREE_STRATEGY: () => import_examples.BUY_X_GET_Y_FREE_STRATEGY,
|
|
33
|
+
ITEM_REWARD_STRATEGY: () => import_examples.ITEM_REWARD_STRATEGY,
|
|
34
|
+
PromotionAdapter: () => import_adapter.PromotionAdapter,
|
|
35
|
+
PromotionEvaluator: () => import_evaluator.PromotionEvaluator,
|
|
36
|
+
X_ITEMS_FOR_Y_PRICE_STRATEGY: () => import_examples.X_ITEMS_FOR_Y_PRICE_STRATEGY,
|
|
37
|
+
default: () => import_adapter2.default
|
|
38
|
+
});
|
|
39
|
+
module.exports = __toCommonJS(promotion_exports);
|
|
40
|
+
var import_evaluator = require("./evaluator");
|
|
41
|
+
var import_adapter = require("./adapter");
|
|
42
|
+
var import_adapter2 = __toESM(require("./adapter"));
|
|
43
|
+
var import_examples = require("./examples");
|
|
44
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
45
|
+
0 && (module.exports = {
|
|
46
|
+
BUY_X_GET_Y_FREE_STRATEGY,
|
|
47
|
+
ITEM_REWARD_STRATEGY,
|
|
48
|
+
PromotionAdapter,
|
|
49
|
+
PromotionEvaluator,
|
|
50
|
+
X_ITEMS_FOR_Y_PRICE_STRATEGY
|
|
51
|
+
});
|
|
@@ -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 | 3 | 4 | 5 | 6;
|
|
330
330
|
}[]>;
|
|
331
331
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
332
332
|
private getScheduleDataByIds;
|
|
@@ -451,19 +451,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
451
451
|
* 加车两阶段主决策(规格弹窗 / 资源编辑 / 直接加车)。
|
|
452
452
|
* 与 ticketBooking `handleSelectProduct` + `handleBooking4Service` 等价。
|
|
453
453
|
*/
|
|
454
|
-
decideAddProduct(item: any, options?: Partial<AddProductDecideContext>):
|
|
455
|
-
action: "reloadCatalog";
|
|
456
|
-
} | {
|
|
457
|
-
action: "add";
|
|
458
|
-
cacheItem: any;
|
|
459
|
-
} | {
|
|
460
|
-
action: "requiresDetail";
|
|
461
|
-
payload: AddProductRequiresDetailPayload;
|
|
462
|
-
} | {
|
|
463
|
-
action: "requiresBookingEdit";
|
|
464
|
-
cacheItem: any;
|
|
465
|
-
payload: import("./utils/addProductDecision").AddProductRequiresBookingEditPayload;
|
|
466
|
-
};
|
|
454
|
+
decideAddProduct(item: any, options?: Partial<AddProductDecideContext>): import("./utils/addProductDecision").AddProductDecision;
|
|
467
455
|
/** 规格弹窗 callback 后的第二段决策。 */
|
|
468
456
|
decideAfterDetail(cacheItem: any, options?: Partial<AddProductDecideContext>): import("./utils/addProductDecision").AddProductDecision;
|
|
469
457
|
/**
|
|
@@ -933,7 +933,9 @@ function buildBookingFromAvailabilitySelection(params) {
|
|
|
933
933
|
candidate,
|
|
934
934
|
product,
|
|
935
935
|
resources = [],
|
|
936
|
-
bookingUid
|
|
936
|
+
bookingUid,
|
|
937
|
+
holder,
|
|
938
|
+
holderIds
|
|
937
939
|
} = params;
|
|
938
940
|
const bookingStartAt = candidate.bookingStartAt || candidate.startAt;
|
|
939
941
|
const bookingEndAt = candidate.bookingEndAt || candidate.endAt;
|
|
@@ -948,6 +950,8 @@ function buildBookingFromAvailabilitySelection(params) {
|
|
|
948
950
|
scheduleRefs: candidate.scheduleRefs
|
|
949
951
|
});
|
|
950
952
|
}
|
|
953
|
+
const normalizedHolder = holder && typeof holder === "object" ? (0, import_lodash_es.cloneDeep)(holder) : void 0;
|
|
954
|
+
const normalizedHolderIds = Array.isArray(holderIds) ? (0, import_lodash_es.cloneDeep)(holderIds) : holderIds;
|
|
951
955
|
return {
|
|
952
956
|
start_date: bookingStartAt.slice(0, 10),
|
|
953
957
|
start_time: bookingStartAt.slice(11, 16),
|
|
@@ -956,6 +960,7 @@ function buildBookingFromAvailabilitySelection(params) {
|
|
|
956
960
|
duration: Math.max(1, Math.trunc((endScalar - startScalar) / (60 * 1e3))),
|
|
957
961
|
like_status: "common",
|
|
958
962
|
schedule_id: scheduleId ?? 0,
|
|
963
|
+
...normalizedHolder ? { holder: normalizedHolder } : {},
|
|
959
964
|
resources: assignments.map((assignment) => {
|
|
960
965
|
const matchedResource = resources.find((resource) => sameAvailabilityId(resource.id, assignment.resourceId));
|
|
961
966
|
const resourceName = String((matchedResource == null ? void 0 : matchedResource.name) || "").trim();
|
|
@@ -979,7 +984,9 @@ function buildBookingFromAvailabilitySelection(params) {
|
|
|
979
984
|
availability_slice_end_at: candidate.endAt,
|
|
980
985
|
availability_schedule_refs: candidate.scheduleRefs,
|
|
981
986
|
...timeSlotId == null ? {} : { time_slot_id: timeSlotId },
|
|
982
|
-
product_kind: product.kind
|
|
987
|
+
product_kind: product.kind,
|
|
988
|
+
...normalizedHolderIds === void 0 ? {} : { holder_id: normalizedHolderIds },
|
|
989
|
+
...normalizedHolder ? { holder: (0, import_lodash_es.cloneDeep)(normalizedHolder) } : {}
|
|
983
990
|
}
|
|
984
991
|
};
|
|
985
992
|
}
|
|
@@ -2804,7 +2811,7 @@ var UnifiedBookingSalesImpl = class extends import_BookingTicket.BookingTicket {
|
|
|
2804
2811
|
}
|
|
2805
2812
|
/** Revalidates against the latest landed occupancy cache, then mutates exactly one product line. */
|
|
2806
2813
|
async commitAvailabilitySelection(contextId, params) {
|
|
2807
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
2814
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s;
|
|
2808
2815
|
const normalizedContextId = String(contextId || "").trim();
|
|
2809
2816
|
if (!normalizedContextId) {
|
|
2810
2817
|
throw new import_ResourcePlanner.AvailabilityError("INVALID_TARGET_FILTER", "commitAvailabilitySelection 缺少 contextId", {
|
|
@@ -3074,7 +3081,9 @@ var UnifiedBookingSalesImpl = class extends import_BookingTicket.BookingTicket {
|
|
|
3074
3081
|
candidate: refreshedCandidate,
|
|
3075
3082
|
product,
|
|
3076
3083
|
resources: refreshedProjection.resources,
|
|
3077
|
-
bookingUid: existingBookingUid || void 0
|
|
3084
|
+
bookingUid: existingBookingUid || void 0,
|
|
3085
|
+
holder: ((_h = (_g = params.orderProduct) == null ? void 0 : _g._extend) == null ? void 0 : _h.holder) ?? (existingBooking == null ? void 0 : existingBooking.holder) ?? ((_i = existingBooking == null ? void 0 : existingBooking.metadata) == null ? void 0 : _i.holder),
|
|
3086
|
+
holderIds: ((_k = (_j = params.orderProduct) == null ? void 0 : _j._extend) == null ? void 0 : _k.holder_id) ?? ((_n = (_m = (_l = params.orderProduct) == null ? void 0 : _l._extend) == null ? void 0 : _m.holder) == null ? void 0 : _n.form_record) ?? ((_o = existingBooking == null ? void 0 : existingBooking.metadata) == null ? void 0 : _o.holder_id) ?? ((_p = existingBooking == null ? void 0 : existingBooking.holder) == null ? void 0 : _p.form_record)
|
|
3078
3087
|
});
|
|
3079
3088
|
const transformed = this.buildUnifiedOrderProduct({
|
|
3080
3089
|
...params.orderProduct,
|
|
@@ -3121,10 +3130,10 @@ var UnifiedBookingSalesImpl = class extends import_BookingTicket.BookingTicket {
|
|
|
3121
3130
|
bookingUids = [bookingUid];
|
|
3122
3131
|
} else {
|
|
3123
3132
|
const beforeProductLineUids = new Set(
|
|
3124
|
-
(((
|
|
3133
|
+
(((_q = this.getTempOrder()) == null ? void 0 : _q.products) || []).map((line) => getProductLineUid(line)).filter(Boolean)
|
|
3125
3134
|
);
|
|
3126
3135
|
const beforeBookingUids = new Set(
|
|
3127
|
-
(((
|
|
3136
|
+
(((_r = this.getTempOrder()) == null ? void 0 : _r.bookings) || []).map((item) => getBookingUid(item)).filter(Boolean)
|
|
3128
3137
|
);
|
|
3129
3138
|
const products = await this.addProductToOrder(transformed, booking);
|
|
3130
3139
|
const addedLines = products.filter((line) => {
|
|
@@ -3132,7 +3141,7 @@ var UnifiedBookingSalesImpl = class extends import_BookingTicket.BookingTicket {
|
|
|
3132
3141
|
return sameAvailabilityId(line.product_id ?? line.id, refreshedCandidate.productId) && ((_a2 = line.metadata) == null ? void 0 : _a2.availability_candidate_key) === refreshedCandidate.key && !beforeProductLineUids.has(getProductLineUid(line));
|
|
3133
3142
|
});
|
|
3134
3143
|
productLineUids = addedLines.map((line) => getProductLineUid(line)).filter(Boolean);
|
|
3135
|
-
const addedBookings = (((
|
|
3144
|
+
const addedBookings = (((_s = this.getTempOrder()) == null ? void 0 : _s.bookings) || []).filter((item) => {
|
|
3136
3145
|
var _a2;
|
|
3137
3146
|
return ((_a2 = item.metadata) == null ? void 0 : _a2.availability_candidate_key) === refreshedCandidate.key && !beforeBookingUids.has(getBookingUid(item));
|
|
3138
3147
|
});
|