mts-booking-library 2.2.0 → 2.2.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -132,27 +132,31 @@ var JourneyBooking = /** @class */ (function (_super) {
|
|
132
132
|
};
|
133
133
|
JourneyBooking.prototype.fetchAndSetCart = function (cartGuid, options) {
|
134
134
|
return __awaiter(this, void 0, void 0, function () {
|
135
|
-
var
|
135
|
+
var cart, cartDueDate;
|
136
136
|
return __generator(this, function (_a) {
|
137
|
-
|
137
|
+
switch (_a.label) {
|
138
|
+
case 0: return [4 /*yield*/, this.fetchCart(cartGuid, options)];
|
139
|
+
case 1:
|
140
|
+
cart = _a.sent();
|
138
141
|
if (cart) {
|
139
|
-
|
142
|
+
cartDueDate = new Date();
|
140
143
|
cartDueDate.setSeconds(cartDueDate.getSeconds() + cart.bookingDueDateRemainingSeconds);
|
141
144
|
if (cartDueDate > new Date() && !cart.hasIssuedTickets) {
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
+
this.cart = cart;
|
146
|
+
this.cartGuid = cart.guid;
|
147
|
+
this.bookingDueDate = cartDueDate; // See Booking class
|
145
148
|
// Update the sellerId. This is particularly important in Linkavel
|
146
|
-
|
149
|
+
this.updateSellerId(cart.sellerId);
|
147
150
|
// Fill the booking process status
|
148
|
-
|
151
|
+
this.bookingStepsToStatus = (0, processBookingSteps_1.processBookingSteps)(cart.stepsToStatus);
|
149
152
|
}
|
150
153
|
else {
|
151
154
|
// This should never happen, but just in case
|
152
|
-
|
155
|
+
this.resetBooking();
|
153
156
|
}
|
154
157
|
}
|
155
|
-
|
158
|
+
return [2 /*return*/];
|
159
|
+
}
|
156
160
|
});
|
157
161
|
});
|
158
162
|
};
|
@@ -301,7 +305,7 @@ var JourneyBooking = /** @class */ (function (_super) {
|
|
301
305
|
throw new Error("Could not fetch cart");
|
302
306
|
}
|
303
307
|
// Update storage
|
304
|
-
this.getStorage().getState().updateCartGuid(response.
|
308
|
+
this.getStorage().getState().updateCartGuid(response.cartGuid);
|
305
309
|
return [2 /*return*/, this.cart];
|
306
310
|
}
|
307
311
|
});
|
@@ -132,27 +132,31 @@ var ServiceBooking = /** @class */ (function (_super) {
|
|
132
132
|
};
|
133
133
|
ServiceBooking.prototype.fetchAndSetCart = function (cartGuid, options) {
|
134
134
|
return __awaiter(this, void 0, void 0, function () {
|
135
|
-
var
|
135
|
+
var cart, cartDueDate;
|
136
136
|
return __generator(this, function (_a) {
|
137
|
-
|
137
|
+
switch (_a.label) {
|
138
|
+
case 0: return [4 /*yield*/, this.fetchCart(cartGuid, options)];
|
139
|
+
case 1:
|
140
|
+
cart = _a.sent();
|
138
141
|
if (cart) {
|
139
|
-
|
142
|
+
cartDueDate = new Date();
|
140
143
|
cartDueDate.setSeconds(cartDueDate.getSeconds() + cart.bookingDueDateRemainingSeconds);
|
141
144
|
if (cartDueDate > new Date() && !cart.hasIssuedTickets) {
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
+
this.cart = cart;
|
146
|
+
this.cartGuid = cart.guid;
|
147
|
+
this.bookingDueDate = cartDueDate; // See Booking class
|
145
148
|
// Update the sellerId. This is particularly important in Linkavel
|
146
|
-
|
149
|
+
this.updateSellerId(cart.sellerId);
|
147
150
|
// Fill the booking process status
|
148
|
-
|
151
|
+
this.bookingStepsToStatus = (0, processBookingSteps_1.processBookingSteps)(cart.stepsToStatus);
|
149
152
|
}
|
150
153
|
else {
|
151
154
|
// This should never happen, but just in case
|
152
|
-
|
155
|
+
this.resetBooking();
|
153
156
|
}
|
154
157
|
}
|
155
|
-
|
158
|
+
return [2 /*return*/];
|
159
|
+
}
|
156
160
|
});
|
157
161
|
});
|
158
162
|
};
|
@@ -302,7 +306,7 @@ var ServiceBooking = /** @class */ (function (_super) {
|
|
302
306
|
throw new Error("Could not fetch cart");
|
303
307
|
}
|
304
308
|
// Update storage
|
305
|
-
this.getStorage().getState().updateCartGuid(response.
|
309
|
+
this.getStorage().getState().updateCartGuid(response.cartGuid);
|
306
310
|
return [2 /*return*/, this.cart];
|
307
311
|
}
|
308
312
|
});
|
@@ -132,27 +132,31 @@ var SubscriptionBooking = /** @class */ (function (_super) {
|
|
132
132
|
};
|
133
133
|
SubscriptionBooking.prototype.fetchAndSetCart = function (cartGuid, options) {
|
134
134
|
return __awaiter(this, void 0, void 0, function () {
|
135
|
-
var
|
135
|
+
var cart, cartDueDate;
|
136
136
|
return __generator(this, function (_a) {
|
137
|
-
|
137
|
+
switch (_a.label) {
|
138
|
+
case 0: return [4 /*yield*/, this.fetchCart(cartGuid, options)];
|
139
|
+
case 1:
|
140
|
+
cart = _a.sent();
|
138
141
|
if (cart) {
|
139
|
-
|
142
|
+
cartDueDate = new Date();
|
140
143
|
cartDueDate.setSeconds(cartDueDate.getSeconds() + cart.bookingDueDateRemainingSeconds);
|
141
144
|
if (cartDueDate > new Date() && !cart.hasIssuedTickets) {
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
+
this.cart = cart;
|
146
|
+
this.cartGuid = cart.guid;
|
147
|
+
this.bookingDueDate = cartDueDate; // See Booking class
|
145
148
|
// Update the sellerId. This is particularly important in Linkavel
|
146
|
-
|
149
|
+
this.updateSellerId(cart.sellerId);
|
147
150
|
// Fill the booking process status
|
148
|
-
|
151
|
+
this.bookingStepsToStatus = (0, processBookingSteps_1.processBookingSteps)(cart.stepsToStatus);
|
149
152
|
}
|
150
153
|
else {
|
151
154
|
// This should never happen, but just in case
|
152
|
-
|
155
|
+
this.resetBooking();
|
153
156
|
}
|
154
157
|
}
|
155
|
-
|
158
|
+
return [2 /*return*/];
|
159
|
+
}
|
156
160
|
});
|
157
161
|
});
|
158
162
|
};
|
@@ -360,7 +364,7 @@ var SubscriptionBooking = /** @class */ (function (_super) {
|
|
360
364
|
throw new Error("Could not fetch cart");
|
361
365
|
}
|
362
366
|
// Update storage
|
363
|
-
this.getStorage().getState().updateCartGuid(response.
|
367
|
+
this.getStorage().getState().updateCartGuid(response.cartGuid);
|
364
368
|
return [2 /*return*/, this.cart];
|
365
369
|
}
|
366
370
|
});
|
@@ -132,27 +132,31 @@ var TplBooking = /** @class */ (function (_super) {
|
|
132
132
|
};
|
133
133
|
TplBooking.prototype.fetchAndSetCart = function (cartGuid, options) {
|
134
134
|
return __awaiter(this, void 0, void 0, function () {
|
135
|
-
var
|
135
|
+
var cart, cartDueDate;
|
136
136
|
return __generator(this, function (_a) {
|
137
|
-
|
137
|
+
switch (_a.label) {
|
138
|
+
case 0: return [4 /*yield*/, this.fetchCart(cartGuid, options)];
|
139
|
+
case 1:
|
140
|
+
cart = _a.sent();
|
138
141
|
if (cart) {
|
139
|
-
|
142
|
+
cartDueDate = new Date();
|
140
143
|
cartDueDate.setSeconds(cartDueDate.getSeconds() + cart.bookingDueDateRemainingSeconds);
|
141
144
|
if (cartDueDate > new Date() && !cart.hasIssuedTickets) {
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
+
this.cart = cart;
|
146
|
+
this.cartGuid = cart.guid;
|
147
|
+
this.bookingDueDate = cartDueDate; // See Booking class
|
145
148
|
// Update the sellerId. This is particularly important in Linkavel
|
146
|
-
|
149
|
+
this.updateSellerId(cart.sellerId);
|
147
150
|
// Fill the booking process status
|
148
|
-
|
151
|
+
this.bookingStepsToStatus = (0, processBookingSteps_1.processBookingSteps)(cart.stepsToStatus);
|
149
152
|
}
|
150
153
|
else {
|
151
154
|
// This should never happen, but just in case
|
152
|
-
|
155
|
+
this.resetBooking();
|
153
156
|
}
|
154
157
|
}
|
155
|
-
|
158
|
+
return [2 /*return*/];
|
159
|
+
}
|
156
160
|
});
|
157
161
|
});
|
158
162
|
};
|
@@ -359,7 +363,7 @@ var TplBooking = /** @class */ (function (_super) {
|
|
359
363
|
throw new Error("Could not fetch cart");
|
360
364
|
}
|
361
365
|
// Update storage
|
362
|
-
this.getStorage().getState().updateCartGuid(response.
|
366
|
+
this.getStorage().getState().updateCartGuid(response.cartGuid);
|
363
367
|
return [2 /*return*/, this.cart];
|
364
368
|
}
|
365
369
|
});
|