@burdenoff/microfe-movethewheels 2026.1012.1 → 2026.1013.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.
@@ -6,21 +6,21 @@ import { MapPin as i } from "../node_modules/lucide-react/dist/esm/icons/map-pin
6
6
  import { Package as a } from "../node_modules/lucide-react/dist/esm/icons/package.js";
7
7
  import { PenLine as o } from "../node_modules/lucide-react/dist/esm/icons/pen-line.js";
8
8
  import { Truck as s } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
9
- import { Type as c } from "../node_modules/lucide-react/dist/esm/icons/type.js";
10
- import { Upload as l } from "../node_modules/lucide-react/dist/esm/icons/upload.js";
11
- import { useMoveTheWheels as u } from "../providers/MoveTheWheelsProvider.js";
12
- import { mapOrderPriority as d, mapOrderStatus as f } from "../hooks/useOrders.js";
13
- import { useShipmentStatusQuery as p } from "../hooks/useShipmentStatusAuthority.js";
14
- import { useCaptureEpod as m, useEpodPhotoUpload as h, useMyPendingEpodDeliveryJobs as g } from "../hooks/useEpod.js";
15
- import { Button as _, Card as v, CardContent as y, CardHeader as b, CardTitle as x, Input as S, Label as C, Textarea as w } from "../components/ui.js";
16
- import { PageLayout as T } from "../components/PageLayout.js";
17
- import { PriorityBadge as E, StatusBadge as D } from "../components/StatusBadge.js";
18
- import { FormError as O } from "../components/FormError.js";
19
- import { Notice as k, useNotice as A } from "../components/Notice.js";
20
- import { formatAddress as j, formatDate as M } from "../utils/formatters.js";
21
- import { SignaturePad as N } from "../components/SignaturePad.js";
22
- import { StatusAuthorityOwnedDeliveryDocument as P } from "../src/generated/shipment-status-authority-operations.js";
23
- import { useEffect as ee, useRef as F, useState as I } from "react";
9
+ import { Type as ee } from "../node_modules/lucide-react/dist/esm/icons/type.js";
10
+ import { Upload as c } from "../node_modules/lucide-react/dist/esm/icons/upload.js";
11
+ import { useMoveTheWheels as l } from "../providers/MoveTheWheelsProvider.js";
12
+ import { mapOrderPriority as u, mapOrderStatus as d } from "../hooks/useOrders.js";
13
+ import { useShipmentStatusQuery as f } from "../hooks/useShipmentStatusAuthority.js";
14
+ import { useCaptureEpod as p, useEpodPhotoUpload as m, useMyPendingEpodDeliveryJobs as h } from "../hooks/useEpod.js";
15
+ import { Button as g, Card as _, CardContent as v, CardHeader as y, CardTitle as b, Input as x, Label as S, Textarea as C } from "../components/ui.js";
16
+ import { PageLayout as w } from "../components/PageLayout.js";
17
+ import { PriorityBadge as T, StatusBadge as E } from "../components/StatusBadge.js";
18
+ import { FormError as D } from "../components/FormError.js";
19
+ import { Notice as O, useNotice as k } from "../components/Notice.js";
20
+ import { formatAddress as A, formatDate as j } from "../utils/formatters.js";
21
+ import { SignaturePad as M } from "../components/SignaturePad.js";
22
+ import { StatusAuthorityOwnedDeliveryDocument as N } from "../src/generated/shipment-status-authority-operations.js";
23
+ import { useEffect as P, useRef as F, useState as I } from "react";
24
24
  import { Fragment as te, jsx as L, jsxs as R } from "react/jsx-runtime";
25
25
  //#region src/movethewheels/pages/DeliveryCapturePage.tsx
26
26
  function ne() {
@@ -37,13 +37,13 @@ function ne() {
37
37
  });
38
38
  }
