sm-types 1.9.0 → 1.9.2

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/common/enums.d.ts CHANGED
@@ -93,3 +93,8 @@ export interface ITagStatus {
93
93
  preReserveFailed: boolean;
94
94
  preReserveExpired: boolean;
95
95
  }
96
+ export declare enum BookingConfirmationStatus {
97
+ CONFIRMED = "CONFIRMED",
98
+ FAILED = "FAILED",
99
+ NOT_SURE = "NOT_SURE"
100
+ }
package/common/enums.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OfferStatus = exports.ServiceType = exports.BookingStatus = exports.NavanStatus = exports.BookingFeeStatus = exports.EmailType = exports.IndicationStatus = exports.IndicationRewardStatus = exports.JustificationPolicy = exports.CabinClass = exports.DealOwnerEnum = exports.SuppliersEnum = exports.RentabilityTypeEnum = exports.TravelCustomFieldEnum = void 0;
3
+ exports.BookingConfirmationStatus = exports.OfferStatus = exports.ServiceType = exports.BookingStatus = exports.NavanStatus = exports.BookingFeeStatus = exports.EmailType = exports.IndicationStatus = exports.IndicationRewardStatus = exports.JustificationPolicy = exports.CabinClass = exports.DealOwnerEnum = exports.SuppliersEnum = exports.RentabilityTypeEnum = exports.TravelCustomFieldEnum = void 0;
4
4
  var TravelCustomFieldEnum;
5
5
  (function (TravelCustomFieldEnum) {
6
6
  TravelCustomFieldEnum["TRIP_PURPOSE"] = "TRIP_PURPOSE";
@@ -102,3 +102,9 @@ var OfferStatus;
102
102
  OfferStatus["EMITTED"] = "EMITTED";
103
103
  OfferStatus["CANCELED"] = "CANCELED";
104
104
  })(OfferStatus = exports.OfferStatus || (exports.OfferStatus = {}));
105
+ var BookingConfirmationStatus;
106
+ (function (BookingConfirmationStatus) {
107
+ BookingConfirmationStatus["CONFIRMED"] = "CONFIRMED";
108
+ BookingConfirmationStatus["FAILED"] = "FAILED";
109
+ BookingConfirmationStatus["NOT_SURE"] = "NOT_SURE";
110
+ })(BookingConfirmationStatus = exports.BookingConfirmationStatus || (exports.BookingConfirmationStatus = {}));
package/common/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { ISmCarContractDetails, ISmCarDetails, ISmCarRentalDetails, ISmCarSupplierInfo } from '../sm-car-rentals';
1
2
  import { EventPrivacy } from '../sm-company-events/enums';
2
3
  import { CabinClass, JustificationPolicy } from './enums';
3
4
  import * as SharedTypes from './shared';
@@ -179,8 +180,16 @@ export interface IHotelJSON {
179
180
  mainPictureUrl: string;
180
181
  freeCancelationUntil: Date;
181
182
  }
