@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.
Files changed (53) hide show
  1. package/dist/generated/wspace-operations.d.ts +168 -912
  2. package/dist/generated/wspace-types.d.ts +78432 -35831
  3. package/dist/hooks/useFleet.js +142 -74
  4. package/dist/hooks/useInventory.js +163 -70
  5. package/dist/hooks/useOrders.js +2 -2
  6. package/dist/hooks/useTracking.js +5 -5
  7. package/dist/index.js +33 -33
  8. package/dist/movethewheels/hooks/index.d.ts +2 -2
  9. package/dist/movethewheels/hooks/useFleet.d.ts +32 -1
  10. package/dist/movethewheels/hooks/useInventory.d.ts +67 -12
  11. package/dist/movethewheels/hooks/useOrders.d.ts +25 -2
  12. package/dist/movethewheels/types/index.d.ts +2 -0
  13. package/dist/node_modules/lucide-react/dist/esm/icons/arrow-down-right.js +11 -0
  14. package/dist/node_modules/lucide-react/dist/esm/icons/arrow-left-right.js +22 -0
  15. package/dist/node_modules/lucide-react/dist/esm/icons/arrow-up-right.js +11 -0
  16. package/dist/node_modules/lucide-react/dist/esm/icons/calendar-clock.js +32 -0
  17. package/dist/node_modules/lucide-react/dist/esm/icons/history.js +18 -0
  18. package/dist/node_modules/lucide-react/dist/esm/icons/lock.js +16 -0
  19. package/dist/node_modules/lucide-react/dist/esm/icons/user-round.js +13 -0
  20. package/dist/pages/CreateOrderPage.js +246 -195
  21. package/dist/pages/DeliveryCapturePage.js +91 -78
  22. package/dist/pages/DriversPage.js +202 -108
  23. package/dist/pages/InventoryPage.js +356 -131
  24. package/dist/pages/ProductDetailsPage.js +212 -156
  25. package/dist/pages/VehicleDetailsPage.js +257 -193
  26. package/dist/utils/formatters.js +4 -1
  27. package/package.json +1 -1
  28. package/src/generated/wspace-operations.ts +134 -929
  29. package/src/generated/wspace-types.ts +91730 -40059
  30. package/src/movethewheels/hooks/index.ts +9 -0
  31. package/src/movethewheels/hooks/useFleet.ts +133 -3
  32. package/src/movethewheels/hooks/useInventory.ts +311 -53
  33. package/src/movethewheels/hooks/useOrders.ts +31 -7
  34. package/src/movethewheels/hooks/useTracking.ts +14 -14
  35. package/src/movethewheels/pages/CreateOrderPage.tsx +67 -10
  36. package/src/movethewheels/pages/DeliveryCapturePage.tsx +8 -0
  37. package/src/movethewheels/pages/DriversPage.tsx +181 -31
  38. package/src/movethewheels/pages/InventoryPage.tsx +299 -19
  39. package/src/movethewheels/pages/ProductDetailsPage.tsx +68 -3
  40. package/src/movethewheels/pages/VehicleDetailsPage.tsx +86 -27
  41. package/src/movethewheels/types/index.ts +2 -0
  42. package/src/operations/wspace/movethewheels/fragments/core.graphql +23 -53
  43. package/src/operations/wspace/movethewheels/fragments/core.withdrawn.graphql +59 -0
  44. package/src/operations/wspace/movethewheels/mutations/entities.graphql +5 -5
  45. package/src/operations/wspace/movethewheels/mutations/marketplace-reports.graphql +18 -78
  46. package/src/operations/wspace/movethewheels/mutations/marketplace-reports.withdrawn.graphql +93 -0
  47. package/src/operations/wspace/movethewheels/mutations/orders.graphql +7 -7
  48. package/src/operations/wspace/movethewheels/queries/dashboard.graphql +3 -3
  49. package/src/operations/wspace/movethewheels/queries/entities.graphql +3 -3
  50. package/src/operations/wspace/movethewheels/queries/logistics.graphql +3 -3
  51. package/src/operations/wspace/movethewheels/queries/marketplace-reports.withdrawn.graphql +58 -0
  52. package/src/operations/wspace/movethewheels/queries/orders.graphql +3 -3
  53. 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 { MapPin as n } from "../node_modules/lucide-react/dist/esm/icons/map-pin.js";
