@pisell/pisellos 0.10.93 → 0.10.95
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.d.ts +1 -1
- package/dist/modules/Product/index.d.ts +1 -1
- package/dist/modules/SalesSummary/index.d.ts +3 -0
- package/dist/modules/SalesSummary/index.js +104 -56
- package/dist/solution/BookingByStep/index.d.ts +2 -2
- package/dist/solution/BookingTicket/utils/redeemArrival.d.ts +8 -8
- package/dist/solution/BookingTicket/utils/redeemArrival.js +11 -5
- package/dist/solution/UnifiedBookingSales/index.d.ts +1 -0
- package/dist/solution/UnifiedBookingSales/index.js +48 -49
- package/dist/solution/UnifiedBookingSales/sessionResourceCache.d.ts +4 -0
- package/dist/solution/UnifiedBookingSales/sessionResourceCache.js +91 -14
- package/lib/modules/Order/index.d.ts +1 -1
- package/lib/modules/Product/index.d.ts +1 -1
- package/lib/modules/SalesSummary/index.d.ts +3 -0
- package/lib/modules/SalesSummary/index.js +36 -15
- package/lib/solution/BookingByStep/index.d.ts +2 -2
- package/lib/solution/BookingTicket/utils/redeemArrival.d.ts +8 -8
- package/lib/solution/BookingTicket/utils/redeemArrival.js +11 -5
- package/lib/solution/UnifiedBookingSales/index.d.ts +1 -0
- package/lib/solution/UnifiedBookingSales/index.js +11 -10
- package/lib/solution/UnifiedBookingSales/sessionResourceCache.d.ts +4 -0
- package/lib/solution/UnifiedBookingSales/sessionResourceCache.js +69 -4
- package/package.json +1 -1
|
@@ -1413,6 +1413,11 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
1413
1413
|
_defineProperty(_assertThisInitialized(_this), "availabilityProjectionRefreshInFlight", new Map());
|
|
1414
1414
|
_defineProperty(_assertThisInitialized(_this), "availabilityRemoteOccupancyCache", new AvailabilityRemoteOccupancyCache(MAX_REMOTE_OCCUPANCY_RESOURCE_DATE_CELLS));
|
|
1415
1415
|
_defineProperty(_assertThisInitialized(_this), "availabilitySessionResourceCache", new AvailabilitySessionResourceCache());
|
|
1416
|
+
_defineProperty(_assertThisInitialized(_this), "fetchAvailabilitySessionResources", function (query) {
|
|
1417
|
+
return _this.fetchAvailabilityResourcesV2(_objectSpread(_objectSpread({}, query), {}, {
|
|
1418
|
+
strictResponse: true
|
|
1419
|
+
}));
|
|
1420
|
+
});
|
|
1416
1421
|
_defineProperty(_assertThisInitialized(_this), "availabilityRemoteResourceQueryInFlight", new Map());
|
|
1417
1422
|
_defineProperty(_assertThisInitialized(_this), "availabilityRemoteResourceQuerySequence", 0);
|
|
1418
1423
|
_defineProperty(_assertThisInitialized(_this), "availabilityRemoteResourceEpoch", 0);
|
|
@@ -4426,14 +4431,17 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
4426
4431
|
return menus.some(function (menu) {
|
|
4427
4432
|
return productMatchesVenueMenu(product, menu);
|
|
4428
4433
|
});
|
|
4429
|
-
}).map(function (product) {
|
|
4430
|
-
return _this15.getVenueCatalogHydratedProduct(product);
|
|
4431
4434
|
});
|
|
4432
4435
|
if ((_input$product_ids = input.product_ids) !== null && _input$product_ids !== void 0 && _input$product_ids.length) products = products.filter(function (product) {
|
|
4433
4436
|
return input.product_ids.some(function (id) {
|
|
4434
4437
|
return Number(id) === Number(product.id);
|
|
4435
4438
|
});
|
|
4436
4439
|
});
|
|
4440
|
+
// Detail/quote reads must not deep-clone every other member of the pool.
|
|
4441
|
+
// Hydration owns a fresh copy of each selected product, including variants.
|
|
4442
|
+
products = products.map(function (product) {
|
|
4443
|
+
return _this15.getVenueCatalogHydratedProduct(product);
|
|
4444
|
+
});
|
|
4437
4445
|
var user = (_this15$core$getPlugi = (_this15$core = _this15.core).getPlugin) === null || _this15$core$getPlugi === void 0 ? void 0 : _this15$core$getPlugi.call(_this15$core, 'user');
|
|
4438
4446
|
var queryPayload = {
|
|
4439
4447
|
schedule_date: datetime.slice(0, 10),
|
|
@@ -4444,7 +4452,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
4444
4452
|
var result = tryResolveClientDataVariants({
|
|
4445
4453
|
core: _this15.core,
|
|
4446
4454
|
otherParams: _this15.otherParams,
|
|
4447
|
-
products:
|
|
4455
|
+
products: products,
|
|
4448
4456
|
queryPayload: queryPayload,
|
|
4449
4457
|
handledByOsServer: false,
|
|
4450
4458
|
scheduleList: _this15.getAvailabilityScheduleCatalog(),
|
|
@@ -6170,11 +6178,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
6170
6178
|
scopeKey: "".concat(scope, ":").concat(this.buildAvailabilityRemoteResourceScopeKey(timezone)),
|
|
6171
6179
|
timezoneName: timezone
|
|
6172
6180
|
}, resourceQuery), {}, {
|
|
6173
|
-
fetch:
|
|
6174
|
-
return _this20.fetchAvailabilityResourcesV2(_objectSpread(_objectSpread({}, query), {}, {
|
|
6175
|
-
strictResponse: true
|
|
6176
|
-
}));
|
|
6177
|
-
}
|
|
6181
|
+
fetch: this.fetchAvailabilitySessionResources
|
|
6178
6182
|
}));
|
|
6179
6183
|
case 24:
|
|
6180
6184
|
_context55.t1 = _context55.sent;
|
|
@@ -6398,7 +6402,6 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
6398
6402
|
key: "loadAvailabilityResources",
|
|
6399
6403
|
value: function () {
|
|
6400
6404
|
var _loadAvailabilityResources = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee57(params) {
|
|
6401
|
-
var _this23 = this;
|
|
6402
6405
|
var resourceIds, _rawResources, cachedRawResources, remoteQuery, rawResources;
|
|
6403
6406
|
return _regeneratorRuntime().wrap(function _callee57$(_context58) {
|
|
6404
6407
|
while (1) switch (_context58.prev = _context58.next) {
|
|
@@ -6423,11 +6426,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
6423
6426
|
timezoneName: params.timezone,
|
|
6424
6427
|
resourceIds: resourceIds,
|
|
6425
6428
|
dateRange: params.dateRange,
|
|
6426
|
-
fetch:
|
|
6427
|
-
return _this23.fetchAvailabilityResourcesV2(_objectSpread(_objectSpread({}, query), {}, {
|
|
6428
|
-
strictResponse: true
|
|
6429
|
-
}));
|
|
6430
|
-
}
|
|
6429
|
+
fetch: this.fetchAvailabilitySessionResources
|
|
6431
6430
|
});
|
|
6432
6431
|
case 6:
|
|
6433
6432
|
_rawResources = _context58.sent;
|
|
@@ -6585,7 +6584,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
6585
6584
|
}, {
|
|
6586
6585
|
key: "collectCartResourceOccupancies",
|
|
6587
6586
|
value: function collectCartResourceOccupancies(tempOrder, exclusions) {
|
|
6588
|
-
var
|
|
6587
|
+
var _this23 = this;
|
|
6589
6588
|
var bookings = Array.isArray(tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.bookings) ? tempOrder.bookings : [];
|
|
6590
6589
|
return bookings.flatMap(function (booking) {
|
|
6591
6590
|
var _ref59, _booking$product_uid2, _booking$metadata2;
|
|
@@ -6602,7 +6601,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
6602
6601
|
var range = normalizeAvailabilityLocalDateTimeRange({
|
|
6603
6602
|
startAt: startAt,
|
|
6604
6603
|
endAt: endAt,
|
|
6605
|
-
fixedOffsetMinutes:
|
|
6604
|
+
fixedOffsetMinutes: _this23.getAvailabilityRuntimeOffsetMinutes(),
|
|
6606
6605
|
rollOverEnd: false
|
|
6607
6606
|
});
|
|
6608
6607
|
if (!range) return [];
|
|
@@ -6620,7 +6619,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
6620
6619
|
resource: resource
|
|
6621
6620
|
}
|
|
6622
6621
|
};
|
|
6623
|
-
return
|
|
6622
|
+
return _this23.occupancyIsExcluded(occupancy, exclusions) ? [] : [occupancy];
|
|
6624
6623
|
});
|
|
6625
6624
|
});
|
|
6626
6625
|
}
|
|
@@ -6687,16 +6686,16 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
6687
6686
|
}, {
|
|
6688
6687
|
key: "assertContextualQueryFreshness",
|
|
6689
6688
|
value: function assertContextualQueryFreshness(context, request) {
|
|
6690
|
-
var
|
|
6689
|
+
var _this24 = this;
|
|
6691
6690
|
if (request.target === 'time') {
|
|
6692
6691
|
request.candidates.forEach(function (candidate) {
|
|
6693
|
-
|
|
6692
|
+
_this24.assertAvailabilityCandidateFreshness(context, candidate);
|
|
6694
6693
|
});
|
|
6695
6694
|
return;
|
|
6696
6695
|
}
|
|
6697
6696
|
if (request.target === 'resource') {
|
|
6698
6697
|
request.selectedRanges.forEach(function (candidate) {
|
|
6699
|
-
|
|
6698
|
+
_this24.assertAvailabilityCandidateFreshness(context, candidate);
|
|
6700
6699
|
});
|
|
6701
6700
|
}
|
|
6702
6701
|
}
|
|
@@ -6745,7 +6744,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
6745
6744
|
key: "buildAvailabilityProjectionSnapshot",
|
|
6746
6745
|
value: function () {
|
|
6747
6746
|
var _buildAvailabilityProjectionSnapshot = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee58(params) {
|
|
6748
|
-
var
|
|
6747
|
+
var _this25 = this;
|
|
6749
6748
|
var options,
|
|
6750
6749
|
normalizedPrepareParams,
|
|
6751
6750
|
timezoneLabel,
|
|
@@ -6827,7 +6826,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
6827
6826
|
var range = normalizeAvailabilityLocalDateTimeRange({
|
|
6828
6827
|
startAt: occupancy.startAt,
|
|
6829
6828
|
endAt: occupancy.endAt,
|
|
6830
|
-
fixedOffsetMinutes:
|
|
6829
|
+
fixedOffsetMinutes: _this25.getAvailabilityRuntimeOffsetMinutes(),
|
|
6831
6830
|
rollOverEnd: false
|
|
6832
6831
|
});
|
|
6833
6832
|
if (!range) return [];
|
|
@@ -6837,7 +6836,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
6837
6836
|
})];
|
|
6838
6837
|
});
|
|
6839
6838
|
remoteOccupancies = [].concat(_toConsumableArray(loadedResources.resourceOccupancies), _toConsumableArray(loadedResources.includesInjectedRawOccupancies ? [] : injectedRawOccupancies)).filter(function (occupancy) {
|
|
6840
|
-
return !
|
|
6839
|
+
return !_this25.occupancyIsExcluded(occupancy, exclusions);
|
|
6841
6840
|
});
|
|
6842
6841
|
cartOccupancies = this.collectCartResourceOccupancies(tempOrder, exclusions);
|
|
6843
6842
|
preparedAt = this.getAvailabilityRuntimeDateTime();
|
|
@@ -6979,7 +6978,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
6979
6978
|
key: "refreshAvailabilityContextProjection",
|
|
6980
6979
|
value: function () {
|
|
6981
6980
|
var _refreshAvailabilityContextProjection = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee61(params) {
|
|
6982
|
-
var
|
|
6981
|
+
var _this26 = this;
|
|
6983
6982
|
var existingInFlight, context, expectedVersion, expectedRefreshNonce, expectedLifecycleGeneration, refreshPromise, current;
|
|
6984
6983
|
return _regeneratorRuntime().wrap(function _callee61$(_context62) {
|
|
6985
6984
|
while (1) switch (_context62.prev = _context62.next) {
|
|
@@ -7004,25 +7003,25 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
7004
7003
|
while (1) switch (_context61.prev = _context61.next) {
|
|
7005
7004
|
case 0:
|
|
7006
7005
|
_context61.next = 2;
|
|
7007
|
-
return
|
|
7006
|
+
return _this26.buildAvailabilityProjectionSnapshot(_this26.cloneAvailabilityPrepareParams(context.prepareParams), {
|
|
7008
7007
|
durationCandidateAnchorAt: context.durationCandidateAnchorAt
|
|
7009
7008
|
});
|
|
7010
7009
|
case 2:
|
|
7011
7010
|
snapshot = _context61.sent;
|
|
7012
|
-
currentContext =
|
|
7011
|
+
currentContext = _this26.availabilityContextRegistry.get(params.contextId);
|
|
7013
7012
|
if (currentContext) {
|
|
7014
7013
|
_context61.next = 6;
|
|
7015
7014
|
break;
|
|
7016
7015
|
}
|
|
7017
7016
|
return _context61.abrupt("return", null);
|
|
7018
7017
|
case 6:
|
|
7019
|
-
if (!(expectedLifecycleGeneration !==
|
|
7018
|
+
if (!(expectedLifecycleGeneration !== _this26.availabilityLifecycleGeneration || currentContext.activeVersion !== expectedVersion || currentContext.refreshNonce !== expectedRefreshNonce || currentContext.lifecycleGeneration !== expectedLifecycleGeneration)) {
|
|
7020
7019
|
_context61.next = 8;
|
|
7021
7020
|
break;
|
|
7022
7021
|
}
|
|
7023
7022
|
return _context61.abrupt("return", null);
|
|
7024
7023
|
case 8:
|
|
7025
|
-
projectionEntry =
|
|
7024
|
+
projectionEntry = _this26.storeAvailabilityProjectionEntry({
|
|
7026
7025
|
contextId: currentContext.contextId,
|
|
7027
7026
|
prepareParams: snapshot.prepareParams,
|
|
7028
7027
|
prepareKey: currentContext.prepareKey,
|
|
@@ -7031,7 +7030,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
7031
7030
|
incrementVersion: true
|
|
7032
7031
|
});
|
|
7033
7032
|
_context61.next = 11;
|
|
7034
|
-
return
|
|
7033
|
+
return _this26.emitAvailabilityDiagnostic({
|
|
7035
7034
|
action: 'refresh',
|
|
7036
7035
|
contextId: currentContext.contextId,
|
|
7037
7036
|
contextVersion: projectionEntry.contextVersion,
|
|
@@ -7343,7 +7342,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
7343
7342
|
_this$otherParams47,
|
|
7344
7343
|
_context$prepareParam2,
|
|
7345
7344
|
_extractFixedOffsetMi3,
|
|
7346
|
-
|
|
7345
|
+
_this27 = this;
|
|
7347
7346
|
var request,
|
|
7348
7347
|
_yield$this$ensureAva,
|
|
7349
7348
|
context,
|
|
@@ -7459,7 +7458,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
7459
7458
|
}).map(function (group) {
|
|
7460
7459
|
return _objectSpread(_objectSpread({}, group), {}, {
|
|
7461
7460
|
ranges: group.ranges.map(function (candidate) {
|
|
7462
|
-
return
|
|
7461
|
+
return _this27.decorateAvailabilityCandidate(context.contextId, contextVersion, candidate);
|
|
7463
7462
|
})
|
|
7464
7463
|
});
|
|
7465
7464
|
}));
|
|
@@ -7639,7 +7638,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
7639
7638
|
var _removeBookingProductsOutsideStartDate = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee69(startDate) {
|
|
7640
7639
|
var _this$getTempOrder5,
|
|
7641
7640
|
_this$otherParams49,
|
|
7642
|
-
|
|
7641
|
+
_this28 = this;
|
|
7643
7642
|
var products, targetDate, identities;
|
|
7644
7643
|
return _regeneratorRuntime().wrap(function _callee69$(_context70) {
|
|
7645
7644
|
while (1) switch (_context70.prev = _context70.next) {
|
|
@@ -7663,7 +7662,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
7663
7662
|
if (!getProductLineUid(product) || (product === null || product === void 0 || (_product$metadata8 = product.metadata) === null || _product$metadata8 === void 0 ? void 0 : _product$metadata8.product_add_schedule_time) != null) {
|
|
7664
7663
|
return [];
|
|
7665
7664
|
}
|
|
7666
|
-
var booking =
|
|
7665
|
+
var booking = _this28.findLinkedBooking(product);
|
|
7667
7666
|
if (!booking || isFulfillmentTimingBooking(booking)) return [];
|
|
7668
7667
|
var bookingDate = getVisibleCalendarDate(booking.start_date);
|
|
7669
7668
|
return bookingDate && bookingDate !== targetDate ? [buildAvailabilityLineIdentity(product)] : [];
|
|
@@ -7718,7 +7717,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
7718
7717
|
value: function () {
|
|
7719
7718
|
var _commitAvailabilitySelectionWithLock = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee71(contextId, params) {
|
|
7720
7719
|
var _this$availabilityCon,
|
|
7721
|
-
|
|
7720
|
+
_this29 = this,
|
|
7722
7721
|
_this$otherParams$pla5,
|
|
7723
7722
|
_this$otherParams50,
|
|
7724
7723
|
_this$availabilityCon2,
|
|
@@ -7745,7 +7744,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
7745
7744
|
params = _objectSpread(_objectSpread({}, params), {}, {
|
|
7746
7745
|
availabilityCommitGuard: function availabilityCommitGuard() {
|
|
7747
7746
|
callerGuard === null || callerGuard === void 0 || callerGuard();
|
|
7748
|
-
if (!
|
|
7747
|
+
if (!_this29.isOrderSessionCurrent(calendarOrderSessionId)) {
|
|
7749
7748
|
throw new AvailabilityError('AVAILABILITY_SELECTION_STALE', 'Calendar booking order session changed.');
|
|
7750
7749
|
}
|
|
7751
7750
|
}
|
|
@@ -7775,21 +7774,21 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
7775
7774
|
if (isOrderRememberedSelection) this.assertRememberedOrderSession(params.orderSessionId);
|
|
7776
7775
|
rememberedOrder = hasCommitGuard ? this.getTempOrder() : null;
|
|
7777
7776
|
getRememberedCommitIdentity = function getRememberedCommitIdentity() {
|
|
7778
|
-
var
|
|
7777
|
+
var _this29$otherParams$s, _this29$otherParams, _this29$otherParams2, _this29$core, _this29$getTempOrder, _this29$getTempOrder2;
|
|
7779
7778
|
return JSON.stringify(stableValue(_objectSpread({
|
|
7780
|
-
scope:
|
|
7781
|
-
shopId: (
|
|
7782
|
-
contextShopId: (
|
|
7779
|
+
scope: _this29.getAvailabilityScopeDescriptor(),
|
|
7780
|
+
shopId: (_this29$otherParams$s = (_this29$otherParams = _this29.otherParams) === null || _this29$otherParams === void 0 ? void 0 : _this29$otherParams.shop_id) !== null && _this29$otherParams$s !== void 0 ? _this29$otherParams$s : (_this29$otherParams2 = _this29.otherParams) === null || _this29$otherParams2 === void 0 ? void 0 : _this29$otherParams2.shopId,
|
|
7781
|
+
contextShopId: (_this29$core = _this29.core) === null || _this29$core === void 0 || (_this29$core = _this29$core.context) === null || _this29$core === void 0 ? void 0 : _this29$core.shop_id
|
|
7783
7782
|
}, isOrderRememberedSelection ? {
|
|
7784
|
-
orderSessionId:
|
|
7783
|
+
orderSessionId: _this29.getOrderSessionId()
|
|
7785
7784
|
} : {
|
|
7786
|
-
orderId: (
|
|
7787
|
-
externalSaleNumber: (
|
|
7785
|
+
orderId: (_this29$getTempOrder = _this29.getTempOrder()) === null || _this29$getTempOrder === void 0 ? void 0 : _this29$getTempOrder.order_id,
|
|
7786
|
+
externalSaleNumber: (_this29$getTempOrder2 = _this29.getTempOrder()) === null || _this29$getTempOrder2 === void 0 ? void 0 : _this29$getTempOrder2.external_sale_number
|
|
7788
7787
|
})));
|
|
7789
7788
|
};
|
|
7790
7789
|
rememberedCommitIdentity = hasCommitGuard ? getRememberedCommitIdentity() : '';
|
|
7791
7790
|
availabilityCommitTargetGuard = function availabilityCommitTargetGuard() {
|
|
7792
|
-
return (isOrderRememberedSelection ?
|
|
7791
|
+
return (isOrderRememberedSelection ? _this29.isOrderSessionCurrent(params.orderSessionId) : _this29.getTempOrder() === rememberedOrder) && getRememberedCommitIdentity() === rememberedCommitIdentity;
|
|
7793
7792
|
};
|
|
7794
7793
|
guardedCommitPublished = false;
|
|
7795
7794
|
_context72.next = 26;
|
|
@@ -8195,11 +8194,11 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
8195
8194
|
availabilityCommitGuard = hasCommitGuard ? function () {
|
|
8196
8195
|
var _params$availabilityC4, _params2;
|
|
8197
8196
|
(_params$availabilityC4 = (_params2 = params).availabilityCommitGuard) === null || _params$availabilityC4 === void 0 || _params$availabilityC4.call(_params2);
|
|
8198
|
-
|
|
8197
|
+
_this29.assertAvailabilityCommitWriteCAS(commitWriteGuard);
|
|
8199
8198
|
if (!availabilityCommitTargetGuard()) {
|
|
8200
|
-
throw
|
|
8199
|
+
throw _this29.createAvailabilityFacadeError('AVAILABILITY_SELECTION_STALE', '记忆时间加购期间订单或业务已变化');
|
|
8201
8200
|
}
|
|
8202
|
-
if (isOrderRememberedSelection) rememberedOrder =
|
|
8201
|
+
if (isOrderRememberedSelection) rememberedOrder = _this29.getTempOrder();
|
|
8203
8202
|
if (customerSelectionSnapshot || !isRememberedSelection && !strictAvailability) return;
|
|
8204
8203
|
var currentValidation = validateAvailabilitySelection(refreshedProjection, {
|
|
8205
8204
|
candidate: refreshedCandidateBase,
|
|
@@ -8207,7 +8206,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
8207
8206
|
partySize: partySize,
|
|
8208
8207
|
bookingCount: bookingCount
|
|
8209
8208
|
}, {
|
|
8210
|
-
useDurationTimeGrid:
|
|
8209
|
+
useDurationTimeGrid: _this29.usesDurationTimeGrid(refreshedProjection),
|
|
8211
8210
|
enforceSaleCutoff: true,
|
|
8212
8211
|
rememberedTimeByProductId: rememberedTimeByProductId
|
|
8213
8212
|
});
|
|
@@ -8302,7 +8301,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
8302
8301
|
break;
|
|
8303
8302
|
}
|
|
8304
8303
|
relatedRetailProducts = params.relatedRetailProducts.map(function (source) {
|
|
8305
|
-
var line =
|
|
8304
|
+
var line = _this29.buildUnifiedOrderProduct(source, 'unified_booking_sales_retail');
|
|
8306
8305
|
if (!line) throw new AvailabilityError('INVALID_TARGET_FILTER', '无法生成附加商品订单行');
|
|
8307
8306
|
var sourceUid = getProductLineUid(source);
|
|
8308
8307
|
if (sourceUid) {
|
|
@@ -8447,7 +8446,7 @@ export var UnifiedBookingSalesImpl = /*#__PURE__*/function (_BookingTicket) {
|
|
|
8447
8446
|
break;
|
|
8448
8447
|
}
|
|
8449
8448
|
emit = function emit() {
|
|
8450
|
-
return
|
|
8449
|
+
return _this29.core.effects.emit("".concat(_this29.name, ":").concat(UnifiedBookingSalesHooks.onAvailabilitySelectionCommitted), result);
|
|
8451
8450
|
};
|
|
8452
8451
|
if (!guardedCommitPublished) {
|
|
8453
8452
|
_context72.next = 218;
|
|
@@ -21,7 +21,11 @@ export declare class AvailabilitySessionResourceCache {
|
|
|
21
21
|
private readonly cells;
|
|
22
22
|
private readonly pending;
|
|
23
23
|
private generation;
|
|
24
|
+
private queuedBatches;
|
|
25
|
+
private batchFlushScheduled;
|
|
24
26
|
clear(): void;
|
|
27
|
+
private enqueueFetch;
|
|
28
|
+
private flushFetchBatches;
|
|
25
29
|
load(params: AvailabilitySessionResourceLoadParams): Promise<RawResource[]>;
|
|
26
30
|
}
|
|
27
31
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
var _excluded = ["event_list"];
|
|
2
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
2
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
5
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6
4
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
7
5
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
8
6
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
7
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
8
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9
9
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
10
10
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
11
11
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
@@ -15,6 +15,11 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
15
15
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
16
16
|
import { cloneDeep } from 'lodash-es';
|
|
17
17
|
import { dateOrdinalFromLocalDate, formatLocalDate, localDateTimeToScalar, localDateToScalarStart, nextDate, parseLocalDateTime } from "../../modules/ResourcePlanner/localClock";
|
|
18
|
+
function sessionChangedError() {
|
|
19
|
+
return Object.assign(new Error('Resource session changed while loading. Please prepare again.'), {
|
|
20
|
+
code: 'AVAILABILITY_CONTEXT_NOT_FOUND'
|
|
21
|
+
});
|
|
22
|
+
}
|
|
18
23
|
function datesInRange(range) {
|
|
19
24
|
var count = dateOrdinalFromLocalDate(range.endDate) - dateOrdinalFromLocalDate(range.startDate) + 1;
|
|
20
25
|
// A legal 90-business-day projection may include its preceding opening and overnight tail.
|
|
@@ -81,6 +86,8 @@ export var AvailabilitySessionResourceCache = /*#__PURE__*/function () {
|
|
|
81
86
|
_defineProperty(this, "cells", new Map());
|
|
82
87
|
_defineProperty(this, "pending", new Map());
|
|
83
88
|
_defineProperty(this, "generation", 0);
|
|
89
|
+
_defineProperty(this, "queuedBatches", []);
|
|
90
|
+
_defineProperty(this, "batchFlushScheduled", false);
|
|
84
91
|
}
|
|
85
92
|
_createClass(AvailabilitySessionResourceCache, [{
|
|
86
93
|
key: "clear",
|
|
@@ -88,22 +95,92 @@ export var AvailabilitySessionResourceCache = /*#__PURE__*/function () {
|
|
|
88
95
|
this.generation += 1;
|
|
89
96
|
this.cells.clear();
|
|
90
97
|
this.pending.clear();
|
|
98
|
+
// A queued request has not reached the transport yet. Settle its waiters
|
|
99
|
+
// now, rather than leaving them pending or dispatching it in the new scope.
|
|
100
|
+
var queued = this.queuedBatches;
|
|
101
|
+
this.queuedBatches = [];
|
|
102
|
+
queued.forEach(function (batch) {
|
|
103
|
+
return batch.reject(sessionChangedError());
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}, {
|
|
107
|
+
key: "enqueueFetch",
|
|
108
|
+
value: function enqueueFetch(params, query, generation) {
|
|
109
|
+
var _this = this;
|
|
110
|
+
var batch = this.queuedBatches.find(function (entry) {
|
|
111
|
+
return entry.generation === generation && entry.scopeKey === params.scopeKey && entry.timezoneName === params.timezoneName && entry.fetch === params.fetch && entry.dateRange.startDate === query.dateRange.startDate && entry.dateRange.endDate === query.dateRange.endDate;
|
|
112
|
+
});
|
|
113
|
+
if (!batch) {
|
|
114
|
+
var resolve;
|
|
115
|
+
var reject;
|
|
116
|
+
var promise = new Promise(function (resolvePromise, rejectPromise) {
|
|
117
|
+
resolve = resolvePromise;
|
|
118
|
+
reject = rejectPromise;
|
|
119
|
+
});
|
|
120
|
+
batch = {
|
|
121
|
+
generation: generation,
|
|
122
|
+
scopeKey: params.scopeKey,
|
|
123
|
+
timezoneName: params.timezoneName,
|
|
124
|
+
dateRange: _objectSpread({}, query.dateRange),
|
|
125
|
+
fetch: params.fetch,
|
|
126
|
+
resourceIds: new Map(),
|
|
127
|
+
promise: promise,
|
|
128
|
+
resolve: resolve,
|
|
129
|
+
reject: reject
|
|
130
|
+
};
|
|
131
|
+
this.queuedBatches.push(batch);
|
|
132
|
+
}
|
|
133
|
+
query.resourceIds.forEach(function (id) {
|
|
134
|
+
return batch.resourceIds.set(String(id), id);
|
|
135
|
+
});
|
|
136
|
+
if (!this.batchFlushScheduled) {
|
|
137
|
+
this.batchFlushScheduled = true;
|
|
138
|
+
// Fetching was already asynchronous. Collect requests from this turn only;
|
|
139
|
+
// do not add a timer or broaden their physical date coverage.
|
|
140
|
+
void Promise.resolve().then(function () {
|
|
141
|
+
return _this.flushFetchBatches();
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
return batch.promise;
|
|
145
|
+
}
|
|
146
|
+
}, {
|
|
147
|
+
key: "flushFetchBatches",
|
|
148
|
+
value: function flushFetchBatches() {
|
|
149
|
+
var _this2 = this;
|
|
150
|
+
this.batchFlushScheduled = false;
|
|
151
|
+
var queued = this.queuedBatches;
|
|
152
|
+
this.queuedBatches = [];
|
|
153
|
+
queued.forEach(function (batch) {
|
|
154
|
+
if (batch.generation !== _this2.generation) {
|
|
155
|
+
batch.reject(sessionChangedError());
|
|
156
|
+
return;
|
|
157
|
+
}
|
|
158
|
+
var query = {
|
|
159
|
+
resourceIds: Array.from(batch.resourceIds.values()).sort(function (left, right) {
|
|
160
|
+
return String(left).localeCompare(String(right));
|
|
161
|
+
}),
|
|
162
|
+
dateRange: _objectSpread({}, batch.dateRange)
|
|
163
|
+
};
|
|
164
|
+
try {
|
|
165
|
+
Promise.resolve(batch.fetch(cloneDeep(query))).then(batch.resolve, batch.reject);
|
|
166
|
+
} catch (error) {
|
|
167
|
+
batch.reject(error);
|
|
168
|
+
}
|
|
169
|
+
});
|
|
91
170
|
}
|
|
92
171
|
}, {
|
|
93
172
|
key: "load",
|
|
94
173
|
value: function () {
|
|
95
174
|
var _load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
|
|
96
|
-
var
|
|
175
|
+
var _this3 = this;
|
|
97
176
|
var generation, assertCurrent, resources, dates, key, waits, gaps, previousIds, result;
|
|
98
177
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
99
178
|
while (1) switch (_context2.prev = _context2.next) {
|
|
100
179
|
case 0:
|
|
101
180
|
generation = this.generation;
|
|
102
181
|
assertCurrent = function assertCurrent() {
|
|
103
|
-
if (generation !==
|
|
104
|
-
throw
|
|
105
|
-
code: 'AVAILABILITY_CONTEXT_NOT_FOUND'
|
|
106
|
-
});
|
|
182
|
+
if (generation !== _this3.generation) {
|
|
183
|
+
throw sessionChangedError();
|
|
107
184
|
}
|
|
108
185
|
};
|
|
109
186
|
resources = Array.from(new Map(params.resourceIds.filter(function (id) {
|
|
@@ -121,8 +198,8 @@ export var AvailabilitySessionResourceCache = /*#__PURE__*/function () {
|
|
|
121
198
|
dates.forEach(function (date) {
|
|
122
199
|
var missing = resources.filter(function (resourceId) {
|
|
123
200
|
var cellKey = key(resourceId, date);
|
|
124
|
-
if (
|
|
125
|
-
var pending =
|
|
201
|
+
if (_this3.cells.has(cellKey)) return false;
|
|
202
|
+
var pending = _this3.pending.get(cellKey);
|
|
126
203
|
if (pending) {
|
|
127
204
|
waits.add(pending);
|
|
128
205
|
return false;
|
|
@@ -163,7 +240,7 @@ export var AvailabilitySessionResourceCache = /*#__PURE__*/function () {
|
|
|
163
240
|
case 0:
|
|
164
241
|
assertCurrent();
|
|
165
242
|
_context.next = 3;
|
|
166
|
-
return
|
|
243
|
+
return _this3.enqueueFetch(params, query, generation);
|
|
167
244
|
case 3:
|
|
168
245
|
response = _context.sent;
|
|
169
246
|
assertCurrent();
|
|
@@ -204,7 +281,7 @@ export var AvailabilitySessionResourceCache = /*#__PURE__*/function () {
|
|
|
204
281
|
});
|
|
205
282
|
assertCurrent();
|
|
206
283
|
updates.forEach(function (cell, cellKey) {
|
|
207
|
-
if (!
|
|
284
|
+
if (!_this3.cells.has(cellKey)) _this3.cells.set(cellKey, cell);
|
|
208
285
|
});
|
|
209
286
|
case 13:
|
|
210
287
|
case "end":
|
|
@@ -213,11 +290,11 @@ export var AvailabilitySessionResourceCache = /*#__PURE__*/function () {
|
|
|
213
290
|
}, _callee);
|
|
214
291
|
}))).finally(function () {
|
|
215
292
|
cellKeys.forEach(function (cellKey) {
|
|
216
|
-
if (
|
|
293
|
+
if (_this3.pending.get(cellKey) === promise) _this3.pending.delete(cellKey);
|
|
217
294
|
});
|
|
218
295
|
});
|
|
219
296
|
cellKeys.forEach(function (cellKey) {
|
|
220
|
-
return
|
|
297
|
+
return _this3.pending.set(cellKey, promise);
|
|
221
298
|
});
|
|
222
299
|
waits.add(promise);
|
|
223
300
|
});
|
|
@@ -230,7 +307,7 @@ export var AvailabilitySessionResourceCache = /*#__PURE__*/function () {
|
|
|
230
307
|
var metadata = null;
|
|
231
308
|
var events = new Map();
|
|
232
309
|
dates.forEach(function (date) {
|
|
233
|
-
var cell =
|
|
310
|
+
var cell = _this3.cells.get(key(id, date));
|
|
234
311
|
if (!cell) throw new Error('Resource session coverage was lost. Please prepare again.');
|
|
235
312
|
if (!metadata && cell.resource) metadata = cell.resource;
|
|
236
313
|
var occurrences = new Map();
|
|
@@ -640,7 +640,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
640
640
|
generateIdempotencyToken(): string;
|
|
641
641
|
syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
|
|
642
642
|
createOrder(params: CommitOrderParams['query']): {
|
|
643
|
-
type: "
|
|
643
|
+
type: "virtual" | "appointment_booking";
|
|
644
644
|
platform: string;
|
|
645
645
|
sales_channel: string;
|
|
646
646
|
order_sales_channel: string;
|
|
@@ -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(): "normal" | "duration" | "session";
|
|
53
53
|
}
|
|
@@ -11,6 +11,7 @@ export declare class SalesSummaryModule extends BaseModule implements Module, Sa
|
|
|
11
11
|
private surchargeListModuleName;
|
|
12
12
|
private otherParams;
|
|
13
13
|
private surchargeListChannel;
|
|
14
|
+
private surchargeLoads;
|
|
14
15
|
constructor(name?: string, version?: string);
|
|
15
16
|
initialize(core: PisellCore, options: ModuleOptions): Promise<void>;
|
|
16
17
|
/**
|
|
@@ -22,6 +23,8 @@ export declare class SalesSummaryModule extends BaseModule implements Module, Sa
|
|
|
22
23
|
updateOtherParams(params: Record<string, any>): Promise<void>;
|
|
23
24
|
private resolveChannel;
|
|
24
25
|
getSurchargeList(channel?: string): Promise<void>;
|
|
26
|
+
private loadSurcharges;
|
|
27
|
+
private fetchSurcharges;
|
|
25
28
|
private getAppData;
|
|
26
29
|
private getTaxConfig;
|
|
27
30
|
getSummary(params: {
|