alliance-shared-types 1.0.7 → 1.0.9

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,3 +1,4 @@
1
1
  export * from './types/auth.types';
2
2
  export * from './types/agent.types';
3
3
  export * from './types/booking.types';
4
+ export * from './types/corporate.types';
package/dist/index.js CHANGED
@@ -18,3 +18,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  __exportStar(require("./types/auth.types"), exports);
19
19
  __exportStar(require("./types/agent.types"), exports);
20
20
  __exportStar(require("./types/booking.types"), exports);
21
+ __exportStar(require("./types/corporate.types"), exports);
@@ -5,7 +5,7 @@ export type BookingStatus = 'pending' | 'confirmed' | 'ticketed' | 'cancelled' |
5
5
  export type PaymentStatus = 'pending' | 'paid' | 'refunded' | 'partial';
6
6
  export type PassengerType = 'adult' | 'child' | 'infant';
7
7
  export type CabinClass = 'economy' | 'premium_economy' | 'business' | 'first';
8
- export type BookingType = 'regular' | 'flexible_outbound' | 'flexible_return';
8
+ export type BookingType = 'regular' | 'flexible_outbound' | 'flexible_return' | 'one_way' | 'return' | 'multi_city';
9
9
  export declare const BOOKING_STATUSES: BookingStatus[];
10
10
  export declare const PAYMENT_STATUSES: PaymentStatus[];
