@routeflow/types 1.0.0 → 1.0.2

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
@@ -17,10 +17,20 @@ export type { components, paths, operations };
17
17
  // ENUMS (match Prisma schema enums)
18
18
  // ============================================================================
19
19
 
20
- export type Role = 'ADMIN' | 'DISPATCHER' | 'DRIVER';
20
+ export type Role = 'ADMIN' | 'OWNER' | 'FLEET_MANAGER' | 'DISPATCHER' | 'ACCOUNTING' | 'DRIVER' | 'BROKER';
21
21
 
22
22
  export type RunStatus = 'DRAFT' | 'ASSIGNED' | 'IN_PROGRESS' | 'COMPLETED' | 'CANCELLED';
23
23
 
24
+ export type CancellationReason =
25
+ | 'CUSTOMER_CANCELLED'
26
+ | 'DRIVER_CANCELLED'
27
+ | 'EQUIPMENT_ISSUE'
28
+ | 'WEATHER'
29
+ | 'RATE_DISPUTE'
30
+ | 'SCHEDULING_CONFLICT'
31
+ | 'NO_SHOW'
32
+ | 'OTHER';
33
+
24
34
  export type StopType = 'PICKUP' | 'DELIVERY';
25
35
 
26
36
  export type StopStatus =
@@ -66,9 +76,16 @@ export type DriverDispatchStatus =
66
76
  | 'DISPATCHED'
67
77
  | 'ASSIGNED';
68
78
 
79
+ export type CustomerType = 'BROKER' | 'SHIPPER' | 'CARRIER';
80
+
81
+ export type StatementStatus = 'DRAFT' | 'PENDING' | 'APPROVED' | 'PAID';
82
+
83
+ export type MessageType = 'TEXT' | 'IMAGE' | 'DOCUMENT' | 'SYSTEM';
84
+
85
+ export type ParsedDocumentStatus = 'PENDING' | 'PROCESSED' | 'FAILED' | 'NEEDS_REVIEW';
86
+
69
87
  // ============================================================================
70
88
  // ENTITY TYPES (Response types - match Prisma models)
71
- // TODO: Replace with generated types once API has Response DTOs
72
89
  // ============================================================================
73
90
 
