alliance-shared-types 1.0.2 → 1.0.4

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