@routeflow/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/src/exports.ts CHANGED
@@ -1,15 +1,10 @@
1
1
  /**
2
- * Friendly type exports from the auto-generated OpenAPI types.
2
+ * Type exports from auto-generated OpenAPI types.
3
3
  *
4
- * Type Flow: Prisma → API DTOs → OpenAPIhereSDKClient Apps
4
+ * Type Flow: Prisma Schema → API DTOs → Swagger/docs-jsonopenapi-typescripthere
5
5
  *
6
- * IMPORTANT:
7
- * - Types that have Response DTOs in API are re-exported from generated types
8
- * - Types WITHOUT Response DTOs (Organization, User, Driver, Run, Stop, etc.)
9
- * are temporarily defined manually until API adds proper Response DTOs
10
- *
11
- * TODO: Once API adds Response DTOs for all entities, convert ALL manual
12
- * definitions to re-exports from components['schemas']
6
+ * IMPORTANT: ALL types in this file are re-exports from the generated index.ts
7
+ * NEVER define types manually here - if a type is missing, add a Response DTO to the API.
13
8
  */
14
9
 
15
10
  import type { components, paths, operations } from './index.js';
@@ -18,630 +13,144 @@ import type { components, paths, operations } from './index.js';
18
13
  export type { components, paths, operations };
19
14
 
20
15
  // ============================================================================
21
- // ENUMS (match Prisma schema enums)
16
+ // ENUMS - Extracted from Response DTOs
22
17
  // ============================================================================
23
- // These should match the Prisma enums exactly
24
-
25
- export type Role = 'ADMIN' | 'OWNER' | 'FLEET_MANAGER' | 'DISPATCHER' | 'ACCOUNTING' | 'DRIVER' | 'BROKER';
26
-
27
- export type RunStatus = 'DRAFT' | 'ASSIGNED' | 'IN_PROGRESS' | 'COMPLETED' | 'CANCELLED';
28
-
29
- export type CancellationReason =
30
- | 'CUSTOMER_CANCELLED'
31
- | 'DRIVER_CANCELLED'
32
- | 'EQUIPMENT_ISSUE'
33
- | 'WEATHER'
34
- | 'RATE_DISPUTE'
35
- | 'SCHEDULING_CONFLICT'
36
- | 'NO_SHOW'
37
- | 'OTHER';
38
-
39
- export type StopType = 'PICKUP' | 'DELIVERY';
40
-
41
- export type StopStatus =
42
- | 'PENDING'
43
- | 'EN_ROUTE'
44
- | 'ARRIVED'
45
- | 'LOADING'
46
- | 'LOADED'
47
- | 'DELIVERING'
48
- | 'DELIVERED'
49
- | 'EXCEPTION'
50
- | 'SKIPPED';
51
-
52
- export type DocumentType = 'BOL' | 'POD' | 'PHOTO' | 'DAMAGE' | 'RATE_CONFIRMATION' | 'SIGNATURE';
53
-
54
- export type EldProvider = 'SAMSARA' | 'GEOTAB' | 'MOTIVE' | 'MANUAL';
55
-
56
- export type AssetStatus = 'ACTIVE' | 'IN_SHOP' | 'INACTIVE';
57
-
58
- export type FuelType = 'DIESEL' | 'GASOLINE' | 'ELECTRIC' | 'HYBRID';
59
-
60
- export type TrailerType = 'RGN' | 'SD' | 'FLATBED' | 'REEFER' | 'DRY_VAN' | 'STEP_DECK' | 'LOWBOY';
61
-
62
- export type CompanyDocumentType =
63
- | 'INSURANCE'
64
- | 'W9'
65
- | 'AUTHORITY'
66
- | 'NOA'
67
- | 'VOID_CHECK'
68
- | 'MC_CERTIFICATE'
69
- | 'DOT_CERTIFICATE'
70
- | 'CARGO_INSURANCE'
71
- | 'LIABILITY_INSURANCE'
72
- | 'OTHER';
73
-
74
- export type DriverDispatchStatus =
75
- | 'AVAILABLE'
76
- | 'HOME'
77
- | 'IN_TRANSIT'
78
- | 'INACTIVE'
79
- | 'SHOP'
80
- | 'REST'
81
- | 'DISPATCHED'
82
- | 'ASSIGNED';
83
-
84
- export type CustomerType = 'BROKER' | 'SHIPPER' | 'CARRIER';
85
-
86
- // New Driver Profile Enums
87
- export type EmploymentStatus = 'ACTIVE' | 'TERMINATED' | 'APPLICANT';
88
- export type CdlClass = 'A' | 'B' | 'C';
89
- export type ComplianceStatus = 'COMPLIANT' | 'WARNING' | 'EXPIRED' | 'PENDING';
90
- export type DriverType = 'SOLO' | 'TEAM';
91
-
92
- // export type StatementStatus = 'DRAFT' | 'PENDING' | 'APPROVED' | 'PAID';
93
-
94
- export type MessageType = 'TEXT' | 'IMAGE' | 'DOCUMENT' | 'SYSTEM';
95
-
96
- export type ParsedDocumentStatus = 'PENDING' | 'PROCESSED' | 'FAILED' | 'NEEDS_REVIEW';
97
-
98
- export type ExtractedAssetType = 'DRIVER' | 'TRUCK' | 'TRAILER';
99
-
100
- export type ExtractedAssetStatus = 'PENDING' | 'APPROVED' | 'REJECTED' | 'MERGED';
101
-
102
- // Email-to-Run Feature Enums
103
- export type InboundEmailStatus =
104
- | 'RECEIVED'
105
- | 'PROCESSING'
106
- | 'AWAITING_SIGNATURE'
107
- | 'SIGNED'
108
- | 'FORWARDED'
109
- | 'COMPLETED'
110
- | 'FAILED';
111
-
112
- export type DocumentSourceType = 'UPLOAD' | 'TELEGRAM' | 'EMAIL' | 'API';
113
-
114
- export type ExpenseType =
115
- | 'FUEL'
116
- | 'REPAIR'
117
- | 'MAINTENANCE'
118
- | 'TOLL'
119
- | 'PARKING'
120
- | 'SCALE'
121
- | 'LUMPER'
122
- | 'DETENTION'
123
- | 'INSURANCE'
124
- | 'OTHER';
125
-
126
- export type ExpenseStatus = 'PENDING' | 'APPROVED' | 'REJECTED' | 'PAID';
18
+
19
+ export type Role = components['schemas']['UserResponseDto']['role'];
20
+ export type RunStatus = components['schemas']['RunResponseDto']['status'];
21
+ export type StopType = components['schemas']['StopResponseDto']['type'];
22
+ export type StopStatus = components['schemas']['StopResponseDto']['status'];
23
+ export type DocumentType = components['schemas']['DocumentResponseDto']['type'];
24
+ export type CustomerType = components['schemas']['CustomerResponseDto']['type'];
25
+ export type MessageType = components['schemas']['MessageResponseDto']['type'];
26
+ export type StatementStatus = components['schemas']['StatementResponseDto']['status'];
27
+ export type ExpenseType = components['schemas']['ExpenseResponseDto']['type'];
28
+ export type ExpenseStatus = components['schemas']['ExpenseResponseDto']['status'];
29
+ export type InboundEmailStatus = components['schemas']['InboundEmailResponseDto']['status'];
127
30
 
