mts-booking-library 2.4.8 → 2.4.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.
- package/lib/booking/booking.d.ts +2 -2
- package/lib/booking/serviceBooking.d.ts +2 -2
- package/lib/booking/tplBooking.d.ts +2 -2
- package/lib/index.d.ts +1 -1
- package/lib/types/common/Cart.d.ts +5 -1
- package/lib/types/common/Person.d.ts +4 -6
- package/lib/types/common/Person.js +2 -1
- package/package.json +1 -1
package/lib/booking/booking.d.ts
CHANGED
@@ -3,7 +3,7 @@ import { ErrorResponse } from "../types/ErrorResponse";
|
|
3
3
|
import { Cart, CreateUpdateCartRequest, processedStepsToStatus } from "../types/common/Cart";
|
4
4
|
import { GetExtrasForBookingResponse, GetExtrasResponse } from "../types/common/Extra";
|
5
5
|
import { GetPaymentInformationFromGatewayResponse, GetSellerGatewaysResponse, PaymentMethods, IssueCartResponse } from "../types/common/Payment";
|
6
|
-
import {
|
6
|
+
import { GetBuyerPassengersDetailsResponse, GetPersonRequest, Person } from "../types/common/Person";
|
7
7
|
import { AddReductionRequest } from "../types/common/Reduction";
|
8
8
|
import { ApiCallOptions } from "../utils/apiCall";
|
9
9
|
export declare abstract class Booking {
|
@@ -63,7 +63,7 @@ export declare abstract class Booking {
|
|
63
63
|
* @param {GetPersonRequest} request The object containing the parameters to search the buyer.
|
64
64
|
* @returns An object of type {@link PersonDetails} containing the buyer information, or an {@link ErrorResponse} object in case of error.
|
65
65
|
*/
|
66
|
-
getPerson(request: GetPersonRequest, options?: ApiCallOptions): Promise<ErrorResponse |
|
66
|
+
getPerson(request: GetPersonRequest, options?: ApiCallOptions): Promise<ErrorResponse | Person>;
|
67
67
|
abstract addReduction(request: AddReductionRequest): Promise<ErrorResponse | boolean>;
|
68
68
|
abstract removeReduction(tripId: number): Promise<ErrorResponse | boolean>;
|
69
69
|
abstract useWallet(): Promise<ErrorResponse | boolean>;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { ErrorResponse } from "../types/ErrorResponse";
|
2
2
|
import { CreateUpdateCartRequest } from "../types/common/Cart";
|
3
|
-
import {
|
3
|
+
import { GetBuyerPassengersDetailsResponse, Person } from "../types/common/Person";
|
4
4
|
import { AddReductionRequest } from "../types/common/Reduction";
|
5
5
|
import { Service, ServiceTripsResponse } from "../types/services/Service";
|
6
6
|
import { CreateServiceCartRequest, ServiceCart } from "../types/services/ServiceCart";
|
@@ -110,7 +110,7 @@ export declare class ServiceBooking extends Booking {
|
|
110
110
|
* It should be null if the buyer data cannot be specified (see {@link GetBuyerPassengersDetailsResponse.buyerDataStatus}).
|
111
111
|
* @returns An {@link ErrorResponse} object in case of error, true otherwise.
|
112
112
|
*/
|
113
|
-
updateBuyerPassengersDetails(buyerDetails:
|
113
|
+
updateBuyerPassengersDetails(buyerDetails: Person | null, options?: ApiCallOptions): Promise<ErrorResponse | boolean>;
|
114
114
|
/**
|
115
115
|
* @description This method allows to add a reduction to the whole cart or to a single trip in the cart.
|
116
116
|
* @param request The information about the reduction to add
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { ErrorResponse } from "../types/ErrorResponse";
|
2
2
|
import { CreateUpdateCartRequest } from "../types/common/Cart";
|
3
3
|
import { City } from "../types/common/City";
|
4
|
-
import {
|
4
|
+
import { GetBuyerPassengersDetailsResponse, Person } from "../types/common/Person";
|
5
5
|
import { AddReductionRequest } from "../types/common/Reduction";
|
6
6
|
import { TariffType, TermsType } from "../types/common/Tariffs";
|
7
7
|
import { GetTariffsResponse } from "../types/tpl/GetTariffsResponse";
|
@@ -124,7 +124,7 @@ export declare class TplBooking extends Booking {
|
|
124
124
|
* with the subscription. This parameter is required if the cart contains a subscription.
|
125
125
|
* @returns An {@link ErrorResponse} object in case of error, true otherwise.
|
126
126
|
*/
|
127
|
-
updateBuyerPassengersDetails(buyerDetails:
|
127
|
+
updateBuyerPassengersDetails(buyerDetails: Person | null, subscriptionPersonCode?: string, options?: ApiCallOptions): Promise<ErrorResponse | boolean>;
|
128
128
|
/**
|
129
129
|
* @description This method allows to add a reduction to the whole cart or to a single trip in the cart.
|
130
130
|
* @param request The information about the reduction to add
|
package/lib/index.d.ts
CHANGED
@@ -5,7 +5,7 @@ export { SubscriptionBooking } from "./booking/subscriptionBooking";
|
|
5
5
|
export { TplBooking } from "./booking/tplBooking";
|
6
6
|
export { useMtsBookingState } from "./mtsStorage";
|
7
7
|
export { CreateUpdateCartRequest, CartBooking } from "./types/common/Cart";
|
8
|
-
export { Person,
|
8
|
+
export { Person, DEFAULT_PERSON, initializePerson } from "./types/common/Person";
|
9
9
|
export { GetBuyerPassengersDetailsResponse, GetPersonRequest, GetPassenger, BuyerDataStatus, EditPassengerRequestType, EditPassengersDetailsRequest } from "./types/common/Person";
|
10
10
|
export { Tariff, TariffsMatrix, TariffSummary, TariffType, TermsType, PassengerTariff, ExtraTariff } from "./types/common/Tariffs";
|
11
11
|
export { ReductionType, Reduction, AddReductionRequest } from "./types/common/Reduction";
|
@@ -20,7 +20,7 @@ export type CreateUpdateCartRequest = {
|
|
20
20
|
returnCartBooking?: CartBooking;
|
21
21
|
/** Whether the buyer has opposed to the collection of the SSN for this cart (possible in TPL). */
|
22
22
|
noSSN?: boolean;
|
23
|
-
/** The payment method that the final customer is using to pay
|
23
|
+
/** The payment method that the final customer is using to pay. Required when using {@link CreateUpdateCartRequest.noSSN} */
|
24
24
|
customerPaymentMethod?: PaymentMethods.CASH | PaymentMethods.CARD;
|
25
25
|
};
|
26
26
|
export type CartBooking = {
|
@@ -126,6 +126,10 @@ export type Cart = {
|
|
126
126
|
* The first element of the list is the default cash in method (and the preferred by the seller).
|
127
127
|
*/
|
128
128
|
cashInMethods: PaymentMethods[];
|
129
|
+
/**
|
130
|
+
* Whether the cart is not associated with a specific SSN.
|
131
|
+
*/
|
132
|
+
noSSN: boolean;
|
129
133
|
};
|
130
134
|
/** The type that {@link Cart.stepsToStatus} assumes once parsed to a map */
|
131
135
|
export type processedStepsToStatus = Map<Booking.BookingSteps, [boolean, boolean, boolean]>;
|
@@ -17,10 +17,8 @@ export type Person = {
|
|
17
17
|
personCode?: string;
|
18
18
|
/** The notes for this person. */
|
19
19
|
notes?: string;
|
20
|
-
|
21
|
-
|
22
|
-
/** The social security number of the buyer, if provided. */
|
23
|
-
socialSecurityNumber: string | null;
|
20
|
+
/** The social security number of the person. */
|
21
|
+
socialSecurityNumber?: string | null;
|
24
22
|
};
|
25
23
|
export declare const DEFAULT_PERSON: Person;
|
26
24
|
export declare const initializePerson: (person?: Person | undefined | null) => Person;
|
@@ -80,7 +78,7 @@ export type GetBuyerPassengersDetailsResponse = {
|
|
80
78
|
/** @deprecated Whether the form for the buyer data is required, optional or cannot be specified. */
|
81
79
|
buyerDataStatus: BuyerDataStatus;
|
82
80
|
/** The {@link Person} object representing the buyer. */
|
83
|
-
buyer:
|
81
|
+
buyer: Person | null;
|
84
82
|
/** Whether the buyer name and last name are required, optional or cannot be specified. */
|
85
83
|
buyerNameLastNameOption: PersonDataFieldStatus;
|
86
84
|
/** Whether the buyer email is required, optional or cannot be specified. */
|
@@ -113,5 +111,5 @@ export type EditPassengersDetailsRequest = {
|
|
113
111
|
* The {@link Person} object representing the buyer.
|
114
112
|
* It should be null if the buyer data cannot be specified (see {@link GetBuyerPassengersDetailsResponse.buyerDataStatus}).
|
115
113
|
*/
|
116
|
-
buyer:
|
114
|
+
buyer: Person | null;
|
117
115
|
};
|