alliance-shared-types 1.0.2 → 1.0.3

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/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './types/auth.types';
2
2
  export * from './types/agent.types';
3
+ export * from './types/booking.types';
package/dist/index.js CHANGED
@@ -17,3 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  // Export all types from the types directory
18
18
  __exportStar(require("./types/auth.types"), exports);
19
19
  __exportStar(require("./types/agent.types"), exports);
20
+ __exportStar(require("./types/booking.types"), exports);
@@ -0,0 +1,252 @@
1
+ /**
2
+ * Booking-related types for the Alliance B2B Travel Portal
3
+ */
4
+ export type BookingStatus = 'pending' | 'confirmed' | 'ticketed' | 'cancelled' | 'failed';
5
+ export type PaymentStatus = 'pending' | 'paid' | 'refunded' | 'partial';
6
+ export type PassengerType = 'adult' | 'child' | 'infant';
7
+ export type CabinClass = 'economy' | 'premium_economy' | 'business' | 'first';
8
+ /**
9
+ * Flight Passenger interface
10
+ */
11
+ export interface FlightPassenger {
12
+ passengerId: string;
13
+ bookingId: string;
14
+ passengerType: PassengerType;
15
+ title: string;
16
+ firstName: string;
17
+ lastName: string;
18
+ dateOfBirth?: string | Date;
19
+ gender?: string;
20
+ passportNumber?: string;
21
+ passportExpiry?: string | Date;
22
+ nationality?: string;
23
+ ticketNumber?: string;
24
+ createdAt: string | Date;
25
+ updatedAt: string | Date;
26
+ }
27
+ /**
28
+ * Flight Segment interface
29
+ */
30
+ export interface FlightSegment {
31
+ segmentId: string;
32
+ bookingId: string;
33
+ segmentOrder: number;
34
+ origin: string;
35
+ destination: string;
36
+ departureAirport: string;
37
+ arrivalAirport: string;
38
+ departureTime: string | Date;
39
+ arrivalTime: string | Date;
40
+ duration: number;
41
+ carrier: string;
42
+ airlineCode: string;
43
+ flightNo: string;
44
+ cabin: string;
45
+ cabinClass: CabinClass;
46
+ fareClass: string;
47
+ baggageAllowance?: string;
48
+ aircraftType?: string;
49
+ }
50
+ /**
51
+ * Flight Booking interface
52
+ */
53
+ export interface FlightBooking {
54
+ bookingId: string;
55
+ agentId: string;
56
+ userId?: string;
57
+ pnr: string;
58
+ status: string;
59
+ bookingStatus: BookingStatus;
60
+ paymentStatus: PaymentStatus;
61
+ totalAmount: number;
62
+ baseFare: number;
63
+ taxes: number;
64
+ fees: number;
65
+ markupAmount: number;
66
+ commissionAmount: number;
67
+ fareRaw?: string;
68
+ fareFinal: number;
69
+ provider: string;
70
+ supplierReference?: string;
71
+ amadeusOfferId?: string;
72
+ amadeusResponse?: string;
73
+ contactName: string;
74
+ contactEmail: string;
75
+ contactPhone: string;
76
+ cancellationPolicy?: string;
77
+ docsLink?: string;
78
+ bookingDate: string | Date;
79
+ createdAt: string | Date;
80
+ updatedAt: string | Date;
81
+ }
82
+ /**
83
+ * Flight Booking with related data
84
+ */
85
+ export interface FlightBookingWithDetails extends FlightBooking {
86
+ segments: FlightSegment[];
87
+ passengers: FlightPassenger[];
88
+ agent?: {
89
+ agentId: string;
90
+ name: string;
91
+ type: string;
92
+ };
93
+ user?: {
94
+ userId: string;
95
+ email: string;
96
+ firstName: string;
97
+ lastName: string;
98
+ };
99
+ }
100
+ /**
101
+ * Hotel Room interface
102
+ */
103
+ export interface HotelRoom {
104
+ roomId: string;
105
+ bookingId: string;
106
+ roomType: string;
107
+ guests: string;
108
+ rate: number;
109
+ checkIn: string | Date;
110
+ checkOut: string | Date;
111
+ }
112
+ /**
113
+ * Hotel Booking interface
114
+ */
115
+ export interface HotelBooking {
116
+ bookingId: string;
117
+ agentId: string;
118
+ userId?: string;
119
+ hotelName: string;
120
+ hotelCode?: string;
121
+ confirmationNumber: string;
122
+ address?: string;
123
+ city?: string;
124
+ country?: string;
125
+ status: string;
126
+ bookingStatus: BookingStatus;
127
+ paymentStatus: PaymentStatus;
128
+ checkInDate: string | Date;
129
+ checkOutDate: string | Date;
130
+ totalAmount: number;
131
+ baseRate: number;
132
+ taxes: number;
133
+ markupAmount: number;
134
+ commissionAmount: number;
135
+ rateRaw?: string;
136
+ rateFinal: number;
137
+ provider: string;
138
+ supplierReference?: string;
139
+ amadeusOfferId?: string;
140
+ amadeusResponse?: string;
141
+ contactName: string;
142
+ contactEmail: string;
143
+ contactPhone: string;
144
+ cancellationPolicy?: string;
145
+ voucherLink?: string;
146
+ bookingDate: string | Date;
147
+ createdAt: string | Date;
148
+ updatedAt: string | Date;
149
+ }
150
+ /**
151
+ * Hotel Booking with related data
152
+ */
153
+ export interface HotelBookingWithDetails extends HotelBooking {
154
+ rooms: HotelRoom[];
155
+ agent?: {
156
+ agentId: string;
157
+ name: string;
158
+ type: string;
159
+ };
160
+ user?: {
161
+ userId: string;
162
+ email: string;
163
+ firstName: string;
164
+ lastName: string;
165
+ };
166
+ }
167
+ /**
168
+ * Booking search parameters
169
+ */
170
+ export interface BookingSearchParams {
171
+ agentId?: string;
172
+ userId?: string;
173
+ status?: BookingStatus;
174
+ paymentStatus?: PaymentStatus;
175
+ startDate?: string | Date;
176
+ endDate?: string | Date;
177
+ pnr?: string;
178
+ confirmationNumber?: string;
179
+ search?: string;
180
+ page?: number;
181
+ limit?: number;
182
+ sortBy?: string;
183
+ sortOrder?: 'asc' | 'desc';
184
+ }
185
+ /**
186
+ * Booking list response
187
+ */
188
+ export interface BookingListResponse<T> {
189
+ data: T[];
190
+ total: number;
191
+ page: number;
192
+ limit: number;
193
+ }
194
+ /**
195
+ * Booking statistics for dashboard
196
+ */
197
+ export interface BookingStats {
198
+ totalBookings: number;
199
+ totalRevenue: number;
200
+ pendingBookings: number;
201
+ confirmedBookings: number;
202
+ cancelledBookings: number;
203
+ failedBookings: number;
204
+ flightBookings: number;
205
+ hotelBookings: number;
206
+ }
207
+ /**
208
+ * Booking trend data
209
+ */
210
+ export interface BookingTrend {
211
+ date: string;
212
+ count: number;
213
+ revenue: number;
214
+ }
215
+ /**
216
+ * Agent performance data
217
+ */
218
+ export interface AgentPerformance {
219
+ agentId: string;
220
+ agentName: string;
221
+ agentType: string;
222
+ bookingCount: number;
223
+ revenue: number;
224
+ commission: number;
225
+ }
226
+ /**
227
+ * Booking override request
228
+ */
229
+ export interface BookingOverride {
230
+ bookingId: string;
231
+ status?: BookingStatus;
232
+ paymentStatus?: PaymentStatus;
233
+ totalAmount?: number;
234
+ markupAmount?: number;
235
+ commissionAmount?: number;
236
+ supplierReference?: string;
237
+ notes?: string;
238
+ }
239
+ /**
240
+ * Flight Passenger creation request
241
+ */
242
+ export interface FlightPassengerCreate {
243
+ passengerType: PassengerType;
244
+ title: string;
245
+ firstName: string;
246
+ lastName: string;
247
+ dateOfBirth?: string | Date;
248
+ gender?: string;
249
+ passportNumber?: string;
250
+ passportExpiry?: string | Date;
251
+ nationality?: string;
252
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * Booking-related types for the Alliance B2B Travel Portal
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alliance-shared-types",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Shared TypeScript types for Alliance B2B Travel Portal",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",