@burdenoff/microfe-movethewheels 2026.925.1 → 2026.925.3
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 +31 -31
- package/dist/constants/index.js +19 -5
- package/dist/hooks/useCustomers.js +0 -3
- package/dist/hooks/useFleet.js +197 -175
- package/dist/hooks/useInventory.js +144 -145
- package/dist/hooks/useRoutes.js +5 -14
- package/dist/movethewheels/components/StatusBadge.d.ts +3 -1
- package/dist/movethewheels/constants/index.d.ts +2 -0
- package/dist/movethewheels/hooks/useFleet.d.ts +53 -1
- package/dist/movethewheels/hooks/useInventory.d.ts +10 -0
- package/dist/movethewheels/types/index.d.ts +29 -108
- package/dist/node_modules/lucide-react/dist/esm/icons/sticky-note.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/user-x.js +30 -0
- package/dist/pages/CustomerDetailsPage.js +666 -344
- package/dist/pages/CustomersPage.js +71 -80
- package/dist/pages/DriverDetailsPage.js +702 -421
- package/dist/pages/DriversPage.js +106 -117
- package/dist/pages/FleetPage.js +5 -13
- package/dist/pages/InventoryPage.js +4 -4
- package/dist/pages/OrderDetailsPage.js +279 -274
- package/dist/pages/RouteDetailsPage.js +300 -263
- package/dist/pages/RoutesPage.js +130 -67
- package/dist/pages/VehicleDetailsPage.js +562 -287
- package/dist/pages/VehiclesPage.js +119 -70
- package/dist/pages/WarehouseDetailsPage.js +410 -370
- package/dist/pages/WarehousesPage.js +131 -82
- package/package.json +1 -1
- package/src/movethewheels/components/StatusBadge.tsx +16 -2
- package/src/movethewheels/constants/index.ts +21 -0
- package/src/movethewheels/hooks/useCustomers.ts +0 -3
- package/src/movethewheels/hooks/useFleet.ts +236 -62
- package/src/movethewheels/hooks/useInventory.ts +76 -32
- 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 +516 -156
- package/src/movethewheels/pages/DriversPage.tsx +28 -11
- package/src/movethewheels/pages/FleetPage.tsx +9 -11
- package/src/movethewheels/pages/InventoryPage.tsx +14 -5
- package/src/movethewheels/pages/OrderDetailsPage.tsx +12 -7
- package/src/movethewheels/pages/RouteDetailsPage.tsx +89 -41
- package/src/movethewheels/pages/RoutesPage.tsx +66 -2
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +282 -20
- package/src/movethewheels/pages/VehiclesPage.tsx +68 -3
- package/src/movethewheels/pages/WarehouseDetailsPage.tsx +213 -135
- package/src/movethewheels/pages/WarehousesPage.tsx +77 -16
- package/src/movethewheels/types/index.ts +30 -108
|
@@ -11,6 +11,18 @@ export interface CreateVehicleInput {
|
|
|
11
11
|
make?: string;
|
|
12
12
|
model?: string;
|
|
13
13
|
licensePlate?: string;
|
|
14
|
+
/** Free-text, e.g. "owned", "leased". */
|
|
15
|
+
ownershipType?: string;
|
|
16
|
+
year?: number;
|
|
17
|
+
/** VehicleStatus enum value, e.g. `ACTIVE`, `MAINTENANCE`. */
|
|
18
|
+
status?: string;
|
|
19
|
+
fuelType?: string;
|
|
20
|
+
fuelEfficiencyLPer100Km?: number;
|
|
21
|
+
capacity?: {
|
|
22
|
+
weight?: number;
|
|
23
|
+
volume?: number;
|
|
24
|
+
pallets?: number;
|
|
25
|
+
};
|
|
14
26
|
}
|
|
15
27
|
export interface CreateDriverInput {
|
|
16
28
|
employeeId: string;
|
|
@@ -19,6 +31,23 @@ export interface CreateDriverInput {
|
|
|
19
31
|
email?: string;
|
|
20
32
|
phone?: string;
|
|
21
33
|
licenseNumber?: string;
|
|
34
|
+
licenseClass?: string;
|
|
35
|
+
licenseExpiry?: string;
|
|
36
|
+
/** DriverStatus enum value, e.g. `AVAILABLE`, `OFF_DUTY`. */
|
|
37
|
+
status?: string;
|
|
38
|
+
vehicleId?: string;
|
|
39
|
+
rating?: number;
|
|
40
|
+
notes?: string;
|
|
41
|
+
hireDate?: string;
|
|
42
|
+
baseSalary?: number;
|
|
43
|
+
bonusYtd?: number;
|
|
44
|
+
payCurrency?: string;
|
|
45
|
+
}
|
|
46
|
+
/** Superset of `CreateDriverInput` with fields that only make sense on an existing driver. */
|
|
47
|
+
export interface UpdateDriverInput extends CreateDriverInput {
|
|
48
|
+
onLeaveUntil?: string | null;
|
|
49
|
+
terminatedAt?: string;
|
|
50
|
+
terminationReason?: string;
|
|
22
51
|
}
|
|
23
52
|
interface UseFleetResult {
|
|
24
53
|
vehicles: Vehicle[];
|
|
@@ -31,7 +60,8 @@ interface UseFleetResult {
|
|
|
31
60
|
createVehicle: (input: CreateVehicleInput) => Promise<Vehicle>;
|
|
32
61
|
createDriver: (input: CreateDriverInput) => Promise<Driver>;
|
|
33
62
|
updateVehicle: (id: string, input: CreateVehicleInput) => Promise<Vehicle>;
|
|
34
|
-
updateDriver: (id: string, input:
|
|
63
|
+
updateDriver: (id: string, input: UpdateDriverInput) => Promise<Driver>;
|
|
64
|
+
deleteVehicle: (id: string) => Promise<void>;
|
|
35
65
|
}
|
|
36
66
|
export interface ApiVehicle {
|
|
37
67
|
id: string;
|
|
@@ -45,6 +75,8 @@ export interface ApiVehicle {
|
|
|
45
75
|
capacity?: Record<string, unknown> | null;
|
|
46
76
|
status: string;
|
|
47
77
|
currentLocation?: Record<string, unknown> | null;
|
|
78
|
+
fuelType?: string | null;
|
|
79
|
+
fuelEfficiencyLPer100Km?: number | null;
|
|
48
80
|
fuelLevel?: number | null;
|
|
49
81
|
mileage?: number | null;
|
|
50
82
|
lastServiceDate?: string | null;
|
|
@@ -68,8 +100,25 @@ export interface ApiDriver {
|
|
|
68
100
|
currentLocation?: Record<string, unknown> | null;
|
|
69
101
|
rating?: number | null;
|
|
70
102
|
vehicleId?: string | null;
|
|
103
|
+
notes?: string | null;
|
|
104
|
+
hireDate?: string | null;
|
|
105
|
+
baseSalary?: number | null;
|
|
106
|
+
bonusYtd?: number | null;
|
|
107
|
+
payCurrency?: string | null;
|
|
108
|
+
onLeaveUntil?: string | null;
|
|
109
|
+
terminatedAt?: string | null;
|
|
110
|
+
terminationReason?: string | null;
|
|
71
111
|
createdAt: string;
|
|
72
112
|
}
|
|
113
|
+
/**
|
|
114
|
+
* Exported so the vehicle edit form's status field can round-trip (BOFF-7909).
|
|
115
|
+
* `decommissioned` must stay distinct from `out_of_service` — collapsing them
|
|
116
|
+
* used to silently rewrite a DECOMMISSIONED vehicle to INACTIVE on any save
|
|
117
|
+
* that touched status, even without the user changing it.
|
|
118
|
+
*/
|
|
119
|
+
export declare function toApiVehicleStatus(status: VehicleStatus): string;
|
|
120
|
+
/** Exported so the driver edit form's status field can round-trip losslessly (BOFF-7909). */
|
|
121
|
+
export declare function toApiDriverStatus(status: DriverStatus): string;
|
|
73
122
|
export declare function mapVehicle(vehicle: ApiVehicle): Vehicle;
|
|
74
123
|
export declare function mapDriver(driver: ApiDriver): Driver;
|
|
75
124
|
export declare function useFleet(options?: UseFleetOptions): UseFleetResult;
|
|
@@ -83,6 +132,8 @@ interface UseVehiclesOptions extends UseListOptions {
|
|
|
83
132
|
vehicleType?: Vehicle['type'];
|
|
84
133
|
/** Narrows to vehicles linked to this driver server-side (VehicleFilterInput.driverId). */
|
|
85
134
|
driverId?: string;
|
|
135
|
+
/** Fetch exactly these vehicles by id, regardless of how many there are. */
|
|
136
|
+
ids?: readonly string[];
|
|
86
137
|
}
|
|
87
138
|
interface UseVehiclesResult {
|
|
88
139
|
vehicles: Vehicle[];
|
|
@@ -94,6 +145,7 @@ interface UseVehiclesResult {
|
|
|
94
145
|
refetch: () => void;
|
|
95
146
|
updateVehicleStatus: (id: string, status: VehicleStatus) => Promise<Vehicle>;
|
|
96
147
|
assignDriver: (vehicleId: string, driverId: string) => Promise<Vehicle>;
|
|
148
|
+
deleteVehicle: (id: string) => Promise<void>;
|
|
97
149
|
}
|
|
98
150
|
export declare function useVehicles(options?: UseVehiclesOptions): UseVehiclesResult;
|
|
99
151
|
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[];
|
|
@@ -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;
|
|
@@ -251,7 +246,7 @@ export interface ProofOfDelivery {
|
|
|
251
246
|
notes?: string;
|
|
252
247
|
}
|
|
253
248
|
export type VehicleType = 'van' | 'truck' | 'motorcycle' | 'bicycle' | 'car';
|
|
254
|
-
export type VehicleStatus = 'available' | 'assigned' | 'maintenance' | 'out_of_service';
|
|
249
|
+
export type VehicleStatus = 'available' | 'assigned' | 'maintenance' | 'out_of_service' | 'decommissioned';
|
|
255
250
|
export interface VehicleDocument {
|
|
256
251
|
id: string;
|
|
257
252
|
type: 'registration' | 'insurance' | 'inspection' | 'permit';
|
|
@@ -268,7 +263,7 @@ export interface Vehicle {
|
|
|
268
263
|
licensePlate: string;
|
|
269
264
|
/** MtwVehicle.ownershipType — free-text, e.g. "owned", "leased". */
|
|
270
265
|
ownershipType?: string;
|
|
271
|
-
year
|
|
266
|
+
year?: number;
|
|
272
267
|
capacity: {
|
|
273
268
|
weight: number;
|
|
274
269
|
volume: number;
|
|
@@ -281,12 +276,15 @@ export interface Vehicle {
|
|
|
281
276
|
nextMaintenance?: Date;
|
|
282
277
|
/** Odometer reading (km) at which the next service is due. */
|
|
283
278
|
nextMaintenanceMileage?: number;
|
|
279
|
+
fuelType?: string;
|
|
280
|
+
/** Fuel consumption, litres per 100km. */
|
|
281
|
+
fuelEfficiencyLPer100Km?: number;
|
|
284
282
|
fuelLevel?: number;
|
|
285
283
|
mileage?: number;
|
|
286
284
|
documents: VehicleDocument[];
|
|
287
285
|
createdAt: Date;
|
|
288
286
|
}
|
|
289
|
-
export type DriverStatus = 'available' | 'busy' | 'offline' | 'on_break';
|
|
287
|
+
export type DriverStatus = 'available' | 'busy' | 'offline' | 'on_break' | 'inactive';
|
|
290
288
|
export interface DriverDocument {
|
|
291
289
|
id: string;
|
|
292
290
|
type: 'license' | 'insurance' | 'certification' | 'background_check';
|
|
@@ -308,110 +306,43 @@ export interface Driver {
|
|
|
308
306
|
assignedVehicle?: string;
|
|
309
307
|
status: DriverStatus;
|
|
310
308
|
currentLocation?: Location;
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
currentHoursThisWeek: number;
|
|
324
|
-
};
|
|
325
|
-
ratings: {
|
|
326
|
-
overall: number;
|
|
327
|
-
punctuality: number;
|
|
328
|
-
communication: number;
|
|
329
|
-
carefulHandling: number;
|
|
330
|
-
professionalism: number;
|
|
331
|
-
onTimeDelivery: number;
|
|
332
|
-
totalRatings: number;
|
|
333
|
-
};
|
|
309
|
+
/** MtwDriver.rating — a single overall rating; the backend does not track per-category breakdowns. */
|
|
310
|
+
rating: number;
|
|
311
|
+
/** Free-text HR/performance notes. */
|
|
312
|
+
notes?: string;
|
|
313
|
+
hireDate?: Date;
|
|
314
|
+
baseSalary?: number;
|
|
315
|
+
bonusYtd?: number;
|
|
316
|
+
payCurrency?: string;
|
|
317
|
+
/** Set and in the future means the driver is currently on leave. */
|
|
318
|
+
onLeaveUntil?: Date;
|
|
319
|
+
terminatedAt?: Date;
|
|
320
|
+
terminationReason?: string;
|
|
334
321
|
documents: DriverDocument[];
|
|
335
|
-
earnings: {
|
|
336
|
-
totalEarnings: number;
|
|
337
|
-
weeklyEarnings: number;
|
|
338
|
-
monthlyEarnings: number;
|
|
339
|
-
pendingPayments: number;
|
|
340
|
-
completedDeliveries: number;
|
|
341
|
-
bonuses: number;
|
|
342
|
-
};
|
|
343
|
-
compliance: {
|
|
344
|
-
hoursOfService: boolean;
|
|
345
|
-
documentation: boolean;
|
|
346
|
-
vehicleInspection: boolean;
|
|
347
|
-
lastUpdate: Date;
|
|
348
|
-
};
|
|
349
322
|
createdAt: Date;
|
|
350
323
|
}
|
|
351
|
-
export interface WarehouseZone {
|
|
352
|
-
id: string;
|
|
353
|
-
name: string;
|
|
354
|
-
type: 'receiving' | 'storage' | 'picking' | 'packing' | 'shipping';
|
|
355
|
-
location: string;
|
|
356
|
-
capacity: number;
|
|
357
|
-
currentOccupancy: number;
|
|
358
|
-
}
|
|
359
|
-
export interface WarehouseEquipment {
|
|
360
|
-
id: string;
|
|
361
|
-
type: string;
|
|
362
|
-
model: string;
|
|
363
|
-
status: 'operational' | 'maintenance' | 'out_of_service';
|
|
364
|
-
lastMaintenance: Date;
|
|
365
|
-
nextMaintenance: Date;
|
|
366
|
-
}
|
|
367
324
|
export interface Warehouse {
|
|
368
325
|
id: string;
|
|
369
326
|
name: string;
|
|
370
327
|
code: string;
|
|
371
328
|
address: Address;
|
|
372
|
-
type: 'distribution' | 'fulfillment' | 'cold_storage' | 'cross_dock';
|
|
329
|
+
type: 'distribution' | 'fulfillment' | 'cold_storage' | 'cross_dock' | 'retail';
|
|
330
|
+
/** Raw backend value (free-text, e.g. "ACTIVE"/"INACTIVE" — defaults to ACTIVE). */
|
|
331
|
+
status: string;
|
|
373
332
|
capacity: {
|
|
374
333
|
totalSpace: number;
|
|
375
334
|
usedSpace: number;
|
|
376
|
-
totalPallets: number;
|
|
377
|
-
usedPallets: number;
|
|
378
|
-
specialAreas: Array<{
|
|
379
|
-
type: string;
|
|
380
|
-
capacity: number;
|
|
381
|
-
currentUsage: number;
|
|
382
|
-
temperature?: {
|
|
383
|
-
min: number;
|
|
384
|
-
max: number;
|
|
385
|
-
unit: string;
|
|
386
|
-
};
|
|
387
|
-
}>;
|
|
388
335
|
};
|
|
389
336
|
operatingHours: Record<string, {
|
|
390
337
|
open: string;
|
|
391
338
|
close: string;
|
|
392
339
|
} | null>;
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
}>;
|
|
397
|
-
zones: WarehouseZone[];
|
|
398
|
-
equipment: WarehouseEquipment[];
|
|
399
|
-
staff: Array<{
|
|
400
|
-
userId: string;
|
|
401
|
-
role: string;
|
|
402
|
-
shift: string;
|
|
403
|
-
permissions: string[];
|
|
404
|
-
}>;
|
|
405
|
-
metrics: {
|
|
406
|
-
throughput: number;
|
|
407
|
-
accuracy: number;
|
|
408
|
-
productivity: number;
|
|
409
|
-
utilization: number;
|
|
410
|
-
ordersFulfilled: number;
|
|
411
|
-
averageProcessingTime: number;
|
|
412
|
-
lastUpdated: Date;
|
|
340
|
+
contactInfo?: {
|
|
341
|
+
email?: string;
|
|
342
|
+
phone?: string;
|
|
413
343
|
};
|
|
414
|
-
|
|
344
|
+
/** Real computed value: usedSpace / totalSpace. No other backend metrics exist for a warehouse. */
|
|
345
|
+
utilization: number;
|
|
415
346
|
createdAt: Date;
|
|
416
347
|
}
|
|
417
348
|
export interface InventoryMovement {
|
|
@@ -431,20 +362,13 @@ export interface Inventory {
|
|
|
431
362
|
productSku?: string;
|
|
432
363
|
warehouseId: string;
|
|
433
364
|
warehouseName?: string;
|
|
434
|
-
zoneId: string;
|
|
435
365
|
quantity: number;
|
|
436
366
|
reservedQuantity: number;
|
|
437
367
|
availableQuantity: number;
|
|
438
|
-
|
|
439
|
-
|
|
368
|
+
damagedQuantity: number;
|
|
369
|
+
/** Undefined means no reorder point is configured — never treat as 0 (matches the backend's low-stock rule, which requires one to be set). */
|
|
370
|
+
reorderLevel?: number;
|
|
440
371
|
lastRestocked: Date;
|
|
441
|
-
location: {
|
|
442
|
-
aisle: string;
|
|
443
|
-
shelf: string;
|
|
444
|
-
position: string;
|
|
445
|
-
level: number;
|
|
446
|
-
};
|
|
447
|
-
movements: InventoryMovement[];
|
|
448
372
|
createdAt: Date;
|
|
449
373
|
updatedAt: Date;
|
|
450
374
|
}
|
|
@@ -478,10 +402,7 @@ export interface Route {
|
|
|
478
402
|
/** Estimated fuel cost for the route (svc MtwRoute.fuelCost). */
|
|
479
403
|
fuelCost?: number;
|
|
480
404
|
actualDuration?: number;
|
|
481
|
-
startTime?: Date;
|
|
482
|
-
endTime?: Date;
|
|
483
405
|
optimized: boolean;
|
|
484
|
-
trafficConditions: TrafficCondition[];
|
|
485
406
|
createdAt: Date;
|
|
486
407
|
}
|
|
487
408
|
export interface TrackingAlert {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createLucideIcon as e } from "../createLucideIcon.js";
|
|
2
|
+
//#region node_modules/lucide-react/dist/esm/icons/sticky-note.js
|
|
3
|
+
var t = e("StickyNote", [["path", {
|
|
4
|
+
d: "M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8Z",
|
|
5
|
+
key: "qazsjp"
|
|
6
|
+
}], ["path", {
|
|
7
|
+
d: "M15 3v4a2 2 0 0 0 2 2h4",
|
|
8
|
+
key: "40519r"
|
|
9
|
+
}]]);
|
|
10
|
+
//#endregion
|
|
11
|
+
export { t as StickyNote };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { createLucideIcon as e } from "../createLucideIcon.js";
|
|
2
|
+
//#region node_modules/lucide-react/dist/esm/icons/user-x.js
|
|
3
|
+
var t = e("UserX", [
|
|
4
|
+
["path", {
|
|
5
|
+
d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",
|
|
6
|
+
key: "1yyitq"
|
|
7
|
+
}],
|
|
8
|
+
["circle", {
|
|
9
|
+
cx: "9",
|
|
10
|
+
cy: "7",
|
|
11
|
+
r: "4",
|
|
12
|
+
key: "nufk8"
|
|
13
|
+
}],
|
|
14
|
+
["line", {
|
|
15
|
+
x1: "17",
|
|
16
|
+
x2: "22",
|
|
17
|
+
y1: "8",
|
|
18
|
+
y2: "13",
|
|
19
|
+
key: "3nzzx3"
|
|
20
|
+
}],
|
|
21
|
+
["line", {
|
|
22
|
+
x1: "22",
|
|
23
|
+
x2: "17",
|
|
24
|
+
y1: "8",
|
|
25
|
+
y2: "13",
|
|
26
|
+
key: "1swrse"
|
|
27
|
+
}]
|
|
28
|
+
]);
|
|
29
|
+
//#endregion
|
|
30
|
+
export { t as UserX };
|