@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,99 +1,179 @@
1
1
  import { Coffee as e } from "../node_modules/lucide-react/dist/esm/icons/coffee.js";
2
2
  import { Download as t } from "../node_modules/lucide-react/dist/esm/icons/download.js";
3
- import { Plus as n } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
4
- import { RefreshCw as r } from "../node_modules/lucide-react/dist/esm/icons/refresh-cw.js";
5
- import { Star as i } from "../node_modules/lucide-react/dist/esm/icons/star.js";
6
- import { UserCheck as a } from "../node_modules/lucide-react/dist/esm/icons/user-check.js";
7
- import { UserMinus as o } from "../node_modules/lucide-react/dist/esm/icons/user-minus.js";
8
- import { Users as s } from "../node_modules/lucide-react/dist/esm/icons/users.js";
9
- import { joinPath as c } from "../utils/navigation.js";
10
- import { useMoveTheWheels as l } from "../providers/MoveTheWheelsProvider.js";
11
- import { useDrivers as u, useFleetStats as d } from "../hooks/useFleet.js";
12
- import { Avatar as f, AvatarFallback as p } from "../components/ui.js";
13
- import { PageLayout as m } from "../components/PageLayout.js";
14
- import { MetricCard as h, MetricGrid as g } from "../components/MetricCard.js";
15
- import { StatusBadge as _ } from "../components/StatusBadge.js";
16
- import { DataTable as v } from "../components/DataTable.js";
17
- import { formatDate as y } from "../utils/formatters.js";
18
- import { useState as b } from "react";
19
- import { jsx as x, jsxs as S } from "react/jsx-runtime";
20
- import { CTAOverflowMenu as C, PagePurpose as w } from "@burdenoff/fe-libs/ui";
3
+ import { Filter as n } from "../node_modules/lucide-react/dist/esm/icons/filter.js";
4
+ import { Plus as r } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
5
+ import { RefreshCw as i } from "../node_modules/lucide-react/dist/esm/icons/refresh-cw.js";
6
+ import { Star as a } from "../node_modules/lucide-react/dist/esm/icons/star.js";
7
+ import { Truck as o } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
8
+ import { UserCheck as s } from "../node_modules/lucide-react/dist/esm/icons/user-check.js";
9
+ import { UserMinus as c } from "../node_modules/lucide-react/dist/esm/icons/user-minus.js";
10
+ import { Users as l } from "../node_modules/lucide-react/dist/esm/icons/users.js";
11
+ import { joinPath as u } from "../utils/navigation.js";
12
+ import { useMoveTheWheels as d } from "../providers/MoveTheWheelsProvider.js";
13
+ import { useDriverStatusCounts as f, useDrivers as ee, useFleetStats as te, useVehicles as p } from "../hooks/useFleet.js";
14
+ import { Avatar as ne, AvatarFallback as m, Button as re, Card as ie, CardContent as h, Select as g, SelectContent as _, SelectItem as v, SelectTrigger as y, SelectValue as b } from "../components/ui.js";
15
+ import { PageLayout as x } from "../components/PageLayout.js";
16
+ import { MetricCard as S, MetricGrid as C } from "../components/MetricCard.js";
17
+ import { StatusBadge as w } from "../components/StatusBadge.js";
18
+ import { DataTable as T } from "../components/DataTable.js";
19
+ import { formatDate as E } from "../utils/formatters.js";
20
+ import { useMemo as D, useState as O } from "react";
21
+ import { jsx as k, jsxs as A } from "react/jsx-runtime";
22
+ import { CTAOverflowMenu as j, PagePurpose as M } from "@burdenoff/fe-libs/ui";
21
23
  //#region src/movethewheels/pages/DriversPage.tsx