128
31
  // ============================================================================
129
- // ENTITY TYPES - WITH Response DTOs (✅ Re-exported from generated types)
32
+ // ENTITY RESPONSE TYPES
130
33
  // ============================================================================
131
34
 
132
- // Customer (has ResponseDto in API)
133
- export type Customer = components['schemas']['CustomerResponseDto'];
134
- export type CustomerList = components['schemas']['CustomerListResponseDto'];
135
-
136
- // Message (has ResponseDto in API)
137
- export type Message = components['schemas']['MessageResponseDto'];
138
- export type MessageList = components['schemas']['MessageListResponseDto'];
139
-
140
- // Statement (has ResponseDto in API)
141
- // export type DriverStatement = components['schemas']['StatementResponseDto'];
142
- // export type StatementList = components['schemas']['StatementListResponseDto'];
35
+ // Core entities
36
+ export type Organization = components['schemas']['OrganizationResponseDto'];
37
+ export type User = components['schemas']['UserResponseDto'];
38
+ export type Run = components['schemas']['RunResponseDto'];
39
+ export type Stop = components['schemas']['StopResponseDto'];
40
+ export type Document = components['schemas']['DocumentResponseDto'];
143
41
 
144
- // Referral (has ResponseDto in API)
145
- export type Referral = components['schemas']['ReferralResponseDto'];
146
- export type ReferralList = components['schemas']['ReferralListResponseDto'];
147
- export type ReferralStats = components['schemas']['ReferralStatsDto'];
42
+ // Driver - full profile with compliance, equipment, etc.
43
+ export type Driver = components['schemas']['DriverResponseDto'];
44
+ export type DriverDispatchStatus = components['schemas']['DriverResponseDto']['dispatchStatus'];
148
45
 
149
- // Extracted Assets (has ResponseDto in API)
150
- export type ExtractedAsset = components['schemas']['ExtractedAssetResponseDto'];
151
- export type ExtractedAssetField = components['schemas']['ExtractedAssetFieldDto'];
152
- export type ExtractionResult = components['schemas']['ExtractionResultResponseDto'];
153
- export type PaginatedExtractions = components['schemas']['PaginatedExtractionsResponseDto'];
154
- export type BulkOperationResult = components['schemas']['BulkOperationResponseDto'];
155
-
156
- // Smart Parse (has DTOs in API)
157
- export type SmartParseDocument = components['schemas']['SmartParseDocumentDto'];
158
- export type SmartParseResult = components['schemas']['SmartParseResultDto'];
159
- export type SuggestedDriver = components['schemas']['SuggestedDriverDto'];
160
- export type SuggestedCustomer = components['schemas']['SuggestedCustomerDto'];
46
+ // Assets
47
+ export type Truck = components['schemas']['TruckResponseDto'];
48
+ export type Trailer = components['schemas']['TrailerResponseDto'];
161
49
 
162
50
  // ============================================================================
163
- // ENTITY TYPES - WITHOUT Response DTOs (⚠️ Temporary manual definitions)
51
+ // TYPES NOW GENERATED FROM SWAGGER
164
52
  // ============================================================================