4
- import { Save as r } from "../node_modules/lucide-react/dist/esm/icons/save.js";
5
- import { SquarePen as i } from "../node_modules/lucide-react/dist/esm/icons/square-pen.js";
6
- import { Truck as a } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
7
- import { Wrench as o } from "../node_modules/lucide-react/dist/esm/icons/wrench.js";
8
- import { joinPath as s } from "../utils/navigation.js";
9
- import { useMoveTheWheels as c } from "../providers/MoveTheWheelsProvider.js";
10
- import { useFleet as l, useVehicle as u } from "../hooks/useFleet.js";
11
- import { Button as d, Card as f, CardContent as p, CardHeader as m, CardTitle as h, Input as g, Label as _, Progress as v, Select as y, SelectContent as b, SelectItem as x, SelectTrigger as S, SelectValue as C } from "../components/ui.js";
12
- import { ErrorState as w, LoadingState as T, PageLayout as E } from "../components/PageLayout.js";
13
- import { StatusBadge as D, VehicleTypeBadge as O } from "../components/StatusBadge.js";
14
- import { FormError as k } from "../components/FormError.js";
15
- import { formatDate as A } from "../utils/formatters.js";
16
- import { DocumentsCard as j } from "../components/DocumentsCard.js";
17
- import { useEffect as M, useState as N } from "react";
18
- import { useLocation as P, useParams as F } from "react-router";
19
- import { jsx as I, jsxs as L } from "react/jsx-runtime";
20
- import { EmphasisPanel as R, NextSteps as z, PagePurpose as B } from "@burdenoff/fe-libs/ui";
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 V = [
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 H({ editId: t }) {
57
- let { basePath: n, navigate: i } = c(), { createVehicle: o, updateVehicle: f } = l(), { vehicle: p } = u(t), m = !!t, [h, v] = N({
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
- }), [w, T] = N(!1), [D, O] = N(null);
64
- M(() => {
65
- t && p && v({
66
- vehicleNumber: p.vehicleNumber ?? "",
67
- type: p.type ? p.type.toUpperCase() : "VAN",
68
- make: p.make ?? "",
69
- model: p.model ?? "",
70
- licensePlate: p.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, p]);
73
- let A = () => i?.(s(n, "fleet/vehicles")), j = async (e) => {
74
- if (e.preventDefault(), !h.vehicleNumber.trim()) {
75
- O("Vehicle number is required.");
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
- T(!0), O(null);
80
+ v(!0), b(null);
79
81
  try {
80
82
  if (t) {
81
- let e = await f(t, {
82
- vehicleNumber: h.vehicleNumber.trim(),
83
- type: h.type,
84
- make: h.make.trim() || void 0,
85
- model: h.model.trim() || void 0,
86
- licensePlate: h.licensePlate.trim() || void 0
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
- i?.(s(n, `fleet/vehicles/${e.id}`));
90
+ r?.(l(n, `fleet/vehicles/${e.id}`));
89
91
  } else {
90
- let e = await o({
91
- vehicleNumber: h.vehicleNumber.trim(),
92
- type: h.type,
93
- make: h.make.trim() || void 0,
94
- model: h.model.trim() || void 0,
95
- licensePlate: h.licensePlate.trim() || void 0
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
- i?.(s(n, `fleet/vehicles/${e.id}`));
99
+ r?.(l(n, `fleet/vehicles/${e.id}`));
98
100
  }
99
101
  } catch (e) {
100
- console.error("Failed to create vehicle:", e), O(e instanceof Error ? e.message : "Failed to create vehicle. Please try again."), T(!1);
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__ */ L(E, {
104
- title: m ? "Edit Vehicle" : "Add Vehicle",
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__ */ I(a, { size: 24 }),
107
- headerActions: /* @__PURE__ */ L("div", {
108
+ icon: /* @__PURE__ */ H(s, { size: 24 }),
109
+ headerActions: /* @__PURE__ */ U("div", {
108
110
  className: "flex gap-2",
109
- children: [/* @__PURE__ */ L(d, {
111
+ children: [/* @__PURE__ */ U(g, {
110
112
  variant: "outline",
111
- onClick: A,
112
- disabled: w,
113
- children: [/* @__PURE__ */ I(e, { size: 16 }), " Cancel"]
114
- }), /* @__PURE__ */ L(d, {
115
- onClick: j,
116
- disabled: w,
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__ */ I(r, { size: 16 }),
120
+ /* @__PURE__ */ H(a, { size: 16 }),
119
121
  " ",
120
- m ? w ? "Saving..." : "Save Changes" : w ? "Saving..." : "Add Vehicle"
122
+ p ? _ ? "Saving..." : "Save Changes" : _ ? "Saving..." : "Add Vehicle"
121
123
  ]
122
124
  })]
123
125
  }),
124
- children: [/* @__PURE__ */ I(B, {
125
- icon: /* @__PURE__ */ I(a, { size: 18 }),
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__ */ L("form", {
128
- onSubmit: j,
129
+ }), /* @__PURE__ */ U("form", {
130
+ onSubmit: k,
129
131
  className: "max-w-2xl space-y-6",
130
- children: [/* @__PURE__ */ I(k, { message: D }), /* @__PURE__ */ L(R, { children: [/* @__PURE__ */ I("h2", {
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__ */ L("div", {
135
+ }), /* @__PURE__ */ U("div", {
134
136
  className: "space-y-4",
135
- children: [/* @__PURE__ */ L("div", {
137
+ children: [/* @__PURE__ */ U("div", {
136
138
  className: "grid grid-cols-1 md:grid-cols-2 gap-4",
137
- children: [/* @__PURE__ */ L("div", {
139
+ children: [/* @__PURE__ */ U("div", {
138
140
  className: "space-y-2",
139
- children: [/* @__PURE__ */ L(_, {
141
+ children: [/* @__PURE__ */ U(S, {
140
142
  htmlFor: "vehicleNumber",
141
- children: ["Vehicle Number ", /* @__PURE__ */ I("span", {
143
+ children: ["Vehicle Number ", /* @__PURE__ */ H("span", {
142
144
  className: "text-status-error-text",
143
145
  children: "*"
144
146
  })]
145
- }), /* @__PURE__ */ I(g, {
147
+ }), /* @__PURE__ */ H(x, {
146
148
  id: "vehicleNumber",
147
- value: h.vehicleNumber,
148
- onChange: (e) => v((t) => ({
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__ */ L("div", {
157
+ }), /* @__PURE__ */ U("div", {
156
158
  className: "space-y-2",
157
- children: [/* @__PURE__ */ L(_, {
159
+ children: [/* @__PURE__ */ U(S, {
158
160
  htmlFor: "type",
159
- children: ["Type ", /* @__PURE__ */ I("span", {
161
+ children: ["Type ", /* @__PURE__ */ H("span", {
160
162
  className: "text-status-error-text",
161
163
  children: "*"
162
164
  })]
163
- }), /* @__PURE__ */ L(y, {
164
- value: h.type,
165
- onValueChange: (e) => v((t) => ({
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__ */ I(S, {
171
+ children: [/* @__PURE__ */ H(D, {
170
172
  id: "type",
171
- children: /* @__PURE__ */ I(C, {})
172
- }), /* @__PURE__ */ I(b, { children: V.map((e) => /* @__PURE__ */ I(x, {
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__ */ L("div", {
180
+ }), /* @__PURE__ */ U("div", {
179
181
  className: "grid grid-cols-1 md:grid-cols-3 gap-4",
180
182
  children: [
181
- /* @__PURE__ */ L("div", {
183
+ /* @__PURE__ */ U("div", {
182
184
  className: "space-y-2",
183
- children: [/* @__PURE__ */ I(_, {
185
+ children: [/* @__PURE__ */ H(S, {
184
186
  htmlFor: "make",
185
187
  children: "Make"
186
- }), /* @__PURE__ */ I(g, {
188
+ }), /* @__PURE__ */ H(x, {
187
189
  id: "make",
188
- value: h.make,
189
- onChange: (e) => v((t) => ({
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__ */ L("div", {
198
+ /* @__PURE__ */ U("div", {
197
199
  className: "space-y-2",
198
- children: [/* @__PURE__ */ I(_, {
200
+ children: [/* @__PURE__ */ H(S, {
199
201
  htmlFor: "model",
200
202
  children: "Model"
201
- }), /* @__PURE__ */ I(g, {
203
+ }), /* @__PURE__ */ H(x, {
202
204
  id: "model",
203
- value: h.model,
204
- onChange: (e) => v((t) => ({
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__ */ L("div", {
213
+ /* @__PURE__ */ U("div", {
212
214
  className: "space-y-2",
213
- children: [/* @__PURE__ */ I(_, {
215
+ children: [/* @__PURE__ */ H(S, {
214
216
  htmlFor: "licensePlate",
215
217
  children: "License Plate"
216
- }), /* @__PURE__ */ I(g, {
218
+ }), /* @__PURE__ */ H(x, {
217
219
  id: "licensePlate",
218
- value: h.licensePlate,
219
- onChange: (e) => v((t) => ({
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 U() {
233
- let { vehicleId: r } = F(), { basePath: l, navigate: g } = c(), { vehicle: _, isLoading: y, error: b, refetch: x } = u(r), S = P().pathname.endsWith("/edit"), C = () => g?.(s(l, "fleet/vehicles")), k = (e) => g?.(s(l, e));
234
- return r ? S ? /* @__PURE__ */ I(H, { editId: r }) : y ? /* @__PURE__ */ I(T, { message: "Loading vehicle details..." }) : b || !_ ? /* @__PURE__ */ I(w, {
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: x
237
- }) : /* @__PURE__ */ L(E, {
238
- title: _.vehicleNumber,
239
- subtitle: `${_.make} ${_.model} (${_.year})`,
240
- icon: /* @__PURE__ */ I(a, { size: 24 }),
241
- headerActions: /* @__PURE__ */ L("div", {
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__ */ L(d, {
245
+ children: [/* @__PURE__ */ U(g, {
244
246
  variant: "outline",
245
- onClick: C,
246
- children: [/* @__PURE__ */ I(e, { size: 16 }), " Back"]
247
- }), /* @__PURE__ */ L(d, {
248
- onClick: () => g?.(s(l, "fleet/vehicles/" + r + "/edit")),
249
- children: [/* @__PURE__ */ I(i, { size: 16 }), " Edit"]
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__ */ L("div", {
254
+ headerContent: /* @__PURE__ */ U("div", {
253
255
  className: "flex gap-2",
254
- children: [/* @__PURE__ */ I(D, {
255
- status: _.status,
256
+ children: [/* @__PURE__ */ H(M, {
257
+ status: S.status,
256
258
  type: "vehicle"
257
- }), /* @__PURE__ */ I(O, { type: _.type })]
259
+ }), /* @__PURE__ */ H(N, { type: S.type })]
258
260
  }),
259
261
  children: [
260
- /* @__PURE__ */ I(B, {
261
- icon: /* @__PURE__ */ I(a, { size: 18 }),
262
- children: "The full record for this vehicle — specs, capacity, fuel and mileage, maintenance schedule and current location. Use it to confirm a vehicle is fuelled, serviced and the right size before dispatching it on a delivery."
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__ */ I(z, {
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__ */ I(n, { size: 16 }),
271
- onClick: () => k("orders")
272
+ icon: /* @__PURE__ */ H(r, { size: 16 }),
273
+ onClick: () => q("orders")
272
274
  }, {
273
- id: "maintenance",
274
- label: "Schedule maintenance",
275
- description: "Keep it road-ready and compliant.",
276
- icon: /* @__PURE__ */ I(o, { size: 16 }),
277
- onClick: () => {}
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__ */ L("div", {
283
+ /* @__PURE__ */ U("div", {
281
284
  className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
282
- children: [/* @__PURE__ */ L("div", {
285
+ children: [/* @__PURE__ */ U("div", {
283
286
  className: "lg:col-span-2 space-y-6",
284
287
  children: [
285
- /* @__PURE__ */ L(R, { children: [/* @__PURE__ */ I("h2", {
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__ */ L("div", {
289
- className: "grid grid-cols-2 md:grid-cols-4 gap-6",
291
+ }), /* @__PURE__ */ U("div", {
292
+ className: "grid grid-cols-2 md:grid-cols-3 gap-6",
290
293
  children: [
291
- /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
294
+ /* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("p", {
292
295
  className: "text-sm text-text-secondary",
293
296
  children: "Type"
294
- }), /* @__PURE__ */ I("p", {
297
+ }), /* @__PURE__ */ H("p", {
295
298
  className: "font-medium capitalize",
296
- children: _.type
299
+ children: S.type
297
300
  })] }),
298
- /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
301
+ /* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("p", {
299
302
  className: "text-sm text-text-secondary",
300
303
  children: "Make"
301
- }), /* @__PURE__ */ I("p", {
304
+ }), /* @__PURE__ */ H("p", {
302
305
  className: "font-medium",
303
- children: _.make
306
+ children: S.make || "—"
304
307
  })] }),
305
- /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
308
+ /* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("p", {
306
309
  className: "text-sm text-text-secondary",
307
310
  children: "Model"
308
- }), /* @__PURE__ */ I("p", {
311
+ }), /* @__PURE__ */ H("p", {
309
312
  className: "font-medium",
310
- children: _.model
313
+ children: S.model || "—"
311
314
  })] }),
312
- /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
315
+ /* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("p", {
313
316
  className: "text-sm text-text-secondary",
314
317
  children: "Year"
315
- }), /* @__PURE__ */ I("p", {
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: _.year
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__ */ L(f, { children: [/* @__PURE__ */ I(m, { children: /* @__PURE__ */ I(h, { children: "Capacity" }) }), /* @__PURE__ */ I(p, { children: /* @__PURE__ */ L("div", {
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__ */ L("div", { children: [/* @__PURE__ */ I("p", {
341
+ /* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("p", {
325
342
  className: "text-sm text-text-secondary",
326
343
  children: "Weight"
327
- }), /* @__PURE__ */ L("p", {
344
+ }), /* @__PURE__ */ U("p", {
328
345
  className: "text-2xl font-bold",
329
- children: [_.capacity.weight, /* @__PURE__ */ I("span", {
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__ */ L("div", { children: [/* @__PURE__ */ I("p", {
351
+ /* @__PURE__ */ U("div", { children: [/* @__PURE__ */ H("p", {
335
352
  className: "text-sm text-text-secondary",
336
353
  children: "Volume"
337
- }), /* @__PURE__ */ L("p", {
354
+ }), /* @__PURE__ */ U("p", {
338
355
  className: "text-2xl font-bold",
339
- children: [_.capacity.volume, /* @__PURE__ */ I("span", {
356
+ children: [S.capacity.volume, /* @__PURE__ */ H("span", {
340
357
  className: "text-sm font-normal",
341
358
  children: " m³"
342
359
  })]
343
360
  })] }),
344
- _.capacity.pallets && /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
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__ */ I("p", {
364
+ }), /* @__PURE__ */ H("p", {
348
365
  className: "text-2xl font-bold",
349
- children: _.capacity.pallets
366
+ children: S.capacity.pallets
350
367
  })] })
351
368
  ]
352
369
  }) })] }),
353
- /* @__PURE__ */ I(j, {
370
+ /* @__PURE__ */ H(L, {
354
371
  entityType: "vehicle",
355
- entityId: _.id
372
+ entityId: S.id
356
373
  })
357
374
  ]
358
- }), /* @__PURE__ */ L("div", {
375
+ }), /* @__PURE__ */ U("div", {
359
376
  className: "space-y-6",
360
377
  children: [
361
- /* @__PURE__ */ L(f, { children: [/* @__PURE__ */ I(m, { children: /* @__PURE__ */ L(h, {
378
+ /* @__PURE__ */ U(_, { children: [/* @__PURE__ */ H(y, { children: /* @__PURE__ */ U(b, {
362
379
  className: "flex items-center gap-2",
363
- children: [/* @__PURE__ */ I(t, { size: 18 }), " Fuel & Mileage"]
364
- }) }), /* @__PURE__ */ L(p, {
380
+ children: [/* @__PURE__ */ H(t, { size: 18 }), " Fuel & Mileage"]
381
+ }) }), /* @__PURE__ */ U(v, {
365
382
  className: "space-y-4",
366
- children: [_.fuelLevel !== void 0 && /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ L("div", {
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__ */ I("span", { children: "Fuel Level" }), /* @__PURE__ */ L("span", { children: [_.fuelLevel, "%"] })]
369
- }), /* @__PURE__ */ I(v, { value: _.fuelLevel })] }), _.mileage !== void 0 && /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
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__ */ L("p", {
389
+ }), /* @__PURE__ */ U("p", {
373
390
  className: "text-2xl font-bold",
374
391
  children: [
375
- _.mileage.toLocaleString(),
392
+ S.mileage.toLocaleString(),
376
393
  " ",
377
- /* @__PURE__ */ I("span", {
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__ */ L(f, { children: [/* @__PURE__ */ I(m, { children: /* @__PURE__ */ L(h, {
401
+ /* @__PURE__ */ U(_, { children: [/* @__PURE__ */ H(y, { children: /* @__PURE__ */ U(b, {
385
402
  className: "flex items-center gap-2",
386
- children: [/* @__PURE__ */ I(o, { size: 18 }), " Maintenance"]
387
- }) }), /* @__PURE__ */ L(p, {
388
- className: "space-y-3",
389
- children: [/* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
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: "Next Scheduled"
398
- }), /* @__PURE__ */ I("p", {
399
- className: "font-medium",
400
- children: _.nextMaintenance ? A(_.nextMaintenance) : "N/A"
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
- _.currentLocation && /* @__PURE__ */ L(f, { children: [/* @__PURE__ */ I(m, { children: /* @__PURE__ */ L(h, {
467
+ S.currentLocation && /* @__PURE__ */ U(_, { children: [/* @__PURE__ */ H(y, { children: /* @__PURE__ */ U(b, {
404
468
  className: "flex items-center gap-2",
405
- children: [/* @__PURE__ */ I(n, { size: 18 }), " Current Location"]
406
- }) }), /* @__PURE__ */ L(p, { children: [/* @__PURE__ */ I("p", {
469
+ children: [/* @__PURE__ */ H(r, { size: 18 }), " Current Location"]
470
+ }) }), /* @__PURE__ */ U(v, { children: [/* @__PURE__ */ H("p", {
407
471
  className: "text-sm",
408
- children: _.currentLocation.address || "Location updating..."
409
- }), /* @__PURE__ */ L("p", {
472
+ children: S.currentLocation.address || "Location updating..."
473
+ }), /* @__PURE__ */ U("p", {
410
474
  className: "text-xs text-text-secondary mt-1",
411
- children: ["Updated ", A(_.currentLocation.timestamp || /* @__PURE__ */ new Date(), "relative")]
475
+ children: ["Updated ", F(S.currentLocation.timestamp || /* @__PURE__ */ new Date(), "relative")]
412
476
  })] })] })
413
477
  ]
414
478
  })]
415
479
  })
416
480
  ]
417
- }) : /* @__PURE__ */ I(H, {});
481
+ }) : /* @__PURE__ */ H(J, {});
418
482
  }
419
483
  //#endregion
420
- export { U as default };
484
+ export { Y as default };