11
11
  /**
@@ -0,0 +1,495 @@
1
+ export type BillingType = 'prepaid' | 'postpaid';
2
+ export type CorporateStatus = 'active' | 'inactive' | 'suspended';
3
+ export type EmployeeStatus = 'active' | 'inactive' | 'resigned';
4
+ export type EmployeeLevel = 'Junior' | 'Mid' | 'Senior' | 'Executive' | 'C-Level';
5
+ export type CityTier = 'Tier1' | 'Tier2' | 'Tier3' | 'International';
6
+ export type TripType = 'domestic' | 'international';
7
+ export type RequestType = 'flight' | 'hotel' | 'car' | 'multi';
8
+ export type PolicyComplianceStatus = 'in_policy' | 'out_of_policy' | 'requires_approval';
9
+ export type ApprovalStatus = 'pending' | 'approved' | 'rejected' | 'cancelled';
10
+ export type ApprovalAction = 'approved' | 'rejected' | 'delegated';
11
+ export type ApproverType = 'manager' | 'finance' | 'travel_admin' | 'specific_user';
12
+ export type ApprovalMode = 'sequential' | 'parallel';
13
+ export type PolicyRuleType = 'flight_class' | 'hotel_rate' | 'advance_booking' | 'trip_duration' | 'budget_limit';
14
+ export type RuleSeverity = 'low' | 'medium' | 'high';
15
+ export type WorkflowType = 'travel_request' | 'expense_report' | 'advance_request';
16
+ export type BudgetPeriod = 'monthly' | 'quarterly' | 'annual';
17
+ export interface CorporateAccount {
18
+ corporateAccountId: string;
19
+ agentId: string;
20
+ companyName: string;
21
+ companyCode: string;
22
+ gstin?: string;
23
+ pan?: string;
24
+ billingType: BillingType;
25
+ creditLimit: number;
26
+ creditPeriodDays: number;
27
+ contactPerson?: string;
28
+ contactEmail?: string;
29
+ contactPhone?: string;
30
+ billingAddress?: string;
31
+ billingCity?: string;
32
+ billingState?: string;
33
+ billingCountry?: string;
34
+ billingPincode?: string;
35
+ status: CorporateStatus;
36
+ createdAt: string | Date;
37
+ updatedAt: string | Date;
38
+ }
39
+ export interface CorporateAccountCreate {
40
+ agentId: string;
41
+ companyName: string;
42
+ companyCode: string;
43
+ gstin?: string;
44
+ pan?: string;
45
+ billingType?: BillingType;
46
+ creditLimit?: number;
47
+ creditPeriodDays?: number;
48
+ contactPerson?: string;
49
+ contactEmail?: string;
50
+ contactPhone?: string;
51
+ billingAddress?: string;
52
+ billingCity?: string;
53
+ billingState?: string;
54
+ billingCountry?: string;
55
+ billingPincode?: string;
56
+ status?: CorporateStatus;
57
+ }
58
+ export interface CorporateAccountUpdate {
59
+ companyName?: string;
60
+ gstin?: string;
61
+ pan?: string;
62
+ billingType?: BillingType;
63
+ creditLimit?: number;
64
+ creditPeriodDays?: number;
65
+ contactPerson?: string;
66
+ contactEmail?: string;
67
+ contactPhone?: string;
68
+ billingAddress?: string;
69
+ billingCity?: string;
70
+ billingState?: string;
71
+ billingCountry?: string;
72
+ billingPincode?: string;
73
+ status?: CorporateStatus;
74
+ }
75
+ export interface Department {
76
+ departmentId: string;
77
+ corporateAccountId: string;
78
+ departmentName: string;
79
+ departmentCode?: string;
80
+ costCenterCode?: string;
81
+ managerEmployeeId?: string;
82
+ budgetAmount?: number;
83
+ budgetPeriod?: BudgetPeriod;
84
+ status: CorporateStatus;
85
+ createdAt: string | Date;
86
+ updatedAt: string | Date;
87
+ }
88
+ export interface DepartmentCreate {
89
+ corporateAccountId: string;
90
+ departmentName: string;
91
+ departmentCode?: string;
92
+ costCenterCode?: string;
93
+ managerEmployeeId?: string;
94
+ budgetAmount?: number;
95
+ budgetPeriod?: BudgetPeriod;
96
+ status?: CorporateStatus;
97
+ }
98
+ export interface DepartmentUpdate {
99
+ departmentName?: string;
100
+ departmentCode?: string;
101
+ costCenterCode?: string;
102
+ managerEmployeeId?: string;
103
+ budgetAmount?: number;
104
+ budgetPeriod?: BudgetPeriod;
105
+ status?: CorporateStatus;
106
+ }
107
+ export interface CorporateEmployee {
108
+ employeeId: string;
109
+ corporateAccountId: string;
110
+ departmentId?: string;
111
+ employeeCode?: string;
112
+ firstName: string;
113
+ lastName: string;
114
+ email: string;
115
+ phone?: string;
116
+ employeeLevel?: EmployeeLevel;
117
+ designation?: string;
118
+ dateOfBirth?: string | Date;
119
+ gender?: string;
120
+ passportNumber?: string;
121
+ passportExpiry?: string | Date;
122
+ nationality?: string;
123
+ panNumber?: string;
124
+ managerEmployeeId?: string;
125
+ status: EmployeeStatus;
126
+ createdAt: string | Date;
127
+ updatedAt: string | Date;
128
+ }
129
+ export interface CorporateEmployeeCreate {
130
+ corporateAccountId: string;
131
+ departmentId?: string;
132
+ employeeCode?: string;
133
+ firstName: string;
134
+ lastName: string;
135
+ email: string;
136
+ phone?: string;
137
+ employeeLevel?: EmployeeLevel;
138
+ designation?: string;
139
+ dateOfBirth?: string | Date;
140
+ gender?: string;
141
+ passportNumber?: string;
142
+ passportExpiry?: string | Date;
143
+ nationality?: string;
144
+ panNumber?: string;
145
+ managerEmployeeId?: string;
146
+ status?: EmployeeStatus;
147
+ }
148
+ export interface CorporateEmployeeUpdate {
149
+ departmentId?: string;
150
+ employeeCode?: string;
151
+ firstName?: string;
152
+ lastName?: string;
153
+ email?: string;
154
+ phone?: string;
155
+ employeeLevel?: EmployeeLevel;
156
+ designation?: string;
157
+ dateOfBirth?: string | Date;
158
+ gender?: string;
159
+ passportNumber?: string;
160
+ passportExpiry?: string | Date;
161
+ nationality?: string;
162
+ panNumber?: string;
163
+ managerEmployeeId?: string;
164
+ status?: EmployeeStatus;
165
+ }
166
+ export interface TravelPolicy {
167
+ policyId: string;
168
+ corporateAccountId: string;
169
+ policyName: string;
170
+ policyCode?: string;
171
+ description?: string;
172
+ effectiveFrom: string | Date;
173
+ effectiveTo?: string | Date;
174
+ isDefault: boolean;
175
+ status: CorporateStatus;
176
+ createdAt: string | Date;
177
+ updatedAt: string | Date;
178
+ }
179
+ export interface TravelPolicyCreate {
180
+ corporateAccountId: string;
181
+ policyName: string;
182
+ policyCode?: string;
183
+ description?: string;
184
+ effectiveFrom: string | Date;
185
+ effectiveTo?: string | Date;
186
+ isDefault?: boolean;
187
+ status?: CorporateStatus;
188
+ }
189
+ export interface TravelPolicyUpdate {
190
+ policyName?: string;
191
+ policyCode?: string;
192
+ description?: string;
193
+ effectiveFrom?: string | Date;
194
+ effectiveTo?: string | Date;
195
+ isDefault?: boolean;
196
+ status?: CorporateStatus;
197
+ }
198
+ export interface PolicyRuleConditions {
199
+ employeeLevel?: EmployeeLevel;
200
+ tripType?: TripType;
201
+ departmentId?: string;
202
+ minAmount?: number;
203
+ maxAmount?: number;
204
+ [key: string]: any;
205
+ }
206
+ export interface PolicyRuleConstraints {
207
+ maxFare?: number;
208
+ allowedClasses?: string[];
209
+ maxHotelRate?: number;
210
+ advanceBookingDays?: number;
211
+ maxTripDuration?: number;
212
+ [key: string]: any;
213
+ }
214
+ export interface PolicyRule {
215
+ ruleId: string;
216
+ policyId: string;
217
+ ruleType: PolicyRuleType;
218
+ ruleName: string;
219
+ conditions?: PolicyRuleConditions;
220
+ constraints?: PolicyRuleConstraints;
221
+ severity: RuleSeverity;
222
+ requiresApproval: boolean;
223
+ violationMessage?: string;
224
+ isActive: boolean;
225
+ createdAt: string | Date;
226
+ }
227
+ export interface PolicyRuleCreate {
228
+ policyId: string;
229
+ ruleType: PolicyRuleType;
230
+ ruleName: string;
231
+ conditions?: PolicyRuleConditions;
232
+ constraints?: PolicyRuleConstraints;
233
+ severity?: RuleSeverity;
234
+ requiresApproval?: boolean;
235
+ violationMessage?: string;
236
+ isActive?: boolean;
237
+ }
238
+ export interface ApprovalWorkflowConditions {
239
+ minAmount?: number;
240
+ maxAmount?: number;
241
+ tripType?: TripType;
242
+ departmentId?: string;
243
+ employeeLevel?: EmployeeLevel;
244
+ [key: string]: any;
245
+ }
246
+ export interface ApprovalWorkflow {
247
+ workflowId: string;
248
+ corporateAccountId: string;
249
+ workflowName: string;
250
+ workflowType?: WorkflowType;
251
+ conditions?: ApprovalWorkflowConditions;
252
+ isDefault: boolean;
253
+ status: CorporateStatus;
254
+ createdAt: string | Date;
255
+ updatedAt: string | Date;
256
+ }
257
+ export interface ApprovalWorkflowCreate {
258
+ corporateAccountId: string;
259
+ workflowName: string;
260
+ workflowType?: WorkflowType;
261
+ conditions?: ApprovalWorkflowConditions;
262
+ isDefault?: boolean;
263
+ status?: CorporateStatus;
264
+ }
265
+ export interface ApprovalWorkflowUpdate {
266
+ workflowName?: string;
267
+ workflowType?: WorkflowType;
268
+ conditions?: ApprovalWorkflowConditions;
269
+ isDefault?: boolean;
270
+ status?: CorporateStatus;
271
+ }
272
+ export interface ApprovalLevel {
273
+ levelId: string;
274
+ workflowId: string;
275
+ levelOrder: number;
276
+ approverType: ApproverType;
277
+ approverId?: string;
278
+ approvalMode: ApprovalMode;
279
+ autoApproveThreshold?: number;
280
+ escalationHours?: number;
281
+ isMandatory: boolean;
282
+ createdAt: string | Date;
283
+ }
284
+ export interface ApprovalLevelCreate {
285
+ workflowId: string;
286
+ levelOrder: number;
287
+ approverType: ApproverType;
288
+ approverId?: string;
289
+ approvalMode?: ApprovalMode;
290
+ autoApproveThreshold?: number;
291
+ escalationHours?: number;
292
+ isMandatory?: boolean;
293
+ }
294
+ export interface PolicyViolation {
295
+ ruleId: string;
296
+ ruleName: string;
297
+ ruleType: PolicyRuleType;
298
+ severity: RuleSeverity;
299
+ message: string;
300
+ }
301
+ export interface TravelRequest {
302
+ requestId: string;
303
+ corporateAccountId: string;
304
+ employeeId: string;
305
+ departmentId?: string;
306
+ requestType?: RequestType;
307
+ tripPurpose?: string;
308
+ tripType?: TripType;
309
+ departureDate?: string | Date;
310
+ returnDate?: string | Date;
311
+ origin?: string;
312
+ destination?: string;
313
+ estimatedCost?: number;
314
+ costCenterCode?: string;
315
+ projectCode?: string;
316
+ justification?: string;
317
+ policyComplianceStatus?: PolicyComplianceStatus;
318
+ policyViolations?: PolicyViolation[];
319
+ approvalStatus: ApprovalStatus;
320
+ currentApprovalLevel: number;
321
+ workflowId?: string;
322
+ createdBy: string;
323
+ createdAt: string | Date;
324
+ updatedAt: string | Date;
325
+ }
326
+ export interface TravelRequestCreate {
327
+ corporateAccountId: string;
328
+ employeeId: string;
329
+ departmentId?: string;
330
+ requestType?: RequestType;
331
+ tripPurpose?: string;
332
+ tripType?: TripType;
333
+ departureDate?: string | Date;
334
+ returnDate?: string | Date;
335
+ origin?: string;
336
+ destination?: string;
337
+ estimatedCost?: number;
338
+ costCenterCode?: string;
339
+ projectCode?: string;
340
+ justification?: string;
341
+ }
342
+ export interface TravelRequestUpdate {
343
+ departmentId?: string;
344
+ requestType?: RequestType;
345
+ tripPurpose?: string;
346
+ tripType?: TripType;
347
+ departureDate?: string | Date;
348
+ returnDate?: string | Date;
349
+ origin?: string;
350
+ destination?: string;
351
+ estimatedCost?: number;
352
+ costCenterCode?: string;
353
+ projectCode?: string;
354
+ justification?: string;
355
+ approvalStatus?: ApprovalStatus;
356
+ }
357
+ export interface ApprovalHistory {
358
+ approvalHistoryId: string;
359
+ requestId: string;
360
+ levelOrder: number;
361
+ approverId: string;
362
+ approverType?: ApproverType;
363
+ action: ApprovalAction;
364
+ comments?: string;
365
+ approvedAt?: string | Date;
366
+ delegatedTo?: string;
367
+ }
368
+ export interface ApprovalHistoryCreate {
369
+ requestId: string;
370
+ levelOrder: number;
371
+ approverId: string;
372
+ approverType?: ApproverType;
373
+ action: ApprovalAction;
374
+ comments?: string;
375
+ delegatedTo?: string;
376
+ }
377
+ export interface PerDiemRate {
378
+ rateId: string;
379
+ corporateAccountId: string;
380
+ cityTier: CityTier;
381
+ employeeLevel?: EmployeeLevel;
382
+ dailyRate: number;
383
+ mealsIncluded: boolean;
384
+ incidentalsIncluded: boolean;
385
+ localTransportIncluded: boolean;
386
+ currency: string;
387
+ effectiveFrom: string | Date;
388
+ effectiveTo?: string | Date;
389
+ status: CorporateStatus;
390
+ createdAt: string | Date;
391
+ updatedAt: string | Date;
392
+ }
393
+ export interface PerDiemRateCreate {
394
+ corporateAccountId: string;
395
+ cityTier: CityTier;
396
+ employeeLevel?: EmployeeLevel;
397
+ dailyRate: number;
398
+ mealsIncluded?: boolean;
399
+ incidentalsIncluded?: boolean;
400
+ localTransportIncluded?: boolean;
401
+ currency?: string;
402
+ effectiveFrom: string | Date;
403
+ effectiveTo?: string | Date;
404
+ status?: CorporateStatus;
405
+ }
406
+ export interface PerDiemRateUpdate {
407
+ cityTier?: CityTier;
408
+ employeeLevel?: EmployeeLevel;
409
+ dailyRate?: number;
410
+ mealsIncluded?: boolean;
411
+ incidentalsIncluded?: boolean;
412
+ localTransportIncluded?: boolean;
413
+ currency?: string;
414
+ effectiveFrom?: string | Date;
415
+ effectiveTo?: string | Date;
416
+ status?: CorporateStatus;
417
+ }
418
+ export interface CityTierMapping {
419
+ mappingId: string;
420
+ cityName: string;
421
+ cityCode?: string;
422
+ state?: string;
423
+ country: string;
424
+ tier: CityTier;
425
+ createdAt: string | Date;
426
+ }
427
+ export interface CityTierMappingCreate {
428
+ cityName: string;
429
+ cityCode?: string;
430
+ state?: string;
431
+ country?: string;
432
+ tier: CityTier;
433
+ }
434
+ export interface CorporateAccountSearchParams {
435
+ agentId?: string;
436
+ status?: CorporateStatus;
437
+ search?: string;
438
+ page?: number;
439
+ limit?: number;
440
+ }
441
+ export interface EmployeeSearchParams {
442
+ corporateAccountId?: string;
443
+ departmentId?: string;
444
+ employeeLevel?: EmployeeLevel;
445
+ status?: EmployeeStatus;
446
+ search?: string;
447
+ page?: number;
448
+ limit?: number;
449
+ }
450
+ export interface TravelRequestSearchParams {
451
+ corporateAccountId?: string;
452
+ employeeId?: string;
453
+ departmentId?: string;
454
+ approvalStatus?: ApprovalStatus;
455
+ tripType?: TripType;
456
+ fromDate?: string | Date;
457
+ toDate?: string | Date;
458
+ page?: number;
459
+ limit?: number;
460
+ }
461
+ export interface CorporateAccountListResponse {
462
+ data: CorporateAccount[];
463
+ total: number;
464
+ page: number;
465
+ limit: number;
466
+ }
467
+ export interface EmployeeListResponse {
468
+ data: CorporateEmployee[];
469
+ total: number;
470
+ page: number;
471
+ limit: number;
472
+ }
473
+ export interface TravelRequestListResponse {
474
+ data: TravelRequest[];
475
+ total: number;
476
+ page: number;
477
+ limit: number;
478
+ }
479
+ export interface CorporateAccountWithDetails extends CorporateAccount {
480
+ departmentCount?: number;
481
+ employeeCount?: number;
482
+ activePolicies?: number;
483
+ }
484
+ export interface TravelRequestWithDetails extends TravelRequest {
485
+ employee?: CorporateEmployee;
486
+ department?: Department;
487
+ approvalHistory?: ApprovalHistory[];
488
+ currentApprover?: string;
489
+ }
490
+ export interface PolicyWithRules extends TravelPolicy {
491
+ rules?: PolicyRule[];
492
+ }
493
+ export interface WorkflowWithLevels extends ApprovalWorkflow {
494
+ levels?: ApprovalLevel[];
495
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ // =============================================
3
+ // Corporate Module - Shared TypeScript Types
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.7",
3
+ "version": "1.0.9",
4
4
  "description": "Shared TypeScript types for Alliance B2B Travel Portal",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",