165
- // TODO: Replace with re-exports once API adds Response DTOs
166
-
167
- export interface Organization {
168
- id: string;
169
- name: string;
170
- settings: Record<string, unknown>;
171
- createdAt: string;
172
- updatedAt: string;
173
- }
174
-
175
- export interface User {
176
- id: string;
177
- email: string | null;
178
- name: string;
179
- phone: string | null;
180
- role: Role;
181
- telegramId: string | null;
182
- language: string;
183
- isActive: boolean;
184
- orgId: string;
185
- createdAt: string;
186
- updatedAt: string;
187
- org?: Organization;
188
- driver?: Driver;
189
- }
190
-
191
- export interface Driver {
192
- id: string;
193
- eldProvider: EldProvider;
194
- eldDriverId: string | null;
195
- hosAvailableMin: number | null;
196
- hosUpdatedAt: string | null;
197
- dispatchStatus: DriverDispatchStatus;
198
- userId: string;
199
- createdAt: string;
200
- updatedAt: string;
201
- user?: User;
202
-
203
- // Address
204
- streetAddress?: string | null;
205
- city?: string | null;
206
- state?: string | null;
207
- zipCode?: string | null;
208
- country?: string | null;
209
-
210
- // Emergency Contact
211
- emergencyName?: string | null;
212
- emergencyPhone?: string | null;
213
-
214
- // Employment
215
- employmentStatus?: EmploymentStatus;
216
- hireDate?: string | null;
217
- terminationDate?: string | null;
218
-
219
- // Compliance - CDL
220
- cdlNumber?: string | null;
221
- cdlState?: string | null;
222
- cdlClass?: CdlClass | null;
223
- cdlExpiry?: string | null;
224
- cdlEndorsements?: string[];
225
-
226
- // Compliance - Medical
227
- medicalCardNumber?: string | null;
228
- medicalCardExpiry?: string | null;
229
- medicalExamDate?: string | null;
230
- medicalExaminer?: string | null;
231
-
232
- // Computed compliance status
233
- complianceStatus?: ComplianceStatus;
234
- complianceNotes?: string | null;
235
-
236
- // Team driver
237
- teamDriverId?: string | null;
238
- teamDriver?: Driver | null;
239
- teamPartner?: Driver | null;
240
- isTeamLead?: boolean;
241
- teamStartDate?: string | null;
242
- driverType?: DriverType;
243
-
244
- // Dispatcher
245
- assignedDispatcherId?: string | null;
246
- assignedDispatcher?: User | null;
247
- }
248
-
249
- export interface Run {
250
- id: string;
251
- name: string;
252
- loadNumber: string | null;
253
- status: RunStatus;
254
- plannedDate: string;
255
- plannedEndDate: string | null;
256
- startedAt: string | null;
257
- completedAt: string | null;
258
- cancelledAt: string | null;
259
- cancellationReason: CancellationReason | null;
260
- cancellationNotes: string | null;
261
- totalDistance: number | null;
262
- totalDuration: number | null;
263
- totalPay: number | null;
264
- equipmentType: string | null;
265
- commodityDesc: string | null;
266
- weight: number | null;
267
- orgId: string;
268
- driverId: string | null;
269
- customerId: string | null;
270
- createdById: string;
271
- cancelledById: string | null;
272
- createdAt: string;
273
- updatedAt: string;
274
- driver?: User;
275
- customer?: Customer;
276
- stops?: Stop[];
277
- documents?: Document[];
278
- }
279
-
280
- export interface Stop {
281
- id: string;
282
- sequence: number;
283
- type: StopType;
284
- status: StopStatus;
285
- facilityName: string | null;
286
- address: string;
287
- lat: number;
288
- lng: number;
289
- contactName: string | null;
290
- contactPhone: string | null;
291
- notes: string | null;
292
- referenceNumber: string | null;
293
- timeWindowStart: string | null;
294
- timeWindowEnd: string | null;
295
- arrivedAt: string | null;
296
- completedAt: string | null;
297
- runId: string;
298
- requiredDocs: DocumentType[];
299
- createdAt: string;
300
- updatedAt: string;
301
- documents?: Document[];
302
- }
303
53
 
