@odynn/awayz-core 0.2.33 → 0.3.0
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/AccountService-Ct4hShV-.js +2037 -0
- package/dist/DateFormats-DZD30Nea.js +4 -0
- package/dist/{_commonjsHelpers-B52_cu2H.js → _commonjsHelpers-MdHo5S7N.js} +2 -2
- package/dist/{AccountService-8OR0UkZ6.js → arrayExtensions-DlcBOj5a.js} +1338 -3360
- package/dist/assets/FlightBooking.css +1 -0
- package/dist/assets/HotelBooking.css +1 -0
- package/dist/assets/Menu.css +1 -0
- package/dist/components/Bookings/FlightBooking/FlightBooking.js +88 -0
- package/dist/components/Bookings/HotelBooking/HotelBooking.js +75 -0
- package/dist/components/CashValue/CashValue.js +519 -2173
- package/dist/components/CashValue/CashValue.stories.js +18 -17
- package/dist/components/Menu/Menu.js +2491 -0
- package/dist/configs/endpoints.js +4 -2
- package/dist/hooks/useAwayzAuth/useAwayzAuth.js +12 -11
- package/dist/hooks/useBookingManagement/useBookingManagement.js +79 -0
- package/dist/hooks/useBookingManagement/useBookingManagement.test.js +79 -0
- package/dist/hooks/useBookingManagement/useBookingManagement.types.js +1 -0
- package/dist/hooks/useSearchLimit.js +2 -1
- package/dist/hooks/useTripManagement/mocks/index.js +19 -0
- package/dist/hooks/useTripManagement/useTripManagement.js +190 -0
- package/dist/hooks/useTripManagement/useTripManagement.test.js +205 -0
- package/dist/hooks/useTripManagement/useTripManagement.types.js +1 -0
- package/dist/hooks/useWallet/useWallet.js +7 -6
- package/dist/hooks/useWallet/useWallet.test.js +17 -12851
- package/dist/index-COgXcb6p.js +1696 -0
- package/dist/{index-B7QVGqcx.js → index-Cv-wvFlM.js} +1 -1
- package/dist/lib/components/Bookings/FlightBooking/FlightBooking.d.ts +59 -0
- package/dist/lib/components/Bookings/HotelBooking/HotelBooking.d.ts +52 -0
- package/dist/lib/components/Menu/Menu.d.ts +13 -0
- package/dist/lib/configs/endpoints.d.ts +12 -0
- package/dist/lib/hooks/useBookingManagement/mocks/FlightBooking200.json.d.ts +312 -0
- package/dist/lib/hooks/useBookingManagement/mocks/HotelBooking200.json.d.ts +92 -0
- package/dist/lib/hooks/useBookingManagement/useBookingManagement.d.ts +11 -0
- package/dist/lib/hooks/useBookingManagement/useBookingManagement.test.d.ts +1 -0
- package/dist/lib/hooks/useBookingManagement/useBookingManagement.types.d.ts +49 -0
- package/dist/lib/hooks/useTripManagement/mocks/PastTrip200.json.d.ts +20 -0
- package/dist/lib/hooks/useTripManagement/mocks/UncategorisedBookings200.json.d.ts +123 -0
- package/dist/lib/hooks/useTripManagement/mocks/UpcomingTrip200.json.d.ts +20 -0
- package/dist/lib/hooks/useTripManagement/mocks/UpdatedTrip200.json.d.ts +18 -0
- package/dist/lib/hooks/useTripManagement/mocks/index.d.ts +5 -0
- package/dist/lib/hooks/useTripManagement/useTripManagement.d.ts +9 -0
- package/dist/lib/hooks/useTripManagement/useTripManagement.test.d.ts +1 -0
- package/dist/lib/hooks/useTripManagement/useTripManagement.types.d.ts +109 -0
- package/dist/lib/main.d.ts +1 -0
- package/dist/lib/services/bookings/BookingService.d.ts +10 -0
- package/dist/lib/services/bookings/BookingService.types.d.ts +110 -0
- package/dist/lib/services/trips/TripService.types.d.ts +124 -0
- package/dist/lib/services/trips/TripsService.d.ts +19 -0
- package/dist/main.js +23 -20
- package/dist/providers/AwayzProvider.js +8 -7
- package/dist/services/account/AccountService.js +3 -2
- package/dist/services/bookings/BookingService.js +51 -0
- package/dist/services/bookings/BookingService.types.js +1 -0
- package/dist/services/currency/CurrencyService.js +11 -10
- package/dist/services/index.js +1 -1
- package/dist/services/instance.js +4 -3
- package/dist/services/instanceConfig.js +7 -6
- package/dist/services/noRetryInstance.js +1 -1
- package/dist/services/trips/TripService.types.js +9 -0
- package/dist/services/trips/TripsService.js +81 -0
- package/dist/services/wallet/WalletService.js +18 -23
- package/dist/tests/TestWrapper.js +2 -2
- package/dist/vi.ClIskdbk-k6t29WRA.js +12860 -0
- package/package.json +2 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { IContextOption } from '../../Menu/Menu';
|
|
2
|
+
interface IFlightBookingLocation {
|
|
3
|
+
airportCode: string;
|
|
4
|
+
location: string;
|
|
5
|
+
dateTime: Date;
|
|
6
|
+
}
|
|
7
|
+
export interface IFlightBookingProps {
|
|
8
|
+
/**
|
|
9
|
+
* An array of airlines involved in the flight booking
|
|
10
|
+
* Each airline has a logo and a name
|
|
11
|
+
*/
|
|
12
|
+
airlines: {
|
|
13
|
+
logo: string;
|
|
14
|
+
name: string;
|
|
15
|
+
}[];
|
|
16
|
+
/**
|
|
17
|
+
* The location and time of the flight's departure
|
|
18
|
+
*/
|
|
19
|
+
departure: IFlightBookingLocation;
|
|
20
|
+
/**
|
|
21
|
+
* The location and time of the flight's arrival
|
|
22
|
+
*/
|
|
23
|
+
arrival: IFlightBookingLocation;
|
|
24
|
+
/**
|
|
25
|
+
* The booking reference number for the flight
|
|
26
|
+
*/
|
|
27
|
+
bookingRef: string;
|
|
28
|
+
/**
|
|
29
|
+
* The class of the flight (e.g., Economy, Business, First Class)
|
|
30
|
+
*/
|
|
31
|
+
flightClass: string;
|
|
32
|
+
/**
|
|
33
|
+
* The number of passengers for this booking
|
|
34
|
+
*/
|
|
35
|
+
numberOfPassengers: number;
|
|
36
|
+
/**
|
|
37
|
+
* The date when the booking was cancelled, if applicable
|
|
38
|
+
*/
|
|
39
|
+
cancelledAt?: Date;
|
|
40
|
+
/**
|
|
41
|
+
* Indicates if there are pending airline changes for this booking
|
|
42
|
+
*/
|
|
43
|
+
hasAirlineChanges: boolean;
|
|
44
|
+
onClick?: () => void;
|
|
45
|
+
/**
|
|
46
|
+
* Context options to show in the menu
|
|
47
|
+
* Generally used for actions like "Cancel Booking", "Add to trip", etc.
|
|
48
|
+
* @default []
|
|
49
|
+
*/
|
|
50
|
+
contextOptions?: IContextOption[];
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* FlightBooking component displays details of a flight booking
|
|
54
|
+
* including airlines, departure and arrival information, booking reference,
|
|
55
|
+
* flight class, number of passengers, and cancellation status.
|
|
56
|
+
* It also provides a menu for additional actions if context options are provided.
|
|
57
|
+
*/
|
|
58
|
+
export declare const FlightBooking: ({ airlines, departure, arrival, bookingRef, flightClass, numberOfPassengers, cancelledAt, hasAirlineChanges, onClick, contextOptions }: IFlightBookingProps) => import("react/jsx-runtime").JSX.Element;
|
|
59
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { IContextOption } from '../../Menu/Menu';
|
|
2
|
+
export interface IHotelBookingProps {
|
|
3
|
+
/**
|
|
4
|
+
* The name of the hotel booked
|
|
5
|
+
*/
|
|
6
|
+
hotelName: string;
|
|
7
|
+
/**
|
|
8
|
+
* The number of guests for the booking
|
|
9
|
+
*/
|
|
10
|
+
numberOfGuests: number;
|
|
11
|
+
/**
|
|
12
|
+
* The number of rooms booked
|
|
13
|
+
*/
|
|
14
|
+
numberOfRooms: number;
|
|
15
|
+
/**
|
|
16
|
+
* The number of nights booked
|
|
17
|
+
*/
|
|
18
|
+
numberOfNights: number;
|
|
19
|
+
/**
|
|
20
|
+
* The booking reference number for the hotel
|
|
21
|
+
*/
|
|
22
|
+
bookingRef: string;
|
|
23
|
+
/**
|
|
24
|
+
* The address of the hotel
|
|
25
|
+
*/
|
|
26
|
+
address?: string;
|
|
27
|
+
/**
|
|
28
|
+
* The image URL of the hotel
|
|
29
|
+
*/
|
|
30
|
+
hotelImage?: string;
|
|
31
|
+
/**
|
|
32
|
+
* The date when the booking was cancelled, if applicable
|
|
33
|
+
*/
|
|
34
|
+
cancelledAt?: Date;
|
|
35
|
+
onClick?: () => void;
|
|
36
|
+
/**
|
|
37
|
+
* Context options to show in the menu
|
|
38
|
+
* Generally used for actions like "Cancel Booking", "Add to trip", etc.
|
|
39
|
+
* @default []
|
|
40
|
+
*/
|
|
41
|
+
contextOptions?: IContextOption[];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* HotelBooking component displays details of a hotel booking
|
|
45
|
+
*
|
|
46
|
+
* It includes hotel name, address, number of guests, rooms, nights,
|
|
47
|
+
* booking reference, and an image of the hotel.
|
|
48
|
+
* It also shows a cancellation notice if the booking was cancelled.
|
|
49
|
+
*
|
|
50
|
+
* It can display a menu with context options for actions related to the booking.
|
|
51
|
+
*/
|
|
52
|
+
export declare const HotelBooking: ({ hotelName, address, hotelImage, numberOfGuests, numberOfRooms, numberOfNights, bookingRef, cancelledAt, onClick, contextOptions }: IHotelBookingProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface IContextOption {
|
|
2
|
+
label: string;
|
|
3
|
+
action?: () => void;
|
|
4
|
+
subOptions?: {
|
|
5
|
+
label: string;
|
|
6
|
+
action: () => void;
|
|
7
|
+
}[];
|
|
8
|
+
}
|
|
9
|
+
interface IMenuProps {
|
|
10
|
+
options: IContextOption[];
|
|
11
|
+
}
|
|
12
|
+
declare const Menu: ({ options }: IMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default Menu;
|
|
@@ -31,3 +31,15 @@ export declare enum EWalletEndpoints {
|
|
|
31
31
|
BANKS = "banks",
|
|
32
32
|
CARDS = "cards"
|
|
33
33
|
}
|
|
34
|
+
export declare enum EMyTripsEndpoints {
|
|
35
|
+
TRIPS = "user/trips",
|
|
36
|
+
ADD_BOOKING = "user/trips/add-booking-to-trip",
|
|
37
|
+
UNCATEGORISED_BOOKINGS = "/user/trips/get-uncategorized-bookings"
|
|
38
|
+
}
|
|
39
|
+
export declare enum EBookingEndpoints {
|
|
40
|
+
USER_HOTEL_BOOKINGS = "/user/bookings/hotels",
|
|
41
|
+
USER_FLIGHT_BOOKINGS = "/user/bookings/flights",
|
|
42
|
+
INITIATE_FLIGHT_CANCEL = "/duffel/flights/initiate-order-cancellation",
|
|
43
|
+
CONFIRM_FLIGHT_CANCEL = "/duffel/flights/confirm-order-cancellation",
|
|
44
|
+
CANCEL_HOTEL_BOOKING = "/duffel/hotels/cancel"
|
|
45
|
+
}
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"data": {
|
|
3
|
+
"_id": "6811290ef16af25943018944",
|
|
4
|
+
"flight_offer_id": "off_0000AtaoutgusFy7zHL7pJ",
|
|
5
|
+
"user_id": "67d82b1c52c4a4dbe4e640c0",
|
|
6
|
+
"status": "flight confirmed",
|
|
7
|
+
"available_actions": ["cancel", "change", "update"],
|
|
8
|
+
"total_currency": "USD",
|
|
9
|
+
"arrival_date": "2025-05-28T21:46:00.000Z",
|
|
10
|
+
"base_amount": "196.19",
|
|
11
|
+
"extras_amount": "0.00",
|
|
12
|
+
"extras_currency": "USD",
|
|
13
|
+
"base_currency": "USD",
|
|
14
|
+
"conditions": {
|
|
15
|
+
"refund_before_departure": {
|
|
16
|
+
"penalty_currency": null,
|
|
17
|
+
"penalty_amount": null,
|
|
18
|
+
"allowed": false
|
|
19
|
+
},
|
|
20
|
+
"change_before_departure": {
|
|
21
|
+
"penalty_currency": "GBP",
|
|
22
|
+
"penalty_amount": "30.00",
|
|
23
|
+
"allowed": true
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"departure_date": "2025-05-28T18:54:00.000Z",
|
|
27
|
+
"passengers": [{ "id": "pas_0000AtaoutTnf1TdKbCeNV", "type": null }],
|
|
28
|
+
"slices": [
|
|
29
|
+
{
|
|
30
|
+
"carriers": {
|
|
31
|
+
"marketing": ["Duffel Airways"],
|
|
32
|
+
"operating": ["Duffel Airways"]
|
|
33
|
+
},
|
|
34
|
+
"id": "sli_0000AtaoutgusFy7zHL7pI",
|
|
35
|
+
"origin": "JFK",
|
|
36
|
+
"destination": "LAX",
|
|
37
|
+
"fare_brand_name": null
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"tax_amount": "35.31",
|
|
41
|
+
"tax_currency": "USD",
|
|
42
|
+
"total_amount": "231.50",
|
|
43
|
+
"type": "instant",
|
|
44
|
+
"synced_at": "2025-04-29T19:31:52Z",
|
|
45
|
+
"order_id": "ord_0000AtapDdwhJRoTNzMZrU",
|
|
46
|
+
"booking_reference": "4LGE5O",
|
|
47
|
+
"cancelled_at": null,
|
|
48
|
+
"payment_status": {
|
|
49
|
+
"paid_at": "2025-04-29T19:31:52Z",
|
|
50
|
+
"price_guarantee_expires_at": null,
|
|
51
|
+
"payment_required_by": null,
|
|
52
|
+
"awaiting_payment": false
|
|
53
|
+
},
|
|
54
|
+
"documents": [
|
|
55
|
+
{
|
|
56
|
+
"passenger_ids": ["pas_0000AtaoutTnf1TdKbCeNV"],
|
|
57
|
+
"unique_identifier": "1",
|
|
58
|
+
"type": "electronic_ticket"
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"services": [],
|
|
62
|
+
"createdAt": "2025-04-29T19:31:26.348Z",
|
|
63
|
+
"updatedAt": "2025-04-29T19:31:52.467Z",
|
|
64
|
+
"__v": 0,
|
|
65
|
+
"data": {
|
|
66
|
+
"void_window_ends_at": null,
|
|
67
|
+
"documents": [
|
|
68
|
+
{
|
|
69
|
+
"passenger_ids": ["pas_0000AtaoutTnf1TdKbCeNV"],
|
|
70
|
+
"unique_identifier": "1",
|
|
71
|
+
"type": "electronic_ticket"
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
"synced_at": "2025-04-29T19:31:52Z",
|
|
75
|
+
"available_actions": ["update"],
|
|
76
|
+
"airline_initiated_changes": [],
|
|
77
|
+
"cancellation": null,
|
|
78
|
+
"tax_currency": "USD",
|
|
79
|
+
"base_currency": "USD",
|
|
80
|
+
"base_amount": "196.19",
|
|
81
|
+
"tax_amount": "35.31",
|
|
82
|
+
"total_currency": "USD",
|
|
83
|
+
"offer_id": "off_0000AtaoutgusFy7zHL7pJ",
|
|
84
|
+
"booking_reference": "4LGE5O",
|
|
85
|
+
"created_at": "2025-04-29T19:31:52.316759Z",
|
|
86
|
+
"payment_status": {
|
|
87
|
+
"paid_at": "2025-04-29T19:31:52Z",
|
|
88
|
+
"price_guarantee_expires_at": null,
|
|
89
|
+
"payment_required_by": null,
|
|
90
|
+
"awaiting_payment": false
|
|
91
|
+
},
|
|
92
|
+
"live_mode": false,
|
|
93
|
+
"total_amount": "231.50",
|
|
94
|
+
"slices": [
|
|
95
|
+
{
|
|
96
|
+
"destination_type": "airport",
|
|
97
|
+
"origin_type": "airport",
|
|
98
|
+
"fare_brand_name": "Basic",
|
|
99
|
+
"segments": [
|
|
100
|
+
{
|
|
101
|
+
"origin_terminal": "2",
|
|
102
|
+
"destination_terminal": "1",
|
|
103
|
+
"aircraft": {
|
|
104
|
+
"iata_code": "773",
|
|
105
|
+
"name": "Boeing 777-300",
|
|
106
|
+
"id": "arc_00009VMF8AhXSSRnQDI6HE"
|
|
107
|
+
},
|
|
108
|
+
"departing_at": "2025-05-28T20:54:00",
|
|
109
|
+
"arriving_at": "2025-05-28T23:46:00",
|
|
110
|
+
"operating_carrier": {
|
|
111
|
+
"logo_symbol_url": "https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/ZZ.svg",
|
|
112
|
+
"logo_lockup_url": null,
|
|
113
|
+
"conditions_of_carriage_url": "https://duffelairways.com/dummy-url/conditions-of-carriage",
|
|
114
|
+
"iata_code": "ZZ",
|
|
115
|
+
"name": "Duffel Airways",
|
|
116
|
+
"id": "arl_00009VME7D6ivUu8dn35WK"
|
|
117
|
+
},
|
|
118
|
+
"marketing_carrier": {
|
|
119
|
+
"logo_symbol_url": "https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/ZZ.svg",
|
|
120
|
+
"logo_lockup_url": null,
|
|
121
|
+
"conditions_of_carriage_url": "https://duffelairways.com/dummy-url/conditions-of-carriage",
|
|
122
|
+
"iata_code": "ZZ",
|
|
123
|
+
"name": "Duffel Airways",
|
|
124
|
+
"id": "arl_00009VME7D6ivUu8dn35WK"
|
|
125
|
+
},
|
|
126
|
+
"stops": [],
|
|
127
|
+
"operating_carrier_flight_number": "2682",
|
|
128
|
+
"marketing_carrier_flight_number": "2682",
|
|
129
|
+
"distance": "3974.2717774447433",
|
|
130
|
+
"passengers": [
|
|
131
|
+
{
|
|
132
|
+
"baggages": [
|
|
133
|
+
{ "quantity": 1, "type": "checked" },
|
|
134
|
+
{ "quantity": 1, "type": "carry_on" }
|
|
135
|
+
],
|
|
136
|
+
"cabin_class_marketing_name": "Economy",
|
|
137
|
+
"passenger_id": "pas_0000AtaoutTnf1TdKbCeNV",
|
|
138
|
+
"seat": null,
|
|
139
|
+
"cabin_class": "economy"
|
|
140
|
+
}
|
|
141
|
+
],
|
|
142
|
+
"duration": "PT5H52M",
|
|
143
|
+
"destination": {
|
|
144
|
+
"city_name": "Los Angeles",
|
|
145
|
+
"icao_code": "KLAX",
|
|
146
|
+
"iata_country_code": "US",
|
|
147
|
+
"iata_code": "LAX",
|
|
148
|
+
"iata_city_code": "LAX",
|
|
149
|
+
"latitude": 33.942045,
|
|
150
|
+
"longitude": -118.408263,
|
|
151
|
+
"city": {
|
|
152
|
+
"city_name": null,
|
|
153
|
+
"icao_code": null,
|
|
154
|
+
"iata_country_code": "US",
|
|
155
|
+
"iata_code": "LAX",
|
|
156
|
+
"iata_city_code": "LAX",
|
|
157
|
+
"latitude": null,
|
|
158
|
+
"longitude": null,
|
|
159
|
+
"time_zone": null,
|
|
160
|
+
"type": "city",
|
|
161
|
+
"name": "Los Angeles",
|
|
162
|
+
"id": "cit_lax_us"
|
|
163
|
+
},
|
|
164
|
+
"time_zone": "America/Los_Angeles",
|
|
165
|
+
"type": "airport",
|
|
166
|
+
"name": "Los Angeles International Airport",
|
|
167
|
+
"id": "arp_lax_us"
|
|
168
|
+
},
|
|
169
|
+
"origin": {
|
|
170
|
+
"city_name": "New York",
|
|
171
|
+
"icao_code": "KJFK",
|
|
172
|
+
"iata_country_code": "US",
|
|
173
|
+
"iata_code": "JFK",
|
|
174
|
+
"iata_city_code": "NYC",
|
|
175
|
+
"latitude": 40.640556,
|
|
176
|
+
"longitude": -73.778519,
|
|
177
|
+
"city": {
|
|
178
|
+
"city_name": null,
|
|
179
|
+
"icao_code": null,
|
|
180
|
+
"iata_country_code": "US",
|
|
181
|
+
"iata_code": "NYC",
|
|
182
|
+
"iata_city_code": "NYC",
|
|
183
|
+
"latitude": null,
|
|
184
|
+
"longitude": null,
|
|
185
|
+
"time_zone": null,
|
|
186
|
+
"type": "city",
|
|
187
|
+
"name": "New York",
|
|
188
|
+
"id": "cit_nyc_us"
|
|
189
|
+
},
|
|
190
|
+
"time_zone": "America/New_York",
|
|
191
|
+
"type": "airport",
|
|
192
|
+
"name": "John F. Kennedy International Airport",
|
|
193
|
+
"id": "arp_jfk_us"
|
|
194
|
+
},
|
|
195
|
+
"id": "seg_0000AtaoutgusFy7zHL7pH"
|
|
196
|
+
}
|
|
197
|
+
],
|
|
198
|
+
"conditions": {
|
|
199
|
+
"change_before_departure": {
|
|
200
|
+
"penalty_currency": "GBP",
|
|
201
|
+
"penalty_amount": "30.00",
|
|
202
|
+
"allowed": true
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
"duration": "PT5H52M",
|
|
206
|
+
"destination": {
|
|
207
|
+
"city_name": "Los Angeles",
|
|
208
|
+
"icao_code": "KLAX",
|
|
209
|
+
"iata_country_code": "US",
|
|
210
|
+
"iata_code": "LAX",
|
|
211
|
+
"iata_city_code": "LAX",
|
|
212
|
+
"latitude": 33.942045,
|
|
213
|
+
"longitude": -118.408263,
|
|
214
|
+
"city": {
|
|
215
|
+
"city_name": null,
|
|
216
|
+
"icao_code": null,
|
|
217
|
+
"iata_country_code": "US",
|
|
218
|
+
"iata_code": "LAX",
|
|
219
|
+
"iata_city_code": "LAX",
|
|
220
|
+
"latitude": null,
|
|
221
|
+
"longitude": null,
|
|
222
|
+
"time_zone": null,
|
|
223
|
+
"type": "city",
|
|
224
|
+
"name": "Los Angeles",
|
|
225
|
+
"id": "cit_lax_us"
|
|
226
|
+
},
|
|
227
|
+
"time_zone": "America/Los_Angeles",
|
|
228
|
+
"type": "airport",
|
|
229
|
+
"name": "Los Angeles International Airport",
|
|
230
|
+
"id": "arp_lax_us"
|
|
231
|
+
},
|
|
232
|
+
"origin": {
|
|
233
|
+
"city_name": "New York",
|
|
234
|
+
"icao_code": "KJFK",
|
|
235
|
+
"iata_country_code": "US",
|
|
236
|
+
"iata_code": "JFK",
|
|
237
|
+
"iata_city_code": "NYC",
|
|
238
|
+
"latitude": 40.640556,
|
|
239
|
+
"longitude": -73.778519,
|
|
240
|
+
"city": {
|
|
241
|
+
"city_name": null,
|
|
242
|
+
"icao_code": null,
|
|
243
|
+
"iata_country_code": "US",
|
|
244
|
+
"iata_code": "NYC",
|
|
245
|
+
"iata_city_code": "NYC",
|
|
246
|
+
"latitude": null,
|
|
247
|
+
"longitude": null,
|
|
248
|
+
"time_zone": null,
|
|
249
|
+
"type": "city",
|
|
250
|
+
"name": "New York",
|
|
251
|
+
"id": "cit_nyc_us"
|
|
252
|
+
},
|
|
253
|
+
"time_zone": "America/New_York",
|
|
254
|
+
"type": "airport",
|
|
255
|
+
"name": "John F. Kennedy International Airport",
|
|
256
|
+
"id": "arp_jfk_us"
|
|
257
|
+
},
|
|
258
|
+
"id": "sli_0000AtaoutgusFy7zHL7pI"
|
|
259
|
+
}
|
|
260
|
+
],
|
|
261
|
+
"passengers": [
|
|
262
|
+
{
|
|
263
|
+
"born_on": "2007-04-29",
|
|
264
|
+
"loyalty_programme_accounts": [],
|
|
265
|
+
"family_name": "Botha",
|
|
266
|
+
"given_name": "Adriaan",
|
|
267
|
+
"gender": "m",
|
|
268
|
+
"infant_passenger_id": null,
|
|
269
|
+
"phone_number": "+12345642342",
|
|
270
|
+
"user_id": null,
|
|
271
|
+
"email": "adriaan.botha@typedev.co.za",
|
|
272
|
+
"title": "mr",
|
|
273
|
+
"type": "adult",
|
|
274
|
+
"id": "pas_0000AtaoutTnf1TdKbCeNV"
|
|
275
|
+
}
|
|
276
|
+
],
|
|
277
|
+
"conditions": {
|
|
278
|
+
"refund_before_departure": {
|
|
279
|
+
"penalty_currency": null,
|
|
280
|
+
"penalty_amount": null,
|
|
281
|
+
"allowed": false
|
|
282
|
+
},
|
|
283
|
+
"change_before_departure": {
|
|
284
|
+
"penalty_currency": "GBP",
|
|
285
|
+
"penalty_amount": "30.00",
|
|
286
|
+
"allowed": true
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
"cancelled_at": null,
|
|
290
|
+
"changes": [],
|
|
291
|
+
"content": "managed",
|
|
292
|
+
"services": [],
|
|
293
|
+
"users": ["icu_0000Asbm8q0FlWOhf0fDUm"],
|
|
294
|
+
"metadata": null,
|
|
295
|
+
"type": "instant",
|
|
296
|
+
"owner": {
|
|
297
|
+
"logo_symbol_url": "https://assets.duffel.com/img/airlines/for-light-background/full-color-logo/ZZ.svg",
|
|
298
|
+
"logo_lockup_url": null,
|
|
299
|
+
"conditions_of_carriage_url": "https://duffelairways.com/dummy-url/conditions-of-carriage",
|
|
300
|
+
"iata_code": "ZZ",
|
|
301
|
+
"name": "Duffel Airways",
|
|
302
|
+
"id": "arl_00009VME7D6ivUu8dn35WK"
|
|
303
|
+
},
|
|
304
|
+
"id": "ord_0000AtapDdwhJRoTNzMZrU"
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
"message": "Flight booking found",
|
|
308
|
+
"success": true
|
|
309
|
+
}
|
|
310
|
+
;
|
|
311
|
+
|
|
312
|
+
export default _default;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"message": "Hotel booking found",
|
|
3
|
+
"success": true,
|
|
4
|
+
"data": {
|
|
5
|
+
"_id": "67f6c1dbbbc4c3c745210abb",
|
|
6
|
+
"user_id": "67d82b1c52c4a4dbe4e640c0",
|
|
7
|
+
"status": "availability confirmed",
|
|
8
|
+
"accommodation_id": "acc_0000AWPt1SGInbu4X9MWOg",
|
|
9
|
+
"number_of_guests": 2,
|
|
10
|
+
"rate_id": "rat_0000AsvJMj2fyryIptLP72",
|
|
11
|
+
"quote_id": "quo_0000AsvJOwZ3PPyHaFBszA",
|
|
12
|
+
"base_amount": "159.08",
|
|
13
|
+
"base_currency": "EUR",
|
|
14
|
+
"tax_amount": null,
|
|
15
|
+
"tax_currency": "EUR",
|
|
16
|
+
"fee_amount": "0.00",
|
|
17
|
+
"fee_currency": "EUR",
|
|
18
|
+
"total_amount": "159.08",
|
|
19
|
+
"total_currency": "EUR",
|
|
20
|
+
"check_in_date": "2025-04-29",
|
|
21
|
+
"check_out_date": "2025-04-30",
|
|
22
|
+
"images": [
|
|
23
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/141/226/276/VIENR_7187550009_H.jpg",
|
|
24
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/311/VIENR_7830110131_H.jpg",
|
|
25
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/406/VIENR_7831079802_H.jpg",
|
|
26
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/413/VIENR_7830110068_H.jpg",
|
|
27
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/750/603/VIENR_7836605121_H.jpg",
|
|
28
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/750/617/VIENR_7836587109_H.jpg",
|
|
29
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/750/623/VIENR_7836596533_H.jpg",
|
|
30
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/141/226/280/VIENR_7187549817_H.jpg",
|
|
31
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/750/589/VIENR_7836587064_H.jpg",
|
|
32
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/365/VIENR_7830109308_H.jpg",
|
|
33
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/152/865/319/VIENR_8279893960_H.jpg",
|
|
34
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/152/865/342/VIENR_8279862750_H.jpg",
|
|
35
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/303/VIENR_7830110109_H.jpg",
|
|
36
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/423/VIENR_7830110088_H.jpg",
|
|
37
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/152/865/325/VIENR_8279819269_H.jpg",
|
|
38
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/152/865/307/VIENR_8279804316_H.jpg",
|
|
39
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/152/865/312/VIENR_8279860525_H.jpg",
|
|
40
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/152/865/334/VIENR_8279819315_H.jpg",
|
|
41
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/153/641/860/VIENR_8454780814_H.jpg",
|
|
42
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/155/931/795/VIENR_8549019991_H.jpg",
|
|
43
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/339/VIENR_7830109664_H.jpg",
|
|
44
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/386/VIENR_7830109180_H.jpg",
|
|
45
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/444/VIENR_7830109282_H.jpg",
|
|
46
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/393/VIENR_7830109711_H.jpg",
|
|
47
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/331/VIENR_7830109210_H.jpg",
|
|
48
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/454/VIENR_7830109964_H.jpg",
|
|
49
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/345/VIENR_7831125904_H.jpg",
|
|
50
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/294/VIENR_7830109970_H.jpg",
|
|
51
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/358/VIENR_7830109736_H.jpg",
|
|
52
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/464/VIENR_7830109689_H.jpg",
|
|
53
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/319/VIENR_7830109259_H.jpg",
|
|
54
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/399/VIENR_7830109928_H.jpg",
|
|
55
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/750/599/VIENR_7836606896_H.jpg",
|
|
56
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/750/609/VIENR_7830109997_H.jpg",
|
|
57
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/750/585/VIENR_7836587084_H.jpg",
|
|
58
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/750/581/VIENR_7836611335_H.jpg",
|
|
59
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/433/VIENR_7830109875_H.jpg",
|
|
60
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/750/634/VIENR_7836608919_H.jpg",
|
|
61
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/325/VIENR_7830110062_H.jpg",
|
|
62
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/750/629/VIENR_7836587030_H.jpg",
|
|
63
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/721/373/VIENR_7830109903_H.jpg",
|
|
64
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/147/750/595/VIENR_7836596445_H.jpg",
|
|
65
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/7/0/164/563/809/VIENR_8953587933_H.jpg",
|
|
66
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/3/0/183/490/977/VIENR_9897245093_H.jpg",
|
|
67
|
+
"https://travelport.leonardocontentcloud.com/imageRepo/2/0/184/483/935/VIENR_8953599865_H.jpg"
|
|
68
|
+
],
|
|
69
|
+
"rooms": [
|
|
70
|
+
{
|
|
71
|
+
"beds": [],
|
|
72
|
+
"photo": [],
|
|
73
|
+
"total_amount": "159.08",
|
|
74
|
+
"name": "Standard Room When You Arrive At The Hotel We Will Do Our Best To Meet Your Room Type"
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"address": {
|
|
78
|
+
"line_one": "RECHTE WIENZEILE 87",
|
|
79
|
+
"city_name": "VIENNA",
|
|
80
|
+
"postal_code": "1050 ",
|
|
81
|
+
"country_code": "AT",
|
|
82
|
+
"region": null
|
|
83
|
+
},
|
|
84
|
+
"guests": [],
|
|
85
|
+
"created_at": "2025-04-09T18:52:11.461Z",
|
|
86
|
+
"updated_at": "2025-04-09T18:52:11.461Z",
|
|
87
|
+
"__v": 0
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
;
|
|
91
|
+
|
|
92
|
+
export default _default;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { EBookingType } from '../../services/trips/TripService.types';
|
|
2
|
+
import { IUseBookingManagement } from './useBookingManagement.types';
|
|
3
|
+
/**
|
|
4
|
+
* Custom hook to manage booking details and cancellation
|
|
5
|
+
* Provides functionality to fetch booking details and manage cancellations for both hotel and flight bookings
|
|
6
|
+
*
|
|
7
|
+
* @param bookingId - The ID of the booking to manage
|
|
8
|
+
* @param bookingType - The type of the booking (hotel or flight)
|
|
9
|
+
* @returns An object containing booking details, error states, and functions to manage cancellations
|
|
10
|
+
*/
|
|
11
|
+
export declare const useBookingManagement: (bookingId: string, bookingType: EBookingType) => IUseBookingManagement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { IFlightBookingDetails, IHotelBookingDetails } from '../../services/bookings/BookingService.types';
|
|
2
|
+
export interface IUseBookingManagement {
|
|
3
|
+
/**
|
|
4
|
+
* The booking details, which can be either hotel or flight booking details
|
|
5
|
+
*/
|
|
6
|
+
details: IHotelBookingDetails | IFlightBookingDetails | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Indicates if there was an error fetching the booking details
|
|
9
|
+
*/
|
|
10
|
+
isError: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* The error object if there was an error fetching the booking details
|
|
13
|
+
*/
|
|
14
|
+
error: Error | null;
|
|
15
|
+
/**
|
|
16
|
+
* Function to initiate the cancellation of a booking
|
|
17
|
+
* This is **ONLY** used for flight bookings
|
|
18
|
+
*/
|
|
19
|
+
initiateCancellation: () => void;
|
|
20
|
+
/**
|
|
21
|
+
* Indicates if the cancellation initiation request is pending
|
|
22
|
+
*/
|
|
23
|
+
isInitiatingCancellation: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Indicates if there was an error while initiating the cancellation
|
|
26
|
+
*/
|
|
27
|
+
isInitiateCancellationError: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* The error object if there was an error while initiating the cancellation
|
|
30
|
+
*/
|
|
31
|
+
initiateCancellationError: Error | null;
|
|
32
|
+
/**
|
|
33
|
+
* Function to cancel the booking
|
|
34
|
+
* This can be used for both flight and hotel bookings
|
|
35
|
+
*/
|
|
36
|
+
cancelBooking: () => void;
|
|
37
|
+
/**
|
|
38
|
+
* Indicates if the cancel booking request is pending
|
|
39
|
+
*/
|
|
40
|
+
isCancelingBooking: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Indicates if there was an error while canceling the booking
|
|
43
|
+
*/
|
|
44
|
+
isCancelBookingError: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* The error object if there was an error while canceling the booking
|
|
47
|
+
*/
|
|
48
|
+
cancelBookingError: Error | null;
|
|
49
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"success": true,
|
|
3
|
+
"data": [
|
|
4
|
+
{
|
|
5
|
+
"_id": "682f2c81a6cc24f39d99eefe",
|
|
6
|
+
"name": "Jet's Landed",
|
|
7
|
+
"user_id": "67fd23bc3a7cbcd0a8757cdc",
|
|
8
|
+
"start_date": "2025-01-21",
|
|
9
|
+
"end_date": "2025-01-26",
|
|
10
|
+
"hotel_bookings": [],
|
|
11
|
+
"flight_bookings": [],
|
|
12
|
+
"created_at": "2025-05-22T13:54:09.085Z",
|
|
13
|
+
"updated_at": "2025-05-22T13:57:31.638Z",
|
|
14
|
+
"__v": 0
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
;
|
|
19
|
+
|
|
20
|
+
export default _default;
|