@burdenoff/microfe-movethewheels 2026.929.3 → 2026.929.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.
Files changed (50) hide show
  1. package/dist/generated/wspace-types.d.ts +1547 -64
  2. package/dist/hooks/useCustomers.js +3 -9
  3. package/dist/hooks/useFleet.js +146 -149
  4. package/dist/hooks/useInventory.js +178 -153
  5. package/dist/hooks/useRoutes.js +9 -9
  6. package/dist/hooks/useTracking.js +14 -16
  7. package/dist/movethewheels/hooks/useFleet.d.ts +9 -2
  8. package/dist/movethewheels/hooks/useInventory.d.ts +13 -12
  9. package/dist/movethewheels/hooks/useRoutes.d.ts +4 -1
  10. package/dist/movethewheels/types/index.d.ts +33 -23
  11. package/dist/movethewheels/utils/formatters.d.ts +1 -1
  12. package/dist/pages/CustomerDetailsPage.js +6 -6
  13. package/dist/pages/CustomersPage.js +2 -2
  14. package/dist/pages/DashboardPage.js +1 -1
  15. package/dist/pages/DriverDetailsPage.js +7 -3
  16. package/dist/pages/DriversPage.js +4 -4
  17. package/dist/pages/FleetPage.js +1 -1
  18. package/dist/pages/InventoryPage.js +11 -12
  19. package/dist/pages/LiveTrackingPage.js +4 -4
  20. package/dist/pages/ProductDetailsPage.js +408 -249
  21. package/dist/pages/ProductsPage.js +5 -5
  22. package/dist/pages/RouteDetailsPage.js +8 -10
  23. package/dist/pages/RoutesPage.js +2 -2
  24. package/dist/pages/TrackingPage.js +14 -8
  25. package/dist/pages/WarehouseDetailsPage.js +166 -163
  26. package/dist/pages/WarehousesPage.js +29 -21
  27. package/package.json +1 -1
  28. package/src/generated/wspace-types.ts +1762 -64
  29. package/src/movethewheels/hooks/useCustomers.ts +7 -9
  30. package/src/movethewheels/hooks/useFleet.ts +89 -31
  31. package/src/movethewheels/hooks/useInventory.ts +143 -49
  32. package/src/movethewheels/hooks/useRoutes.ts +36 -16
  33. package/src/movethewheels/hooks/useTracking.ts +23 -15
  34. package/src/movethewheels/pages/CustomerDetailsPage.tsx +14 -8
  35. package/src/movethewheels/pages/CustomersPage.tsx +5 -2
  36. package/src/movethewheels/pages/DashboardPage.tsx +3 -1
  37. package/src/movethewheels/pages/DriverDetailsPage.tsx +13 -3
  38. package/src/movethewheels/pages/DriversPage.tsx +1 -1
  39. package/src/movethewheels/pages/FleetPage.tsx +1 -1
  40. package/src/movethewheels/pages/InventoryPage.tsx +20 -16
  41. package/src/movethewheels/pages/LiveTrackingPage.tsx +6 -4
  42. package/src/movethewheels/pages/ProductDetailsPage.tsx +228 -49
  43. package/src/movethewheels/pages/ProductsPage.tsx +13 -5
  44. package/src/movethewheels/pages/RouteDetailsPage.tsx +16 -8
  45. package/src/movethewheels/pages/RoutesPage.tsx +4 -2
  46. package/src/movethewheels/pages/TrackingPage.tsx +25 -10
  47. package/src/movethewheels/pages/WarehouseDetailsPage.tsx +42 -29
  48. package/src/movethewheels/pages/WarehousesPage.tsx +23 -15
  49. package/src/movethewheels/types/index.ts +36 -24
  50. package/src/movethewheels/utils/formatters.ts +1 -1
@@ -6,18 +6,21 @@ import { useCallback as u, useEffect as d, useMemo as f, useState as p } from "r
6
6
  //#region src/movethewheels/hooks/useTracking.ts