304
- export interface Document {
305
- id: string;
306
- type: DocumentType;
307
- fileUrl: string;
308
- fileName: string | null;
309
- mimeType: string | null;
310
- fileSize: number | null;
311
- captureLat: number | null;
312
- captureLng: number | null;
313
- captureTime: string | null;
314
- signatureData: string | null;
315
- signedBy: string | null;
316
- runId: string;
317
- stopId: string | null;
318
- uploadedById: string;
319
- createdAt: string;
320
- }
321
-
322
- export interface DriverLocation {
323
- id: string;
324
- lat: number;
325
- lng: number;
326
- heading: number | null;
327
- speed: number | null;
328
- accuracy: number | null;
329
- recordedAt: string;
330
- driverId: string;
331
- createdAt: string;
332
- }
333
-
334
- export interface MagicLink {
335
- id: string;
336
- token: string;
337
- customerEmail: string | null;
338
- customerPhone: string | null;
339
- expiresAt: string;
340
- runId: string;
341
- stopId: string | null;
342
- createdAt: string;
343
- }
344
-
345
- export interface Truck {
346
- id: string;
347
- truckNumber: string;
348
- year: number | null;
349
- make: string | null;
350
- model: string | null;
351
- vin: string | null;
352
- licensePlate: string | null;
353
- status: AssetStatus;
354
- mileage: number | null;
355
- fuelType: FuelType | null;
356
- insuranceExpiry: string | null;
357
- lastServiceDate: string | null;
358
- notes: string | null;
359
- orgId: string;
360
- assignedDriverId: string | null;
361
- createdAt: string;
362
- updatedAt: string;
363
- assignedDriver?: User;
364
- }
365
-
366
- export interface Trailer {
367
- id: string;
368
- trailerNumber: string;
369
- type: TrailerType;
370
- length: string | null;
371
- weightCapacity: string | null;
372
- status: AssetStatus;
373
- vin: string | null;
374
- licensePlate: string | null;
375
- registrationExpiry: string | null;
376
- lastInspectionDate: string | null;
377
- notes: string | null;
378
- orgId: string;
379
- assignedDriverId: string | null;
380
- createdAt: string;
381
- updatedAt: string;
382
- assignedDriver?: User;
383
- }
54
+ // Magic Link
55
+ export type MagicLink = components['schemas']['MagicLinkResponseDto'];
384
56
 
385
- export interface CompanyDocument {
386
- id: string;
387
- type: CompanyDocumentType;
388
- name: string;
389
- description: string | null;
390
- fileUrl: string;
391
- fileName: string | null;
392
- mimeType: string | null;
393
- fileSize: number | null;
394
- expiryDate: string | null;
395
- isActive: boolean;
396
- orgId: string;
397
- uploadedById: string;
398
- createdAt: string;
399
- updatedAt: string;
400
- }
57
+ // Tracking types
58
+ export type TrackingStatus = components['schemas']['TrackingStatusResponseDto'];
59
+ export type TrackingLocation = components['schemas']['TrackingLocationResponseDto'];
401
60
 
402
- export interface ParsedDocument {
403
- id: string;
404
- originalFileUrl: string;
405
- fileName: string | null;
406
- mimeType: string | null;
407
- fileSize: number | null;
408
- status: ParsedDocumentStatus;
409
- parsedData: Record<string, unknown> | null;
410
- confidence: number | null;
411
- errorMessage: string | null;
412
- createdRunId: string | null;
413
- matchedCustomerId: string | null;
414
- suggestedDriverId: string | null;
415
- uploadedById: string;
416
- orgId: string;
417
- createdAt: string;
418
- updatedAt: string;
419
- // Signing workflow fields
420
- needsSignature: boolean;
421
- signatureData: string | null;
422
- signedAt: string | null;
423
- signedByName: string | null;
424
- signedByEmail: string | null;
425
- signingToken: string | null;
426
- signingTokenExp: string | null;
427
- sourceType: DocumentSourceType;
428
- sourceEmailId: string | null;
429
- }
61
+ // Company Document
62
+ export type CompanyDocument = components['schemas']['CompanyDocumentResponseDto'];
430
63
 
431
64
  // ============================================================================
432
- // EMAIL-TO-RUN FEATURE ENTITIES
65
+ // TYPES NOW GENERATED FROM SWAGGER (formerly manual)
433
66
  // ============================================================================
434
67
 
435
- export interface UserSignature {
436
- id: string;
437
- signatureData: string;
438
- userId: string;
439
- createdAt: string;
440
- updatedAt: string;
441
- }
442
-
443
- export interface ClientEmail {
444
- id: string;
445
- localPart: string;
446
- isActive: boolean;
447
- forwardTo: string[];
448
- orgId: string;
449
- customerId: string | null;
450
- createdAt: string;
451
- updatedAt: string;
452
- // Extended response fields
453
- fullEmail?: string;
454
- customerName?: string;
455
- emailCount?: number;
456
- lastEmailAt?: string | null;
457
- }
458
-
459
- export interface InboundEmail {
460
- id: string;
461
- messageId: string;
462
- fromEmail: string;
463
- fromName: string | null;
464
- subject: string | null;
465
- textBody: string | null;
466
- htmlBody: string | null;
467
- receivedAt: string;
468
- processedAt: string | null;
469
- status: InboundEmailStatus;
470
- errorMessage: string | null;
471
- clientEmailId: string;
472
- attachments?: EmailAttachment[];
473
- clientEmailLocalPart?: string;
474
- }
475
-
476
- export interface EmailAttachment {
477
- id: string;
478
- fileName: string;
479
- mimeType: string;
480
- fileSize: number;
481
- fileUrl: string;
482
- inboundEmailId: string;
483
- parsedDocumentId: string | null;
484
- }
485
-
486
- export interface Expense {
487
- id: string;
488
- type: ExpenseType;
489
- amount: number;
490
- description: string | null;
491
- date: string;
492
- vendor: string | null;
493
- receiptUrl: string | null;
494
- status: ExpenseStatus;
495
- aiConfidence: number | null;
496
- aiMatchNotes: string | null;
497
- sourceEmailId: string | null;
498
- approvedById: string | null;
499
- approvedAt: string | null;
500
- rejectedById: string | null;
501
- rejectedAt: string | null;
502
- rejectionReason: string | null;
503
- orgId: string;
504
- runId: string | null;
505
- driverId: string | null;
506
- truckId: string | null;
507
- trailerId: string | null;
508
- createdAt: string;
509
- updatedAt: string;
510
- // Extended response fields
511
- driverName?: string;
512
- truckNumber?: string;
513
- trailerNumber?: string;
514
- runName?: string;
515
- aiSuggestion?: ExpenseAISuggestion;
516
- }
68
+ // Driver Location - used for real-time tracking
69
+ export type DriverLocation = components['schemas']['DriverLocationResponseDto'];
517
70
 
