@burdenoff/microfe-movethewheels 2026.924.2 → 2026.925.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/dist/components/OrderItemRow.js +195 -109
- package/dist/components/StatusBadge.js +31 -31
- package/dist/constants/index.js +11 -3
- package/dist/generated/wspace-operations.d.ts +7 -0
- package/dist/hooks/useFleet.js +85 -76
- package/dist/hooks/useOrders.js +8 -4
- package/dist/hooks/useTracking.js +127 -66
- package/dist/movethewheels/components/OrderItemRow.d.ts +1 -2
- 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 +41 -1
- package/dist/movethewheels/hooks/useOrders.d.ts +1 -0
- package/dist/movethewheels/hooks/useTracking.d.ts +2 -2
- package/dist/movethewheels/types/index.d.ts +17 -39
- 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/CreateOrderPage.js +597 -420
- package/dist/pages/DriverDetailsPage.js +702 -421
- package/dist/pages/DriversPage.js +106 -117
- package/dist/pages/FleetPage.js +4 -10
- package/dist/pages/OrderDetailsPage.js +290 -262
- package/dist/pages/OrdersListPage.js +4 -0
- package/dist/pages/RouteDetailsPage.js +264 -252
- package/dist/pages/TrackingPage.js +205 -195
- package/dist/pages/VehicleDetailsPage.js +403 -243
- package/dist/utils/mapMarkers.js +2 -1
- package/package.json +1 -1
- package/src/generated/wspace-operations.ts +10 -3
- package/src/movethewheels/components/OrderItemRow.tsx +162 -99
- package/src/movethewheels/components/StatusBadge.tsx +11 -2
- package/src/movethewheels/constants/index.ts +13 -0
- package/src/movethewheels/hooks/useFleet.ts +163 -44
- package/src/movethewheels/hooks/useOrders.ts +17 -3
- package/src/movethewheels/hooks/useTracking.ts +208 -27
- package/src/movethewheels/pages/CreateOrderPage.tsx +372 -263
- package/src/movethewheels/pages/DriverDetailsPage.tsx +516 -156
- package/src/movethewheels/pages/DriversPage.tsx +28 -11
- package/src/movethewheels/pages/FleetPage.tsx +7 -10
- package/src/movethewheels/pages/OrderDetailsPage.tsx +67 -30
- package/src/movethewheels/pages/OrdersListPage.tsx +1 -0
- package/src/movethewheels/pages/RouteDetailsPage.tsx +15 -7
- package/src/movethewheels/pages/TrackingPage.tsx +44 -14
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +137 -15
- package/src/movethewheels/types/index.ts +17 -38
- package/src/movethewheels/utils/mapMarkers.ts +1 -0
- package/src/operations/wspace/movethewheels/queries/dashboard.graphql +5 -0
- package/src/operations/wspace/movethewheels/queries/logistics.graphql +2 -2
|
@@ -6,6 +6,8 @@ interface StatusBadgeProps {
|
|
|
6
6
|
bg: string;
|
|
7
7
|
text: string;
|
|
8
8
|
};
|
|
9
|
+
/** Override the auto-derived display text (title-cased raw status). */
|
|
10
|
+
label?: string;
|
|
9
11
|
size?: 'sm' | 'md' | 'lg';
|
|
10
12
|
showDot?: boolean;
|
|
11
13
|
className?: string;
|
|
@@ -13,7 +15,7 @@ interface StatusBadgeProps {
|
|
|
13
15
|
/**
|
|
14
16
|
* StatusBadge - Displays status with appropriate colors
|
|
15
17
|
*/
|
|
16
|
-
export declare function StatusBadge({ status, type, customColors, size, showDot, className, }: StatusBadgeProps): import("react").JSX.Element;
|
|
18
|
+
export declare function StatusBadge({ status, type, customColors, label, size, showDot, className, }: StatusBadgeProps): import("react").JSX.Element;
|
|
17
19
|
/**
|
|
18
20
|
* Priority Badge - Displays priority level
|
|
19
21
|
*/
|
|
@@ -13,6 +13,7 @@ export interface StatusColor {
|
|
|
13
13
|
export declare const ORDER_STATUS_COLORS: Record<string, StatusColor>;
|
|
14
14
|
export declare const VEHICLE_STATUS_COLORS: Record<string, StatusColor>;
|
|
15
15
|
export declare const DRIVER_STATUS_COLORS: Record<string, StatusColor>;
|
|
16
|
+
export declare const DRIVER_STATUS_LABELS: Record<string, string>;
|
|
16
17
|
export declare const PRIORITY_COLORS: Record<string, StatusColor>;
|
|
17
18
|
export declare const ROUTE_STATUS_COLORS: Record<string, StatusColor>;
|
|
18
19
|
export declare const CUSTOMER_TYPE_LABELS: Record<string, string>;
|
|
@@ -11,6 +11,13 @@ 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;
|
|
14
21
|
}
|
|
15
22
|
export interface CreateDriverInput {
|
|
16
23
|
employeeId: string;
|
|
@@ -19,6 +26,23 @@ export interface CreateDriverInput {
|
|
|
19
26
|
email?: string;
|
|
20
27
|
phone?: string;
|
|
21
28
|
licenseNumber?: string;
|
|
29
|
+
licenseClass?: string;
|
|
30
|
+
licenseExpiry?: string;
|
|
31
|
+
/** DriverStatus enum value, e.g. `AVAILABLE`, `OFF_DUTY`. */
|
|
32
|
+
status?: string;
|
|
33
|
+
vehicleId?: string;
|
|
34
|
+
rating?: number;
|
|
35
|
+
notes?: string;
|
|
36
|
+
hireDate?: string;
|
|
37
|
+
baseSalary?: number;
|
|
38
|
+
bonusYtd?: number;
|
|
39
|
+
payCurrency?: string;
|
|
40
|
+
}
|
|
41
|
+
/** Superset of `CreateDriverInput` with fields that only make sense on an existing driver. */
|
|
42
|
+
export interface UpdateDriverInput extends CreateDriverInput {
|
|
43
|
+
onLeaveUntil?: string | null;
|
|
44
|
+
terminatedAt?: string;
|
|
45
|
+
terminationReason?: string;
|
|
22
46
|
}
|
|
23
47
|
interface UseFleetResult {
|
|
24
48
|
vehicles: Vehicle[];
|
|
@@ -31,7 +55,7 @@ interface UseFleetResult {
|
|
|
31
55
|
createVehicle: (input: CreateVehicleInput) => Promise<Vehicle>;
|
|
32
56
|
createDriver: (input: CreateDriverInput) => Promise<Driver>;
|
|
33
57
|
updateVehicle: (id: string, input: CreateVehicleInput) => Promise<Vehicle>;
|
|
34
|
-
updateDriver: (id: string, input:
|
|
58
|
+
updateDriver: (id: string, input: UpdateDriverInput) => Promise<Driver>;
|
|
35
59
|
}
|
|
36
60
|
export interface ApiVehicle {
|
|
37
61
|
id: string;
|
|
@@ -45,6 +69,8 @@ export interface ApiVehicle {
|
|
|
45
69
|
capacity?: Record<string, unknown> | null;
|
|
46
70
|
status: string;
|
|
47
71
|
currentLocation?: Record<string, unknown> | null;
|
|
72
|
+
fuelType?: string | null;
|
|
73
|
+
fuelEfficiencyLPer100Km?: number | null;
|
|
48
74
|
fuelLevel?: number | null;
|
|
49
75
|
mileage?: number | null;
|
|
50
76
|
lastServiceDate?: string | null;
|
|
@@ -68,8 +94,20 @@ export interface ApiDriver {
|
|
|
68
94
|
currentLocation?: Record<string, unknown> | null;
|
|
69
95
|
rating?: number | null;
|
|
70
96
|
vehicleId?: string | null;
|
|
97
|
+
notes?: string | null;
|
|
98
|
+
hireDate?: string | null;
|
|
99
|
+
baseSalary?: number | null;
|
|
100
|
+
bonusYtd?: number | null;
|
|
101
|
+
payCurrency?: string | null;
|
|
102
|
+
onLeaveUntil?: string | null;
|
|
103
|
+
terminatedAt?: string | null;
|
|
104
|
+
terminationReason?: string | null;
|
|
71
105
|
createdAt: string;
|
|
72
106
|
}
|
|
107
|
+
/** Exported so the vehicle edit form's status field can round-trip (BOFF-7909). */
|
|
108
|
+
export declare function toApiVehicleStatus(status: VehicleStatus): string;
|
|
109
|
+
/** Exported so the driver edit form's status field can round-trip losslessly (BOFF-7909). */
|
|
110
|
+
export declare function toApiDriverStatus(status: DriverStatus): string;
|
|
73
111
|
export declare function mapVehicle(vehicle: ApiVehicle): Vehicle;
|
|
74
112
|
export declare function mapDriver(driver: ApiDriver): Driver;
|
|
75
113
|
export declare function useFleet(options?: UseFleetOptions): UseFleetResult;
|
|
@@ -83,6 +121,8 @@ interface UseVehiclesOptions extends UseListOptions {
|
|
|
83
121
|
vehicleType?: Vehicle['type'];
|
|
84
122
|
/** Narrows to vehicles linked to this driver server-side (VehicleFilterInput.driverId). */
|
|
85
123
|
driverId?: string;
|
|
124
|
+
/** Fetch exactly these vehicles by id, regardless of how many there are. */
|
|
125
|
+
ids?: readonly string[];
|
|
86
126
|
}
|
|
87
127
|
interface UseVehiclesResult {
|
|
88
128
|
vehicles: Vehicle[];
|
|
@@ -19,12 +19,12 @@ interface LiveDelivery {
|
|
|
19
19
|
estimatedArrival: Date | undefined;
|
|
20
20
|
}
|
|
21
21
|
export declare function useTracking(options?: UseTrackingOptions): UseTrackingResult;
|
|
22
|
-
export declare function useOrderTracking(
|
|
22
|
+
export declare function useOrderTracking(orderLookup: string | undefined): {
|
|
23
23
|
tracking: Tracking | null;
|
|
24
24
|
order: Order | null;
|
|
25
25
|
isLoading: boolean;
|
|
26
26
|
error: Error | null;
|
|
27
|
-
refetch: () =>
|
|
27
|
+
refetch: () => void;
|
|
28
28
|
};
|
|
29
29
|
export declare function useVehicleTracking(vehicleId: string | undefined): {
|
|
30
30
|
tracking: Tracking | null;
|
|
@@ -199,7 +199,7 @@ export interface OrderPricing {
|
|
|
199
199
|
paymentMethod: string;
|
|
200
200
|
paymentStatus: 'pending' | 'paid' | 'failed' | 'refunded';
|
|
201
201
|
}
|
|
202
|
-
export type OrderStatus = 'pending' | 'confirmed' | 'assigned' | 'picked_up' | 'in_transit' | 'out_for_delivery' | 'delivered' | 'cancelled' | 'failed';
|
|
202
|
+
export type OrderStatus = 'pending' | 'confirmed' | 'assigned' | 'picked_up' | 'in_transit' | 'out_for_delivery' | 'delivered' | 'returned' | 'cancelled' | 'failed';
|
|
203
203
|
export interface Order {
|
|
204
204
|
id: string;
|
|
205
205
|
orderNumber: string;
|
|
@@ -281,12 +281,15 @@ export interface Vehicle {
|
|
|
281
281
|
nextMaintenance?: Date;
|
|
282
282
|
/** Odometer reading (km) at which the next service is due. */
|
|
283
283
|
nextMaintenanceMileage?: number;
|
|
284
|
+
fuelType?: string;
|
|
285
|
+
/** Fuel consumption, litres per 100km. */
|
|
286
|
+
fuelEfficiencyLPer100Km?: number;
|
|
284
287
|
fuelLevel?: number;
|
|
285
288
|
mileage?: number;
|
|
286
289
|
documents: VehicleDocument[];
|
|
287
290
|
createdAt: Date;
|
|
288
291
|
}
|
|
289
|
-
export type DriverStatus = 'available' | 'busy' | 'offline' | 'on_break';
|
|
292
|
+
export type DriverStatus = 'available' | 'busy' | 'offline' | 'on_break' | 'inactive';
|
|
290
293
|
export interface DriverDocument {
|
|
291
294
|
id: string;
|
|
292
295
|
type: 'license' | 'insurance' | 'certification' | 'background_check';
|
|
@@ -308,44 +311,19 @@ export interface Driver {
|
|
|
308
311
|
assignedVehicle?: string;
|
|
309
312
|
status: DriverStatus;
|
|
310
313
|
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
|
-
};
|
|
314
|
+
/** MtwDriver.rating — a single overall rating; the backend does not track per-category breakdowns. */
|
|
315
|
+
rating: number;
|
|
316
|
+
/** Free-text HR/performance notes. */
|
|
317
|
+
notes?: string;
|
|
318
|
+
hireDate?: Date;
|
|
319
|
+
baseSalary?: number;
|
|
320
|
+
bonusYtd?: number;
|
|
321
|
+
payCurrency?: string;
|
|
322
|
+
/** Set and in the future means the driver is currently on leave. */
|
|
323
|
+
onLeaveUntil?: Date;
|
|
324
|
+
terminatedAt?: Date;
|
|
325
|
+
terminationReason?: string;
|
|
334
326
|
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
327
|
createdAt: Date;
|
|
350
328
|
}
|
|
351
329
|
export interface WarehouseZone {
|
|
@@ -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 };
|