7
7
  var m = "\n query ListShipments($filter: ShipmentFilterInput, $pagination: PaginationInput) {\n shipments(filter: $filter, pagination: $pagination) {\n id\n shipmentNumber\n deliveryJobId\n status\n trackingNumber\n estimatedDelivery\n }\n }\n", h = "\n query LookupDeliveryJob($id: ID!) {\n deliveryJob(id: $id) {\n id\n }\n }\n", g = "\n query LookupDeliveryJobs($filter: DeliveryJobFilterInput, $pagination: PaginationInput) {\n deliveryJobs(filter: $filter, pagination: $pagination) {\n id\n deliveryJobNumber\n trackingNumber\n }\n }\n", _ = "\n query GetDeliveryJobTracking($deliveryJobId: ID!, $pagination: PaginationInput) {\n deliveryJobTracking(deliveryJobId: $deliveryJobId, pagination: $pagination) {\n id\n shipmentId\n eventType\n location\n details\n timestamp\n }\n }\n", v = "\n query GetActiveDeliveries($pagination: PaginationInput) {\n activeDeliveries(pagination: $pagination) {\n id\n shipmentNumber\n deliveryJobId\n status\n estimatedDelivery\n trackingEvents(pagination: { limit: 1, offset: 0 }) {\n id\n shipmentId\n eventType\n location\n details\n timestamp\n }\n deliveryJob {\n id\n deliveryJobNumber\n customerId\n status\n priority\n pickupAddress\n deliveryAddress\n cargoItems\n pricing\n trackingNumber\n specialInstructions\n scheduledDelivery\n vehicleId\n driverId\n createdAt\n updatedAt\n customer {\n name\n email\n phone\n company\n }\n vehicle {\n id\n vehicleNumber\n type\n make\n model\n licensePlate\n ownershipType\n year\n capacity\n status\n currentLocation\n fuelLevel\n mileage\n lastServiceDate\n nextServiceDueDate\n nextServiceDueMileage\n createdAt\n }\n driver {\n id\n userId\n firstName\n lastName\n email\n phone\n employeeId\n licenseNumber\n licenseClass\n licenseExpiry\n status\n currentLocation\n rating\n vehicleId\n createdAt\n }\n }\n }\n }\n", y = "\n query GetTrackingAlerts {\n trackingAlerts {\n shipmentId\n shipmentNumber\n alertType\n message\n }\n }\n";
8
8
  function b(e) {
9
- return {
10
- latitude: Number(e.location?.latitude ?? 0),
11
- longitude: Number(e.location?.longitude ?? 0),
12
- address: e.location?.address ?? void 0,
9
+ let t = e.location;
10
+ if (!t) return null;
11
+ let n = t.latitude ?? t.lat, r = t.longitude ?? t.lng;
12
+ return typeof n != "number" || !Number.isFinite(n) || typeof r != "number" || !Number.isFinite(r) ? null : {
13
+ latitude: n,
14
+ longitude: r,
15
+ address: typeof t.address == "string" ? t.address : void 0,
13
16
  timestamp: new Date(e.timestamp)
14
17
  };
15
18
  }
16
19
  function x(e, t) {
17
20
  let n = e[0];
18
21
  if (!n) return null;
19
- let r = e.map(b), i = r[0];
20
- return i ? {
22
+ let r = e.map(b).filter((e) => e !== null), i = r[0];
23
+ return {
21
24
  id: n.id,
22
25
  entityId: t,
23
26
  entityType: "order",
@@ -28,7 +31,7 @@ function x(e, t) {
28
31
  nextCheckpoint: n.details ?? void 0,
29
32
  alerts: [],
30
33
  lastUpdated: new Date(n.timestamp)
31
- } : null;
34
+ };
32
35
  }
33
36
  function S() {
34
37
  let { apiGatewayUrl: t, authToken: n, workspaceToken: r, workspaceId: i, tenantId: a, currentUser: o } = e();
@@ -78,17 +81,13 @@ function T(e = {}) {
78
81
  id: e.id,
79
82
  entityId: n ?? e.deliveryJobId ?? e.id,
80
83
  entityType: r ?? "order",
81
- currentLocation: {
82
- latitude: 0,
83
- longitude: 0,
84
- timestamp: /* @__PURE__ */ new Date()
85
- },
84
+ currentLocation: void 0,
86
85
  locationHistory: [],
87
86
  status: e.status.toLowerCase(),
88
87
  estimatedArrival: e.estimatedDelivery ? new Date(e.estimatedDelivery) : void 0,
89
88
  nextCheckpoint: e.shipmentNumber,
90
89
  alerts: [],
91
- lastUpdated: /* @__PURE__ */ new Date()
90
+ lastUpdated: void 0
92
91
  })));