518
- export interface ExpenseAISuggestion {
519
- driverId?: string;
520
- driverName?: string;
521
- truckId?: string;
522
- truckNumber?: string;
523
- trailerId?: string;
524
- trailerNumber?: string;
525
- runId?: string;
526
- runName?: string;
527
- confidence: number;
528
- }
71
+ // Parsed Document - rate con/bol parsing results
72
+ export type ParsedDocument = components['schemas']['ParsedDocumentResponseDto'];
529
73
 
530
- export interface ExpenseStats {
531
- totalPending: number;
532
- totalApproved: number;
533
- pendingAmount: number;
534
- approvedAmount: number;
535
- byType: Record<ExpenseType, number>;
536
- }
74
+ // Run Summary for dashboard/pagination
75
+ export type RunSummary = components['schemas']['RunSummaryResponseDto'];
537
76
 
538
- // Document signing response
539
- export interface DocumentToSign {
540
- id: string;
541
- documentUrl: string;
542
- fileName: string | null;
543
- mimeType: string | null;
544
- isSigned: boolean;
545
- signedAt: string | null;
546
- isExpired: boolean;
547
- expiresAt: string | null;
548
- // Parsed data
549
- brokerName?: string;
550
- loadNumber?: string;
551
- rate?: number;
552
- pickupLocation?: string;
553
- deliveryLocation?: string;
554
- pickupDate?: string;
555
- deliveryDate?: string;
556
- equipmentType?: string;
557
- commodity?: string;
558
- weight?: number;
559
- organizationName: string;
560
- hasSavedSignature?: boolean;
561
- savedSignaturePreview?: string;
562
- }
77
+ // ============================================================================
78
+ // PAGINATION UTILITY TYPES (generic helpers, not entity-specific)
79
+ // ============================================================================
563
80
 
