@burdenoff/microfe-movethewheels 2026.920.3 → 2026.923.1

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 (79) hide show
  1. package/dist/components/CarbonFootprintPanel.js +1 -1
  2. package/dist/components/CustomerPicker.js +76 -65
  3. package/dist/components/DataTable.js +140 -139
  4. package/dist/components/DocumentsCard.js +14 -8
  5. package/dist/generated/wspace-types.d.ts +2719 -8
  6. package/dist/hooks/index.js +1 -1
  7. package/dist/hooks/useAnalytics.js +21 -1
  8. package/dist/hooks/useCustomers.js +94 -78
  9. package/dist/hooks/useDebouncedValue.js +11 -0
  10. package/dist/hooks/useEntityDocuments.js +28 -18
  11. package/dist/hooks/useEpod.js +24 -17
  12. package/dist/hooks/useFleet.js +148 -125
  13. package/dist/hooks/useInventory.js +255 -186
  14. package/dist/hooks/useMultiModalShipments.js +35 -27
  15. package/dist/hooks/useOrders.js +139 -134
  16. package/dist/hooks/useRoutes.js +97 -75
  17. package/dist/hooks/useTracking.js +100 -88
  18. package/dist/index.js +6 -6
  19. package/dist/movethewheels/components/CustomerPicker.d.ts +3 -1
  20. package/dist/movethewheels/components/DataTable.d.ts +5 -1
  21. package/dist/movethewheels/hooks/useCustomers.d.ts +0 -1
  22. package/dist/movethewheels/hooks/useDebouncedValue.d.ts +1 -0
  23. package/dist/movethewheels/hooks/useEntityDocuments.d.ts +2 -0
  24. package/dist/movethewheels/hooks/useEpod.d.ts +6 -1
  25. package/dist/movethewheels/hooks/useFleet.d.ts +49 -5
  26. package/dist/movethewheels/hooks/useInventory.d.ts +24 -17
  27. package/dist/movethewheels/hooks/useMultiModalShipments.d.ts +6 -1
  28. package/dist/movethewheels/hooks/useOrders.d.ts +48 -5
  29. package/dist/movethewheels/hooks/useRoutes.d.ts +18 -1
  30. package/dist/movethewheels/hooks/useTracking.d.ts +12 -11
  31. package/dist/movethewheels/types/index.d.ts +12 -5
  32. package/dist/pages/CreateOrderPage.js +191 -129
  33. package/dist/pages/CustomersPage.js +61 -54
  34. package/dist/pages/DeliveryCapturePage.js +131 -109
  35. package/dist/pages/DriversPage.js +100 -92
  36. package/dist/pages/InventoryPage.js +239 -236
  37. package/dist/pages/MultiModalShipmentPage.js +163 -130
  38. package/dist/pages/OrderDetailsPage.js +190 -106
  39. package/dist/pages/OrdersListPage.js +66 -60
  40. package/dist/pages/ProductDetailsPage.js +241 -200
  41. package/dist/pages/ProductsPage.js +59 -52
  42. package/dist/pages/RouteDetailsPage.js +324 -293
  43. package/dist/pages/RoutesPage.js +55 -48
  44. package/dist/pages/VehiclesPage.js +63 -56
  45. package/dist/pages/WarehousesPage.js +60 -53
  46. package/package.json +1 -1
  47. package/src/generated/wspace-types.ts +3136 -8
  48. package/src/movethewheels/components/CarbonFootprintPanel.tsx +0 -1
  49. package/src/movethewheels/components/CustomerPicker.tsx +14 -0
  50. package/src/movethewheels/components/DataTable.tsx +34 -18
  51. package/src/movethewheels/components/DocumentsCard.tsx +6 -1
  52. package/src/movethewheels/components/maps/leaflet-setup.ts +1 -8
  53. package/src/movethewheels/hooks/useAnalytics.ts +27 -0
  54. package/src/movethewheels/hooks/useCustomers.ts +64 -24
  55. package/src/movethewheels/hooks/useDebouncedValue.ts +12 -0
  56. package/src/movethewheels/hooks/useEntityDocuments.ts +43 -25
  57. package/src/movethewheels/hooks/useEpod.ts +14 -7
  58. package/src/movethewheels/hooks/useFleet.ts +66 -38
  59. package/src/movethewheels/hooks/useFleetIntelligence.ts +1 -4
  60. package/src/movethewheels/hooks/useInventory.ts +211 -90
  61. package/src/movethewheels/hooks/useMultiModalShipments.ts +15 -11
  62. package/src/movethewheels/hooks/useOrders.ts +48 -14
  63. package/src/movethewheels/hooks/useRoutes.ts +81 -24
  64. package/src/movethewheels/hooks/useTracking.ts +130 -98
  65. package/src/movethewheels/pages/CreateOrderPage.tsx +93 -2
  66. package/src/movethewheels/pages/CustomersPage.tsx +11 -1
  67. package/src/movethewheels/pages/DeliveryCapturePage.tsx +31 -1
  68. package/src/movethewheels/pages/DriversPage.tsx +24 -12
  69. package/src/movethewheels/pages/InventoryPage.tsx +57 -32
  70. package/src/movethewheels/pages/MultiModalShipmentPage.tsx +52 -3
  71. package/src/movethewheels/pages/OrderDetailsPage.tsx +91 -6
  72. package/src/movethewheels/pages/OrdersListPage.tsx +20 -3
  73. package/src/movethewheels/pages/ProductDetailsPage.tsx +52 -3
  74. package/src/movethewheels/pages/ProductsPage.tsx +11 -1
  75. package/src/movethewheels/pages/RouteDetailsPage.tsx +45 -5
  76. package/src/movethewheels/pages/RoutesPage.tsx +11 -1
  77. package/src/movethewheels/pages/VehiclesPage.tsx +19 -2
  78. package/src/movethewheels/pages/WarehousesPage.tsx +11 -1
  79. package/src/movethewheels/types/index.ts +12 -5
