@burdenoff/microfe-movethewheels 2026.822.1 → 2026.827.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/generated/wspace-operations.d.ts +168 -912
- package/dist/generated/wspace-types.d.ts +78432 -35831
- package/dist/hooks/useFleet.js +142 -74
- package/dist/hooks/useInventory.js +163 -70
- package/dist/hooks/useOrders.js +2 -2
- package/dist/hooks/useTracking.js +5 -5
- package/dist/index.js +33 -33
- package/dist/movethewheels/hooks/index.d.ts +2 -2
- package/dist/movethewheels/hooks/useFleet.d.ts +32 -1
- package/dist/movethewheels/hooks/useInventory.d.ts +67 -12
- package/dist/movethewheels/hooks/useOrders.d.ts +25 -2
- package/dist/movethewheels/types/index.d.ts +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/arrow-down-right.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/arrow-left-right.js +22 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/arrow-up-right.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/calendar-clock.js +32 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/history.js +18 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/lock.js +16 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/user-round.js +13 -0
- package/dist/pages/CreateOrderPage.js +246 -195
- package/dist/pages/DeliveryCapturePage.js +91 -78
- package/dist/pages/DriversPage.js +202 -108
- package/dist/pages/InventoryPage.js +356 -131
- package/dist/pages/ProductDetailsPage.js +212 -156
- package/dist/pages/VehicleDetailsPage.js +257 -193
- package/dist/utils/formatters.js +4 -1
- package/package.json +1 -1
- package/src/generated/wspace-operations.ts +134 -929
- package/src/generated/wspace-types.ts +91730 -40059
- package/src/movethewheels/hooks/index.ts +9 -0
- package/src/movethewheels/hooks/useFleet.ts +133 -3
- package/src/movethewheels/hooks/useInventory.ts +311 -53
- package/src/movethewheels/hooks/useOrders.ts +31 -7
- package/src/movethewheels/hooks/useTracking.ts +14 -14
- package/src/movethewheels/pages/CreateOrderPage.tsx +67 -10
- package/src/movethewheels/pages/DeliveryCapturePage.tsx +8 -0
- package/src/movethewheels/pages/DriversPage.tsx +181 -31
- package/src/movethewheels/pages/InventoryPage.tsx +299 -19
- package/src/movethewheels/pages/ProductDetailsPage.tsx +68 -3
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +86 -27
- package/src/movethewheels/types/index.ts +2 -0
- package/src/operations/wspace/movethewheels/fragments/core.graphql +23 -53
- package/src/operations/wspace/movethewheels/fragments/core.withdrawn.graphql +59 -0
- package/src/operations/wspace/movethewheels/mutations/entities.graphql +5 -5
- package/src/operations/wspace/movethewheels/mutations/marketplace-reports.graphql +18 -78
- package/src/operations/wspace/movethewheels/mutations/marketplace-reports.withdrawn.graphql +93 -0
- package/src/operations/wspace/movethewheels/mutations/orders.graphql +7 -7
- package/src/operations/wspace/movethewheels/queries/dashboard.graphql +3 -3
- package/src/operations/wspace/movethewheels/queries/entities.graphql +3 -3
- package/src/operations/wspace/movethewheels/queries/logistics.graphql +3 -3
- package/src/operations/wspace/movethewheels/queries/marketplace-reports.withdrawn.graphql +58 -0
- package/src/operations/wspace/movethewheels/queries/orders.graphql +3 -3
- package/src/operations/wspace/movethewheels/queries/marketplace-reports.graphql +0 -40
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
import { ArrowLeft as e } from "../node_modules/lucide-react/dist/esm/icons/arrow-left.js";
|
|
2
2
|
import { Fuel as t } from "../node_modules/lucide-react/dist/esm/icons/fuel.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
3
|
+
import { Mail as n } from "../node_modules/lucide-react/dist/esm/icons/mail.js";
|
|
4
|
+
import { MapPin as r } from "../node_modules/lucide-react/dist/esm/icons/map-pin.js";
|
|
5
|
+
import { Phone as i } from "../node_modules/lucide-react/dist/esm/icons/phone.js";
|
|
6
|
+
import { Save as a } from "../node_modules/lucide-react/dist/esm/icons/save.js";
|
|
7
|
+
import { SquarePen as o } from "../node_modules/lucide-react/dist/esm/icons/square-pen.js";
|
|
8
|
+
import { Truck as s } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
|
|
9
|
+
import { UserRound as c } from "../node_modules/lucide-react/dist/esm/icons/user-round.js";
|
|
10
|
+
import { joinPath as l } from "../utils/navigation.js";
|
|
11
|
+
import { useMoveTheWheels as u } from "../providers/MoveTheWheelsProvider.js";
|
|
12
|
+
import { useFleet as d, useVehicle as f, useVehicleDrivers as p } from "../hooks/useFleet.js";
|
|
13
|
+
import { Avatar as m, AvatarFallback as h, Button as g, Card as _, CardContent as v, CardHeader as y, CardTitle as b, Input as x, Label as S, Progress as C, Select as w, SelectContent as T, SelectItem as E, SelectTrigger as D, SelectValue as O } from "../components/ui.js";
|
|
14
|
+
import { ErrorState as k, LoadingState as A, PageLayout as j } from "../components/PageLayout.js";
|
|
15
|
+
import { StatusBadge as M, VehicleTypeBadge as N } from "../components/StatusBadge.js";
|
|
16
|
+
import { FormError as P } from "../components/FormError.js";
|
|
17
|
+
import { formatDate as F, getInitials as I } from "../utils/formatters.js";
|
|
18
|
+
import { DocumentsCard as L } from "../components/DocumentsCard.js";
|
|
19
|
+
import { useEffect as R, useState as z } from "react";
|
|
20
|
+
import { useLocation as B, useParams as V } from "react-router";
|
|
21
|
+
import { jsx as H, jsxs as U } from "react/jsx-runtime";
|
|
22
|
+
import { EmphasisPanel as W, NextSteps as G, PagePurpose as K } from "@burdenoff/fe-libs/ui";
|
|
21
23
|
//#region src/movethewheels/pages/VehicleDetailsPage.tsx
|
|
22
|
-
var
|
|
24
|
+
var q = [
|
|
23
25
|
{
|
|
24
26
|
value: "TRUCK",
|
|
25
27
|
label: "Truck"
|
|
@@ -53,170 +55,170 @@ var V = [
|
|
|
53
55
|
label: "Drone"
|
|
54
56
|
}
|
|
55
57
|
];
|
|
56
|
-
function
|
|
57
|
-
let { basePath: n, navigate:
|
|
58
|
+
function J({ editId: t }) {
|
|
59
|
+
let { basePath: n, navigate: r } = u(), { createVehicle: i, updateVehicle: o } = d(), { vehicle: c } = f(t), p = !!t, [m, h] = z({
|
|
58
60
|
vehicleNumber: "",
|
|
59
61
|
type: "VAN",
|
|
60
62
|
make: "",
|
|
61
63
|
model: "",
|
|
62
64
|
licensePlate: ""
|
|
63
|
-
}), [
|
|
64
|
-
|
|
65
|
-
t &&
|
|
66
|
-
vehicleNumber:
|
|
67
|
-
type:
|
|
68
|
-
make:
|
|
69
|
-
model:
|
|
70
|
-
licensePlate:
|
|
65
|
+
}), [_, v] = z(!1), [y, b] = z(null);
|
|
66
|
+
R(() => {
|
|
67
|
+
t && c && h({
|
|
68
|
+
vehicleNumber: c.vehicleNumber ?? "",
|
|
69
|
+
type: c.type ? c.type.toUpperCase() : "VAN",
|
|
70
|
+
make: c.make ?? "",
|
|
71
|
+
model: c.model ?? "",
|
|
72
|
+
licensePlate: c.licensePlate ?? ""
|
|
71
73
|
});
|
|
72
|
-
}, [t,
|
|
73
|
-
let
|
|
74
|
-
if (e.preventDefault(), !
|
|
75
|
-
|
|
74
|
+
}, [t, c]);
|
|
75
|
+
let C = () => r?.(l(n, "fleet/vehicles")), k = async (e) => {
|
|
76
|
+
if (e.preventDefault(), !m.vehicleNumber.trim()) {
|
|
77
|
+
b("Vehicle number is required.");
|
|
76
78
|
return;
|
|
77
79
|
}
|
|
78
|
-
|
|
80
|
+
v(!0), b(null);
|
|
79
81
|
try {
|
|
80
82
|
if (t) {
|
|
81
|
-
let e = await
|
|
82
|
-
vehicleNumber:
|
|
83
|
-
type:
|
|
84
|
-
make:
|
|
85
|
-
model:
|
|
86
|
-
licensePlate:
|
|
83
|
+
let e = await o(t, {
|
|
84
|
+
vehicleNumber: m.vehicleNumber.trim(),
|
|
85
|
+
type: m.type,
|
|
86
|
+
make: m.make.trim() || void 0,
|
|
87
|
+
model: m.model.trim() || void 0,
|
|
88
|
+
licensePlate: m.licensePlate.trim() || void 0
|
|
87
89
|
});
|
|
88
|
-
|
|
90
|
+
r?.(l(n, `fleet/vehicles/${e.id}`));
|
|
89
91
|
} else {
|
|
90
|
-
let e = await
|
|
91
|
-
vehicleNumber:
|
|
92
|
-
type:
|
|
93
|
-
make:
|
|
94
|
-
model:
|
|
95
|
-
licensePlate:
|
|
92
|
+
let e = await i({
|
|
93
|
+
vehicleNumber: m.vehicleNumber.trim(),
|
|
94
|
+
type: m.type,
|
|
95
|
+
make: m.make.trim() || void 0,
|
|
96
|
+
model: m.model.trim() || void 0,
|
|
97
|
+
licensePlate: m.licensePlate.trim() || void 0
|
|
96
98
|
});
|
|
97
|
-
|
|
99
|
+
r?.(l(n, `fleet/vehicles/${e.id}`));
|
|
98
100
|
}
|
|
99
101
|
} catch (e) {
|
|
100
|
-
console.error("Failed to create vehicle:", e),
|
|
102
|
+
console.error("Failed to create vehicle:", e), b(e instanceof Error ? e.message : "Failed to create vehicle. Please try again."), v(!1);
|
|
101
103
|
}
|
|
102
104
|
};
|
|
103
|
-
return /* @__PURE__ */
|
|
104
|
-
title:
|
|
105
|
+
return /* @__PURE__ */ U(j, {
|
|
106
|
+
title: p ? "Edit Vehicle" : "Add Vehicle",
|
|
105
107
|
subtitle: "Register a new vehicle in your fleet",
|
|
106
|
-
icon: /* @__PURE__ */
|
|
107
|
-
headerActions: /* @__PURE__ */
|
|
108
|
+
icon: /* @__PURE__ */ H(s, { size: 24 }),
|
|
109
|
+
headerActions: /* @__PURE__ */ U("div", {
|
|
108
110
|
className: "flex gap-2",
|
|
109
|
-
children: [/* @__PURE__ */
|
|
111
|
+
children: [/* @__PURE__ */ U(g, {
|
|
110
112
|
variant: "outline",
|
|
111
|
-
onClick:
|
|
112
|
-
disabled:
|
|
113
|
-
children: [/* @__PURE__ */
|
|
114
|
-
}), /* @__PURE__ */
|
|
115
|
-
onClick:
|
|
116
|
-
disabled:
|
|
113
|
+
onClick: C,
|
|
114
|
+
disabled: _,
|
|
115
|
+
children: [/* @__PURE__ */ H(e, { size: 16 }), " Cancel"]
|
|
116
|
+
}), /* @__PURE__ */ U(g, {
|
|
117
|
+
onClick: k,
|
|
118
|
+
disabled: _,
|
|
117
119
|
children: [
|
|
118
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ H(a, { size: 16 }),
|
|
119
121
|
" ",
|
|
120
|
-
|
|
122
|
+
p ? _ ? "Saving..." : "Save Changes" : _ ? "Saving..." : "Add Vehicle"
|
|
121
123
|
]
|
|
122
124
|
})]
|
|
123
125
|
}),
|
|
124
|
-
children: [/* @__PURE__ */
|
|
125
|
-
icon: /* @__PURE__ */
|
|
126
|
+
children: [/* @__PURE__ */ H(K, {
|
|
127
|
+
icon: /* @__PURE__ */ H(s, { size: 18 }),
|
|
126
128
|
children: "Add a vehicle so it can be assigned to deliveries and routes. Give it a fleet number and type to start — make, model and plate help identify it on the road."
|
|
127
|
-
}), /* @__PURE__ */
|
|
128
|
-
onSubmit:
|
|
129
|
+
}), /* @__PURE__ */ U("form", {
|
|
130
|
+
onSubmit: k,
|
|
129
131
|
className: "max-w-2xl space-y-6",
|
|
130
|
-
children: [/* @__PURE__ */
|
|
132
|
+
children: [/* @__PURE__ */ H(P, { message: y }), /* @__PURE__ */ U(W, { children: [/* @__PURE__ */ H("h2", {
|
|
131
133
|
className: "text-base font-semibold text-text-primary mb-4",
|
|
132
134
|
children: "Vehicle Details"
|
|
133
|
-
}), /* @__PURE__ */
|
|
135
|
+
}), /* @__PURE__ */ U("div", {
|
|
134
136
|
className: "space-y-4",
|
|
135
|
-
children: [/* @__PURE__ */
|
|
137
|
+
children: [/* @__PURE__ */ U("div", {
|
|
136
138
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
137
|
-
children: [/* @__PURE__ */
|
|
139
|
+
children: [/* @__PURE__ */ U("div", {
|
|
138
140
|
className: "space-y-2",
|
|
139
|
-
children: [/* @__PURE__ */
|
|
141
|
+
children: [/* @__PURE__ */ U(S, {
|
|
140
142
|
htmlFor: "vehicleNumber",
|
|
141
|
-
children: ["Vehicle Number ", /* @__PURE__ */
|
|
143
|
+
children: ["Vehicle Number ", /* @__PURE__ */ H("span", {
|
|
142
144
|
className: "text-status-error-text",
|
|
143
145
|
children: "*"
|
|
144
146
|
})]
|
|
145
|
-
}), /* @__PURE__ */
|
|
147
|
+
}), /* @__PURE__ */ H(x, {
|
|
146
148
|
id: "vehicleNumber",
|
|
147
|
-
value:
|
|
148
|
-
onChange: (e) =>
|
|
149
|
+
value: m.vehicleNumber,
|
|
150
|
+
onChange: (e) => h((t) => ({
|
|
149
151
|
...t,
|
|
150
152
|
vehicleNumber: e.target.value
|
|
151
153
|
})),
|
|
152
154
|
placeholder: "MTW-001",
|
|
153
155
|
required: !0
|
|
154
156
|
})]
|
|
155
|
-
}), /* @__PURE__ */
|
|
157
|
+
}), /* @__PURE__ */ U("div", {
|
|
156
158
|
className: "space-y-2",
|
|
157
|
-
children: [/* @__PURE__ */
|
|
159
|
+
children: [/* @__PURE__ */ U(S, {
|
|
158
160
|
htmlFor: "type",
|
|
159
|
-
children: ["Type ", /* @__PURE__ */
|
|
161
|
+
children: ["Type ", /* @__PURE__ */ H("span", {
|
|
160
162
|
className: "text-status-error-text",
|
|
161
163
|
children: "*"
|
|
162
164
|
})]
|
|
163
|
-
}), /* @__PURE__ */
|
|
164
|
-
value:
|
|
165
|
-
onValueChange: (e) =>
|
|
165
|
+
}), /* @__PURE__ */ U(w, {
|
|
166
|
+
value: m.type,
|
|
167
|
+
onValueChange: (e) => h((t) => ({
|
|
166
168
|
...t,
|
|
167
169
|
type: e
|
|
168
170
|
})),
|
|
169
|
-
children: [/* @__PURE__ */
|
|
171
|
+
children: [/* @__PURE__ */ H(D, {
|
|
170
172
|
id: "type",
|
|
171
|
-
children: /* @__PURE__ */
|
|
172
|
-
}), /* @__PURE__ */
|
|
173
|
+
children: /* @__PURE__ */ H(O, {})
|
|
174
|
+
}), /* @__PURE__ */ H(T, { children: q.map((e) => /* @__PURE__ */ H(E, {
|
|
173
175
|
value: e.value,
|
|
174
176
|
children: e.label
|
|
175
177
|
}, e.value)) })]
|
|
176
178
|
})]
|
|
177
179
|
})]
|
|
178
|
-
}), /* @__PURE__ */
|
|
180
|
+
}), /* @__PURE__ */ U("div", {
|
|
179
181
|
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
180
182
|
children: [
|
|
181
|
-
/* @__PURE__ */
|
|
183
|
+
/* @__PURE__ */ U("div", {
|
|
182
184
|
className: "space-y-2",
|
|
183
|
-
children: [/* @__PURE__ */
|
|
185
|
+
children: [/* @__PURE__ */ H(S, {
|
|
184
186
|
htmlFor: "make",
|
|
185
187
|
children: "Make"
|
|
186
|
-
}), /* @__PURE__ */
|
|
188
|
+
}), /* @__PURE__ */ H(x, {
|
|
187
189
|
id: "make",
|
|
188
|
-
value:
|
|
189
|
-
onChange: (e) =>
|
|
190
|
+
value: m.make,
|
|
191
|
+
onChange: (e) => h((t) => ({
|
|
190
192
|
...t,
|
|
191
193
|
make: e.target.value
|
|
192
194
|
})),
|
|
193
195
|
placeholder: "Ford"
|
|
194
196
|
})]
|
|
195
197
|
}),
|
|
196
|
-
/* @__PURE__ */
|
|
198
|
+
/* @__PURE__ */ U("div", {
|
|
197
199
|
className: "space-y-2",
|
|
198
|
-
children: [/* @__PURE__ */
|
|
200
|
+
children: [/* @__PURE__ */ H(S, {
|
|
199
201
|
htmlFor: "model",
|
|
200
202
|
children: "Model"
|
|
201
|
-
}), /* @__PURE__ */
|
|
203
|
+
}), /* @__PURE__ */ H(x, {
|
|
202
204
|
id: "model",
|
|
203
|
-
value:
|
|
204
|
-
onChange: (e) =>
|
|
205
|
+
value: m.model,
|
|
206
|
+
onChange: (e) => h((t) => ({
|
|
205
207
|
...t,
|
|
206
208
|
model: e.target.value
|
|
207
209
|
})),
|
|
208
210
|
placeholder: "Transit"
|
|
209
211
|
})]
|
|
210
212
|
}),
|
|
211
|
-
/* @__PURE__ */
|
|
213
|
+
/* @__PURE__ */ U("div", {
|
|
212
214
|
className: "space-y-2",
|
|
213
|
-
children: [/* @__PURE__ */
|
|
215
|
+
children: [/* @__PURE__ */ H(S, {
|
|
214
216
|
htmlFor: "licensePlate",
|
|
215
217
|
children: "License Plate"
|
|
216
|
-
}), /* @__PURE__ */
|
|
218
|
+
}), /* @__PURE__ */ H(x, {
|
|
217
219
|
id: "licensePlate",
|
|
218
|
-
value:
|
|
219
|
-
onChange: (e) =>
|
|
220
|
+
value: m.licensePlate,
|
|
221
|
+
onChange: (e) => h((t) => ({
|
|
220
222
|
...t,
|
|
221
223
|
licensePlate: e.target.value
|
|
222
224
|
})),
|
|
@@ -229,192 +231,254 @@ function H({ editId: t }) {
|
|
|
229
231
|
})]
|
|
230
232
|
});
|
|
231
233
|
}
|
|
232
|
-
function
|
|
233
|
-
let { vehicleId:
|
|
234
|
-
return
|
|
234
|
+
function Y() {
|
|
235
|
+
let { vehicleId: a } = V(), { basePath: d, navigate: x } = u(), { vehicle: S, isLoading: w, error: T, refetch: E } = f(a), D = B().pathname.endsWith("/edit"), { drivers: O, isLoading: P, error: R } = p(D ? void 0 : a), z = () => x?.(l(d, "fleet/vehicles")), q = (e) => x?.(l(d, e));
|
|
236
|
+
return a ? D ? /* @__PURE__ */ H(J, { editId: a }) : w ? /* @__PURE__ */ H(A, { message: "Loading vehicle details..." }) : T || !S ? /* @__PURE__ */ H(k, {
|
|
235
237
|
title: "Vehicle not found",
|
|
236
|
-
onRetry:
|
|
237
|
-
}) : /* @__PURE__ */
|
|
238
|
-
title:
|
|
239
|
-
subtitle: `${
|
|
240
|
-
icon: /* @__PURE__ */
|
|
241
|
-
headerActions: /* @__PURE__ */
|
|
238
|
+
onRetry: E
|
|
239
|
+
}) : /* @__PURE__ */ U(j, {
|
|
240
|
+
title: S.vehicleNumber,
|
|
241
|
+
subtitle: `${S.make} ${S.model} (${S.year})`,
|
|
242
|
+
icon: /* @__PURE__ */ H(s, { size: 24 }),
|
|
243
|
+
headerActions: /* @__PURE__ */ U("div", {
|
|
242
244
|
className: "flex gap-2",
|
|
243
|
-
children: [/* @__PURE__ */
|
|
245
|
+
children: [/* @__PURE__ */ U(g, {
|
|
244
246
|
variant: "outline",
|
|
245
|
-
onClick:
|
|
246
|
-
children: [/* @__PURE__ */
|
|
247
|
-
}), /* @__PURE__ */
|
|
248
|
-
onClick: () =>
|
|
249
|
-
children: [/* @__PURE__ */
|
|
247
|
+
onClick: z,
|
|
248
|
+
children: [/* @__PURE__ */ H(e, { size: 16 }), " Back"]
|
|
249
|
+
}), /* @__PURE__ */ U(g, {
|
|
250
|
+
onClick: () => x?.(l(d, "fleet/vehicles/" + a + "/edit")),
|
|
251
|
+
children: [/* @__PURE__ */ H(o, { size: 16 }), " Edit"]
|
|
250
252
|
})]
|
|
251
253
|
}),
|
|
252
|
-
headerContent: /* @__PURE__ */
|
|
254
|
+
headerContent: /* @__PURE__ */ U("div", {
|
|
253
255
|
className: "flex gap-2",
|
|
254
|
-
children: [/* @__PURE__ */
|
|
255
|
-
status:
|
|
256
|
+
children: [/* @__PURE__ */ H(M, {
|
|
257
|
+
status: S.status,
|
|
256
258
|
type: "vehicle"
|
|
257
|
-
}), /* @__PURE__ */
|
|
259
|
+
}), /* @__PURE__ */ H(N, { type: S.type })]
|
|
258
260
|
}),
|
|
259
261
|
children: [
|
|
260
|
-
/* @__PURE__ */
|
|
261
|
-
icon: /* @__PURE__ */
|
|
262
|
-
children: "The full record for this vehicle — specs, capacity, fuel and mileage,
|
|
262
|
+
/* @__PURE__ */ H(K, {
|
|
263
|
+
icon: /* @__PURE__ */ H(s, { size: 18 }),
|
|
264
|
+
children: "The full record for this vehicle — specs, capacity, fuel and mileage, who is driving it and where it is right now. Use it to confirm a vehicle is fuelled, crewed and the right size before dispatching it on a delivery."
|
|
263
265
|
}),
|
|
264
|
-
/* @__PURE__ */
|
|
266
|
+
/* @__PURE__ */ H(G, {
|
|
265
267
|
storageKey: "movethewheels-vehicle-details",
|
|
266
268
|
steps: [{
|
|
267
269
|
id: "assign",
|
|
268
270
|
label: "Assign to a delivery",
|
|
269
271
|
description: "Put this vehicle on an order that fits its capacity.",
|
|
270
|
-
icon: /* @__PURE__ */
|
|
271
|
-
onClick: () =>
|
|
272
|
+
icon: /* @__PURE__ */ H(r, { size: 16 }),
|
|
273
|
+
onClick: () => q("orders")
|
|
272
274
|
}, {
|
|
273
|
-
id: "
|
|
274
|
-
label: "
|
|
275
|
-
description: "
|
|
276
|
-
icon: /* @__PURE__ */
|
|
277
|
-
|
|
275
|
+
id: "driver",
|
|
276
|
+
label: O.length > 0 ? "Review the assigned driver" : "Assign a driver",
|
|
277
|
+
description: "A vehicle needs a driver before it can be dispatched.",
|
|
278
|
+
icon: /* @__PURE__ */ H(c, { size: 16 }),
|
|
279
|
+
done: O.length > 0,
|
|
280
|
+
onClick: () => O[0] ? q(`fleet/drivers/${O[0].id}`) : q("fleet/drivers")
|
|
278
281
|
}]
|
|
279
282
|
}),
|
|
280
|
-
/* @__PURE__ */
|
|
283
|
+
/* @__PURE__ */ U("div", {
|
|
281
284
|
className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
|
|
282
|
-
children: [/* @__PURE__ */
|
|
285
|
+
children: [/* @__PURE__ */ U("div", {
|
|
283
286
|
className: "lg:col-span-2 space-y-6",
|
|
284
287
|
children: [
|
|
285
|
-
/* @__PURE__ */
|
|
288
|
+
/* @__PURE__ */ U(W, { children: [/* @__PURE__ */ H("h2", {
|
|
286
289
|
className: "text-base font-semibold text-text-primary mb-4",
|
|
287
290
|
children: "Vehicle Information"
|
|
288
|
-
}), /* @__PURE__ */
|
|
289
|
-
className: "grid grid-cols-2 md:grid-cols-
|
|
291
|
+
}), /* @__PURE__ */ U("div", {
|
|
292
|
+
className: "grid grid-cols-2 md:grid-cols-3 gap-6",
|
|
290
293
|
children: [
|
|
291
|
-
/* @__PURE__ */
|
|
294
|
+
/* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("p", {
|
|
292
295
|
className: "text-sm text-text-secondary",
|
|
293
296
|
children: "Type"
|
|
294
|
-
}), /* @__PURE__ */
|
|
297
|
+
}), /* @__PURE__ */ H("p", {
|
|
295
298
|
className: "font-medium capitalize",
|
|
296
|
-
children:
|
|
299
|
+
children: S.type
|
|
297
300
|
})] }),
|
|
298
|
-
/* @__PURE__ */
|
|
301
|
+
/* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("p", {
|
|
299
302
|
className: "text-sm text-text-secondary",
|
|
300
303
|
children: "Make"
|
|
301
|
-
}), /* @__PURE__ */
|
|
304
|
+
}), /* @__PURE__ */ H("p", {
|
|
302
305
|
className: "font-medium",
|
|
303
|
-
children:
|
|
306
|
+
children: S.make || "—"
|
|
304
307
|
})] }),
|
|
305
|
-
/* @__PURE__ */
|
|
308
|
+
/* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("p", {
|
|
306
309
|
className: "text-sm text-text-secondary",
|
|
307
310
|
children: "Model"
|
|
308
|
-
}), /* @__PURE__ */
|
|
311
|
+
}), /* @__PURE__ */ H("p", {
|
|
309
312
|
className: "font-medium",
|
|
310
|
-
children:
|
|
313
|
+
children: S.model || "—"
|
|
311
314
|
})] }),
|
|
312
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("p", {
|
|
313
316
|
className: "text-sm text-text-secondary",
|
|
314
317
|
children: "Year"
|
|
315
|
-
}), /* @__PURE__ */
|
|
318
|
+
}), /* @__PURE__ */ H("p", {
|
|
319
|
+
className: "font-medium",
|
|
320
|
+
children: S.year
|
|
321
|
+
})] }),
|
|
322
|
+
/* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("p", {
|
|
323
|
+
className: "text-sm text-text-secondary",
|
|
324
|
+
children: "License Plate"
|
|
325
|
+
}), /* @__PURE__ */ H("p", {
|
|
316
326
|
className: "font-medium",
|
|
317
|
-
children:
|
|
327
|
+
children: S.licensePlate || "—"
|
|
328
|
+
})] }),
|
|
329
|
+
/* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("p", {
|
|
330
|
+
className: "text-sm text-text-secondary",
|
|
331
|
+
children: "Ownership"
|
|
332
|
+
}), /* @__PURE__ */ H("p", {
|
|
333
|
+
className: "font-medium capitalize",
|
|
334
|
+
children: S.ownershipType || "—"
|
|
318
335
|
})] })
|
|
319
336
|
]
|
|
320
337
|
})] }),
|
|
321
|
-
/* @__PURE__ */
|
|
338
|
+
/* @__PURE__ */ U(_, { children: [/* @__PURE__ */ H(y, { children: /* @__PURE__ */ H(b, { children: "Capacity" }) }), /* @__PURE__ */ H(v, { children: /* @__PURE__ */ U("div", {
|
|
322
339
|
className: "grid grid-cols-1 sm:grid-cols-3 gap-6",
|
|
323
340
|
children: [
|
|
324
|
-
/* @__PURE__ */
|
|
341
|
+
/* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("p", {
|
|
325
342
|
className: "text-sm text-text-secondary",
|
|
326
343
|
children: "Weight"
|
|
327
|
-
}), /* @__PURE__ */
|
|
344
|
+
}), /* @__PURE__ */ U("p", {
|
|
328
345
|
className: "text-2xl font-bold",
|
|
329
|
-
children: [
|
|
346
|
+
children: [S.capacity.weight, /* @__PURE__ */ H("span", {
|
|
330
347
|
className: "text-sm font-normal",
|
|
331
348
|
children: " kg"
|
|
332
349
|
})]
|
|
333
350
|
})] }),
|
|
334
|
-
/* @__PURE__ */
|
|
351
|
+
/* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("p", {
|
|
335
352
|
className: "text-sm text-text-secondary",
|
|
336
353
|
children: "Volume"
|
|
337
|
-
}), /* @__PURE__ */
|
|
354
|
+
}), /* @__PURE__ */ U("p", {
|
|
338
355
|
className: "text-2xl font-bold",
|
|
339
|
-
children: [
|
|
356
|
+
children: [S.capacity.volume, /* @__PURE__ */ H("span", {
|
|
340
357
|
className: "text-sm font-normal",
|
|
341
358
|
children: " m³"
|
|
342
359
|
})]
|
|
343
360
|
})] }),
|
|
344
|
-
|
|
361
|
+
S.capacity.pallets && /* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("p", {
|
|
345
362
|
className: "text-sm text-text-secondary",
|
|
346
363
|
children: "Pallets"
|
|
347
|
-
}), /* @__PURE__ */
|
|
364
|
+
}), /* @__PURE__ */ H("p", {
|
|
348
365
|
className: "text-2xl font-bold",
|
|
349
|
-
children:
|
|
366
|
+
children: S.capacity.pallets
|
|
350
367
|
})] })
|
|
351
368
|
]
|
|
352
369
|
}) })] }),
|
|
353
|
-
/* @__PURE__ */
|
|
370
|
+
/* @__PURE__ */ H(L, {
|
|
354
371
|
entityType: "vehicle",
|
|
355
|
-
entityId:
|
|
372
|
+
entityId: S.id
|
|
356
373
|
})
|
|
357
374
|
]
|
|
358
|
-
}), /* @__PURE__ */
|
|
375
|
+
}), /* @__PURE__ */ U("div", {
|
|
359
376
|
className: "space-y-6",
|
|
360
377
|
children: [
|
|
361
|
-
/* @__PURE__ */
|
|
378
|
+
/* @__PURE__ */ U(_, { children: [/* @__PURE__ */ H(y, { children: /* @__PURE__ */ U(b, {
|
|
362
379
|
className: "flex items-center gap-2",
|
|
363
|
-
children: [/* @__PURE__ */
|
|
364
|
-
}) }), /* @__PURE__ */
|
|
380
|
+
children: [/* @__PURE__ */ H(t, { size: 18 }), " Fuel & Mileage"]
|
|
381
|
+
}) }), /* @__PURE__ */ U(v, {
|
|
365
382
|
className: "space-y-4",
|
|
366
|
-
children: [
|
|
383
|
+
children: [S.fuelLevel !== void 0 && /* @__PURE__ */ U("div", { children: [/* @__PURE__ */ U("div", {
|
|
367
384
|
className: "flex justify-between text-sm mb-2",
|
|
368
|
-
children: [/* @__PURE__ */
|
|
369
|
-
}), /* @__PURE__ */
|
|
385
|
+
children: [/* @__PURE__ */ H("span", { children: "Fuel Level" }), /* @__PURE__ */ U("span", { children: [S.fuelLevel, "%"] })]
|
|
386
|
+
}), /* @__PURE__ */ H(C, { value: S.fuelLevel })] }), S.mileage !== void 0 && /* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("p", {
|
|
370
387
|
className: "text-sm text-text-secondary",
|
|
371
388
|
children: "Total Mileage"
|
|
372
|
-
}), /* @__PURE__ */
|
|
389
|
+
}), /* @__PURE__ */ U("p", {
|
|
373
390
|
className: "text-2xl font-bold",
|
|
374
391
|
children: [
|
|
375
|
-
|
|
392
|
+
S.mileage.toLocaleString(),
|
|
376
393
|
" ",
|
|
377
|
-
/* @__PURE__ */
|
|
394
|
+
/* @__PURE__ */ H("span", {
|
|
378
395
|
className: "text-sm font-normal",
|
|
379
396
|
children: "miles"
|
|
380
397
|
})
|
|
381
398
|
]
|
|
382
399
|
})] })]
|
|
383
400
|
})] }),
|
|
384
|
-
/* @__PURE__ */
|
|
401
|
+
/* @__PURE__ */ U(_, { children: [/* @__PURE__ */ H(y, { children: /* @__PURE__ */ U(b, {
|
|
385
402
|
className: "flex items-center gap-2",
|
|
386
|
-
children: [/* @__PURE__ */
|
|
387
|
-
}) }), /* @__PURE__ */
|
|
388
|
-
className: "space-y-
|
|
389
|
-
children:
|
|
390
|
-
className: "text-sm text-text-secondary",
|
|
391
|
-
children: "Last Maintenance"
|
|
392
|
-
}), /* @__PURE__ */ I("p", {
|
|
393
|
-
className: "font-medium",
|
|
394
|
-
children: _.lastMaintenance ? A(_.lastMaintenance) : "N/A"
|
|
395
|
-
})] }), /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
|
|
403
|
+
children: [/* @__PURE__ */ H(c, { size: 18 }), " Assigned Driver"]
|
|
404
|
+
}) }), /* @__PURE__ */ H(v, {
|
|
405
|
+
className: "space-y-4",
|
|
406
|
+
children: P ? /* @__PURE__ */ H("p", {
|
|
396
407
|
className: "text-sm text-text-secondary",
|
|
397
|
-
children: "
|
|
398
|
-
})
|
|
399
|
-
className: "
|
|
400
|
-
children:
|
|
401
|
-
})
|
|
408
|
+
children: "Loading assignment…"
|
|
409
|
+
}) : R ? /* @__PURE__ */ H("p", {
|
|
410
|
+
className: "text-sm text-status-error-text",
|
|
411
|
+
children: R.message
|
|
412
|
+
}) : O.length === 0 ? /* @__PURE__ */ U("div", {
|
|
413
|
+
className: "space-y-3",
|
|
414
|
+
children: [/* @__PURE__ */ H("p", {
|
|
415
|
+
className: "text-sm text-text-secondary",
|
|
416
|
+
children: "No driver is assigned to this vehicle yet."
|
|
417
|
+
}), /* @__PURE__ */ H(g, {
|
|
418
|
+
variant: "outline",
|
|
419
|
+
size: "sm",
|
|
420
|
+
onClick: () => q("fleet/drivers"),
|
|
421
|
+
children: "Assign from the roster"
|
|
422
|
+
})]
|
|
423
|
+
}) : O.map((e) => /* @__PURE__ */ U("div", {
|
|
424
|
+
role: "button",
|
|
425
|
+
tabIndex: 0,
|
|
426
|
+
className: "flex w-full items-start gap-3 rounded-lg p-2 text-left hover:bg-bg-sunken/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-bg",
|
|
427
|
+
onClick: () => q(`fleet/drivers/${e.id}`),
|
|
428
|
+
onKeyDown: (t) => {
|
|
429
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), q(`fleet/drivers/${e.id}`));
|
|
430
|
+
},
|
|
431
|
+
children: [/* @__PURE__ */ H(m, { children: /* @__PURE__ */ H(h, { children: I(e.fullName) }) }), /* @__PURE__ */ U("div", {
|
|
432
|
+
className: "min-w-0 space-y-1",
|
|
433
|
+
children: [
|
|
434
|
+
/* @__PURE__ */ H("p", {
|
|
435
|
+
className: "font-medium",
|
|
436
|
+
children: e.fullName
|
|
437
|
+
}),
|
|
438
|
+
/* @__PURE__ */ H("p", {
|
|
439
|
+
className: "text-xs text-text-secondary",
|
|
440
|
+
children: e.employeeId
|
|
441
|
+
}),
|
|
442
|
+
/* @__PURE__ */ H(M, {
|
|
443
|
+
status: e.status,
|
|
444
|
+
type: "driver",
|
|
445
|
+
size: "sm"
|
|
446
|
+
}),
|
|
447
|
+
e.email && /* @__PURE__ */ U("p", {
|
|
448
|
+
className: "flex items-center gap-1.5 truncate text-sm text-text-secondary",
|
|
449
|
+
children: [
|
|
450
|
+
/* @__PURE__ */ H(n, { size: 13 }),
|
|
451
|
+
" ",
|
|
452
|
+
e.email
|
|
453
|
+
]
|
|
454
|
+
}),
|
|
455
|
+
e.phone && /* @__PURE__ */ U("p", {
|
|
456
|
+
className: "flex items-center gap-1.5 text-sm text-text-secondary",
|
|
457
|
+
children: [
|
|
458
|
+
/* @__PURE__ */ H(i, { size: 13 }),
|
|
459
|
+
" ",
|
|
460
|
+
e.phone
|
|
461
|
+
]
|
|
462
|
+
})
|
|
463
|
+
]
|
|
464
|
+
})]
|
|
465
|
+
}, e.id))
|
|
402
466
|
})] }),
|
|
403
|
-
|
|
467
|
+
S.currentLocation && /* @__PURE__ */ U(_, { children: [/* @__PURE__ */ H(y, { children: /* @__PURE__ */ U(b, {
|
|
404
468
|
className: "flex items-center gap-2",
|
|
405
|
-
children: [/* @__PURE__ */
|
|
406
|
-
}) }), /* @__PURE__ */
|
|
469
|
+
children: [/* @__PURE__ */ H(r, { size: 18 }), " Current Location"]
|
|
470
|
+
}) }), /* @__PURE__ */ U(v, { children: [/* @__PURE__ */ H("p", {
|
|
407
471
|
className: "text-sm",
|
|
408
|
-
children:
|
|
409
|
-
}), /* @__PURE__ */
|
|
472
|
+
children: S.currentLocation.address || "Location updating..."
|
|
473
|
+
}), /* @__PURE__ */ U("p", {
|
|
410
474
|
className: "text-xs text-text-secondary mt-1",
|
|
411
|
-
children: ["Updated ",
|
|
475
|
+
children: ["Updated ", F(S.currentLocation.timestamp || /* @__PURE__ */ new Date(), "relative")]
|
|
412
476
|
})] })] })
|
|
413
477
|
]
|
|
414
478
|
})]
|
|
415
479
|
})
|
|
416
480
|
]
|
|
417
|
-
}) : /* @__PURE__ */
|
|
481
|
+
}) : /* @__PURE__ */ H(J, {});
|
|
418
482
|
}
|
|
419
483
|
//#endregion
|
|
420
|
-
export {
|
|
484
|
+
export { Y as default };
|