93
92
  } catch (e) {
94
93
  h(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load tracking data"));
@@ -197,7 +196,7 @@ function O(e) {
197
196
  currentLocation: t.currentLocation,
198
197
  locationHistory: [t.currentLocation],
199
198
  status: t.status,
200
- lastUpdated: t.currentLocation.timestamp ?? /* @__PURE__ */ new Date(),
199
+ lastUpdated: t.currentLocation.timestamp,
201
200
  alerts: []
202
201
  }, [t]),
203
202
  vehicle: t,
@@ -216,7 +215,7 @@ function k(e) {
216
215
  currentLocation: t.currentLocation,
217
216
  locationHistory: [t.currentLocation],
218
217
  status: t.status,
219
- lastUpdated: t.currentLocation.timestamp ?? /* @__PURE__ */ new Date(),
218
+ lastUpdated: t.currentLocation.timestamp,
220
219
  alerts: []
221
220
  }, [t]),
222
221
  driver: t,
@@ -266,7 +265,6 @@ function j() {
266
265
  type: "delay",
267
266
  severity: "medium",
268
267
  message: `${e.shipmentNumber}: ${e.message}`,
269
- timestamp: /* @__PURE__ */ new Date(),
270
268
  acknowledged: !1
271
269
  })));
272
270
  } catch (e) {
@@ -36,7 +36,8 @@ export interface CreateDriverInput {
36
36
  licenseExpiry?: string;
37
37
  /** DriverStatus enum value, e.g. `AVAILABLE`, `OFF_DUTY`. */
38
38
  status?: string;
39
- vehicleId?: string;
39
+ vehicleId?: string | null;
40
+ vehicleIds?: string[];
40
41
  rating?: number;
41
42
  notes?: string;
42
43
  hireDate?: string;
@@ -85,6 +86,9 @@ export interface ApiVehicle {
85
86
  nextServiceDueMileage?: number | null;
86
87
  createdAt: string;
87
88
  updatedAt?: string;
89
+ drivers?: Array<{
90
+ id: string;
91
+ }>;
88
92
  }
89
93
  export interface ApiDriver {
90
94
  id: string;
@@ -101,6 +105,9 @@ export interface ApiDriver {
101
105
  currentLocation?: Record<string, unknown> | null;
102
106
  rating?: number | null;
103
107
  vehicleId?: string | null;
108
+ vehicles?: Array<{
109
+ id: string;
110
+ }>;
104
111
  notes?: string | null;
105
112
  hireDate?: string | null;
106
113
  baseSalary?: number | null;
@@ -164,7 +171,7 @@ interface UseDriversResult {
164
171
  error: Error | null;
165
172
  refetch: () => void;
166
173
  updateDriverStatus: (id: string, status: DriverStatus) => Promise<Driver>;
167
- assignVehicle: (driverId: string, vehicleId: string) => Promise<Driver>;
174
+ assignVehicle: (driverId: string, vehicleId: string | null) => Promise<Driver>;
168
175
  }
169
176
  interface UseDriversOptions extends UseListOptions {
170
177
  /** Narrows the roster server-side via DriverFilterInput.status. */
@@ -1,4 +1,4 @@
1
- import { Inventory, InventoryFilter, Product, Warehouse } from '../types';
1
+ import { Inventory, InventoryFilter, Product, ProductDimensions, Warehouse } from '../types';
2
2
 
3
3
  interface UseInventoryOptions {
4
4
  filters?: InventoryFilter;
@@ -9,23 +9,23 @@ interface UseInventoryOptions {
9
9
  export interface CreateProductInput {
10
10
  name: string;
11
11
  sku: string;
12
- category?: string;
13
- brand?: string;
14
- weight?: number;
12
+ description?: string | null;
13
+ category?: string | null;
14
+ brand?: string | null;
15
+ dimensions?: ProductDimensions | null;
16
+ weight?: number | null;
17
+ value?: number | null;
18
+ hazardous?: boolean;
19
+ fragile?: boolean;
20
+ temperatureControlled?: boolean;
15
21
  }
16
22
  export interface CreateWarehouseInput {
17
23
  code: string;
18
24
  name: string;
19
25
  /** WarehouseType enum value, e.g. `DISTRIBUTION`, `FULFILLMENT`. */
20
26
  type: string;
21
- address: {
22
- street: string;
23
- city: string;
24
- state: string;
25
- postalCode: string;
26
- country: string;
27
- };
28
- /** Free-text on the backend, e.g. "ACTIVE", "INACTIVE". Defaults to ACTIVE. */
27
+ address: Record<string, string>;
28
+ /** Free-text on the backend, e.g. "ACTIVE", "INACTIVE". */
29
29
  status?: string;
30
30
  contactInfo?: {
31
31
  email?: string;
@@ -49,6 +49,7 @@ interface UseInventoryResult {
49
49
  createProduct: (input: CreateProductInput) => Promise<Product>;
50
50
  createWarehouse: (input: CreateWarehouseInput) => Promise<Warehouse>;
51
51
  updateProduct: (id: string, input: CreateProductInput) => Promise<Product>;
52
+ deleteProduct: (id: string) => Promise<void>;
52
53
  updateWarehouse: (id: string, input: CreateWarehouseInput) => Promise<Warehouse>;
53
54
  deleteWarehouse: (id: string) => Promise<void>;
54
55
  }
@@ -17,7 +17,10 @@ interface UseRoutesResult {
17
17
  error: Error | null;
18
18
  refetch: () => void;
19
19
  createRoute: (route: Partial<Route>) => Promise<Route>;
20
- updateRoute: (id: string, updates: Partial<Route>) => Promise<Route>;
20
+ updateRoute: (id: string, updates: Omit<Partial<Route>, 'vehicleId' | 'driverId'> & {
21
+ vehicleId?: string | null;
22
+ driverId?: string | null;
23
+ }) => Promise<Route>;
21
24
  deleteRoute: (id: string) => Promise<void>;
22
25
  optimizeRoute: (routeId: string) => Promise<Route>;
23
26
  updateStopStatus: (routeId: string, stopId: string, status: RouteStop['status']) => Promise<Route>;
@@ -76,6 +76,12 @@ export interface Dimensions {
76
76
  height: number;
77
77
  unit: 'cm' | 'in' | 'm';
78
78
  }
79
+ export interface ProductDimensions {
80
+ length?: number;
81
+ width?: number;
82
+ height?: number;
83
+ unit?: 'cm' | 'in' | 'm' | string;
84
+ }
79
85
  export interface Company {
80
86
  id: string;
81
87
  name: string;
@@ -132,10 +138,10 @@ export interface Customer {
132
138
  phone: string;
133
139
  type: 'b2b' | 'b2c';
134
140
  company?: string;
135
- address: Address;
141
+ address: Partial<Address>;
136
142
  businessLicense?: string;
137
143
  taxId?: string;
138
- rating: number;
144
+ rating?: number;
139
145
  createdAt: Date;
140
146
  updatedAt: Date;
141
147
  }
@@ -143,12 +149,12 @@ export interface Product {
143
149
  id: string;
144
150
  sku: string;
145
151
  name: string;
146
- description: string;
147
- category: string;
152
+ description?: string;
153
+ category?: string;
148
154
  brand?: string;
149
- dimensions: Dimensions;
150
- weight: number;
151
- value: number;
155
+ dimensions?: ProductDimensions;
156
+ weight?: number;
157
+ value?: number;
152
158
  barcode?: string;
153
159
  images: string[];
154
160
  attributes: Array<{
@@ -271,7 +277,9 @@ export interface Vehicle {
271
277
  pallets?: number;
272
278
  };
273
279
  status: VehicleStatus;
280
+ /** Deprecated single-driver convenience value; use driverIds for all links. */
274
281
  driverId?: string;
282
+ driverIds: string[];
275
283
  currentLocation?: Location;
276
284
  lastMaintenance?: Date;
277
285
  nextMaintenance?: Date;
@@ -304,11 +312,12 @@ export interface Driver {
304
312
  licenseType: string;
305
313
  licenseExpiry?: Date;
306
314
  vehicleIds: string[];
315
+ /** Deprecated single-vehicle convenience value; use vehicleIds for all links. */
307
316
  assignedVehicle?: string;
308
317
  status: DriverStatus;
309
318
  currentLocation?: Location;
310
319
  /** MtwDriver.rating — a single overall rating; the backend does not track per-category breakdowns. */
311
- rating: number;
320
+ rating?: number;
312
321
  /** Free-text HR/performance notes. */
313
322
  notes?: string;
314
323
  hireDate?: Date;
@@ -326,13 +335,13 @@ export interface Warehouse {
326
335
  id: string;
327
336
  name: string;
328
337
  code: string;
329
- address: Address;
338
+ address: Partial<Address>;
330
339
  type: 'distribution' | 'fulfillment' | 'cold_storage' | 'cross_dock' | 'retail';
331
- /** Raw backend value (free-text, e.g. "ACTIVE"/"INACTIVE" — defaults to ACTIVE). */
332
- status: string;
340
+ /** Raw backend value (free-text, e.g. "ACTIVE"/"INACTIVE"). */
341
+ status?: string;
333
342
  capacity: {
334
- totalSpace: number;
335
- usedSpace: number;
343
+ totalSpace?: number;
344
+ usedSpace?: number;
336
345
  };
337
346
  operatingHours: Record<string, {
338
347
  open: string;
@@ -342,8 +351,8 @@ export interface Warehouse {
342
351
  email?: string;
343
352
  phone?: string;
344
353
  };
345
- /** Real computed value: usedSpace / totalSpace. No other backend metrics exist for a warehouse. */
346
- utilization: number;
354
+ /** Real computed value: usedSpace / totalSpace, when both values are available. */
355
+ utilization?: number;
347
356
  createdAt: Date;
348
357
  }
349
358
  export interface InventoryMovement {
@@ -379,9 +388,9 @@ export interface RouteStop {
379
388
  sequence: number;
380
389
  address: Address;
381
390
  type: 'pickup' | 'delivery';
382
- scheduledTime: Date;
391
+ scheduledTime?: Date;
383
392
  actualTime?: Date;
384
- duration: number;
393
+ duration?: number;
385
394
  status: 'pending' | 'completed' | 'skipped' | 'failed';
386
395
  notes?: string;
387
396
  }
@@ -394,8 +403,8 @@ export interface TrafficCondition {
394
403
  export interface Route {
395
404
  id: string;
396
405
  name: string;
397
- driverId: string;
398
- vehicleId: string;
406
+ driverId?: string;
407
+ vehicleId?: string;
399
408
  status: 'planned' | 'in_progress' | 'completed' | 'cancelled';
400
409
  stops: RouteStop[];
401
410
  distance: number;
@@ -403,7 +412,8 @@ export interface Route {
403
412
  /** Estimated fuel cost for the route (svc MtwRoute.fuelCost). */
404
413
  fuelCost?: number;
405
414
  actualDuration?: number;
406
- optimized: boolean;
415
+ /** Backend currently does not expose whether optimization has run. */
416
+ optimized?: boolean;
407
417
  createdAt: Date;
408
418
  }
409
419
  export interface TrackingAlert {
@@ -411,7 +421,7 @@ export interface TrackingAlert {
411
421
  type: 'delay' | 'deviation' | 'temperature' | 'damage' | 'security';
412
422
  severity: 'low' | 'medium' | 'high' | 'critical';
413
423
  message: string;
414
- timestamp: Date;
424
+ timestamp?: Date;
415
425
  acknowledged: boolean;
416
426
  resolvedAt?: Date;
417
427
  }
@@ -419,13 +429,13 @@ export interface Tracking {
419
429
  id: string;
420
430
  entityId: string;
421
431
  entityType: 'order' | 'vehicle' | 'driver';
422
- currentLocation: Location;
432
+ currentLocation?: Location;
423
433
  locationHistory: Location[];
424
434
  status: string;
425
435
  estimatedArrival?: Date;
426
436
  nextCheckpoint?: string;
427
437
  alerts: TrackingAlert[];
428
- lastUpdated: Date;
438
+ lastUpdated?: Date;
429
439
  }
430
440
  export interface Notification {
431
441
  id: string;
@@ -3,7 +3,7 @@ import { Address } from '../types';
3
3
  /**
4
4
  * Format an address object into a readable string.
5
5
  */
6
- export declare function formatAddress(address: Address): string;
6
+ export declare function formatAddress(address: Partial<Address>): string;
7
7
  /**
8
8
  * Format a number as currency.
9
9
  */
@@ -346,11 +346,11 @@ function H(e) {
346
346
  phone: e.phone,
347
347
  company: e.company ?? "",
348
348
  type: e.type,
349
- street: e.address.street,
350
- city: e.address.city,
351
- state: e.address.state,
352
- postalCode: e.address.postalCode,
353
- country: e.address.country,
349
+ street: e.address.street ?? "",
350
+ city: e.address.city ?? "",
351
+ state: e.address.state ?? "",
352
+ postalCode: e.address.postalCode ?? "",
353
+ country: e.address.country ?? "",
354
354
  businessLicense: e.businessLicense ?? "",
355
355
  taxId: e.taxId ?? "",
356
356
  rating: e.rating ? String(e.rating) : ""
@@ -430,7 +430,7 @@ function U() {
430
430
  }),
431
431
  headerContent: /* @__PURE__ */ R("div", {
432
432
  className: "flex items-center gap-4",
433
- children: [/* @__PURE__ */ L(re, { type: W.type }), W.rating > 0 && /* @__PURE__ */ R("div", {
433
+ children: [/* @__PURE__ */ L(re, { type: W.type }), W.rating !== void 0 && /* @__PURE__ */ R("div", {
434
434
  className: "flex items-center gap-1",
435
435
  children: [/* @__PURE__ */ L(c, {
436
436
  size: 16,
@@ -113,7 +113,7 @@ function T() {
113
113
  {
114
114
  id: "location",
115
115
  header: "Location",
116
- cell: (e) => `${e.address.city}, ${e.address.state}`
116
+ cell: (e) => [e.address.city, e.address.state].filter(Boolean).join(", ") || "Not provided"
117
117
  },
118
118
  {
119
119
  id: "rating",
@@ -123,7 +123,7 @@ function T() {
123
123
  children: [/* @__PURE__ */ x(i, {
124
124
  size: 14,
125
125
  className: "text-status-warning-text fill-current"
126
- }), /* @__PURE__ */ x("span", { children: e.rating.toFixed(1) })]
126
+ }), /* @__PURE__ */ x("span", { children: e.rating === void 0 ? "Not provided" : e.rating.toFixed(1) })]
127
127
  })
128
128
  },
129
129
  {
@@ -189,7 +189,7 @@ function L() {
189
189
  children: e.message
190
190
  }), /* @__PURE__ */ j("p", {
191
191
  className: "mt-1 text-xs text-text-secondary",
192
- children: k(e.timestamp, "relative")
192
+ children: e.timestamp ? k(e.timestamp, "relative") : "Time not recorded"
193
193
  })]
194
194
  }, e.id))
195
195
  }) : /* @__PURE__ */ j("p", {
@@ -41,6 +41,7 @@ var pe = Object.entries(N).map(([e, t]) => ({
41
41
  licenseExpiry: "",
42
42
  status: "available",
43
43
  vehicleId: "",
44
+ vehicleIds: [],
44
45
  rating: "",
45
46
  notes: "",
46
47
  hireDate: "",
@@ -68,6 +69,7 @@ function J({ editId: t }) {
68
69
  licenseExpiry: K(j.licenseExpiry),
69
70
  status: j.status,
70
71
  vehicleId: j.assignedVehicle || "",
72
+ vehicleIds: j.vehicleIds,
71
73
  rating: j.rating ? String(j.rating) : "",
72
74
  notes: j.notes || "",
73
75
  hireDate: K(j.hireDate),
@@ -86,7 +88,8 @@ function J({ editId: t }) {
86
88
  licenseClass: P.licenseClass.trim() || void 0,
87
89
  licenseExpiry: q(P.licenseExpiry),
88
90
  status: p(P.status),
89
- vehicleId: P.vehicleId || void 0,
91
+ vehicleId: P.vehicleId || null,
92
+ vehicleIds: P.vehicleIds,
90
93
  rating: P.rating.trim() ? Number(P.rating) : void 0,
91
94
  notes: P.notes.trim() || void 0,
92
95
  hireDate: q(P.hireDate),
@@ -388,7 +391,8 @@ function J({ editId: t }) {
388
391
  value: P.vehicleId,
389
392
  onChange: (e) => I((t) => ({
390
393
  ...t,
391
- vehicleId: e
394
+ vehicleId: e,
395
+ vehicleIds: e ? [e] : []
392
396
  })),
393
397
  options: be,
394
398
  loading: xe,
@@ -658,7 +662,7 @@ function Y() {
658
662
  text: "text-status-warning-text"
659
663
  }
660
664
  }),
661
- _.rating > 0 && /* @__PURE__ */ W("div", {
665
+ _.rating !== void 0 && /* @__PURE__ */ W("div", {
662
666
  className: "flex items-center gap-1",
663
667
  children: [/* @__PURE__ */ U(s, {
664
668
  size: 16,
@@ -206,7 +206,10 @@ function P() {
206
206
  {
207
207
  id: "rating",
208
208
  header: "Rating",
209
- cell: (e) => e.rating > 0 ? /* @__PURE__ */ A("div", {
209
+ cell: (e) => e.rating === void 0 ? /* @__PURE__ */ k("span", {
210
+ className: "text-sm text-text-secondary",
211
+ children: "Not rated"
212
+ }) : /* @__PURE__ */ A("div", {
210
213
  className: "flex items-center gap-1",
211
214
  children: [/* @__PURE__ */ k(i, {
212
215
  size: 14,
@@ -215,9 +218,6 @@ function P() {
215
218
  className: "font-medium",
216
219
  children: e.rating.toFixed(1)
217
220
  })]
218
- }) : /* @__PURE__ */ k("span", {
219
- className: "text-sm text-text-secondary",
220
- children: "Not rated"
221
221
  })
222
222
  },
223
223
  {
@@ -261,7 +261,7 @@ function A() {
261
261
  status: e.status,
262
262
  type: "driver",
263
263
  size: "sm"
264
- }), e.rating > 0 && /* @__PURE__ */ w("div", {
264
+ }), e.rating !== void 0 && /* @__PURE__ */ w("div", {
265
265
  className: "mt-1 flex items-center gap-1 justify-end",
266
266
  children: [/* @__PURE__ */ C(n, {
267
267
  size: 12,
@@ -409,25 +409,24 @@ function M() {
409
409
  children: [/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
410
410
  className: "font-medium",
411
411
  children: e.name
412
- }), /* @__PURE__ */ w("p", {
412
+ }), /* @__PURE__ */ C("p", {
413
413
  className: "text-sm text-text-secondary",
414
- children: [
415
- e.address.city,
416
- ", ",
417
- e.address.state
418
- ]
414
+ children: [e.address.city, e.address.state].filter(Boolean).join(", ") || "Not provided"
419
415
  })] }), /* @__PURE__ */ w("div", {
420
416
  className: "text-right",
421
417
  children: [/* @__PURE__ */ C(d, {
422
- variant: e.status.toUpperCase() === "ACTIVE" ? "default" : "secondary",
423
- children: e.status.toUpperCase() === "ACTIVE" ? N("movethewheels.inventory.warehouses.active", "Active") : N("movethewheels.inventory.warehouses.inactive", "Inactive")
418
+ variant: e.status?.toUpperCase() === "ACTIVE" ? "default" : "secondary",
419
+ children: e.status ? e.status.toUpperCase() === "ACTIVE" ? N("movethewheels.inventory.warehouses.active", "Active") : N("movethewheels.inventory.warehouses.inactive", "Inactive") : "Not provided"
424
420
  }), /* @__PURE__ */ w("div", {
425
421
  className: "mt-2",
426
422
  children: [/* @__PURE__ */ C("p", {
427
423
  className: "text-xs text-text-secondary",
428
424
  children: N("movethewheels.inventory.warehouses.utilization", "Utilization")
429
- }), /* @__PURE__ */ C(g, {
430
- value: e.capacity.totalSpace > 0 ? e.capacity.usedSpace / e.capacity.totalSpace * 100 : 0,
425
+ }), e.utilization === void 0 ? /* @__PURE__ */ C("p", {
426
+ className: "text-xs text-text-tertiary",
427
+ children: "Not provided"
428
+ }) : /* @__PURE__ */ C(g, {
429
+ value: e.utilization,
431
430
  className: "w-24 h-2"
432
431
  })]
433
432
  })]
@@ -471,10 +470,10 @@ function M() {
471
470
  className: "text-right",
472
471
  children: [/* @__PURE__ */ C("p", {
473
472
  className: "font-medium",
474
- children: le(e.value)
473
+ children: e.value === void 0 ? "Not provided" : le(e.value)
475
474
  }), /* @__PURE__ */ C(d, {
476
475
  variant: "outline",
477
- children: e.category
476
+ children: e.category ?? "Not provided"
478
477
  })]
479
478
  })]
480
479
  })
@@ -34,7 +34,7 @@ function I() {
34
34
  lng: t.lng,
35
35
  label: e.order.orderNumber,
36
36
  status: D(e.order.status),
37
- sublabel: e.driver?.fullName || e.vehicle?.vehicleNumber || e.tracking?.currentLocation.address || void 0
37
+ sublabel: e.driver?.fullName || e.vehicle?.vehicleNumber || e.tracking?.currentLocation?.address || void 0
38
38
  }] : [];
39
39
  }), [X]), Q = Z.length, $ = [
40
40
  {
@@ -226,7 +226,7 @@ function I() {
226
226
  ]
227
227
  }), /* @__PURE__ */ j("p", {
228
228
  className: "text-xs text-text-secondary",
229
- children: e.tracking?.currentLocation.address || "Location updating..."
229
+ children: e.tracking?.currentLocation?.address || "Location updating..."
230
230
  })]
231
231
  })]
232
232
  })
@@ -299,7 +299,7 @@ function I() {
299
299
  }),
300
300
  /* @__PURE__ */ j("p", {
301
301
  className: "text-sm",
302
- children: Y.tracking?.currentLocation.address || "Updating..."
302
+ children: Y.tracking?.currentLocation?.address || "Updating..."
303
303
  }),
304
304
  (() => {
305
305
  let e = O(Y.vehicle?.currentLocation, Y.driver?.currentLocation, Y.tracking?.currentLocation);
@@ -363,7 +363,7 @@ function I() {
363
363
  children: e.message
364
364
  }), /* @__PURE__ */ j("p", {
365
365
  className: "text-xs text-text-secondary mt-1",
366
- children: E(e.timestamp, "relative")
366
+ children: e.timestamp ? E(e.timestamp, "relative") : "Time not recorded"
367
367
  })]
368
368
  }, e.id))
369
369
  }) : /* @__PURE__ */ j("div", {