@@ -2,6 +2,7 @@ import { Driver, DriverStatus, FleetFilter, Vehicle, VehicleStatus } from '../ty
2
2
 
3
3
  interface UseFleetOptions {
4
4
  filters?: FleetFilter;
5
+ limit?: number;
5
6
  }
6
7
  export interface CreateVehicleInput {
7
8
  vehicleNumber: string;
@@ -32,11 +33,55 @@ interface UseFleetResult {
32
33
  updateVehicle: (id: string, input: CreateVehicleInput) => Promise<Vehicle>;
33
34
  updateDriver: (id: string, input: CreateDriverInput) => Promise<Driver>;
34
35
  }
36
+ export interface ApiVehicle {
37
+ id: string;
38
+ vehicleNumber: string;
39
+ type: string;
40
+ make?: string | null;
41
+ model?: string | null;
42
+ licensePlate?: string | null;
43
+ ownershipType?: string | null;
44
+ year?: number | null;
45
+ capacity?: Record<string, unknown> | null;
46
+ status: string;
47
+ currentLocation?: Record<string, unknown> | null;
48
+ fuelLevel?: number | null;
49
+ mileage?: number | null;
50
+ lastServiceDate?: string | null;
51
+ nextServiceDueDate?: string | null;
52
+ nextServiceDueMileage?: number | null;
53
+ createdAt: string;
54
+ updatedAt?: string;
55
+ }
56
+ export interface ApiDriver {
57
+ id: string;
58
+ userId?: string | null;
59
+ firstName: string;
60
+ lastName: string;
61
+ email?: string | null;
62
+ phone?: string | null;
63
+ employeeId: string;
64
+ licenseNumber?: string | null;
65
+ licenseClass?: string | null;
66
+ licenseExpiry?: string | null;
67
+ status: string;
68
+ currentLocation?: Record<string, unknown> | null;
69
+ rating?: number | null;
70
+ vehicleId?: string | null;
71
+ createdAt: string;
72
+ }
73
+ export declare function mapVehicle(vehicle: ApiVehicle): Vehicle;
74
+ export declare function mapDriver(driver: ApiDriver): Driver;
35
75
  export declare function useFleet(options?: UseFleetOptions): UseFleetResult;
36
76
  interface UseListOptions {
37
77
  limit?: number;
38
78
  offset?: number;
39
79
  }
80
+ interface UseVehiclesOptions extends UseListOptions {
81
+ search?: string;
82
+ status?: VehicleStatus;
83
+ vehicleType?: Vehicle['type'];
84
+ }
40
85
  interface UseVehiclesResult {
41
86
  vehicles: Vehicle[];
42
87
  totalVehicles: number;
@@ -48,7 +93,7 @@ interface UseVehiclesResult {
48
93
  updateVehicleStatus: (id: string, status: VehicleStatus) => Promise<Vehicle>;
49
94
  assignDriver: (vehicleId: string, driverId: string) => Promise<Vehicle>;
50
95
  }
51
- export declare function useVehicles(options?: UseListOptions): UseVehiclesResult;
96
+ export declare function useVehicles(options?: UseVehiclesOptions): UseVehiclesResult;
52
97
  export declare function useVehicle(vehicleId: string | undefined): {
53
98
  vehicle: Vehicle | null;
54
99
  isLoading: boolean;
@@ -67,11 +112,10 @@ interface UseDriversResult {
67
112
  assignVehicle: (driverId: string, vehicleId: string) => Promise<Driver>;
68
113
  }
69
114
  interface UseDriversOptions extends UseListOptions {
70
- /**
71
- * Narrows the roster server-side via `DriverFilterInput.status` so the pager
72
- * still counts whole result sets rather than filtering one fetched page.
73
- */
115
+ /** Narrows the roster server-side via DriverFilterInput.status. */
74
116
  status?: DriverStatus;
117
+ search?: string;
118
+ licenseClass?: string;
75
119
  }
76
120
  export declare function useDrivers(options?: UseDriversOptions): UseDriversResult;
77
121
  export declare function useDriver(driverId: string | undefined): {
@@ -2,6 +2,9 @@ import { Inventory, InventoryFilter, Product, Warehouse } from '../types';
2
2
 
3
3
  interface UseInventoryOptions {
4
4
  filters?: InventoryFilter;
5
+ search?: string;
6
+ limit?: number;
7
+ offset?: number;
5
8
  }
6
9
  export interface CreateProductInput {
7
10
  name: string;
@@ -26,9 +29,11 @@ export interface CreateWarehouseInput {
26
29
  }
27
30
  interface UseInventoryResult {
28
31
  inventory: Inventory[];
32
+ lowStockItems: Inventory[];
29
33
  products: Product[];
30
34
  warehouses: Warehouse[];
31
35
  totalItems: number;
36
+ hasMore: boolean;
32
37
  isLoading: boolean;
33
38
  error: Error | null;
34
39
  refetch: () => void;
@@ -44,7 +49,14 @@ interface UseListOptions {
44
49
  limit?: number;
45
50
  offset?: number;
46
51
  }
47
- export declare function useProducts(options?: UseListOptions): {
52
+ interface UseProductsOptions extends UseListOptions {
53
+ search?: string;
54
+ category?: string;
55
+ }
56
+ interface UseWarehousesOptions extends UseListOptions {
57
+ search?: string;
58
+ }
59
+ export declare function useProducts(options?: UseProductsOptions): {
48
60
  products: Product[];
49
61
  totalProducts: number;
50
62
  hasMore: boolean;
@@ -52,14 +64,7 @@ export declare function useProducts(options?: UseListOptions): {
52
64
  error: Error | null;
53
65
  refetch: () => undefined;
54
66
  };
55
- /**
56
- * Bounded aggregate for the Products page "at a glance" tiles. Fetches up to
57
- * `sampleSize` products (independent of the paginated list) and computes the
58
- * special-handling / temperature-controlled counts so the tiles never reflect
59
- * a single truncated page. There is no product *Count field on the frozen
60
- * supergraph, so this bounded sample is the aggregate source.
61
- */
62
- export declare function useProductStats(sampleSize?: number): {
67
+ export declare function useProductStats(): {
63
68
  stats: {
64
69
  total: number;
65
70
  specialHandling: number;
@@ -74,7 +79,7 @@ export declare function useProduct(productId: string | undefined): {
74
79
  error: Error | null;
75
80
  refetch: () => undefined;
76
81
  };
77
- export declare function useWarehouses(options?: UseListOptions): {
82
+ export declare function useWarehouses(options?: UseWarehousesOptions): {
78
83
  warehouses: Warehouse[];
79
84
  totalWarehouses: number;
80
85
  hasMore: boolean;
@@ -82,12 +87,7 @@ export declare function useWarehouses(options?: UseListOptions): {
82
87
  error: Error | null;
83
88
  refetch: () => undefined;
84
89
  };
85
- /**
86
- * Bounded aggregate for the Warehouses page "at a glance" tiles — fetches up to
87
- * `sampleSize` warehouses (independent of the paginated list) so the active /
88
- * avg-utilization tiles never reflect a single truncated page.
89
- */
90
- export declare function useWarehouseStats(sampleSize?: number): {
90
+ export declare function useWarehouseStats(): {
91
91
  stats: {
92
92
  total: number;
93
93
  active: number;
@@ -140,9 +140,16 @@ export interface ProductStockLevel {
140
140
  damaged: number;
141
141
  reorderPoint?: number;
142
142
  }
143
+ interface ProductStockLevelOptions {
144
+ limit?: number;
145
+ offset?: number;
146
+ }
143
147
  /** Where a catalog item is stocked, and how much of it is free to promise. */
144
- export declare function useProductStockLevels(productId: string | undefined): {
148
+ export declare function useProductStockLevels(productId: string | undefined, options?: ProductStockLevelOptions): {
145
149
  levels: ProductStockLevel[];
150
+ totalLevels: number;
151
+ totalAvailable: number;
152
+ hasMore: boolean;
146
153
  isLoading: boolean;
147
154
  error: Error | null;
148
155
  refetch: () => void;
@@ -56,8 +56,13 @@ export interface MultiModalShipment {
56
56
  createdAt: string;
57
57
  legs: ShipmentLeg[];
58
58
  }
59
- export declare function useMultiModalShipments(): {
59
+ export declare function useMultiModalShipments(options?: {
60
+ limit?: number;
61
+ offset?: number;
62
+ }): {
60
63
  shipments: MultiModalShipment[];
64
+ totalShipments: number;
65
+ hasMore: boolean;
61
66
  isLoading: boolean;
62
67
  error: Error | null;
63
68
  refetch: () => undefined;
@@ -18,11 +18,7 @@ export type OrderWriteInput = Omit<Partial<Order>, 'scheduledDelivery'> & {
18
18
  interface UseOrdersResult {
19
19
  orders: Order[];
20
20
  totalOrders: number;
21
- /**
22
- * True when the most recent fetch returned a full page (rawCount === limit),
23
- * i.e. there may be another page. Used for offset pagers where no grand
24
- * total is available.
25
- */
21
+ /** True when the most recent fetch has another server page. */
26
22
  hasMore: boolean;
27
23
  isLoading: boolean;
28
24
  error: Error | null;
@@ -32,6 +28,52 @@ interface UseOrdersResult {
32
28
  deleteOrder: (id: string) => Promise<void>;
33
29
  updateOrderStatus: (id: string, status: OrderStatus) => Promise<Order>;
34
30
  }
31
+ export interface ApiOrder {
32
+ id: string;
33
+ deliveryJobNumber: string;
34
+ customerId: string;
35
+ status: string;
36
+ priority: string;
37
+ pickupAddress: Record<string, unknown> | null;
38
+ deliveryAddress: Record<string, unknown> | null;
39
+ cargoItems: unknown;
40
+ pricing: unknown;
41
+ trackingNumber?: string | null;
42
+ specialInstructions?: string | null;
43
+ scheduledDelivery?: string | null;
44
+ vehicleId?: string | null;
45
+ driverId?: string | null;
46
+ routeId?: string | null;
47
+ route?: {
48
+ id: string;
49
+ name: string;
50
+ status: string;
51
+ vehicleId?: string | null;
52
+ driverId?: string | null;
53
+ waypoints?: unknown;
54
+ estimatedDistance?: number | null;
55
+ estimatedDuration?: number | null;
56
+ fuelCost?: number | null;
57
+ actualDistance?: number | null;
58
+ actualDuration?: number | null;
59
+ createdAt: string;
60
+ } | null;
61
+ createdAt: string;
62
+ updatedAt: string;
63
+ customer?: {
64
+ name?: string | null;
65
+ email?: string | null;
66
+ phone?: string | null;
67
+ company?: string | null;
68
+ } | null;
69
+ statusHistory?: Array<{
70
+ status: string;
71
+ notes?: string | null;
72
+ location?: Record<string, unknown> | null;
73
+ createdAt: string;
74
+ createdBy?: string | null;
75
+ }>;
76
+ }
35
77
  /**
36
78
  * Normalises a service `DeliveryJobStatus` into the MFE's OrderStatus union.
37
79
  * Exported so any surface rendering a raw job status badge normalises it the
@@ -45,6 +87,7 @@ export declare function mapOrderStatus(status: string): OrderStatus;
45
87
  * no direct badge entry, so rendering the raw value would break the colour map.
46
88
  */
47
89
  export declare function mapOrderPriority(priority: string): 'low' | 'normal' | 'high' | 'urgent';
90
+ export declare function mapOrder(order: ApiOrder): Order;
48
91
  export declare function useOrders(options?: UseOrdersOptions): UseOrdersResult;
49
92
  export declare function useOrder(orderId: string | undefined): {
50
93
  order: Order | null;
@@ -4,13 +4,14 @@ interface UseRoutesOptions {
4
4
  driverId?: string;
5
5
  vehicleId?: string;
6
6
  status?: 'planned' | 'in_progress' | 'completed' | 'cancelled';
7
+ search?: string;
7
8
  limit?: number;
8
9
  offset?: number;
9
10
  }
10
11
  interface UseRoutesResult {
11
12
  routes: Route[];
12
13
  totalRoutes: number;
13
- /** True when the last fetch returned a full page (rawCount === limit). */
14
+ /** True when the last fetch has another server page. */
14
15
  hasMore: boolean;
15
16
  isLoading: boolean;
16
17
  error: Error | null;
@@ -21,6 +22,22 @@ interface UseRoutesResult {
21
22
  optimizeRoute: (routeId: string) => Promise<Route>;
22
23
  updateStopStatus: (routeId: string, stopId: string, status: RouteStop['status']) => Promise<Route>;
23
24
  }
25
+ interface ApiRoute {
26
+ id: string;
27
+ name: string;
28
+ status: string;
29
+ shipmentId?: string | null;
30
+ vehicleId?: string | null;
31
+ driverId?: string | null;
32
+ waypoints?: unknown;
33
+ estimatedDistance?: number | null;
34
+ estimatedDuration?: number | null;
35
+ fuelCost?: number | null;
36
+ actualDistance?: number | null;
37
+ actualDuration?: number | null;
38
+ createdAt: string;
39
+ }
40
+ export declare function mapRoute(route: ApiRoute): Route;
24
41
  export declare function useRoutes(options?: UseRoutesOptions): UseRoutesResult;
25
42
  export declare function useRoute(routeId: string | undefined): {
26
43
  route: Route | null;
@@ -1,4 +1,4 @@
1
- import { Location, Tracking, TrackingAlert } from '../types';
1
+ import { Location, Order, Tracking, TrackingAlert, Driver, Vehicle } from '../types';
2
2
 
3
3
  interface UseTrackingOptions {
4
4
  entityId?: string;
@@ -11,36 +11,37 @@ interface UseTrackingResult {
11
11
  error: Error | null;
12
12
  refetch: () => void;
13
13
  }
14
+ interface LiveDelivery {
15
+ order: Order;
16
+ driver: Driver | null;
17
+ vehicle: Vehicle | null;
18
+ tracking: Tracking | null;
19
+ estimatedArrival: Date | undefined;
20
+ }
14
21
  export declare function useTracking(options?: UseTrackingOptions): UseTrackingResult;
15
22
  export declare function useOrderTracking(orderId: string | undefined): {
16
23
  tracking: Tracking | null;
17
- order: import('..').Order | null;
24
+ order: Order | null;
18
25
  isLoading: boolean;
19
26
  error: Error | null;
20
27
  refetch: () => undefined;
21
28
  };
22
29
  export declare function useVehicleTracking(vehicleId: string | undefined): {
23
30
  tracking: Tracking | null;
24
- vehicle: import('..').Vehicle | null;
31
+ vehicle: Vehicle | null;
25
32
  isLoading: boolean;
26
33
  error: Error | null;
27
34
  refetch: () => void;
28
35
  };
29
36
  export declare function useDriverTracking(driverId: string | undefined): {
30
37
  tracking: Tracking | null;
31
- driver: import('..').Driver | null;
38
+ driver: Driver | null;
32
39
  isLoading: boolean;
33
40
  error: Error | null;
34
41
  refetch: () => void;
35
42
  };
36
43
  export declare function useLiveTracking(): {
37
- activeDeliveries: {
38
- order: import('..').Order;
39
- driver: import('..').Driver | null;
40
- vehicle: import('..').Vehicle | null;
41
- tracking: Tracking | null;
42
- estimatedArrival: Date | undefined;
43
- }[];
44
+ activeDeliveries: LiveDelivery[];
44
45
  isLoading: boolean;
45
46
  error: Error | null;
46
47
  refetch: () => undefined;
@@ -223,6 +223,8 @@ export interface Order {
223
223
  actualDelivery?: Date;
224
224
  driverId?: string;
225
225
  vehicleId?: string;
226
+ routeId?: string;
227
+ route?: Route;
226
228
  trackingNumber: string;
227
229
  specialInstructions?: string;
228
230
  pricing: OrderPricing;
@@ -425,7 +427,10 @@ export interface InventoryMovement {
425
427
  export interface Inventory {
426
428
  id: string;
427
429
  productId: string;
430
+ productName?: string;
431
+ productSku?: string;
428
432
  warehouseId: string;
433
+ warehouseName?: string;
429
434
  zoneId: string;
430
435
  quantity: number;
431
436
  reservedQuantity: number;
@@ -661,21 +666,23 @@ export interface OrderFilter {
661
666
  dateFrom?: Date;
662
667
  dateTo?: Date;
663
668
  priority?: string;
664
- /**
665
- * Client-side quick filter for orders that still need a driver assigned
666
- * (driverId is null). The backend DeliveryJobFilterInput has no null-driver
667
- * predicate, so this is applied to the fetched page after mapping.
668
- */
669
+ search?: string;
670
+ /** Server-side predicate for orders that still need a driver assigned. */
669
671
  unassigned?: boolean;
670
672
  }
671
673
  export interface FleetFilter {
672
674
  vehicleType?: VehicleType;
673
675
  status?: VehicleStatus;
676
+ /** Filter vehicles to those linked to this driver. */
674
677
  driverId?: string;
678
+ /** Filter drivers to those linked to this vehicle. */
679
+ vehicleId?: string;
680
+ search?: string;
675
681
  }
676
682
  export interface InventoryFilter {
677
683
  warehouseId?: string;
678
684
  productId?: string;
685
+ search?: string;
679
686
  lowStock?: boolean;
680
687
  }
681
688
  export interface CustomerFilter {