22
- function T() {
23
- let { basePath: T, navigate: E } = l(), [D, O] = b(0), [k, A] = b(25), { drivers: j, isLoading: M, error: N, refetch: P } = u({
24
- limit: k,
25
- offset: D * k
26
- }), { stats: F } = d(), I = F.totalDrivers, L = (e) => E?.(c(T, e));
27
- return /* @__PURE__ */ S(m, {
24
+ var N = [
25
+ {
26
+ value: "all",
27
+ label: "All statuses"
28
+ },
29
+ {
30
+ value: "available",
31
+ label: "Available"
32
+ },
33
+ {
34
+ value: "busy",
35
+ label: "On delivery"
36
+ },
37
+ {
38
+ value: "on_break",
39
+ label: "On break"
40
+ },
41
+ {
42
+ value: "offline",
43
+ label: "Off duty"
44
+ }
45
+ ];
46
+ function P() {
47
+ let { basePath: P, navigate: F } = d(), [I, L] = O(0), [R, z] = O(25), [B, V] = O("all"), [H, U] = O("all"), { drivers: W, isLoading: G, error: K, refetch: q } = ee({
48
+ limit: R,
49
+ offset: I * R,
50
+ status: B === "all" ? void 0 : B
51
+ }), { stats: J } = te(), { counts: Y } = f(), { vehicles: X } = p({ limit: 500 }), ae = D(() => new Map(X.map((e) => [e.id, e.vehicleNumber])), [X]), Z = J.totalDrivers, oe = D(() => Array.from(new Set(W.map((e) => e.licenseType).filter(Boolean))).sort((e, t) => e.localeCompare(t)), [W]), se = D(() => H === "all" ? W : W.filter((e) => e.licenseType === H), [W, H]), Q = B !== "all" || H !== "all", $ = (e) => F?.(u(P, e));
52
+ return /* @__PURE__ */ A(x, {
28
53
  title: "Drivers",
29
- subtitle: `${I} drivers`,
30
- icon: /* @__PURE__ */ x(s, { size: 24 }),
31
- headerActions: /* @__PURE__ */ x(C, {
54
+ subtitle: `${Z} drivers`,
55
+ icon: /* @__PURE__ */ k(l, { size: 24 }),
56
+ headerActions: /* @__PURE__ */ k(j, {
32
57
  primary: {
33
58
  label: "Add Driver",
34
- icon: /* @__PURE__ */ x(n, { size: 16 }),
35
- onSelect: () => L("fleet/drivers/new")
59
+ icon: /* @__PURE__ */ k(r, { size: 16 }),
60
+ onSelect: () => $("fleet/drivers/new")
36
61
  },
37
62
  actions: [{
38
63
  label: "Refresh",
39
- icon: /* @__PURE__ */ x(r, { size: 16 }),
40
- onSelect: () => P()
64
+ icon: /* @__PURE__ */ k(i, { size: 16 }),
65
+ onSelect: () => q()
41
66
  }, {
42
67
  label: "Export",
43
- icon: /* @__PURE__ */ x(t, { size: 16 }),
44
- onSelect: () => L("import-export")
68
+ icon: /* @__PURE__ */ k(t, { size: 16 }),
69
+ onSelect: () => $("import-export")
45
70
  }]
46
71
  }),
47
72
  children: [
48
- /* @__PURE__ */ x(w, {
49
- icon: /* @__PURE__ */ x(s, { size: 18 }),
50
- children: "Your delivery workforce. Track each driver's availability, performance rating, completed deliveries and license status here — open a driver to review their history before assigning them to an order or route."
73
+ /* @__PURE__ */ k(M, {
74
+ icon: /* @__PURE__ */ k(l, { size: 18 }),
75
+ children: "Your delivery workforce. Track each driver's availability, rating, licence status, contact number and the vehicle they are on — open a driver to review their record before assigning them to an order or route."
51
76
  }),
52
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
77
+ /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("p", {
53
78
  className: "mb-3 text-sm font-medium text-text-secondary",
54
79
  children: "Workforce at a glance"
55
- }), /* @__PURE__ */ S(g, {
80
+ }), /* @__PURE__ */ A(C, {
56
81
  columns: 4,
57
82
  children: [
58
- /* @__PURE__ */ x(h, {
83
+ /* @__PURE__ */ k(S, {
59
84
  label: "On duty",
60
- value: F.driversByStatus.available + F.driversByStatus.busy,
61
- icon: /* @__PURE__ */ x(a, { size: 20 }),
85
+ value: J.driversByStatus.available + J.driversByStatus.busy,
86
+ icon: /* @__PURE__ */ k(s, { size: 20 }),
62
87
  accent: "success",
63
88
  subtitle: "Available or delivering"
64
89
  }),
65
- /* @__PURE__ */ x(h, {
90
+ /* @__PURE__ */ k(S, {
66
91
  label: "On break",
67
- value: F.driversByStatus.on_break,
68
- icon: /* @__PURE__ */ x(e, { size: 20 }),
69
- accent: "warning"
92
+ value: Y.onBreak,
93
+ icon: /* @__PURE__ */ k(e, { size: 20 }),
94
+ accent: "warning",
95
+ subtitle: "Back on shift shortly"
70
96
  }),
71
- /* @__PURE__ */ x(h, {
97
+ /* @__PURE__ */ k(S, {
72
98
  label: "Off duty",
73
- value: F.driversByStatus.offline,
74
- icon: /* @__PURE__ */ x(o, { size: 20 }),
75
- accent: "neutral"
99
+ value: Y.offDuty,
100
+ icon: /* @__PURE__ */ k(c, { size: 20 }),
101
+ accent: "neutral",
102
+ subtitle: Y.inactive > 0 ? `${Y.inactive} inactive` : void 0
76
103
  }),
77
- /* @__PURE__ */ x(h, {
104
+ /* @__PURE__ */ k(S, {
78
105
  label: "Avg rating",
79
- value: F.avgDriverRating > 0 ? F.avgDriverRating.toFixed(1) : "—",
80
- icon: /* @__PURE__ */ x(i, { size: 20 }),
106
+ value: J.avgDriverRating > 0 ? J.avgDriverRating.toFixed(1) : "—",
107
+ icon: /* @__PURE__ */ k(a, { size: 20 }),
81
108
  accent: "brand",
82
- subtitle: `${I} drivers`
109
+ subtitle: `${Z} drivers`
83
110
  })
84
111
  ]
85
112
  })] }),
86
- /* @__PURE__ */ x(v, {
113
+ /* @__PURE__ */ k(ie, { children: /* @__PURE__ */ k(h, {
114
+ className: "p-4",
115
+ children: /* @__PURE__ */ A("div", {
116
+ className: "flex flex-wrap items-center gap-4",
117
+ children: [
118
+ /* @__PURE__ */ A("div", {
119
+ className: "flex items-center gap-2",
120
+ children: [/* @__PURE__ */ k(n, {
121
+ size: 16,
122
+ className: "text-text-secondary"
123
+ }), /* @__PURE__ */ k("span", {
124
+ className: "text-sm font-medium",
125
+ children: "Filters:"
126
+ })]
127
+ }),
128
+ /* @__PURE__ */ A(g, {
129
+ value: B,
130
+ onValueChange: (e) => {
131
+ V(e), L(0);
132
+ },
133
+ children: [/* @__PURE__ */ k(y, {
134
+ className: "w-[180px]",
135
+ children: /* @__PURE__ */ k(b, { placeholder: "Status" })
136
+ }), /* @__PURE__ */ k(_, { children: N.map((e) => /* @__PURE__ */ k(v, {
137
+ value: e.value,
138
+ children: e.label
139
+ }, e.value)) })]
140
+ }),
141
+ /* @__PURE__ */ A(g, {
142
+ value: H,
143
+ onValueChange: U,
144
+ children: [/* @__PURE__ */ k(y, {
145
+ className: "w-[180px]",
146
+ children: /* @__PURE__ */ k(b, { placeholder: "License class" })
147
+ }), /* @__PURE__ */ A(_, { children: [/* @__PURE__ */ k(v, {
148
+ value: "all",
149
+ children: "All licence classes"
150
+ }), oe.map((e) => /* @__PURE__ */ k(v, {
151
+ value: e,
152
+ children: e
153
+ }, e))] })]
154
+ }),
155
+ Q && /* @__PURE__ */ k(re, {
156
+ variant: "ghost",
157
+ size: "sm",
158
+ onClick: () => {
159
+ V("all"), U("all"), L(0);
160
+ },
161
+ children: "Clear filters"
162
+ })
163
+ ]
164
+ })
165
+ }) }),
166
+ /* @__PURE__ */ k(T, {
87
167
  columns: [
88
168
  {
89
169
  id: "driver",
90
170
  header: "Driver",
91
- cell: (e) => /* @__PURE__ */ S("div", {
171
+ cell: (e) => /* @__PURE__ */ A("div", {
92
172
  className: "flex items-center gap-3",
93
- children: [/* @__PURE__ */ x(f, { children: /* @__PURE__ */ x(p, { children: e.fullName.split(" ").map((e) => e[0]).join("") }) }), /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
173
+ children: [/* @__PURE__ */ k(ne, { children: /* @__PURE__ */ k(m, { children: e.fullName.split(" ").map((e) => e[0]).join("") }) }), /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("p", {
94
174
  className: "font-medium",
95
175
  children: e.fullName
96
- }), /* @__PURE__ */ x("p", {
176
+ }), /* @__PURE__ */ k("p", {
97
177
  className: "text-sm text-text-secondary",
98
178
  children: e.employeeId
99
179
  })] })]
@@ -104,87 +184,101 @@ function T() {
104
184
  header: "Status",
105
185
  accessorKey: "status",
106
186
  sortable: !0,
107
- cell: (e) => /* @__PURE__ */ x(_, {
187
+ cell: (e) => /* @__PURE__ */ k(w, {
108
188
  status: e.status,
109
189
  type: "driver"
110
190
  })
111
191
  },
112
192
  {
113
- id: "rating",
114
- header: "Rating",
115
- cell: (e) => /* @__PURE__ */ S("div", {
116
- className: "flex items-center gap-1",
117
- children: [
118
- /* @__PURE__ */ x(i, {
119
- size: 14,
120
- className: "text-status-warning-text fill-current"
121
- }),
122
- /* @__PURE__ */ x("span", {
123
- className: "font-medium",
124
- children: e.ratings.overall.toFixed(1)
125
- }),
126
- /* @__PURE__ */ S("span", {
127
- className: "text-text-secondary text-sm",
128
- children: [
129
- "(",
130
- e.ratings.totalRatings,
131
- ")"
132
- ]
133
- })
134
- ]
193
+ id: "license",
194
+ header: "License",
195
+ cell: (e) => /* @__PURE__ */ A("div", {
196
+ className: "text-sm",
197
+ children: [/* @__PURE__ */ k("p", { children: e.licenseType }), /* @__PURE__ */ A("p", {
198
+ className: "text-text-secondary",
199
+ children: ["Exp: ", E(e.licenseExpiry, "short")]
200
+ })]
135
201
  })
136
202
  },
137
203
  {
138
- id: "deliveries",
139
- header: "Deliveries",
140
- accessorKey: "completedOrders",
141
- sortable: !0,
142
- cell: (e) => /* @__PURE__ */ x("span", {
143
- className: "font-medium",
144
- children: e.completedOrders.toLocaleString()
204
+ id: "phone",
205
+ header: "Phone",
206
+ accessorKey: "phone",
207
+ cell: (e) => e.phone ? /* @__PURE__ */ k("a", {
208
+ href: `tel:${e.phone}`,
209
+ className: "text-sm hover:underline",
210
+ onClick: (e) => e.stopPropagation(),
211
+ children: e.phone
212
+ }) : /* @__PURE__ */ k("span", {
213
+ className: "text-sm text-text-secondary",
214
+ children: "—"
145
215
  })
146
216
  },
147
217
  {
148
- id: "license",
149
- header: "License",
150
- cell: (e) => /* @__PURE__ */ S("div", {
151
- className: "text-sm",
152
- children: [/* @__PURE__ */ x("p", { children: e.licenseType }), /* @__PURE__ */ S("p", {
153
- className: "text-text-secondary",
154
- children: ["Exp: ", y(e.licenseExpiry, "short")]
218
+ id: "rating",
219
+ header: "Rating",
220
+ cell: (e) => e.ratings.overall > 0 ? /* @__PURE__ */ A("div", {
221
+ className: "flex items-center gap-1",
222
+ children: [/* @__PURE__ */ k(a, {
223
+ size: 14,
224
+ className: "text-status-warning-text fill-current"
225
+ }), /* @__PURE__ */ k("span", {
226
+ className: "font-medium",
227
+ children: e.ratings.overall.toFixed(1)
155
228
  })]
229
+ }) : /* @__PURE__ */ k("span", {
230
+ className: "text-sm text-text-secondary",
231
+ children: "Not rated"
156
232
  })
157
233
  },
234
+ {
235
+ id: "vehicle",
236
+ header: "Assigned vehicle",
237
+ cell: (e) => {
238
+ if (!e.assignedVehicle) return /* @__PURE__ */ k("span", {
239
+ className: "text-sm text-text-secondary",
240
+ children: "Unassigned"
241
+ });
242
+ let t = ae.get(e.assignedVehicle);
243
+ return /* @__PURE__ */ A("span", {
244
+ className: "inline-flex items-center gap-1.5 text-sm font-medium",
245
+ children: [/* @__PURE__ */ k(o, {
246
+ size: 14,
247
+ className: "text-text-secondary"
248
+ }), t ?? "Assigned"]
249
+ });
250
+ }
251
+ },
158
252
  {
159
253
  id: "joined",
160
254
  header: "Join Date",
161
255
  accessorKey: "joinDate",
162
256
  sortable: !0,
163
- cell: (e) => y(e.joinDate, "short")
257
+ cell: (e) => E(e.joinDate, "short")
164
258
  }
165
259
  ],
166
- data: j,
167
- isLoading: M,
168
- error: N,
169
- onRetry: P,
260
+ data: se,
261
+ isLoading: G,
262
+ error: K,
263
+ onRetry: q,
170
264
  searchable: !0,
171
265
  searchPlaceholder: "Search drivers...",
172
266
  searchFields: ["fullName", "employeeId"],
173
- onRowClick: (e) => L(`fleet/drivers/${e.id}`),
267
+ onRowClick: (e) => $(`fleet/drivers/${e.id}`),
174
268
  getRowId: (e) => e.id,
175
- pageIndex: D,
176
- pageSize: k,
177
- onPageChange: O,
269
+ pageIndex: I,
270
+ pageSize: R,
271
+ onPageChange: L,
178
272
  onPageSizeChange: (e) => {
179
- A(e), O(0);
273
+ z(e), L(0);
180
274
  },
181
- totalItems: I,
275
+ totalItems: Q ? void 0 : Z,
182
276
  emptyIllustration: "empty-people",
183
- emptyTitle: "No drivers yet",
184
- emptyDescription: "Add drivers to start assigning deliveries and routes."
277
+ emptyTitle: Q ? "No drivers match these filters" : "No drivers yet",
278
+ emptyDescription: Q ? "Clear the status or licence-class filter to see the rest of the roster." : "Add drivers to start assigning deliveries and routes."
185
279
  })
186
280
  ]
187
281
  });
188
282
  }
189
283
  //#endregion
190
- export { T as default };
284
+ export { P as default };