@burdenoff/microfe-movethewheels 2026.1011.1 → 2026.1011.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/MoveTheWheelsRoot.js +5 -0
- package/dist/MoveTheWheelsRoutes.js +54 -50
- package/dist/generated/shipment-status-authority-operations.d.ts +4473 -0
- package/dist/hooks/useEpod.js +85 -77
- package/dist/hooks/useShipmentStatusAuthority.js +127 -0
- package/dist/hooks/useTracking.js +15 -14
- package/dist/hooks/useTrackingEventQuality.js +43 -17
- package/dist/movethewheels/hooks/useEpod.d.ts +23 -0
- package/dist/movethewheels/hooks/useShipmentStatusAuthority.d.ts +23 -0
- package/dist/movethewheels/hooks/useTrackingEventQuality.d.ts +5 -0
- package/dist/movethewheels/pages/ShipmentStatusAuthorityPage.d.ts +1 -0
- package/dist/movethewheels/utils/shipmentStatusDraft.d.ts +45 -0
- package/dist/pages/DeliveryCapturePage.js +181 -116
- package/dist/pages/ShipmentStatusAuthorityPage.js +563 -0
- package/dist/pages/TrackingEventQualityPage.js +6 -1
- package/dist/src/generated/shipment-status-authority-operations.js +86 -0
- package/dist/utils/shipmentStatusDraft.js +41 -0
- package/package.json +5 -4
- package/src/generated/shipment-status-authority-operations.ts +5503 -0
- package/src/movethewheels/MoveTheWheelsRoot.tsx +6 -0
- package/src/movethewheels/MoveTheWheelsRoutes.tsx +2 -0
- package/src/movethewheels/hooks/useEpod.ts +47 -12
- package/src/movethewheels/hooks/useShipmentStatusAuthority.ts +179 -0
- package/src/movethewheels/hooks/useTracking.ts +27 -12
- package/src/movethewheels/hooks/useTrackingEventQuality.ts +42 -0
- package/src/movethewheels/pages/DeliveryCapturePage.tsx +113 -6
- package/src/movethewheels/pages/ShipmentStatusAuthorityPage.tsx +639 -0
- package/src/movethewheels/pages/TrackingEventQualityPage.tsx +13 -2
- package/src/movethewheels/utils/shipmentStatusDraft.ts +118 -0
- package/src/operations/shipment-status-authority/status.graphql +80 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export interface ShipmentSourceDraft {
|
|
2
|
+
integrationId: string;
|
|
3
|
+
basisTrackingEventId: string;
|
|
4
|
+
maxSourceAgeSeconds: string;
|
|
5
|
+
maxFutureSkewSeconds: string;
|
|
6
|
+
reason: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function statusDecisionReason(value: string): string;
|
|
9
|
+
export declare function shipmentSourceInput(draft: ShipmentSourceDraft, expectedStatusRevision: number): {
|
|
10
|
+
expectedStatusRevision: number;
|
|
11
|
+
integrationId: string;
|
|
12
|
+
basisTrackingEventId: string;
|
|
13
|
+
maxSourceAgeSeconds: number;
|
|
14
|
+
maxFutureSkewSeconds: number;
|
|
15
|
+
reason: string;
|
|
16
|
+
};
|
|
17
|
+
interface StatusAcknowledgement {
|
|
18
|
+
id: string;
|
|
19
|
+
status: string;
|
|
20
|
+
statusRevision: number;
|
|
21
|
+
statusAuthority: string;
|
|
22
|
+
statusAuthorityEpoch: number;
|
|
23
|
+
designatedIntegrationId?: string | null;
|
|
24
|
+
statusBasisEventId?: string | null;
|
|
25
|
+
statusBasisSourceTime?: string | null;
|
|
26
|
+
maxSourceAgeSeconds?: number | null;
|
|
27
|
+
maxFutureSkewSeconds?: number | null;
|
|
28
|
+
}
|
|
29
|
+
export declare function sourceStatusAcknowledged(actual: StatusAcknowledgement | null | undefined, expected: {
|
|
30
|
+
id: string;
|
|
31
|
+
epoch: number;
|
|
32
|
+
input: ReturnType<typeof shipmentSourceInput>;
|
|
33
|
+
basis: {
|
|
34
|
+
id: string;
|
|
35
|
+
eventType: string;
|
|
36
|
+
providerEventTime?: string | null;
|
|
37
|
+
} | undefined;
|
|
38
|
+
}): boolean;
|
|
39
|
+
export declare function manualStatusAcknowledged(actual: StatusAcknowledgement | null | undefined, expected: {
|
|
40
|
+
id: string;
|
|
41
|
+
revision: number;
|
|
42
|
+
epoch: number;
|
|
43
|
+
status: string;
|
|
44
|
+
}): boolean;
|
|
45
|
+
export {};
|
|
@@ -8,19 +8,22 @@ import { PenLine as o } from "../node_modules/lucide-react/dist/esm/icons/pen-li
|
|
|
8
8
|
import { Truck as s } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
|
|
9
9
|
import { Type as c } from "../node_modules/lucide-react/dist/esm/icons/type.js";
|
|
10
10
|
import { Upload as l } from "../node_modules/lucide-react/dist/esm/icons/upload.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
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";
|
|
24
|
+
import { Fragment as te, jsx as L, jsxs as R } from "react/jsx-runtime";
|
|
22
25
|
//#region src/movethewheels/pages/DeliveryCapturePage.tsx
|
|
23
|
-
function
|
|
26
|
+
function ne() {
|
|
24
27
|
return new Promise((e) => {
|
|
25
28
|
if (!navigator.geolocation) {
|
|
26
29
|
e(null);
|
|
@@ -33,242 +36,304 @@ function L() {
|
|
|
33
36
|
});
|
|
34
37
|
});
|
|
35
38
|
}
|
|
36
|
-
function
|
|
37
|
-
let { captureEpod: u, isSubmitting: d, error:
|
|
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, () => {
|
|
42
|
+
B.current = !1;
|
|
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 () => {
|
|
45
|
+
if (z.current) return;
|
|
46
|
+
if (Q(null), D.loading || D.error || !D.data || T < H || !k || g?.kind === "UNKNOWN") {
|
|
47
|
+
Q("Review the current linked shipment status and confirm completion before capture. Do not resend an uncertain capture.");
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
let n = G.trim();
|
|
40
51
|
if (!n) {
|
|
41
|
-
|
|
52
|
+
Q("Recipient name is required.");
|
|
42
53
|
return;
|
|
43
54
|
}
|
|
44
|
-
let r =
|
|
55
|
+
let r = K === "typed" ? J.trim() : W.current?.toDataUrl() ?? null;
|
|
45
56
|
if (!r) {
|
|
46
|
-
|
|
57
|
+
Q(K === "typed" ? "Type the recipient full name as their signature." : "A signature is required.");
|
|
47
58
|
return;
|
|
48
59
|
}
|
|
60
|
+
z.current = !0, V(!0);
|
|
49
61
|
try {
|
|
50
62
|
let i;
|
|
51
|
-
|
|
52
|
-
|
|
63
|
+
if (Y) if (M.current?.file === Y) i = [M.current.id];
|
|
64
|
+
else {
|
|
65
|
+
let e = await ae(Y);
|
|
66
|
+
M.current = {
|
|
67
|
+
file: Y,
|
|
68
|
+
id: e.fileId
|
|
69
|
+
}, i = [e.fileId];
|
|
70
|
+
}
|
|
71
|
+
if (!B.current) return;
|
|
72
|
+
let a = await ne();
|
|
73
|
+
if (!B.current) return;
|
|
53
74
|
await u({
|
|
75
|
+
expectedShipmentId: D.data.myEpodShipmentStatus?.id ?? null,
|
|
76
|
+
expectedShipmentStatusRevision: D.data.myEpodShipmentStatus?.statusRevision,
|
|
77
|
+
completionAttestation: k,
|
|
54
78
|
deliveryJobId: e.id,
|
|
55
79
|
recipientName: n,
|
|
56
|
-
signatureType:
|
|
80
|
+
signatureType: K,
|
|
57
81
|
signatureData: r,
|
|
58
82
|
photoFileIds: i,
|
|
59
83
|
latitude: a?.coords.latitude,
|
|
60
84
|
longitude: a?.coords.longitude,
|
|
61
85
|
locationAccuracy: a?.coords.accuracy,
|
|
62
|
-
notes:
|
|
86
|
+
notes: X.trim() || void 0
|
|
63
87
|
}), t();
|
|
64
|
-
} catch {
|
|
65
|
-
|
|
66
|
-
|
|
88
|
+
} catch {
|
|
89
|
+
A(!1), ie(T + 1);
|
|
90
|
+
} finally {
|
|
91
|
+
z.current = !1, V(!1);
|
|
92
|
+
}
|
|
93
|
+
}, $ = d || oe || re;
|
|
94
|
+
return /* @__PURE__ */ R(v, { children: [/* @__PURE__ */ L(b, { children: /* @__PURE__ */ R(x, {
|
|
67
95
|
className: "flex items-center gap-2",
|
|
68
96
|
children: [
|
|
69
|
-
/* @__PURE__ */
|
|
97
|
+
/* @__PURE__ */ L(s, { size: 18 }),
|
|
70
98
|
" Capture delivery for ",
|
|
71
99
|
e.deliveryJobNumber
|
|
72
100
|
]
|
|
73
|
-
}) }), /* @__PURE__ */
|
|
101
|
+
}) }), /* @__PURE__ */ R(y, {
|
|
74
102
|
className: "space-y-4",
|
|
75
103
|
children: [
|
|
76
|
-
/* @__PURE__ */
|
|
104
|
+
/* @__PURE__ */ R("div", {
|
|
77
105
|
className: "text-sm text-text-secondary space-y-1",
|
|
78
|
-
children: [e.customerName && /* @__PURE__ */
|
|
106
|
+
children: [e.customerName && /* @__PURE__ */ R("p", { children: ["Recipient on file: ", e.customerName] }), e.deliveryAddress && /* @__PURE__ */ L("p", { children: j(e.deliveryAddress) })]
|
|
107
|
+
}),
|
|
108
|
+
/* @__PURE__ */ R("section", {
|
|
109
|
+
"aria-label": "Linked shipment status",
|
|
110
|
+
className: "space-y-2",
|
|
111
|
+
children: [
|
|
112
|
+
/* @__PURE__ */ R("p", { children: [
|
|
113
|
+
"Recorded shipment:",
|
|
114
|
+
" ",
|
|
115
|
+
D.data?.myEpodShipmentStatus ? `${D.data.myEpodShipmentStatus.status.toLowerCase().replaceAll("_", " ")} · revision ${D.data.myEpodShipmentStatus.statusRevision}` : D.data ? "No linked shipment" : "Loading current record"
|
|
116
|
+
] }),
|
|
117
|
+
D.error && /* @__PURE__ */ L("p", {
|
|
118
|
+
role: "alert",
|
|
119
|
+
children: D.error
|
|
120
|
+
}),
|
|
121
|
+
/* @__PURE__ */ L(_, {
|
|
122
|
+
variant: "outline",
|
|
123
|
+
disabled: D.loading || $,
|
|
124
|
+
onClick: () => {
|
|
125
|
+
A(!1), E((e) => e + 1);
|
|
126
|
+
},
|
|
127
|
+
children: "Refresh linked status"
|
|
128
|
+
}),
|
|
129
|
+
/* @__PURE__ */ R("label", {
|
|
130
|
+
className: "flex items-start gap-2",
|
|
131
|
+
children: [/* @__PURE__ */ L("input", {
|
|
132
|
+
type: "checkbox",
|
|
133
|
+
checked: k,
|
|
134
|
+
disabled: D.loading || !!D.error || $ || T < H || g?.kind === "UNKNOWN",
|
|
135
|
+
onChange: (e) => A(e.target.checked)
|
|
136
|
+
}), "I reviewed the recorded linked status and attest to this delivery completion."]
|
|
137
|
+
}),
|
|
138
|
+
/* @__PURE__ */ L("p", { children: "This records an assigned driver's attestation; it does not independently verify physical freight movement." }),
|
|
139
|
+
g && /* @__PURE__ */ L("p", {
|
|
140
|
+
role: "status",
|
|
141
|
+
children: g.message
|
|
142
|
+
})
|
|
143
|
+
]
|
|
79
144
|
}),
|
|
80
|
-
/* @__PURE__ */
|
|
145
|
+
/* @__PURE__ */ R("div", {
|
|
81
146
|
className: "space-y-1.5",
|
|
82
|
-
children: [/* @__PURE__ */
|
|
147
|
+
children: [/* @__PURE__ */ L(C, {
|
|
83
148
|
htmlFor: "epod-recipient-name",
|
|
84
149
|
children: "Recipient name"
|
|
85
|
-
}), /* @__PURE__ */
|
|
150
|
+
}), /* @__PURE__ */ L(S, {
|
|
86
151
|
id: "epod-recipient-name",
|
|
87
|
-
value:
|
|
88
|
-
onChange: (e) =>
|
|
152
|
+
value: G,
|
|
153
|
+
onChange: (e) => se(e.target.value),
|
|
89
154
|
placeholder: "Who received the delivery?"
|
|
90
155
|
})]
|
|
91
156
|
}),
|
|
92
|
-
/* @__PURE__ */
|
|
157
|
+
/* @__PURE__ */ R("div", {
|
|
93
158
|
className: "space-y-1.5",
|
|
94
159
|
children: [
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
-
/* @__PURE__ */
|
|
160
|
+
/* @__PURE__ */ L(C, { children: "Signature" }),
|
|
161
|
+
/* @__PURE__ */ R("div", {
|
|
97
162
|
className: "flex gap-2",
|
|
98
|
-
children: [/* @__PURE__ */
|
|
163
|
+
children: [/* @__PURE__ */ R(_, {
|
|
99
164
|
type: "button",
|
|
100
|
-
variant:
|
|
165
|
+
variant: K === "drawn" ? "default" : "outline",
|
|
101
166
|
size: "sm",
|
|
102
|
-
onClick: () =>
|
|
103
|
-
children: [/* @__PURE__ */
|
|
104
|
-
}), /* @__PURE__ */
|
|
167
|
+
onClick: () => q("drawn"),
|
|
168
|
+
children: [/* @__PURE__ */ L(o, { size: 14 }), " Draw"]
|
|
169
|
+
}), /* @__PURE__ */ R(_, {
|
|
105
170
|
type: "button",
|
|
106
|
-
variant:
|
|
171
|
+
variant: K === "typed" ? "default" : "outline",
|
|
107
172
|
size: "sm",
|
|
108
|
-
onClick: () =>
|
|
109
|
-
children: [/* @__PURE__ */
|
|
173
|
+
onClick: () => q("typed"),
|
|
174
|
+
children: [/* @__PURE__ */ L(c, { size: 14 }), " Type name instead"]
|
|
110
175
|
})]
|
|
111
176
|
}),
|
|
112
|
-
|
|
113
|
-
value:
|
|
114
|
-
onChange: (e) =>
|
|
177
|
+
K === "drawn" ? /* @__PURE__ */ L(N, { ref: W }) : /* @__PURE__ */ L(S, {
|
|
178
|
+
value: J,
|
|
179
|
+
onChange: (e) => ce(e.target.value),
|
|
115
180
|
placeholder: "Type full name as signature"
|
|
116
181
|
})
|
|
117
182
|
]
|
|
118
183
|
}),
|
|
119
|
-
/* @__PURE__ */
|
|
184
|
+
/* @__PURE__ */ R("div", {
|
|
120
185
|
className: "space-y-1.5",
|
|
121
186
|
children: [
|
|
122
|
-
/* @__PURE__ */
|
|
187
|
+
/* @__PURE__ */ L(C, {
|
|
123
188
|
htmlFor: "epod-photo",
|
|
124
189
|
children: "Delivery photo (optional)"
|
|
125
190
|
}),
|
|
126
|
-
/* @__PURE__ */
|
|
191
|
+
/* @__PURE__ */ R("div", {
|
|
127
192
|
className: "flex items-center gap-2",
|
|
128
|
-
children: [/* @__PURE__ */
|
|
193
|
+
children: [/* @__PURE__ */ L("input", {
|
|
129
194
|
id: "epod-photo",
|
|
130
195
|
type: "file",
|
|
131
196
|
accept: "image/*",
|
|
132
197
|
capture: "environment",
|
|
133
|
-
onChange: (e) =>
|
|
198
|
+
onChange: (e) => le(e.target.files?.[0] ?? null),
|
|
134
199
|
className: "text-sm"
|
|
135
|
-
}),
|
|
200
|
+
}), Y && /* @__PURE__ */ L(l, {
|
|
136
201
|
size: 14,
|
|
137
202
|
className: "text-text-secondary"
|
|
138
203
|
})]
|
|
139
204
|
}),
|
|
140
|
-
|
|
205
|
+
Y && /* @__PURE__ */ L("p", {
|
|
141
206
|
className: "text-xs text-text-secondary",
|
|
142
|
-
children:
|
|
207
|
+
children: Y.name
|
|
143
208
|
})
|
|
144
209
|
]
|
|
145
210
|
}),
|
|
146
|
-
/* @__PURE__ */
|
|
211
|
+
/* @__PURE__ */ R("div", {
|
|
147
212
|
className: "space-y-1.5",
|
|
148
|
-
children: [/* @__PURE__ */
|
|
213
|
+
children: [/* @__PURE__ */ L(C, {
|
|
149
214
|
htmlFor: "epod-notes",
|
|
150
215
|
children: "Notes (optional)"
|
|
151
|
-
}), /* @__PURE__ */
|
|
216
|
+
}), /* @__PURE__ */ L(w, {
|
|
152
217
|
id: "epod-notes",
|
|
153
|
-
value:
|
|
154
|
-
onChange: (e) =>
|
|
218
|
+
value: X,
|
|
219
|
+
onChange: (e) => ue(e.target.value),
|
|
155
220
|
placeholder: "e.g. Left with front desk, gate code used, etc.",
|
|
156
221
|
rows: 2
|
|
157
222
|
})]
|
|
158
223
|
}),
|
|
159
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ R("p", {
|
|
160
225
|
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
161
|
-
children: [/* @__PURE__ */
|
|
226
|
+
children: [/* @__PURE__ */ L(i, { size: 12 }), " Device GPS is captured automatically when permitted by the browser."]
|
|
162
227
|
}),
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
/* @__PURE__ */
|
|
228
|
+
Z && /* @__PURE__ */ L(O, { message: Z }),
|
|
229
|
+
f && /* @__PURE__ */ L(O, { message: f.message }),
|
|
230
|
+
U && /* @__PURE__ */ L(O, { message: U.message }),
|
|
231
|
+
/* @__PURE__ */ R("div", {
|
|
167
232
|
className: "flex gap-2 justify-end",
|
|
168
|
-
children: [/* @__PURE__ */
|
|
233
|
+
children: [/* @__PURE__ */ L(_, {
|
|
169
234
|
type: "button",
|
|
170
235
|
variant: "outline",
|
|
171
236
|
onClick: a,
|
|
172
|
-
disabled:
|
|
237
|
+
disabled: $,
|
|
173
238
|
children: "Cancel"
|
|
174
|
-
}), /* @__PURE__ */
|
|
239
|
+
}), /* @__PURE__ */ L(_, {
|
|
175
240
|
type: "button",
|
|
176
|
-
onClick: () => void
|
|
177
|
-
disabled:
|
|
178
|
-
children:
|
|
241
|
+
onClick: () => void de(),
|
|
242
|
+
disabled: $ || D.loading || !!D.error || !D.data || T < H || !k || g?.kind === "UNKNOWN",
|
|
243
|
+
children: $ ? /* @__PURE__ */ R(te, { children: [/* @__PURE__ */ L(r, {
|
|
179
244
|
size: 14,
|
|
180
245
|
className: "animate-spin"
|
|
181
|
-
}), " Submitting…"] }) : /* @__PURE__ */
|
|
246
|
+
}), " Submitting…"] }) : /* @__PURE__ */ R(te, { children: [/* @__PURE__ */ L(n, { size: 14 }), " Confirm delivery"] })
|
|
182
247
|
})]
|
|
183
248
|
})
|
|
184
249
|
]
|
|
185
250
|
})] });
|
|
186
251
|
}
|
|
187
|
-
function
|
|
188
|
-
let
|
|
252
|
+
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({
|
|
189
254
|
limit: 20,
|
|
190
|
-
offset:
|
|
191
|
-
}), [
|
|
192
|
-
return /* @__PURE__ */
|
|
255
|
+
offset: l * 20
|
|
256
|
+
}), [C, w] = I(null), { message: N, notify: P } = A();
|
|
257
|
+
return /* @__PURE__ */ L(T, {
|
|
193
258
|
title: "My Deliveries",
|
|
194
259
|
subtitle: "Capture proof of delivery for your assigned stops",
|
|
195
|
-
icon: /* @__PURE__ */
|
|
196
|
-
children: /* @__PURE__ */
|
|
260
|
+
icon: /* @__PURE__ */ L(s, { size: 24 }),
|
|
261
|
+
children: /* @__PURE__ */ R("div", {
|
|
197
262
|
className: "space-y-4",
|
|
198
|
-
children: [/* @__PURE__ */
|
|
199
|
-
job:
|
|
263
|
+
children: [/* @__PURE__ */ L(k, { message: N }), C ? /* @__PURE__ */ L(z, {
|
|
264
|
+
job: C,
|
|
200
265
|
onCaptured: () => {
|
|
201
|
-
|
|
266
|
+
P("Proof of delivery captured — delivery marked complete."), w(null), p(0), S();
|
|
202
267
|
},
|
|
203
|
-
onCancel: () =>
|
|
204
|
-
}) :
|
|
268
|
+
onCancel: () => w(null)
|
|
269
|
+
}, `${r}:${i}:${o?.id}:${c}:${C.id}`) : b ? /* @__PURE__ */ L("p", {
|
|
205
270
|
className: "text-text-secondary text-center py-8",
|
|
206
271
|
children: "Loading your deliveries…"
|
|
207
|
-
}) :
|
|
272
|
+
}) : x ? /* @__PURE__ */ L(O, { message: x.message }) : m.length > 0 ? /* @__PURE__ */ R("div", {
|
|
208
273
|
className: "space-y-3",
|
|
209
|
-
children: [
|
|
274
|
+
children: [m.map((e) => /* @__PURE__ */ L(v, { children: /* @__PURE__ */ R(y, {
|
|
210
275
|
className: "flex items-center justify-between gap-3 py-4",
|
|
211
|
-
children: [/* @__PURE__ */
|
|
276
|
+
children: [/* @__PURE__ */ R("div", {
|
|
212
277
|
className: "min-w-0",
|
|
213
278
|
children: [
|
|
214
|
-
/* @__PURE__ */
|
|
279
|
+
/* @__PURE__ */ R("p", {
|
|
215
280
|
className: "font-medium flex items-center gap-2",
|
|
216
281
|
children: [
|
|
217
|
-
/* @__PURE__ */
|
|
282
|
+
/* @__PURE__ */ L(a, { size: 16 }),
|
|
218
283
|
" ",
|
|
219
284
|
e.deliveryJobNumber
|
|
220
285
|
]
|
|
221
286
|
}),
|
|
222
|
-
/* @__PURE__ */
|
|
287
|
+
/* @__PURE__ */ R("div", {
|
|
223
288
|
className: "flex flex-wrap items-center gap-1.5 py-1",
|
|
224
|
-
children: [/* @__PURE__ */
|
|
225
|
-
status:
|
|
289
|
+
children: [/* @__PURE__ */ L(D, {
|
|
290
|
+
status: f(e.status),
|
|
226
291
|
type: "order",
|
|
227
292
|
size: "sm"
|
|
228
|
-
}), /* @__PURE__ */
|
|
229
|
-
priority:
|
|
293
|
+
}), /* @__PURE__ */ L(E, {
|
|
294
|
+
priority: d(e.priority),
|
|
230
295
|
size: "sm"
|
|
231
296
|
})]
|
|
232
297
|
}),
|
|
233
|
-
e.deliveryAddress && /* @__PURE__ */
|
|
298
|
+
e.deliveryAddress && /* @__PURE__ */ L("p", {
|
|
234
299
|
className: "text-sm text-text-secondary truncate",
|
|
235
|
-
children:
|
|
300
|
+
children: j(e.deliveryAddress)
|
|
236
301
|
}),
|
|
237
|
-
e.scheduledDelivery && /* @__PURE__ */
|
|
302
|
+
e.scheduledDelivery && /* @__PURE__ */ R("p", {
|
|
238
303
|
className: "text-xs text-text-secondary",
|
|
239
|
-
children: ["Scheduled ",
|
|
304
|
+
children: ["Scheduled ", M(e.scheduledDelivery, "short")]
|
|
240
305
|
})
|
|
241
306
|
]
|
|
242
|
-
}), /* @__PURE__ */
|
|
307
|
+
}), /* @__PURE__ */ L(_, {
|
|
243
308
|
type: "button",
|
|
244
309
|
size: "sm",
|
|
245
|
-
onClick: () =>
|
|
310
|
+
onClick: () => w(e),
|
|
246
311
|
children: "Capture"
|
|
247
312
|
})]
|
|
248
|
-
}) }, e.id)), (
|
|
313
|
+
}) }, e.id)), (l > 0 || h) && /* @__PURE__ */ R("div", {
|
|
249
314
|
className: "flex justify-end gap-2 pt-2",
|
|
250
|
-
children: [/* @__PURE__ */
|
|
315
|
+
children: [/* @__PURE__ */ R(_, {
|
|
251
316
|
type: "button",
|
|
252
317
|
variant: "outline",
|
|
253
318
|
size: "sm",
|
|
254
|
-
disabled:
|
|
255
|
-
onClick: () =>
|
|
256
|
-
children: [/* @__PURE__ */
|
|
257
|
-
}), /* @__PURE__ */
|
|
319
|
+
disabled: l === 0 || b,
|
|
320
|
+
onClick: () => p((e) => Math.max(0, e - 1)),
|
|
321
|
+
children: [/* @__PURE__ */ L(e, { size: 16 }), " Previous"]
|
|
322
|
+
}), /* @__PURE__ */ R(_, {
|
|
258
323
|
type: "button",
|
|
259
324
|
variant: "outline",
|
|
260
325
|
size: "sm",
|
|
261
|
-
disabled: !
|
|
262
|
-
onClick: () =>
|
|
263
|
-
children: ["Next ", /* @__PURE__ */
|
|
326
|
+
disabled: !h || b,
|
|
327
|
+
onClick: () => p((e) => e + 1),
|
|
328
|
+
children: ["Next ", /* @__PURE__ */ L(t, { size: 16 })]
|
|
264
329
|
})]
|
|
265
330
|
})]
|
|
266
|
-
}) : /* @__PURE__ */
|
|
331
|
+
}) : /* @__PURE__ */ R("div", {
|
|
267
332
|
className: "text-center py-12",
|
|
268
|
-
children: [/* @__PURE__ */
|
|
333
|
+
children: [/* @__PURE__ */ L(n, {
|
|
269
334
|
size: 40,
|
|
270
335
|
className: "mx-auto mb-3 text-text-secondary opacity-50"
|
|
271
|
-
}), /* @__PURE__ */
|
|
336
|
+
}), /* @__PURE__ */ L("p", {
|
|
272
337
|
className: "text-text-secondary",
|
|
273
338
|
children: "No deliveries awaiting proof of delivery."
|
|
274
339
|
})]
|
|
@@ -277,4 +342,4 @@ function z() {
|
|
|
277
342
|
});
|
|
278
343
|
}
|
|
279
344
|
//#endregion
|
|
280
|
-
export {
|
|
345
|
+
export { B as default };
|