564
- export interface SignDocumentResponse {
565
- success: boolean;
566
- message: string;
567
- createdRunId?: string;
568
- forwarded?: boolean;
569
- forwardedTo?: string[];
81
+ // Generic pagination metadata
82
+ export interface PaginationMeta {
83
+ total: number;
84
+ page: number;
85
+ limit: number;
86
+ totalPages: number;
570
87
  }
571
88
 
572
- // export interface StatementLineItem {
573
- // description: string;
574
- // type: 'EARNING' | 'DEDUCTION';
575
- // amount: number;
576
- // runId?: string;
577
- // loadNumber?: string;
578
- // }
579
- //
580
- // // ============================================================================
581
- // // AUTH RESPONSE TYPES
582
- // // ============================================================================
583
- //
584
- export interface AuthResponse {
585
- accessToken: string;
586
- refreshToken: string;
587
- user: User;
89
+ // Generic paginated response helper
90
+ export interface PaginatedResponse<T> {
91
+ data: T[];
92
+ meta: PaginationMeta;
588
93
  }
589
94
 
590
- export interface LinkingCodeResponse {
591
- code: string;
592
- expiresAt: string;
593
- }
95
+ // Customer
96
+ export type Customer = components['schemas']['CustomerResponseDto'];
97
+ export type CustomerList = components['schemas']['CustomerListResponseDto'];
594
98
 
595
- // ============================================================================
596
- // TRACKING TYPES (Public API responses)
597
- // ============================================================================
99
+ // Message
100
+ export type Message = components['schemas']['MessageResponseDto'];
101
+ export type MessageList = components['schemas']['MessageListResponseDto'];
598
102
 
599
- export interface TrackingStatus {
600
- runId: string;
601
- runName: string;
602
- status: RunStatus;
603
- estimatedArrival: string | null;
604
- currentStop: {
605
- id: string;
606
- address: string;
607
- status: StopStatus;
608
- } | null;
609
- stopsTotal: number;
610
- stopsCompleted: number;
611
- }
103
+ // Statement
104
+ export type DriverStatement = components['schemas']['StatementResponseDto'];
105
+ export type StatementList = components['schemas']['StatementListResponseDto'];
106
+ export type StatementLineItem = components['schemas']['StatementLineItem'];
612
107
 
613
- export interface TrackingLocation {
614
- lat: number;
615
- lng: number;
616
- updatedAt: string;
617
- }
108
+ // Referral
109
+ export type Referral = components['schemas']['ReferralResponseDto'];
110
+ export type ReferralList = components['schemas']['ReferralListResponseDto'];
111
+ export type ReferralStats = components['schemas']['ReferralStatsDto'];
618
112
 
619
- // ============================================================================
620
- // DASHBOARD/SUMMARY TYPES
621
- // ============================================================================
113
+ // Extracted Assets
114
+ export type ExtractedAsset = components['schemas']['ExtractedAssetResponseDto'];
115
+ export type ExtractedAssetField = components['schemas']['ExtractedAssetFieldDto'];
116
+ export type ExtractionResult = components['schemas']['ExtractionResultResponseDto'];
117
+ export type PaginatedExtractions = components['schemas']['PaginatedExtractionsResponseDto'];
118
+ export type BulkOperationResult = components['schemas']['BulkOperationResponseDto'];
622
119
 
623
- export interface RunSummary {
624
- id: string;
625
- name: string;
626
- status: RunStatus;
627
- plannedDate: string;
628
- driverName: string | null;
629
- stopsTotal: number;
630
- stopsCompleted: number;
631
- }
120
+ // Smart Parse
121
+ export type SmartParseDocument = components['schemas']['SmartParseDocumentDto'];
122
+ export type SmartParseResult = components['schemas']['SmartParseResultDto'];
123
+ export type SuggestedDriver = components['schemas']['SuggestedDriverDto'];
124
+ export type SuggestedCustomer = components['schemas']['SuggestedCustomerDto'];
632
125
 
633
- export interface TodaysRunsResponse {
634
- runs: RunSummary[];
635
- stats: {
636
- total: number;
637
- inProgress: number;
638
- completed: number;
639
- delayed: number;
640
- };
641
- }
126
+ // Signatures
127
+ export type UserSignature = components['schemas']['SignatureResponseDto'];
128
+ export type SignatureExists = components['schemas']['SignatureExistsResponseDto'];
129
+
130
+ // Expenses
131
+ export type Expense = components['schemas']['ExpenseResponseDto'];
132
+ export type ExpenseList = components['schemas']['ExpenseListResponseDto'];
133
+ export type ExpenseListResponse = components['schemas']['ExpenseListResponseDto'];
134
+ export type PaginatedExpenses = components['schemas']['ExpenseListResponseDto'];
135
+ export type ExpenseStats = components['schemas']['ExpenseStatsDto'];
136
+ export type AISuggestion = components['schemas']['AISuggestionDto'];
137
+
138
+ // Email Inbound
139
+ export type ClientEmail = components['schemas']['ClientEmailResponseDto'];
140
+ export type ClientEmailList = components['schemas']['ClientEmailListResponseDto'];
141
+ export type ClientEmailListResponse = components['schemas']['ClientEmailListResponseDto'];
142
+ export type InboundEmail = components['schemas']['InboundEmailResponseDto'];
143
+ export type InboundEmailList = components['schemas']['InboundEmailListResponseDto'];
144
+ export type InboundEmailListResponse = components['schemas']['InboundEmailListResponseDto'];
145
+ export type PaginatedInboundEmails = components['schemas']['InboundEmailListResponseDto'];
146
+ export type EmailAttachment = components['schemas']['EmailAttachmentResponseDto'];
147
+
148
+ // Document Signing
149
+ export type DocumentToSign = components['schemas']['DocumentToSignResponseDto'];
150
+ export type SignDocumentResponse = components['schemas']['SignDocumentResponseDto'];
642
151
 
643
152
  // ============================================================================
644
- // REQUEST DTOs (✅ Re-exported from generated types)
153
+ // REQUEST DTOs
645
154
  // ============================================================================
646
155
 
647
156
  // Auth DTOs
@@ -650,6 +159,9 @@ export type LoginDto = components['schemas']['LoginDto'];
650
159
  export type TelegramAuthDto = components['schemas']['TelegramAuthDto'];
651
160
  export type TelegramLinkDto = components['schemas']['TelegramLinkDto'];
652
161
  export type RefreshTokenDto = components['schemas']['RefreshTokenDto'];
162
+ export type VerifyEmailDto = components['schemas']['VerifyEmailDto'];
163
+ export type ForgotPasswordDto = components['schemas']['ForgotPasswordDto'];
164
+ export type ResetPasswordDto = components['schemas']['ResetPasswordDto'];
653
165
 
654
166
  // User DTOs
655
167
  export type CreateUserDto = components['schemas']['CreateUserDto'];
@@ -665,6 +177,8 @@ export type InviteUserDto = components['schemas']['InviteUserDto'];
665
177
  export type CreateRunDto = components['schemas']['CreateRunDto'];
666
178
  export type UpdateRunDto = components['schemas']['UpdateRunDto'];
667
179
  export type AssignDriverDto = components['schemas']['AssignDriverDto'];
180
+ export type CancelRunDto = components['schemas']['CancelRunDto'];
181
+ export type ReactivateRunDto = components['schemas']['ReactivateRunDto'];
668
182
 
669
183
  // Stop DTOs
670
184
  export type CreateStopDto = components['schemas']['CreateStopDto'];
@@ -675,6 +189,8 @@ export type UpdateStopStatusDto = components['schemas']['UpdateStopStatusDto'];
675
189
  // Document DTOs
676
190
  export type CreateDocumentDto = components['schemas']['CreateDocumentDto'];
677
191
  export type CreateCompanyDocumentDto = components['schemas']['CreateCompanyDocumentDto'];
192
+ export type ParseRateConDto = components['schemas']['ParseRateConDto'];
193
+ export type ExtractAssetsDto = components['schemas']['ExtractAssetsDto'];
678
194
 
679
195
  // Magic Link DTOs
680
196
  export type CreateMagicLinkDto = components['schemas']['CreateMagicLinkDto'];
@@ -695,224 +211,74 @@ export type CreateMessageDto = components['schemas']['CreateMessageDto'];
695
211
  export type MarkReadDto = components['schemas']['MarkReadDto'];
696
212
 
697
213
  // Statement DTOs
698
- // export type CreateStatementDto = components['schemas']['CreateStatementDto'];
699
- // export type UpdateStatementDto = components['schemas']['UpdateStatementDto'];
700
- // export type GenerateStatementDto = components['schemas']['GenerateStatementDto'];
214
+ export type CreateStatementDto = components['schemas']['CreateStatementDto'];
215
+ export type UpdateStatementDto = components['schemas']['UpdateStatementDto'];
216
+ export type GenerateStatementDto = components['schemas']['GenerateStatementDto'];
701
217
 
702
218
  // Referral DTOs
703
219
  export type CreateReferralDto = components['schemas']['CreateReferralDto'];
704
220
  export type UpdateReferralDto = components['schemas']['UpdateReferralDto'];
705
221
 
706
222
  // Document Processing DTOs
707
- export type ParseRateConDto = components['schemas']['ParseRateConDto'];
708
- export type ExtractAssetsDto = components['schemas']['ExtractAssetsDto'];
709
223
  export type ApproveExtractionDto = components['schemas']['ApproveExtractionDto'];
710
224
  export type RejectExtractionDto = components['schemas']['RejectExtractionDto'];
711
225
  export type MergeExtractionDto = components['schemas']['MergeExtractionDto'];
712
226
  export type BulkApproveDto = components['schemas']['BulkApproveDto'];
713
227
  export type BulkRejectDto = components['schemas']['BulkRejectDto'];
714
228
 
715
- // Driver Management DTOs (new)
229
+ // Driver Management DTOs
716
230
  export type UpdateDriverDto = components['schemas']['UpdateDriverDto'];
717
231
  export type UpdateComplianceDto = components['schemas']['UpdateComplianceDto'];
718
232
  export type AssignDispatcherDto = components['schemas']['AssignDispatcherDto'];
719
233
  export type LinkTeamDriverDto = components['schemas']['LinkTeamDriverDto'];
720
- export type ReactivateRunDto = components['schemas']['ReactivateRunDto'];
721
- export type CancelRunDto = components['schemas']['CancelRunDto'];
722
-
723
- // Compliance Warning Response
724
- export interface ComplianceWarning {
725
- driverId: string;
726
- driverName: string;
727
- type: 'CDL' | 'MEDICAL';
728
- expiryDate: string;
729
- daysUntilExpiry: number;
730
- status: ComplianceStatus;
731
- }
732
-
733
- // Dispatcher Assignment History
734
- export interface DispatcherAssignmentHistory {
735
- id: string;
736
- driverId: string;
737
- dispatcherId: string | null;
738
- dispatcher?: User | null;
739
- assignedById: string;
740
- assignedBy?: User;
741
- reason?: string | null;
742
- createdAt: string;
743
- }
744
-
745
- // ============================================================================
746
- // EMAIL-TO-RUN REQUEST DTOs (manual until OpenAPI regeneration)
747
- // ============================================================================
748
234
 
749
235
  // Signature DTOs
750
- export interface SaveSignatureRequest {
751
- signatureData: string;
752
- }
753
-
754
- // Client Email DTOs
755
- export interface CreateClientEmailRequest {
756
- localPart: string;
757
- customerId?: string;
758
- forwardTo?: string[];
759
- }
760
-
761
- export interface UpdateClientEmailRequest {
762
- localPart?: string;
763
- customerId?: string;
764
- forwardTo?: string[];
765
- isActive?: boolean;
766
- }
767
-
768
- export interface SendInvitationRequest {
769
- recipientEmail: string;
770
- customMessage?: string;
771
- }
236
+ export type SaveSignatureDto = components['schemas']['SaveSignatureDto'];
772
237
 
773
238
  // Expense DTOs
774
- export interface CreateExpenseRequest {
775
- type: ExpenseType;
776
- amount: number;
777
- description?: string;
778
- date: string;
779
- vendor?: string;
780
- receiptUrl?: string;
781
- driverId?: string;
782
- truckId?: string;
783
- trailerId?: string;
784
- runId?: string;
785
- }
786
-
787
- export interface UpdateExpenseRequest {
788
- type?: ExpenseType;
789
- amount?: number;
790
- description?: string;
791
- date?: string;
792
- vendor?: string;
793
- receiptUrl?: string;
794
- driverId?: string;
795
- truckId?: string;
796
- trailerId?: string;
797
- runId?: string;
798
- }
799
-
800
- export interface AssociateExpenseRequest {
801
- driverId?: string;
802
- truckId?: string;
803
- trailerId?: string;
804
- runId?: string;
805
- }
806
-
807
- export interface RejectExpenseRequest {
808
- reason: string;
809
- }
239
+ export type CreateExpenseDto = components['schemas']['CreateExpenseDto'];
240
+ export type UpdateExpenseDto = components['schemas']['UpdateExpenseDto'];
241
+ export type AssociateExpenseDto = components['schemas']['AssociateExpenseDto'];
242
+ export type RejectExpenseDto = components['schemas']['RejectExpenseDto'];
810
243
 
811
- export interface ExpenseFilters {
812
- type?: ExpenseType;
813
- status?: ExpenseStatus;
814
- driverId?: string;
815
- truckId?: string;
816
- runId?: string;
817
- fromDate?: string;
818
- toDate?: string;
819
- search?: string;
820
- page?: number;
821
- limit?: number;
822
- }
244
+ // Client Email DTOs
245
+ export type CreateClientEmailDto = components['schemas']['CreateClientEmailDto'];
246
+ export type UpdateClientEmailDto = components['schemas']['UpdateClientEmailDto'];
247
+ export type SendInvitationDto = components['schemas']['SendInvitationDto'];
823
248
 
824
249
  // Signing DTOs
825
- export interface SignDocumentRequest {
826
- signatureData: string;
827
- signedByName?: string;
828
- signedByEmail?: string;
829
- useSavedSignature?: boolean;
830
- }
250
+ export type SignDocumentDto = components['schemas']['SignDocumentDto'];
831
251
 
832
- // Inbound Email Filters
833
- export interface InboundEmailFilters {
834
- status?: InboundEmailStatus;
835
- clientEmailId?: string;
836
- fromDate?: string;
837
- toDate?: string;
838
- search?: string;
839
- page?: number;
840
- limit?: number;
841
- }
252
+ // ELD DTOs
253
+ export type UpdateManualHosDto = components['schemas']['UpdateManualHosDto'];
254
+ export type LinkEldProviderDto = components['schemas']['LinkEldProviderDto'];
842
255
 
843
256
  // ============================================================================
844
257
  // REQUEST TYPE ALIASES (for SDK compatibility)
845
258
  // ============================================================================
846
259
 
847
260
  export type LoginRequest = LoginDto;
848
- export type LoginResponse = AuthResponse;
849
261
  export type RegisterRequest = RegisterDto;
850
- export type RegisterResponse = AuthResponse;
851
-
852
262
  export type CreateRunRequest = CreateRunDto;
853
263
  export type UpdateRunRequest = UpdateRunDto;
854
-
855
264
  export type CreateStopRequest = CreateStopDto;
856
265
  export type UpdateStopRequest = UpdateStopDto;
857
-
858
266
  export type CreateCustomerRequest = CreateCustomerDto;
859
267
  export type UpdateCustomerRequest = UpdateCustomerDto;
860
-
861
268
  export type CreateMessageRequest = CreateMessageDto;
862
-
863
- // export type CreateStatementRequest = CreateStatementDto;
864
- // export type UpdateStatementRequest = UpdateStatementDto;
865
-
269
+ export type CreateStatementRequest = CreateStatementDto;
270
+ export type UpdateStatementRequest = UpdateStatementDto;
866
271
  export type CreateReferralRequest = CreateReferralDto;
867
272
  export type UpdateReferralRequest = UpdateReferralDto;
868
-
869
- // ============================================================================
870
- // PAGINATION TYPES
871
- // ============================================================================
872
-
873
- export interface PaginationMeta {
874
- total: number;
875
- page: number;
876
- limit: number;
877
- totalPages: number;
878
- }
879
-
880
- export interface PaginatedResponse<T> {
881
- data: T[];
882
- meta: PaginationMeta;
883
- }
884
-
885
- export type PaginatedRuns = PaginatedResponse<Run>;
886
- export type PaginatedStops = PaginatedResponse<Stop>;
887
- export type PaginatedDrivers = PaginatedResponse<User>;
888
- export type PaginatedTrucks = PaginatedResponse<Truck>;
889
- export type PaginatedTrailers = PaginatedResponse<Trailer>;
890
- export type PaginatedCustomers = PaginatedResponse<Customer>;
891
- // export type PaginatedStatements = PaginatedResponse<DriverStatement>;
892
- export type PaginatedMessages = PaginatedResponse<Message>;
893
- export type PaginatedExpenses = PaginatedResponse<Expense>;
894
- export type PaginatedInboundEmails = PaginatedResponse<InboundEmail>;
895
-
896
- // List response types for Email-to-Run feature
897
- export interface ClientEmailListResponse {
898
- data: ClientEmail[];
899
- total: number;
900
- }
901
-
902
- export interface InboundEmailListResponse {
903
- data: InboundEmail[];
904
- total: number;
905
- page: number;
906
- limit: number;
907
- }
908
-
909
- export interface ExpenseListResponse {
910
- data: Expense[];
911
- total: number;
912
- page: number;
913
- limit: number;
914
- pendingCount?: number;
915
- }
273
+ export type CreateExpenseRequest = CreateExpenseDto;
274
+ export type UpdateExpenseRequest = UpdateExpenseDto;
275
+ export type AssociateExpenseRequest = AssociateExpenseDto;
276
+ export type RejectExpenseRequest = RejectExpenseDto;
277
+ export type SendInvitationRequest = SendInvitationDto;
278
+ export type CreateClientEmailRequest = CreateClientEmailDto;
279
+ export type UpdateClientEmailRequest = UpdateClientEmailDto;
280
+ export type SaveSignatureRequest = SaveSignatureDto;
281
+ export type SignDocumentRequest = SignDocumentDto;
916
282
 
917
283
  // ============================================================================
918
284
  // TYPE HELPERS