183
+ export type additionalDriver = {
184
+ userToken: string;
185
+ firstName: string;
186
+ lastName: string;
187
+ email: string;
188
+ cpf: Nullable<string>;
189
+ };
182
190
  export interface ICarJSON {
183
191
  search: IOfferSearch;
192
+ additionalDrivers: additionalDriver[];
184
193
  pickup: {
185
194
  date: string;
186
195
  time: string;
@@ -199,64 +208,10 @@ export interface ICarJSON {
199
208
  storeCode: number;
200
209
  storeName: string;
201
210
  };
202
- carDetails: {
203
- type: string;
204
- class: string;
205
- image: string;
206
- features: {
207
- abs: unknown;
208
- air: boolean;
209
- doors: number;
210
- airbag: unknown;
211
- baggages: unknown;
212
- steering: unknown;
213
- passengers: number;
214
- transmission: string;
215
- };
216
- sippCode: string;
217
- modelTitle: string;
218
- modelDescription: string;
219
- supplierCarGroupCode: string;
220
- };
221
- supplierInfo: {
222
- id: number;
223
- supplier: string;
224
- };
225
- rentalDetails: {
226
- id: string;
227
- logo: string;
228
- name: string;
229
- };
230
- contractDetails: {
231
- features: {
232
- ali: boolean;
233
- ldw: boolean;
234
- unlimitedKm: boolean;
235
- mandatoryDriverCreditCard: number;
236
- };
237
- feesInfo: any[];
238
- dailyInfo: {
239
- total: unknown;
240
- discount: number;
241
- netPrice: unknown;
242
- quantity: unknown;
243
- rawPrice: unknown;
244
- };
245
- extraHoursInfo: {
246
- total: number;
247
- discount: number;
248
- netPrice: number;
249
- quantity: number;
250
- rawPrice: number;
251
- };
252
- finalPriceInfo: {
253
- discount: number;
254
- netTotal: number;
255
- rawTotal: number;
256
- };
257
- additionalsInfo: any[];
258
- freeCancelationUntil: Date;
259
- };
211
+ carDetails: ISmCarDetails;
212
+ supplierInfo: ISmCarSupplierInfo;
213
+ rentalDetails: ISmCarRentalDetails;
214
+ contractDetails: ISmCarContractDetails;
260
215
  }
261
216
  export interface IFlightSearchMetadata {
262
217
  average_price: number;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "author": "Smartrips",
4
4
  "license": "ISC",
5
5
  "keywords": [],
6
- "version": "1.9.0",
6
+ "version": "1.9.2",
7
7
  "description": "",
8
8
  "repository": {
9
9
  "type": "git",
@@ -0,0 +1,153 @@
1
+ export interface IBusFilterInfo {
2
+ departureFiltersInfo: IBusTripFilterInfo;
3
+ returnFiltersInfo: IBusTripFilterInfo;
4
+ }
5
+ export interface IBusTripFilterInfo {
6
+ maxPrice: number;
7
+ minPrice: number;
8
+ categories: IBusPartInfo[];
9
+ departureTerminals: ITerminal[];
10
+ arrivalTerminals: ITerminal[];
11
+ companies: any[];
12
+ }
13
+ export interface IBusLocality {
14
+ cityName: string;
15
+ stateName: string;
16
+ }
17
+ export declare enum BusTripType {
18
+ DEPARTURES = "departures",
19
+ RETURNS = "returns"
20
+ }
21
+ export interface ISmClickBusOffer {
22
+ origin: ILocation;
23
+ destination: ILocation;
24
+ filters: IFilters;
25
+ availableDaysWeek: IAvailableDaysWeek;
26
+ pageLimited: boolean;
27
+ departures: ITripConnection[];
28
+ returns: ITripConnection[];
29
+ }
30
+ export interface ITerminal {
31
+ name: string;
32
+ slug: string;
33
+ terminalName: string;
34
+ terminalAddress: string;
35
+ phone: string;
36
+ cityName: string;
37
+ stateCode: string;
38
+ stateName: string;
39
+ countryCode: string;
40
+ countryName: string;
41
+ hasLandingPage: boolean;
42
+ }
43
+ export interface ITravelCompany {
44
+ name: string;
45
+ logo: string;
46
+ slug: string;
47
+ hasLandingPage: boolean;
48
+ id: string;
49
+ }
50
+ export interface IFilters {
51
+ departures: {
52
+ terminals: ITerminal[];
53
+ travelCompanies: ITravelCompany[];
54
+ };
55
+ returns: {
56
+ terminals: ITerminal[];
57
+ travelCompanies: ITravelCompany[];
58
+ };
59
+ }
60
+ export interface ILocation {
61
+ name: string;
62
+ slug: string;
63
+ terminalName: string;
64
+ cityName: string;
65
+ phone: string;
66
+ stateCode: string;
67
+ stateName: string;
68
+ countryCode: string;
69
+ countryName: string;
70
+ }
71
+ export interface IAvailableDaysWeek {
72
+ departures: string[];
73
+ returns: string[];
74
+ }
75
+ export interface ITripPart {
76
+ tripId: string;
77
+ duration: string;
78
+ currency: string;
79
+ price: number;
80
+ referencePrice: string;
81
+ originalPrice: string;
82
+ departure: {
83
+ schedule: {
84
+ date: string;
85
+ time: string;
86
+ timezone: string;
87
+ };
88
+ place: {
89
+ id: number;
90
+ name: string;
91
+ slug: string;
92
+ city: string;
93
+ state: string;
94
+ country: string;
95
+ terminal: string;
96
+ };
97
+ scheduleDateTime: number[];
98
+ };
99
+ arrival: {
100
+ schedule: {
101
+ date: string;
102
+ time: string;
103
+ timezone: string;
104
+ };
105
+ place: {
106
+ id: number;
107
+ name: string;
108
+ slug: string;
109
+ city: string;
110
+ state: string;
111
+ country: string;
112
+ terminal: string;
113
+ };
114
+ };
115
+ travelCompany: {
116
+ id: string;
117
+ name: string;
118
+ slug: string;
119
+ logo: string;
120
+ };
121
+ bus: IBusPartInfo;
122
+ availableSeats: number;
123
+ boardingPass: boolean;
124
+ electronicBoardingPass: boolean;
125
+ serviceNumber: string;
126
+ lowFare: boolean;
127
+ departureDateTime: number[];
128
+ isReservable: boolean;
129
+ }
130
+ export interface IBusPartInfo {
131
+ id: string;
132
+ name: string;
133
+ }
134
+ export interface ITripConnection {
135
+ from: string;
136
+ to: string;
137
+ type: string;
138
+ price: number;
139
+ referencePrice: string;
140
+ originalPrice: string;
141
+ waitingTime: string;
142
+ duration: string;
143
+ parts: ITripPart[];
144
+ roundedDiscountPercentageApplied: number;
145
+ discountPercentageApplied: number;
146
+ supplierCommission: number;
147
+ departure: string;
148
+ departureHour: string;
149
+ departureWeekDay: string;
150
+ arrival: string;
151
+ arrivalHour: string;
152
+ arrivalWeekDay: string;
153
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BusTripType = void 0;
4
+ var BusTripType;
5
+ (function (BusTripType) {
6
+ BusTripType["DEPARTURES"] = "departures";
7
+ BusTripType["RETURNS"] = "returns";
8
+ })(BusTripType = exports.BusTripType || (exports.BusTripType = {}));
@@ -1,4 +1,4 @@
1
- import { Nullable } from "../common";
1
+ import { BookingConfirmationStatus, Nullable } from "../common";
2
2
  export interface ISmCarsAgency {
3
3
  code: string;
4
4
  active: boolean;
@@ -52,7 +52,7 @@ export interface ISmCarDetails {
52
52
  supplierCarGroupCode: string;
53
53
  sippCode: string;
54
54
  }
55
- interface ISmCarContractFeatures {
55
+ export interface ISmCarContractFeatures {
56
56
  ldw: boolean;
57
57
  ali: boolean;
58
58
  unlimitedKm: boolean;
@@ -70,7 +70,9 @@ export interface ISmCarFeeInfo {
70
70
  total: number;
71
71
  }
72
72
  export interface ISmCarAdditionalPriceInfo {
73
+ code?: string;
73
74
  name: string;
75
+ dayCount: number;
74
76
  supplierCategory: string;
75
77
  supplierId: Nullable<string>;
76
78
  selected: boolean;
@@ -94,6 +96,9 @@ export interface ISmCarContractDetails {
94
96
  feesInfo: ISmCarFeeInfo[];
95
97
  additionalsInfo: ISmCarAdditionalPriceInfo[];
96
98
  finalPriceInfo: ISmCarFinalPriceInfo;
99
+ protectionAdditionals: ISmCarAdditionalPriceInfo[];
100
+ serviceAdditionals: ISmCarAdditionalPriceInfo[];
101
+ accessoryAdditionals: ISmCarAdditionalPriceInfo[];
97
102
  }
98
103
  export interface ISmCarSupplierInfo {
99
104
  id: string;
@@ -131,18 +136,18 @@ export interface OfferAddResponse {
131
136
  createdOffer: ISmCarCompleteOffer;
132
137
  }
133
138
  export interface OfferAddResponseData {
134
- status: string;
135
139
  data: OfferAddResponse;
136
- message?: string;
137
140
  }
138
141
  export interface ListOffersResponse {
139
142
  offers: ISmCarCompleteOffer[];
140
143
  expirationTime: Date;
141
144
  }
142
145
  export interface ListOffersResponseData {
143
- status: string;
144
146
  data: ListOffersResponse;
145
- message?: string;
147
+ }
148
+ export interface GetSupplierOfferResponse {
149
+ offer: ISmCarCompleteOffer;
150
+ expirationTime: Date;
146
151
  }
147
152
  export type CarReservationCustomerPhoneDto = {
148
153
  ddi: string;
@@ -205,4 +210,88 @@ export declare enum CarSupplier {
205
210
  LOCALIZA = "localiza",
206
211
  MOVIDA = "movida"
207
212
  }
213
+ export type ReserveOfferRequestDto = {
214
+ smOfferId: string;
215
+ customer: CarReservationCustomerDto;
216
+ paymentInfo: {
217
+ category: CarPaymentCategory;
218
+ };
219
+ };
220
+ export type DocumentData = {
221
+ type: string;
222
+ number: string;
223
+ expireDate?: string | null;
224
+ emissionCountry: string;
225
+ };
226
+ export declare enum CarPaymentCategory {
227
+ AGENCY_BILLED = "AGENCY_BILLED",
228
+ COMPANY_BILLED = "COMPANY_BILLED",
229
+ BALCONY = "BALCONY"
230
+ }
231
+ export declare enum ConfirmationStatus {
232
+ CONFIRMED = "confirmed",
233
+ FAILED = "failed",
234
+ NOT_SURE = "not_sure"
235
+ }
236
+ export interface IConfirmOfferResponse {
237
+ status: CarRentalsOfferStatus;
238
+ bookingCode: string;
239
+ }
240
+ export interface IReserveOfferResponse {
241
+ bookingCode: string;
242
+ confirmationStatus: ConfirmationStatus;
243
+ finalPrice: number;
244
+ }
245
+ export declare enum CarRentalsOfferStatus {
246
+ Added = "added",
247
+ Pending = "pending",
248
+ Booked = "booked",
249
+ Emitted = "emitted",
250
+ Canceled = "canceled",
251
+ Failed = "failed",
252
+ NotSure = "not_sure"
253
+ }
254
+ export type ReserveOfferResponseData = {
255
+ bookingCode: string;
256
+ confirmationStatus: BookingConfirmationStatus;
257
+ error?: any[];
258
+ };
259
+ export type CarRentalsResponse<T> = {
260
+ auditUuid?: string;
261
+ data?: T;
262
+ error?: any;
263
+ };
264
+ export type CancelOfferResponseData = {
265
+ error?: any[];
266
+ success: boolean;
267
+ bookingCode: string;
268
+ };
269
+ export interface ListOffersRequest {
270
+ pickupLatitude: string;
271
+ pickupLongitude: string;
272
+ pickupHour: number;
273
+ pickupMinute: number;
274
+ pickupDate: string | Date;
275
+ diffDropoff: boolean;
276
+ dropoffDate: string | Date;
277
+ dropoffLatitude?: string;
278
+ dropoffLongitude?: string;
279
+ dropoffHour: number;
280
+ dropoffMinute: number;
281
+ searchFilters: SearchFilters;
282
+ clientCredentials: ClientCarCredential[];
283
+ }
284
+ export interface SearchFilters {
285
+ minSearchRadius: number;
286
+ maxSearchRadius: number;
287
+ }
288
+ export type RecalculateOfferAdditional = {
289
+ code: string;
290
+ category: string;
291
+ quantity?: string;
292
+ };
293
+ export type RecalculateCarOfferRequest = {
294
+ smOfferId: string;
295
+ additionals: RecalculateOfferAdditional[];
296
+ };
208
297
  export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CarSupplier = exports.CarPaymentCategory = exports.FeeType = exports.TransmissionType = exports.SteeringType = void 0;
3
+ exports.CarRentalsOfferStatus = exports.ConfirmationStatus = exports.CarSupplier = exports.CarPaymentCategory = exports.FeeType = exports.TransmissionType = exports.SteeringType = void 0;
4
4
  exports.SteeringType = {
5
5
  HYDRAULIC: "hydraulic",
6
6
  ELETRIC: "eletric",
@@ -25,3 +25,24 @@ var CarSupplier;
25
25
  CarSupplier["LOCALIZA"] = "localiza";
26
26
  CarSupplier["MOVIDA"] = "movida";
27
27
  })(CarSupplier = exports.CarSupplier || (exports.CarSupplier = {}));
28
+ (function (CarPaymentCategory) {
29
+ CarPaymentCategory["AGENCY_BILLED"] = "AGENCY_BILLED";
30
+ CarPaymentCategory["COMPANY_BILLED"] = "COMPANY_BILLED";
31
+ CarPaymentCategory["BALCONY"] = "BALCONY";
32
+ })(CarPaymentCategory = exports.CarPaymentCategory || (exports.CarPaymentCategory = {}));
33
+ var ConfirmationStatus;
34
+ (function (ConfirmationStatus) {
35
+ ConfirmationStatus["CONFIRMED"] = "confirmed";
36
+ ConfirmationStatus["FAILED"] = "failed";
37
+ ConfirmationStatus["NOT_SURE"] = "not_sure";
38
+ })(ConfirmationStatus = exports.ConfirmationStatus || (exports.ConfirmationStatus = {}));
39
+ var CarRentalsOfferStatus;
40
+ (function (CarRentalsOfferStatus) {
41
+ CarRentalsOfferStatus["Added"] = "added";
42
+ CarRentalsOfferStatus["Pending"] = "pending";
43
+ CarRentalsOfferStatus["Booked"] = "booked";
44
+ CarRentalsOfferStatus["Emitted"] = "emitted";
45
+ CarRentalsOfferStatus["Canceled"] = "canceled";
46
+ CarRentalsOfferStatus["Failed"] = "failed";
47
+ CarRentalsOfferStatus["NotSure"] = "not_sure";
48
+ })(CarRentalsOfferStatus = exports.CarRentalsOfferStatus || (exports.CarRentalsOfferStatus = {}));