39
39
  function z({ job: e, onCaptured: t, onCancel: a }) {
40
- let { captureEpod: u, isSubmitting: d, error: f, captureFeedback: g } = m(), [T, E] = I(0), D = p(P, { deliveryJobId: e.id }, T), [k, A] = I(!1), M = F(null), z = F(!1), B = F(!0);
41
- ee(() => (B.current = !0, () => {
40
+ let { captureEpod: l, isSubmitting: u, error: d, captureFeedback: h } = p(), [w, T] = I(0), E = f(N, { deliveryJobId: e.id }, w), [O, k] = I(!1), j = F(null), z = F(!1), B = F(!0);
41
+ P(() => (B.current = !0, () => {
42
42
  B.current = !1;
43
43
  }), []);
44
- let [re, V] = I(!1), [H, ie] = I(0), { upload: ae, isUploading: oe, error: U } = h(), W = F(null), [G, se] = I(""), [K, q] = I("drawn"), [J, ce] = I(""), [Y, le] = I(null), [X, ue] = I(""), [Z, Q] = I(null), de = async () => {
44
+ let [re, V] = I(!1), [H, ie] = I(0), { upload: ae, isUploading: oe, error: U } = m(), W = F(null), [G, se] = I(""), [K, q] = I("drawn"), [J, ce] = I(""), [Y, le] = I(null), [X, ue] = I(""), [Z, Q] = I(null), de = async () => {
45
45
  if (z.current) return;
46
- if (Q(null), D.loading || D.error || !D.data || T < H || !k || g?.kind === "UNKNOWN") {
46
+ if (Q(null), E.loading || E.error || !E.data || w < H || !O || h?.kind === "UNKNOWN") {
47
47
  Q("Review the current linked shipment status and confirm completion before capture. Do not resend an uncertain capture.");
48
48
  return;
49
49
  }
@@ -60,10 +60,10 @@ function z({ job: e, onCaptured: t, onCancel: a }) {
60
60
  z.current = !0, V(!0);
61
61
  try {
62
62
  let i;
63
- if (Y) if (M.current?.file === Y) i = [M.current.id];
63
+ if (Y) if (j.current?.file === Y) i = [j.current.id];
64
64
  else {
65
65
  let e = await ae(Y);
66
- M.current = {
66
+ j.current = {
67
67
  file: Y,
68
68
  id: e.fileId
69
69
  }, i = [e.fileId];
@@ -71,10 +71,10 @@ function z({ job: e, onCaptured: t, onCancel: a }) {
71
71
  if (!B.current) return;
72
72
  let a = await ne();
73
73
  if (!B.current) return;
74
- await u({
75
- expectedShipmentId: D.data.myEpodShipmentStatus?.id ?? null,
76
- expectedShipmentStatusRevision: D.data.myEpodShipmentStatus?.statusRevision,
77
- completionAttestation: k,
74
+ let o = await l({
75
+ expectedShipmentId: E.data.myEpodShipmentStatus?.id ?? null,
76
+ expectedShipmentStatusRevision: E.data.myEpodShipmentStatus?.statusRevision,
77
+ completionAttestation: O,
78
78
  deliveryJobId: e.id,
79
79
  recipientName: n,
80
80
  signatureType: K,
@@ -84,26 +84,28 @@ function z({ job: e, onCaptured: t, onCancel: a }) {
84
84
  longitude: a?.coords.longitude,
85
85
  locationAccuracy: a?.coords.accuracy,
86
86
  notes: X.trim() || void 0
87
- }), t();
87
+ });
88
+ if (!B.current) return;
89
+ t(o.deliveryJobId);
88
90
  } catch {
89
- A(!1), ie(T + 1);
91
+ k(!1), ie(w + 1);
90
92
  } finally {
91
93
  z.current = !1, V(!1);
92
94
  }
93
- }, $ = d || oe || re;
94
- return /* @__PURE__ */ R(v, { children: [/* @__PURE__ */ L(b, { children: /* @__PURE__ */ R(x, {
95
+ }, $ = u || oe || re;
96
+ return /* @__PURE__ */ R(_, { children: [/* @__PURE__ */ L(y, { children: /* @__PURE__ */ R(b, {
95
97
  className: "flex items-center gap-2",
96
98
  children: [
97
99
  /* @__PURE__ */ L(s, { size: 18 }),
98
100
  " Capture delivery for ",
99
101
  e.deliveryJobNumber
100
102
  ]
101
- }) }), /* @__PURE__ */ R(y, {
103
+ }) }), /* @__PURE__ */ R(v, {
102
104
  className: "space-y-4",
103
105
  children: [
104
106
  /* @__PURE__ */ R("div", {
105
107
  className: "text-sm text-text-secondary space-y-1",
106
- children: [e.customerName && /* @__PURE__ */ R("p", { children: ["Recipient on file: ", e.customerName] }), e.deliveryAddress && /* @__PURE__ */ L("p", { children: j(e.deliveryAddress) })]
108
+ children: [e.customerName && /* @__PURE__ */ R("p", { children: ["Recipient on file: ", e.customerName] }), e.deliveryAddress && /* @__PURE__ */ L("p", { children: A(e.deliveryAddress) })]
107
109
  }),
108
110
  /* @__PURE__ */ R("section", {
109
111
  "aria-label": "Linked shipment status",
@@ -112,17 +114,17 @@ function z({ job: e, onCaptured: t, onCancel: a }) {
112
114
  /* @__PURE__ */ R("p", { children: [
113
115
  "Recorded shipment:",
114
116
  " ",
115
- D.data?.myEpodShipmentStatus ? `${D.data.myEpodShipmentStatus.status.toLowerCase().replaceAll("_", " ")} · revision ${D.data.myEpodShipmentStatus.statusRevision}` : D.data ? "No linked shipment" : "Loading current record"
117
+ E.data?.myEpodShipmentStatus ? `${E.data.myEpodShipmentStatus.status.toLowerCase().replaceAll("_", " ")} · revision ${E.data.myEpodShipmentStatus.statusRevision}` : E.data ? "No linked shipment" : "Loading current record"
116
118
  ] }),
117
- D.error && /* @__PURE__ */ L("p", {
119
+ E.error && /* @__PURE__ */ L("p", {
118
120
  role: "alert",
119
- children: D.error
121
+ children: E.error
120
122
  }),
121
- /* @__PURE__ */ L(_, {
123
+ /* @__PURE__ */ L(g, {
122
124
  variant: "outline",
123
- disabled: D.loading || $,
125
+ disabled: E.loading || $,
124
126
  onClick: () => {
125
- A(!1), E((e) => e + 1);
127
+ k(!1), T((e) => e + 1);
126
128
  },
127
129
  children: "Refresh linked status"
128
130
  }),
@@ -130,24 +132,24 @@ function z({ job: e, onCaptured: t, onCancel: a }) {
130
132
  className: "flex items-start gap-2",
131
133
  children: [/* @__PURE__ */ L("input", {
132
134
  type: "checkbox",
133
- checked: k,
134
- disabled: D.loading || !!D.error || $ || T < H || g?.kind === "UNKNOWN",
135
- onChange: (e) => A(e.target.checked)
135
+ checked: O,
136
+ disabled: E.loading || !!E.error || $ || w < H || h?.kind === "UNKNOWN",
137
+ onChange: (e) => k(e.target.checked)
136
138
  }), "I reviewed the recorded linked status and attest to this delivery completion."]
137
139
  }),
138
140
  /* @__PURE__ */ L("p", { children: "This records an assigned driver's attestation; it does not independently verify physical freight movement." }),
139
- g && /* @__PURE__ */ L("p", {
141
+ h && /* @__PURE__ */ L("p", {
140
142
  role: "status",
141
- children: g.message
143
+ children: h.message
142
144
  })
143
145
  ]
144
146
  }),
145
147
  /* @__PURE__ */ R("div", {
146
148
  className: "space-y-1.5",
147
- children: [/* @__PURE__ */ L(C, {
149
+ children: [/* @__PURE__ */ L(S, {
148
150
  htmlFor: "epod-recipient-name",
149
151
  children: "Recipient name"
150
- }), /* @__PURE__ */ L(S, {
152
+ }), /* @__PURE__ */ L(x, {
151
153
  id: "epod-recipient-name",
152
154
  value: G,
153
155
  onChange: (e) => se(e.target.value),
@@ -157,24 +159,24 @@ function z({ job: e, onCaptured: t, onCancel: a }) {
157
159
  /* @__PURE__ */ R("div", {
158
160
  className: "space-y-1.5",
159
161
  children: [
160
- /* @__PURE__ */ L(C, { children: "Signature" }),
162
+ /* @__PURE__ */ L(S, { children: "Signature" }),
161
163
  /* @__PURE__ */ R("div", {
162
164
  className: "flex gap-2",
163
- children: [/* @__PURE__ */ R(_, {
165
+ children: [/* @__PURE__ */ R(g, {
164
166
  type: "button",
165
167
  variant: K === "drawn" ? "default" : "outline",
166
168
  size: "sm",
167
169
  onClick: () => q("drawn"),
168
170
  children: [/* @__PURE__ */ L(o, { size: 14 }), " Draw"]
169
- }), /* @__PURE__ */ R(_, {
171
+ }), /* @__PURE__ */ R(g, {
170
172
  type: "button",
171
173
  variant: K === "typed" ? "default" : "outline",
172
174
  size: "sm",
173
175
  onClick: () => q("typed"),
174
- children: [/* @__PURE__ */ L(c, { size: 14 }), " Type name instead"]
176
+ children: [/* @__PURE__ */ L(ee, { size: 14 }), " Type name instead"]
175
177
  })]
176
178
  }),
177
- K === "drawn" ? /* @__PURE__ */ L(N, { ref: W }) : /* @__PURE__ */ L(S, {
179
+ K === "drawn" ? /* @__PURE__ */ L(M, { ref: W }) : /* @__PURE__ */ L(x, {
178
180
  value: J,
179
181
  onChange: (e) => ce(e.target.value),
180
182
  placeholder: "Type full name as signature"
@@ -184,7 +186,7 @@ function z({ job: e, onCaptured: t, onCancel: a }) {
184
186
  /* @__PURE__ */ R("div", {
185
187
  className: "space-y-1.5",
186
188
  children: [
187
- /* @__PURE__ */ L(C, {
189
+ /* @__PURE__ */ L(S, {
188
190
  htmlFor: "epod-photo",
189
191
  children: "Delivery photo (optional)"
190
192
  }),
@@ -197,7 +199,7 @@ function z({ job: e, onCaptured: t, onCancel: a }) {
197
199
  capture: "environment",
198
200
  onChange: (e) => le(e.target.files?.[0] ?? null),
199
201
  className: "text-sm"
200
- }), Y && /* @__PURE__ */ L(l, {
202
+ }), Y && /* @__PURE__ */ L(c, {
201
203
  size: 14,
202
204
  className: "text-text-secondary"
203
205
  })]
@@ -210,10 +212,10 @@ function z({ job: e, onCaptured: t, onCancel: a }) {
210
212
  }),
211
213
  /* @__PURE__ */ R("div", {
212
214
  className: "space-y-1.5",
213
- children: [/* @__PURE__ */ L(C, {
215
+ children: [/* @__PURE__ */ L(S, {
214
216
  htmlFor: "epod-notes",
215
217
  children: "Notes (optional)"
216
- }), /* @__PURE__ */ L(w, {
218
+ }), /* @__PURE__ */ L(C, {
217
219
  id: "epod-notes",
218
220
  value: X,
219
221
  onChange: (e) => ue(e.target.value),
@@ -225,21 +227,21 @@ function z({ job: e, onCaptured: t, onCancel: a }) {
225
227
  className: "flex items-center gap-1.5 text-xs text-text-secondary",
226
228
  children: [/* @__PURE__ */ L(i, { size: 12 }), " Device GPS is captured automatically when permitted by the browser."]
227
229
  }),
228
- Z && /* @__PURE__ */ L(O, { message: Z }),
229
- f && /* @__PURE__ */ L(O, { message: f.message }),
230
- U && /* @__PURE__ */ L(O, { message: U.message }),
230
+ Z && /* @__PURE__ */ L(D, { message: Z }),
231
+ d && /* @__PURE__ */ L(D, { message: d.message }),
232
+ U && /* @__PURE__ */ L(D, { message: U.message }),
231
233
  /* @__PURE__ */ R("div", {
232
234
  className: "flex gap-2 justify-end",
233
- children: [/* @__PURE__ */ L(_, {
235
+ children: [/* @__PURE__ */ L(g, {
234
236
  type: "button",
235
237
  variant: "outline",
236
238
  onClick: a,
237
239
  disabled: $,
238
240
  children: "Cancel"
239
- }), /* @__PURE__ */ L(_, {
241
+ }), /* @__PURE__ */ L(g, {
240
242
  type: "button",
241
243
  onClick: () => void de(),
242
- disabled: $ || D.loading || !!D.error || !D.data || T < H || !k || g?.kind === "UNKNOWN",
244
+ disabled: $ || E.loading || !!E.error || !E.data || w < H || !O || h?.kind === "UNKNOWN",
243
245
  children: $ ? /* @__PURE__ */ R(te, { children: [/* @__PURE__ */ L(r, {
244
246
  size: 14,
245
247
  className: "animate-spin"
@@ -250,28 +252,28 @@ function z({ job: e, onCaptured: t, onCancel: a }) {
250
252
  })] });
251
253
  }
252
254
  function B() {
253
- let { workspaceId: r, tenantId: i, currentUser: o, apiGatewayUrl: c } = u(), [l, p] = I(0), { jobs: m, hasMore: h, isLoading: b, error: x, refetch: S } = g({
255
+ let { workspaceId: r, tenantId: i, currentUser: o, apiGatewayUrl: ee } = l(), [c, f] = I(0), { jobs: p, hasMore: m, isLoading: y, error: b, refetch: x, retireAcknowledgedJob: S } = h({
254
256
  limit: 20,
255
- offset: l * 20
256
- }), [C, w] = I(null), { message: N, notify: P } = A();
257
- return /* @__PURE__ */ L(T, {
257
+ offset: c * 20
258
+ }), [C, M] = I(null), { message: N, notify: P } = k();
259
+ return /* @__PURE__ */ L(w, {
258
260
  title: "My Deliveries",
259
261
  subtitle: "Capture proof of delivery for your assigned stops",
260
262
  icon: /* @__PURE__ */ L(s, { size: 24 }),
261
263
  children: /* @__PURE__ */ R("div", {
262
264
  className: "space-y-4",
263
- children: [/* @__PURE__ */ L(k, { message: N }), C ? /* @__PURE__ */ L(z, {
265
+ children: [/* @__PURE__ */ L(O, { message: N }), C ? /* @__PURE__ */ L(z, {
264
266
  job: C,
265
- onCaptured: () => {
266
- P("Proof of delivery captured — delivery marked complete."), w(null), p(0), S();
267
+ onCaptured: (e) => {
268
+ S(e), P("Proof of delivery captured — delivery marked complete."), M(null), f(0), x();
267
269
  },
268
- onCancel: () => w(null)
269
- }, `${r}:${i}:${o?.id}:${c}:${C.id}`) : b ? /* @__PURE__ */ L("p", {
270
+ onCancel: () => M(null)
271
+ }, `${r}:${i}:${o?.id}:${ee}:${C.id}`) : y ? /* @__PURE__ */ L("p", {
270
272
  className: "text-text-secondary text-center py-8",
271
273
  children: "Loading your deliveries…"
272
- }) : x ? /* @__PURE__ */ L(O, { message: x.message }) : m.length > 0 ? /* @__PURE__ */ R("div", {
274
+ }) : b ? /* @__PURE__ */ L(D, { message: b.message }) : p.length > 0 ? /* @__PURE__ */ R("div", {
273
275
  className: "space-y-3",
274
- children: [m.map((e) => /* @__PURE__ */ L(v, { children: /* @__PURE__ */ R(y, {
276
+ children: [p.map((e) => /* @__PURE__ */ L(_, { children: /* @__PURE__ */ R(v, {
275
277
  className: "flex items-center justify-between gap-3 py-4",
276
278
  children: [/* @__PURE__ */ R("div", {
277
279
  className: "min-w-0",
@@ -286,45 +288,45 @@ function B() {
286
288
  }),
287
289
  /* @__PURE__ */ R("div", {
288
290
  className: "flex flex-wrap items-center gap-1.5 py-1",
289
- children: [/* @__PURE__ */ L(D, {
290
- status: f(e.status),
291
+ children: [/* @__PURE__ */ L(E, {
292
+ status: d(e.status),
291
293
  type: "order",
292
294
  size: "sm"
293
- }), /* @__PURE__ */ L(E, {
294
- priority: d(e.priority),
295
+ }), /* @__PURE__ */ L(T, {
296
+ priority: u(e.priority),
295
297
  size: "sm"
296
298
  })]
297
299
  }),
298
300
  e.deliveryAddress && /* @__PURE__ */ L("p", {
299
301
  className: "text-sm text-text-secondary truncate",
300
- children: j(e.deliveryAddress)
302
+ children: A(e.deliveryAddress)
301
303
  }),
302
304
  e.scheduledDelivery && /* @__PURE__ */ R("p", {
303
305
  className: "text-xs text-text-secondary",
304
- children: ["Scheduled ", M(e.scheduledDelivery, "short")]
306
+ children: ["Scheduled ", j(e.scheduledDelivery, "short")]
305
307
  })
306
308
  ]
307
- }), /* @__PURE__ */ L(_, {
309
+ }), /* @__PURE__ */ L(g, {
308
310
  type: "button",
309
311
  size: "sm",
310
- onClick: () => w(e),
312
+ onClick: () => M(e),
311
313
  children: "Capture"
312
314
  })]
313
- }) }, e.id)), (l > 0 || h) && /* @__PURE__ */ R("div", {
315
+ }) }, e.id)), (c > 0 || m) && /* @__PURE__ */ R("div", {
314
316
  className: "flex justify-end gap-2 pt-2",
315
- children: [/* @__PURE__ */ R(_, {
317
+ children: [/* @__PURE__ */ R(g, {
316
318
  type: "button",
317
319
  variant: "outline",
318
320
  size: "sm",
319
- disabled: l === 0 || b,
320
- onClick: () => p((e) => Math.max(0, e - 1)),
321
+ disabled: c === 0 || y,
322
+ onClick: () => f((e) => Math.max(0, e - 1)),
321
323
  children: [/* @__PURE__ */ L(e, { size: 16 }), " Previous"]
322
- }), /* @__PURE__ */ R(_, {
324
+ }), /* @__PURE__ */ R(g, {
323
325
  type: "button",
324
326
  variant: "outline",
325
327
  size: "sm",
326
- disabled: !h || b,
327
- onClick: () => p((e) => e + 1),
328
+ disabled: !m || y,
329
+ onClick: () => f((e) => e + 1),
328
330
  children: ["Next ", /* @__PURE__ */ L(t, { size: 16 })]
329
331
  })]
330
332
  })]