@burdenoff/microfe-movethewheels 2026.925.2 → 2026.929.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.
- package/dist/components/StatusBadge.js +34 -31
- package/dist/constants/index.js +12 -5
- package/dist/hooks/useCustomers.js +0 -3
- package/dist/hooks/useFleet.js +148 -135
- package/dist/hooks/useInventory.js +146 -146
- package/dist/hooks/useRoutes.js +5 -14
- package/dist/movethewheels/components/StatusBadge.d.ts +3 -1
- package/dist/movethewheels/constants/index.d.ts +1 -0
- package/dist/movethewheels/hooks/useFleet.d.ts +17 -4
- package/dist/movethewheels/hooks/useInventory.d.ts +11 -0
- package/dist/movethewheels/types/index.d.ts +19 -75
- package/dist/pages/CustomerDetailsPage.js +666 -344
- package/dist/pages/CustomersPage.js +71 -80
- package/dist/pages/DriverDetailsPage.js +2 -2
- package/dist/pages/DriversPage.js +2 -2
- package/dist/pages/FleetPage.js +1 -3
- package/dist/pages/InventoryPage.js +5 -5
- package/dist/pages/RouteDetailsPage.js +273 -248
- package/dist/pages/RoutesPage.js +130 -67
- package/dist/pages/VehicleDetailsPage.js +527 -389
- package/dist/pages/VehiclesPage.js +120 -71
- package/dist/pages/WarehouseDetailsPage.js +411 -368
- package/dist/pages/WarehousesPage.js +132 -83
- package/package.json +1 -1
- package/src/movethewheels/components/StatusBadge.tsx +15 -7
- package/src/movethewheels/constants/index.ts +9 -0
- package/src/movethewheels/hooks/useCustomers.ts +0 -3
- package/src/movethewheels/hooks/useFleet.ts +89 -25
- package/src/movethewheels/hooks/useInventory.ts +77 -33
- package/src/movethewheels/hooks/useRoutes.ts +17 -12
- package/src/movethewheels/pages/CustomerDetailsPage.tsx +376 -109
- package/src/movethewheels/pages/CustomersPage.tsx +6 -15
- package/src/movethewheels/pages/DriverDetailsPage.tsx +3 -1
- package/src/movethewheels/pages/DriversPage.tsx +5 -1
- package/src/movethewheels/pages/FleetPage.tsx +2 -1
- package/src/movethewheels/pages/InventoryPage.tsx +18 -6
- package/src/movethewheels/pages/RouteDetailsPage.tsx +74 -34
- package/src/movethewheels/pages/RoutesPage.tsx +66 -2
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +185 -23
- package/src/movethewheels/pages/VehiclesPage.tsx +72 -5
- package/src/movethewheels/pages/WarehouseDetailsPage.tsx +217 -138
- package/src/movethewheels/pages/WarehousesPage.tsx +81 -17
- package/src/movethewheels/types/index.ts +28 -75
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Driver, DriverStatus, FleetFilter, Vehicle, VehicleStatus } from '../types';
|
|
1
|
+
import { Driver, DriverStatus, FleetFilter, Vehicle, VehicleFuelType, VehicleStatus } from '../types';
|
|
2
2
|
|
|
3
3
|
interface UseFleetOptions {
|
|
4
4
|
filters?: FleetFilter;
|
|
@@ -16,8 +16,14 @@ export interface CreateVehicleInput {
|
|
|
16
16
|
year?: number;
|
|
17
17
|
/** VehicleStatus enum value, e.g. `ACTIVE`, `MAINTENANCE`. */
|
|
18
18
|
status?: string;
|
|
19
|
-
|
|
19
|
+
/** FuelType enum value, e.g. `DIESEL`, `ELECTRIC`. */
|
|
20
|
+
fuelType?: VehicleFuelType;
|
|
20
21
|
fuelEfficiencyLPer100Km?: number;
|
|
22
|
+
capacity?: {
|
|
23
|
+
weight?: number;
|
|
24
|
+
volume?: number;
|
|
25
|
+
pallets?: number;
|
|
26
|
+
};
|
|
21
27
|
}
|
|
22
28
|
export interface CreateDriverInput {
|
|
23
29
|
employeeId: string;
|
|
@@ -56,6 +62,7 @@ interface UseFleetResult {
|
|
|
56
62
|
createDriver: (input: CreateDriverInput) => Promise<Driver>;
|
|
57
63
|
updateVehicle: (id: string, input: CreateVehicleInput) => Promise<Vehicle>;
|
|
58
64
|
updateDriver: (id: string, input: UpdateDriverInput) => Promise<Driver>;
|
|
65
|
+
deleteVehicle: (id: string) => Promise<void>;
|
|
59
66
|
}
|
|
60
67
|
export interface ApiVehicle {
|
|
61
68
|
id: string;
|
|
@@ -69,7 +76,7 @@ export interface ApiVehicle {
|
|
|
69
76
|
capacity?: Record<string, unknown> | null;
|
|
70
77
|
status: string;
|
|
71
78
|
currentLocation?: Record<string, unknown> | null;
|
|
72
|
-
fuelType?:
|
|
79
|
+
fuelType?: VehicleFuelType | null;
|
|
73
80
|
fuelEfficiencyLPer100Km?: number | null;
|
|
74
81
|
fuelLevel?: number | null;
|
|
75
82
|
mileage?: number | null;
|
|
@@ -104,7 +111,12 @@ export interface ApiDriver {
|
|
|
104
111
|
terminationReason?: string | null;
|
|
105
112
|
createdAt: string;
|
|
106
113
|
}
|
|
107
|
-
/**
|
|
114
|
+
/**
|
|
115
|
+
* Exported so the vehicle edit form's status field can round-trip (BOFF-7909).
|
|
116
|
+
* `decommissioned` must stay distinct from `out_of_service` — collapsing them
|
|
117
|
+
* used to silently rewrite a DECOMMISSIONED vehicle to INACTIVE on any save
|
|
118
|
+
* that touched status, even without the user changing it.
|
|
119
|
+
*/
|
|
108
120
|
export declare function toApiVehicleStatus(status: VehicleStatus): string;
|
|
109
121
|
/** Exported so the driver edit form's status field can round-trip losslessly (BOFF-7909). */
|
|
110
122
|
export declare function toApiDriverStatus(status: DriverStatus): string;
|
|
@@ -134,6 +146,7 @@ interface UseVehiclesResult {
|
|
|
134
146
|
refetch: () => void;
|
|
135
147
|
updateVehicleStatus: (id: string, status: VehicleStatus) => Promise<Vehicle>;
|
|
136
148
|
assignDriver: (vehicleId: string, driverId: string) => Promise<Vehicle>;
|
|
149
|
+
deleteVehicle: (id: string) => Promise<void>;
|
|
137
150
|
}
|
|
138
151
|
export declare function useVehicles(options?: UseVehiclesOptions): UseVehiclesResult;
|
|
139
152
|
export declare function useVehicle(vehicleId: string | undefined): {
|
|
@@ -25,7 +25,14 @@ export interface CreateWarehouseInput {
|
|
|
25
25
|
postalCode: string;
|
|
26
26
|
country: string;
|
|
27
27
|
};
|
|
28
|
+
/** Free-text on the backend, e.g. "ACTIVE", "INACTIVE". Defaults to ACTIVE. */
|
|
29
|
+
status?: string;
|
|
30
|
+
contactInfo?: {
|
|
31
|
+
email?: string;
|
|
32
|
+
phone?: string;
|
|
33
|
+
};
|
|
28
34
|
totalCapacity?: number;
|
|
35
|
+
usedCapacity?: number;
|
|
29
36
|
}
|
|
30
37
|
interface UseInventoryResult {
|
|
31
38
|
inventory: Inventory[];
|
|
@@ -43,6 +50,7 @@ interface UseInventoryResult {
|
|
|
43
50
|
createWarehouse: (input: CreateWarehouseInput) => Promise<Warehouse>;
|
|
44
51
|
updateProduct: (id: string, input: CreateProductInput) => Promise<Product>;
|
|
45
52
|
updateWarehouse: (id: string, input: CreateWarehouseInput) => Promise<Warehouse>;
|
|
53
|
+
deleteWarehouse: (id: string) => Promise<void>;
|
|
46
54
|
}
|
|
47
55
|
export declare function useInventory(options?: UseInventoryOptions): UseInventoryResult;
|
|
48
56
|
interface UseListOptions {
|
|
@@ -55,6 +63,8 @@ interface UseProductsOptions extends UseListOptions {
|
|
|
55
63
|
}
|
|
56
64
|
interface UseWarehousesOptions extends UseListOptions {
|
|
57
65
|
search?: string;
|
|
66
|
+
/** Raw backend value, e.g. "ACTIVE"/"INACTIVE". */
|
|
67
|
+
status?: string;
|
|
58
68
|
}
|
|
59
69
|
export declare function useProducts(options?: UseProductsOptions): {
|
|
60
70
|
products: Product[];
|
|
@@ -101,6 +111,7 @@ export declare function useWarehouse(warehouseId: string | undefined): {
|
|
|
101
111
|
isLoading: boolean;
|
|
102
112
|
error: Error | null;
|
|
103
113
|
refetch: () => undefined;
|
|
114
|
+
reload: () => Promise<void>;
|
|
104
115
|
};
|
|
105
116
|
export interface InventoryStats {
|
|
106
117
|
/** Units physically in the warehouses. */
|
|
@@ -135,11 +135,6 @@ export interface Customer {
|
|
|
135
135
|
address: Address;
|
|
136
136
|
businessLicense?: string;
|
|
137
137
|
taxId?: string;
|
|
138
|
-
website?: string;
|
|
139
|
-
preferredContactMethod: 'email' | 'phone' | 'both';
|
|
140
|
-
marketingOptIn: boolean;
|
|
141
|
-
notes?: string;
|
|
142
|
-
isActive: boolean;
|
|
143
138
|
rating: number;
|
|
144
139
|
createdAt: Date;
|
|
145
140
|
updatedAt: Date;
|
|
@@ -250,8 +245,9 @@ export interface ProofOfDelivery {
|
|
|
250
245
|
capturedByDriverId: string;
|
|
251
246
|
notes?: string;
|
|
252
247
|
}
|
|
253
|
-
export type VehicleType = 'van' | 'truck' | 'motorcycle' | 'bicycle' | '
|
|
254
|
-
export type
|
|
248
|
+
export type VehicleType = 'van' | 'truck' | 'motorcycle' | 'bicycle' | 'flatbed' | 'refrigerated' | 'semi_trailer' | 'drone';
|
|
249
|
+
export type VehicleFuelType = 'DIESEL' | 'PETROL' | 'CNG' | 'ELECTRIC' | 'HYBRID';
|
|
250
|
+
export type VehicleStatus = 'available' | 'assigned' | 'maintenance' | 'out_of_service' | 'decommissioned';
|
|
255
251
|
export interface VehicleDocument {
|
|
256
252
|
id: string;
|
|
257
253
|
type: 'registration' | 'insurance' | 'inspection' | 'permit';
|
|
@@ -268,10 +264,10 @@ export interface Vehicle {
|
|
|
268
264
|
licensePlate: string;
|
|
269
265
|
/** MtwVehicle.ownershipType — free-text, e.g. "owned", "leased". */
|
|
270
266
|
ownershipType?: string;
|
|
271
|
-
year
|
|
267
|
+
year?: number;
|
|
272
268
|
capacity: {
|
|
273
|
-
weight
|
|
274
|
-
volume
|
|
269
|
+
weight?: number;
|
|
270
|
+
volume?: number;
|
|
275
271
|
pallets?: number;
|
|
276
272
|
};
|
|
277
273
|
status: VehicleStatus;
|
|
@@ -281,7 +277,7 @@ export interface Vehicle {
|
|
|
281
277
|
nextMaintenance?: Date;
|
|
282
278
|
/** Odometer reading (km) at which the next service is due. */
|
|
283
279
|
nextMaintenanceMileage?: number;
|
|
284
|
-
fuelType?:
|
|
280
|
+
fuelType?: VehicleFuelType;
|
|
285
281
|
/** Fuel consumption, litres per 100km. */
|
|
286
282
|
fuelEfficiencyLPer100Km?: number;
|
|
287
283
|
fuelLevel?: number;
|
|
@@ -306,7 +302,7 @@ export interface Driver {
|
|
|
306
302
|
employeeId: string;
|
|
307
303
|
licenseNumber: string;
|
|
308
304
|
licenseType: string;
|
|
309
|
-
licenseExpiry
|
|
305
|
+
licenseExpiry?: Date;
|
|
310
306
|
vehicleIds: string[];
|
|
311
307
|
assignedVehicle?: string;
|
|
312
308
|
status: DriverStatus;
|
|
@@ -326,70 +322,28 @@ export interface Driver {
|
|
|
326
322
|
documents: DriverDocument[];
|
|
327
323
|
createdAt: Date;
|
|
328
324
|
}
|
|
329
|
-
export interface WarehouseZone {
|
|
330
|
-
id: string;
|
|
331
|
-
name: string;
|
|
332
|
-
type: 'receiving' | 'storage' | 'picking' | 'packing' | 'shipping';
|
|
333
|
-
location: string;
|
|
334
|
-
capacity: number;
|
|
335
|
-
currentOccupancy: number;
|
|
336
|
-
}
|
|
337
|
-
export interface WarehouseEquipment {
|
|
338
|
-
id: string;
|
|
339
|
-
type: string;
|
|
340
|
-
model: string;
|
|
341
|
-
status: 'operational' | 'maintenance' | 'out_of_service';
|
|
342
|
-
lastMaintenance: Date;
|
|
343
|
-
nextMaintenance: Date;
|
|
344
|
-
}
|
|
345
325
|
export interface Warehouse {
|
|
346
326
|
id: string;
|
|
347
327
|
name: string;
|
|
348
328
|
code: string;
|
|
349
329
|
address: Address;
|
|
350
|
-
type: 'distribution' | 'fulfillment' | 'cold_storage' | 'cross_dock';
|
|
330
|
+
type: 'distribution' | 'fulfillment' | 'cold_storage' | 'cross_dock' | 'retail';
|
|
331
|
+
/** Raw backend value (free-text, e.g. "ACTIVE"/"INACTIVE" — defaults to ACTIVE). */
|
|
332
|
+
status: string;
|
|
351
333
|
capacity: {
|
|
352
334
|
totalSpace: number;
|
|
353
335
|
usedSpace: number;
|
|
354
|
-
totalPallets: number;
|
|
355
|
-
usedPallets: number;
|
|
356
|
-
specialAreas: Array<{
|
|
357
|
-
type: string;
|
|
358
|
-
capacity: number;
|
|
359
|
-
currentUsage: number;
|
|
360
|
-
temperature?: {
|
|
361
|
-
min: number;
|
|
362
|
-
max: number;
|
|
363
|
-
unit: string;
|
|
364
|
-
};
|
|
365
|
-
}>;
|
|
366
336
|
};
|
|
367
337
|
operatingHours: Record<string, {
|
|
368
338
|
open: string;
|
|
369
339
|
close: string;
|
|
370
340
|
} | null>;
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
}>;
|
|
375
|
-
zones: WarehouseZone[];
|
|
376
|
-
equipment: WarehouseEquipment[];
|
|
377
|
-
staff: Array<{
|
|
378
|
-
userId: string;
|
|
379
|
-
role: string;
|
|
380
|
-
shift: string;
|
|
381
|
-
permissions: string[];
|
|
382
|
-
}>;
|
|
383
|
-
metrics: {
|
|
384
|
-
throughput: number;
|
|
385
|
-
accuracy: number;
|
|
386
|
-
productivity: number;
|
|
387
|
-
utilization: number;
|
|
388
|
-
ordersFulfilled: number;
|
|
389
|
-
averageProcessingTime: number;
|
|
390
|
-
lastUpdated: Date;
|
|
341
|
+
contactInfo?: {
|
|
342
|
+
email?: string;
|
|
343
|
+
phone?: string;
|
|
391
344
|
};
|
|
392
|
-
|
|
345
|
+
/** Real computed value: usedSpace / totalSpace. No other backend metrics exist for a warehouse. */
|
|
346
|
+
utilization: number;
|
|
393
347
|
createdAt: Date;
|
|
394
348
|
}
|
|
395
349
|
export interface InventoryMovement {
|
|
@@ -409,20 +363,13 @@ export interface Inventory {
|
|
|
409
363
|
productSku?: string;
|
|
410
364
|
warehouseId: string;
|
|
411
365
|
warehouseName?: string;
|
|
412
|
-
zoneId: string;
|
|
413
366
|
quantity: number;
|
|
414
367
|
reservedQuantity: number;
|
|
415
368
|
availableQuantity: number;
|
|
416
|
-
|
|
417
|
-
|
|
369
|
+
damagedQuantity: number;
|
|
370
|
+
/** Undefined means no reorder point is configured — never treat as 0 (matches the backend's low-stock rule, which requires one to be set). */
|
|
371
|
+
reorderLevel?: number;
|
|
418
372
|
lastRestocked: Date;
|
|
419
|
-
location: {
|
|
420
|
-
aisle: string;
|
|
421
|
-
shelf: string;
|
|
422
|
-
position: string;
|
|
423
|
-
level: number;
|
|
424
|
-
};
|
|
425
|
-
movements: InventoryMovement[];
|
|
426
373
|
createdAt: Date;
|
|
427
374
|
updatedAt: Date;
|
|
428
375
|
}
|
|
@@ -456,10 +403,7 @@ export interface Route {
|
|
|
456
403
|
/** Estimated fuel cost for the route (svc MtwRoute.fuelCost). */
|
|
457
404
|
fuelCost?: number;
|
|
458
405
|
actualDuration?: number;
|
|
459
|
-
startTime?: Date;
|
|
460
|
-
endTime?: Date;
|
|
461
406
|
optimized: boolean;
|
|
462
|
-
trafficConditions: TrafficCondition[];
|
|
463
407
|
createdAt: Date;
|
|
464
408
|
}
|
|
465
409
|
export interface TrackingAlert {
|