mts-booking-library 1.3.8 → 1.3.10
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.
@@ -3,7 +3,7 @@ import { ErrorResponse } from "../types/ErrorResponse";
|
|
3
3
|
import { City } from "../types/common/City";
|
4
4
|
import { GetBuyerPassengersDetailsResponse, Person } from "../types/common/Person";
|
5
5
|
import { AddReductionRequest } from "../types/common/Reduction";
|
6
|
-
import { TermsType } from "../types/common/Tariffs";
|
6
|
+
import { TariffType, TermsType } from "../types/common/Tariffs";
|
7
7
|
import { GetTariffsResponse } from "../types/tpl/GetTariffsResponse";
|
8
8
|
import { SuperArea } from "../types/tpl/SuperArea";
|
9
9
|
import { TplCart } from "../types/tpl/TplCart";
|
@@ -95,6 +95,11 @@ export declare class TplBooking extends Booking {
|
|
95
95
|
* @returns An array of {@link TermsType} objects representing the available terms types if the call is successful, an {@link ErrorResponse} object otherwise.
|
96
96
|
*/
|
97
97
|
getTermsTypes(superAreaId: number): Promise<ErrorResponse | TermsType[]>;
|
98
|
+
/**
|
99
|
+
* This method fetches the list of tariff types in a given super area.
|
100
|
+
* @returns An array of {@link TariffType} objects representing the available tariff types if the call is successful, an {@link ErrorResponse} object otherwise.
|
101
|
+
*/
|
102
|
+
getTariffTypes(superAreaId: number): Promise<ErrorResponse | TariffType[]>;
|
98
103
|
/**
|
99
104
|
* This method fetches the list of available tariffs for the selected terms type in a given super area.
|
100
105
|
* @param {number} superAreaId The id of the super area (as returned by the {@link getSuperAreas} method).
|
@@ -249,10 +249,26 @@ var TplBooking = /** @class */ (function (_super) {
|
|
249
249
|
return __generator(this, function (_a) {
|
250
250
|
searchParams = new URLSearchParams({ superAreaId: superAreaId.toString() });
|
251
251
|
url = "".concat(this.config.API_ENDPOINT, "/v3_booking/tpl/termsTypesBySuperArea?").concat(searchParams);
|
252
|
+
return [2 /*return*/, this.callGetApi(url).then(function (response) {
|
253
|
+
return (0, ErrorResponse_1.objectIsMTSErrorResponse)(response) ? response : response.termsTypes;
|
254
|
+
})];
|
255
|
+
});
|
256
|
+
});
|
257
|
+
};
|
258
|
+
/**
|
259
|
+
* This method fetches the list of tariff types in a given super area.
|
260
|
+
* @returns An array of {@link TariffType} objects representing the available tariff types if the call is successful, an {@link ErrorResponse} object otherwise.
|
261
|
+
*/
|
262
|
+
TplBooking.prototype.getTariffTypes = function (superAreaId) {
|
263
|
+
return __awaiter(this, void 0, void 0, function () {
|
264
|
+
var searchParams, url;
|
265
|
+
return __generator(this, function (_a) {
|
266
|
+
searchParams = new URLSearchParams({ superAreaId: superAreaId.toString() });
|
267
|
+
url = "".concat(this.config.API_ENDPOINT, "/v3_booking/tpl/tariffTypesBySuperArea?").concat(searchParams);
|
252
268
|
return [2 /*return*/, this.callGetApi(url).then(function (response) {
|
253
269
|
return (0, ErrorResponse_1.objectIsMTSErrorResponse)(response)
|
254
270
|
? response
|
255
|
-
: response.
|
271
|
+
: response.tariffTypes;
|
256
272
|
})];
|
257
273
|
});
|
258
274
|
});
|
@@ -2,12 +2,14 @@
|
|
2
2
|
* @description Represents information about a service.
|
3
3
|
*
|
4
4
|
* @property {string} sellerName - The name of the seller offering the service.
|
5
|
+
* @property {string} sellerId - The id of the seller offering the service.
|
5
6
|
* @property {string} minimumTotalPrice - The minimum total price for booking the service, meaning the price if all passenger choose the cheapest tariff.
|
6
7
|
* @property {string} bookingProcessMessage - Optional message to be displayed to the user when booking this service.
|
7
8
|
* @property {boolean} isBookable - Indicates whether the service is bookable (true) or not (false).
|
8
9
|
*/
|
9
10
|
export type ServiceInfo = {
|
10
11
|
sellerName: string;
|
12
|
+
sellerId: string;
|
11
13
|
minimumTotalPrice: string;
|
12
14
|
bookingProcessMessage: string;
|
13
15
|
isBookable: boolean;
|