74
91
  export interface Organization {
@@ -111,19 +128,30 @@ export interface Driver {
111
128
  export interface Run {
112
129
  id: string;
113
130
  name: string;
131
+ loadNumber: string | null;
114
132
  status: RunStatus;
115
133
  plannedDate: string;
116
134
  plannedEndDate: string | null;
117
135
  startedAt: string | null;
118
136
  completedAt: string | null;
137
+ cancelledAt: string | null;
138
+ cancellationReason: CancellationReason | null;
139
+ cancellationNotes: string | null;
119
140
  totalDistance: number | null;
120
141
  totalDuration: number | null;
142
+ totalPay: number | null;
143
+ equipmentType: string | null;
144
+ commodityDesc: string | null;
145
+ weight: number | null;
121
146
  orgId: string;
122
147
  driverId: string | null;
148
+ customerId: string | null;
123
149
  createdById: string;
150
+ cancelledById: string | null;
124
151
  createdAt: string;
125
152
  updatedAt: string;
126
153
  driver?: User;
154
+ customer?: Customer;
127
155
  stops?: Stop[];
128
156
  documents?: Document[];
129
157
  }
@@ -133,12 +161,14 @@ export interface Stop {
133
161
  sequence: number;
134
162
  type: StopType;
135
163
  status: StopStatus;
164
+ facilityName: string | null;
136
165
  address: string;
137
166
  lat: number;
138
167
  lng: number;
139
168
  contactName: string | null;
140
169
  contactPhone: string | null;
141
170
  notes: string | null;
171
+ referenceNumber: string | null;
142
172
  timeWindowStart: string | null;
143
173
  timeWindowEnd: string | null;
144
174
  arrivedAt: string | null;
@@ -248,6 +278,108 @@ export interface CompanyDocument {
248
278
  updatedAt: string;
249
279
  }
250
280
 
281
+ // ============================================================================
282
+ // NEW ENTITY TYPES
283
+ // ============================================================================
284
+
285
+ export interface Customer {
286
+ id: string;
287
+ type: CustomerType;
288
+ companyName: string;
289
+ contactName: string | null;
290
+ email: string | null;
291
+ phone: string | null;
292
+ mcNumber: string | null;
293
+ dotNumber: string | null;
294
+ address: string | null;
295
+ city: string | null;
296
+ state: string | null;
297
+ zipCode: string | null;
298
+ country: string | null;
299
+ notes: string | null;
300
+ isActive: boolean;
301
+ orgId: string;
302
+ createdAt: string;
303
+ updatedAt: string;
304
+ }
305
+
306
+ export interface Message {
307
+ id: string;
308
+ type: MessageType;
309
+ content: string;
310
+ metadata: Record<string, unknown> | null;
311
+ isRead: boolean;
312
+ senderId: string;
313
+ recipientId: string | null;
314
+ runId: string | null;
315
+ orgId: string;
316
+ createdAt: string;
317
+ sender?: { id: string; name: string; role: Role };
318
+ recipient?: { id: string; name: string; role: Role };
319
+ }
320
+
321
+ export interface DriverStatement {
322
+ id: string;
323
+ periodStart: string;
324
+ periodEnd: string;
325
+ status: StatementStatus;
326
+ totalMiles: number;
327
+ totalLoads: number;
328
+ grossPay: number;
329
+ deductions: number;
330
+ netPay: number;
331
+ lineItems: StatementLineItem[];
332
+ notes: string | null;
333
+ paidAt: string | null;
334
+ driverId: string;
335
+ orgId: string;
336
+ createdAt: string;
337
+ updatedAt: string;
338
+ driver?: { id: string; name: string };
339
+ }
340
+
341
+ export interface StatementLineItem {
342
+ description: string;
343
+ type: 'EARNING' | 'DEDUCTION';
344
+ amount: number;
345
+ runId?: string;
346
+ loadNumber?: string;
347
+ }
348
+
349
+ export interface Referral {
350
+ id: string;
351
+ code: string;
352
+ description: string | null;
353
+ isActive: boolean;
354
+ maxUses: number | null;
355
+ usedCount: number;
356
+ expiresAt: string | null;
357
+ createdById: string;
358
+ orgId: string;
359
+ createdAt: string;
360
+ updatedAt: string;
361
+ createdBy?: { id: string; name: string };
362
+ }
363
+
364
+ export interface ParsedDocument {
365
+ id: string;
366
+ originalFileUrl: string;
367
+ fileName: string | null;
368
+ mimeType: string | null;
369
+ fileSize: number | null;
370
+ status: ParsedDocumentStatus;
371
+ parsedData: Record<string, unknown> | null;
372
+ confidence: number | null;
373
+ errorMessage: string | null;
374
+ createdRunId: string | null;
375
+ matchedCustomerId: string | null;
376
+ suggestedDriverId: string | null;
377
+ uploadedById: string;
378
+ orgId: string;
379
+ createdAt: string;
380
+ updatedAt: string;
381
+ }
382
+
251
383
  // ============================================================================
252
384
  // AUTH RESPONSE TYPES
253
385
  // ============================================================================
@@ -311,6 +443,15 @@ export interface TodaysRunsResponse {
311
443
  };
312
444
  }
313
445
 
446
+ // ============================================================================
447
+ // SMART PARSE TYPES
448
+ // ============================================================================
449
+
450
+ export type SmartParseDocumentDto = components['schemas']['SmartParseDocumentDto'];
451
+ export type SmartParseResultDto = components['schemas']['SmartParseResultDto'];
452
+ export type SuggestedDriverDto = components['schemas']['SuggestedDriverDto'];
453
+ export type SuggestedCustomerDto = components['schemas']['SuggestedCustomerDto'];
454
+
314
455
  // ============================================================================
315
456
  // REQUEST DTOs (from OpenAPI - these are generated)
316
457
  // ============================================================================
@@ -349,6 +490,54 @@ export type CreateTrailerDto = components['schemas']['CreateTrailerDto'];
349
490
  export type UpdateTrailerDto = components['schemas']['UpdateTrailerDto'];
350
491
  export type AssignAssetDto = components['schemas']['AssignAssetDto'];
351
492
 
493
+ // Customer DTOs
494
+ export type CreateCustomerDto = components['schemas']['CreateCustomerDto'];
495
+ export type UpdateCustomerDto = components['schemas']['UpdateCustomerDto'];
496
+ export type CustomerResponseDto = components['schemas']['CustomerResponseDto'];
497
+ export type CustomerListResponseDto = components['schemas']['CustomerListResponseDto'];
498
+
499
+ // Message DTOs
500
+ export type CreateMessageDto = components['schemas']['CreateMessageDto'];
501
+ export type MessageResponseDto = components['schemas']['MessageResponseDto'];
502
+ export type MessageListResponseDto = components['schemas']['MessageListResponseDto'];
503
+ export type MarkReadDto = components['schemas']['MarkReadDto'];
504
+
505
+ // Statement DTOs
506
+ export type CreateStatementDto = components['schemas']['CreateStatementDto'];
507
+ export type UpdateStatementDto = components['schemas']['UpdateStatementDto'];
508
+ export type GenerateStatementDto = components['schemas']['GenerateStatementDto'];
509
+ export type StatementResponseDto = components['schemas']['StatementResponseDto'];
510
+ export type StatementListResponseDto = components['schemas']['StatementListResponseDto'];
511
+
512
+ // Referral DTOs
513
+ export type CreateReferralDto = components['schemas']['CreateReferralDto'];
514
+ export type UpdateReferralDto = components['schemas']['UpdateReferralDto'];
515
+ export type ReferralResponseDto = components['schemas']['ReferralResponseDto'];
516
+ export type ReferralListResponseDto = components['schemas']['ReferralListResponseDto'];
517
+ export type ReferralStatsDto = components['schemas']['ReferralStatsDto'];
518
+
519
+ // Rate Con Parser DTOs
520
+ export type ParseRateConDto = components['schemas']['ParseRateConDto'];
521
+
522
+ // Asset Extraction DTOs
523
+ export type ExtractAssetsDto = components['schemas']['ExtractAssetsDto'];
524
+ export type ApproveExtractionDto = components['schemas']['ApproveExtractionDto'];
525
+ export type RejectExtractionDto = components['schemas']['RejectExtractionDto'];
526
+ export type MergeExtractionDto = components['schemas']['MergeExtractionDto'];
527
+ export type BulkApproveDto = components['schemas']['BulkApproveDto'];
528
+ export type BulkRejectDto = components['schemas']['BulkRejectDto'];
529
+
530
+ // Asset Extraction Response DTOs
531
+ export type ExtractedAssetFieldDto = components['schemas']['ExtractedAssetFieldDto'];
532
+ export type ExtractedAssetResponseDto = components['schemas']['ExtractedAssetResponseDto'];
533
+ export type ExtractionResultResponseDto = components['schemas']['ExtractionResultResponseDto'];
534
+ export type PaginatedExtractionsResponseDto = components['schemas']['PaginatedExtractionsResponseDto'];
535
+ export type BulkOperationResponseDto = components['schemas']['BulkOperationResponseDto'];
536
+
537
+ // Asset Extraction Enums
538
+ export type ExtractedAssetType = 'DRIVER' | 'TRUCK' | 'TRAILER';
539
+ export type ExtractedAssetStatus = 'PENDING' | 'APPROVED' | 'REJECTED' | 'MERGED';
540
+
352
541
  // ============================================================================
353
542
  // REQUEST TYPE ALIASES (for SDK compatibility)
354
543
  // ============================================================================
@@ -385,6 +574,9 @@ export type PaginatedStops = PaginatedResponse<Stop>;
385
574
  export type PaginatedDrivers = PaginatedResponse<User>;
386
575
  export type PaginatedTrucks = PaginatedResponse<Truck>;
387
576
  export type PaginatedTrailers = PaginatedResponse<Trailer>;
577
+ export type PaginatedCustomers = PaginatedResponse<Customer>;
578
+ export type PaginatedStatements = PaginatedResponse<DriverStatement>;
579
+ export type PaginatedMessages = PaginatedResponse<Message>;
388
580
 
389
581
  // ============================================================================
390
582
  // TYPE HELPERS