@burdenoff/microfe-movethewheels 2026.822.1 → 2026.828.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generated/wspace-operations.d.ts +168 -912
- package/dist/generated/wspace-types.d.ts +78432 -35831
- package/dist/hooks/useFleet.js +142 -74
- package/dist/hooks/useImportExport.js +22 -51
- package/dist/hooks/useInventory.js +163 -70
- package/dist/hooks/useOrders.js +2 -2
- package/dist/hooks/useReports.js +63 -73
- package/dist/hooks/useSettings.js +52 -44
- package/dist/hooks/useTracking.js +5 -5
- package/dist/index.js +33 -33
- package/dist/movethewheels/hooks/index.d.ts +2 -2
- package/dist/movethewheels/hooks/useFleet.d.ts +32 -1
- package/dist/movethewheels/hooks/useImportExport.d.ts +10 -0
- package/dist/movethewheels/hooks/useInventory.d.ts +67 -12
- package/dist/movethewheels/hooks/useOrders.d.ts +25 -2
- package/dist/movethewheels/pages/MarketplacePage.d.ts +7 -4
- package/dist/movethewheels/types/index.d.ts +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/arrow-down-right.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/arrow-left-right.js +22 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/arrow-up-right.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/calendar-clock.js +32 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/history.js +18 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/lock.js +16 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/user-round.js +13 -0
- package/dist/pages/CreateOrderPage.js +246 -195
- package/dist/pages/DeliveryCapturePage.js +91 -78
- package/dist/pages/DriversPage.js +202 -108
- package/dist/pages/InventoryPage.js +356 -131
- package/dist/pages/MarketplacePage.js +11 -432
- package/dist/pages/ProductDetailsPage.js +212 -156
- package/dist/pages/ReportsPage.js +120 -109
- package/dist/pages/VehicleDetailsPage.js +257 -193
- package/dist/utils/formatters.js +4 -1
- package/package.json +2 -2
- package/src/generated/wspace-operations.ts +134 -929
- package/src/generated/wspace-types.ts +91730 -40059
- package/src/movethewheels/hooks/index.ts +9 -0
- package/src/movethewheels/hooks/useFleet.ts +133 -3
- package/src/movethewheels/hooks/useImportExport.ts +36 -72
- package/src/movethewheels/hooks/useInventory.ts +311 -53
- package/src/movethewheels/hooks/useOrders.ts +31 -7
- package/src/movethewheels/hooks/useReports.ts +73 -87
- package/src/movethewheels/hooks/useSettings.ts +50 -53
- package/src/movethewheels/hooks/useTracking.ts +14 -14
- package/src/movethewheels/pages/CreateOrderPage.tsx +67 -10
- package/src/movethewheels/pages/DeliveryCapturePage.tsx +8 -0
- package/src/movethewheels/pages/DriversPage.tsx +181 -31
- package/src/movethewheels/pages/InventoryPage.tsx +299 -19
- package/src/movethewheels/pages/MarketplacePage.tsx +16 -539
- package/src/movethewheels/pages/ProductDetailsPage.tsx +68 -3
- package/src/movethewheels/pages/ReportsPage.tsx +23 -0
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +86 -27
- package/src/movethewheels/types/index.ts +2 -0
- package/src/operations/wspace/movethewheels/fragments/core.graphql +23 -53
- package/src/operations/wspace/movethewheels/fragments/core.withdrawn.graphql +59 -0
- package/src/operations/wspace/movethewheels/mutations/entities.graphql +5 -5
- package/src/operations/wspace/movethewheels/mutations/marketplace-reports.graphql +18 -78
- package/src/operations/wspace/movethewheels/mutations/marketplace-reports.withdrawn.graphql +93 -0
- package/src/operations/wspace/movethewheels/mutations/orders.graphql +7 -7
- package/src/operations/wspace/movethewheels/queries/dashboard.graphql +3 -3
- package/src/operations/wspace/movethewheels/queries/entities.graphql +3 -3
- package/src/operations/wspace/movethewheels/queries/logistics.graphql +3 -3
- package/src/operations/wspace/movethewheels/queries/marketplace-reports.withdrawn.graphql +58 -0
- package/src/operations/wspace/movethewheels/queries/orders.graphql +3 -3
- package/dist/generated/global-operations.d.ts +0 -1
- package/dist/generated/global-types.d.ts +0 -23526
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.js +0 -8
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js +0 -8
- package/src/generated/global-operations.ts +0 -2
- package/src/generated/global-types.ts +0 -27259
- package/src/operations/wspace/movethewheels/queries/marketplace-reports.graphql +0 -40
|
@@ -6,17 +6,19 @@ import { PenLine as i } from "../node_modules/lucide-react/dist/esm/icons/pen-li
|
|
|
6
6
|
import { Truck as a } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
|
|
7
7
|
import { Type as o } from "../node_modules/lucide-react/dist/esm/icons/type.js";
|
|
8
8
|
import { Upload as s } from "../node_modules/lucide-react/dist/esm/icons/upload.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
9
|
+
import { mapOrderPriority as c, mapOrderStatus as l } from "../hooks/useOrders.js";
|
|
10
|
+
import { useCaptureEpod as u, useEpodPhotoUpload as d, useMyPendingEpodDeliveryJobs as f } from "../hooks/useEpod.js";
|
|
11
|
+
import { Button as p, Card as m, CardContent as h, CardHeader as g, CardTitle as _, Input as v, Label as y, Textarea as b } from "../components/ui.js";
|
|
12
|
+
import { PageLayout as x } from "../components/PageLayout.js";
|
|
13
|
+
import { PriorityBadge as S, StatusBadge as C } from "../components/StatusBadge.js";
|
|
14
|
+
import { FormError as w } from "../components/FormError.js";
|
|
15
|
+
import { Notice as T, useNotice as E } from "../components/Notice.js";
|
|
16
|
+
import { formatAddress as D, formatDate as O } from "../utils/formatters.js";
|
|
17
|
+
import { SignaturePad as k } from "../components/SignaturePad.js";
|
|
18
|
+
import { useRef as A, useState as j } from "react";
|
|
19
|
+
import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
|
|
18
20
|
//#region src/movethewheels/pages/DeliveryCapturePage.tsx
|
|
19
|
-
function
|
|
21
|
+
function F() {
|
|
20
22
|
return new Promise((e) => {
|
|
21
23
|
if (!navigator.geolocation) {
|
|
22
24
|
e(null);
|
|
@@ -29,24 +31,24 @@ function j() {
|
|
|
29
31
|
});
|
|
30
32
|
});
|
|
31
33
|
}
|
|
32
|
-
function
|
|
33
|
-
let { captureEpod:
|
|
34
|
+
function I({ job: r, onCaptured: c, onCancel: l }) {
|
|
35
|
+
let { captureEpod: f, isSubmitting: x, error: S } = u(), { upload: C, isUploading: T, error: E } = d(), O = A(null), [I, L] = j(""), [R, z] = j("drawn"), [B, V] = j(""), [H, U] = j(null), [W, G] = j(""), [K, q] = j(null), J = async () => {
|
|
34
36
|
q(null);
|
|
35
37
|
let e = I.trim();
|
|
36
38
|
if (!e) {
|
|
37
39
|
q("Recipient name is required.");
|
|
38
40
|
return;
|
|
39
41
|
}
|
|
40
|
-
let t = R === "typed" ? B.trim() :
|
|
42
|
+
let t = R === "typed" ? B.trim() : O.current?.toDataUrl() ?? null;
|
|
41
43
|
if (!t) {
|
|
42
44
|
q(R === "typed" ? "Type the recipient full name as their signature." : "A signature is required.");
|
|
43
45
|
return;
|
|
44
46
|
}
|
|
45
47
|
try {
|
|
46
48
|
let n;
|
|
47
|
-
H && (n = [(await
|
|
48
|
-
let i = await
|
|
49
|
-
await
|
|
49
|
+
H && (n = [(await C(H)).fileId]);
|
|
50
|
+
let i = await F();
|
|
51
|
+
await f({
|
|
50
52
|
deliveryJobId: r.id,
|
|
51
53
|
recipientName: e,
|
|
52
54
|
signatureType: R,
|
|
@@ -56,95 +58,95 @@ function M({ job: r, onCaptured: u, onCancel: y }) {
|
|
|
56
58
|
longitude: i?.coords.longitude,
|
|
57
59
|
locationAccuracy: i?.coords.accuracy,
|
|
58
60
|
notes: W.trim() || void 0
|
|
59
|
-
}),
|
|
61
|
+
}), c();
|
|
60
62
|
} catch {}
|
|
61
|
-
}, Y =
|
|
62
|
-
return /* @__PURE__ */
|
|
63
|
+
}, Y = x || T;
|
|
64
|
+
return /* @__PURE__ */ P(m, { children: [/* @__PURE__ */ N(g, { children: /* @__PURE__ */ P(_, {
|
|
63
65
|
className: "flex items-center gap-2",
|
|
64
66
|
children: [
|
|
65
|
-
/* @__PURE__ */
|
|
67
|
+
/* @__PURE__ */ N(a, { size: 18 }),
|
|
66
68
|
" Capture delivery for ",
|
|
67
69
|
r.deliveryJobNumber
|
|
68
70
|
]
|
|
69
|
-
}) }), /* @__PURE__ */
|
|
71
|
+
}) }), /* @__PURE__ */ P(h, {
|
|
70
72
|
className: "space-y-4",
|
|
71
73
|
children: [
|
|
72
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ P("div", {
|
|
73
75
|
className: "text-sm text-text-secondary space-y-1",
|
|
74
|
-
children: [r.customerName && /* @__PURE__ */
|
|
76
|
+
children: [r.customerName && /* @__PURE__ */ P("p", { children: ["Recipient on file: ", r.customerName] }), r.deliveryAddress && /* @__PURE__ */ N("p", { children: D(r.deliveryAddress) })]
|
|
75
77
|
}),
|
|
76
|
-
/* @__PURE__ */
|
|
78
|
+
/* @__PURE__ */ P("div", {
|
|
77
79
|
className: "space-y-1.5",
|
|
78
|
-
children: [/* @__PURE__ */
|
|
80
|
+
children: [/* @__PURE__ */ N(y, {
|
|
79
81
|
htmlFor: "epod-recipient-name",
|
|
80
82
|
children: "Recipient name"
|
|
81
|
-
}), /* @__PURE__ */
|
|
83
|
+
}), /* @__PURE__ */ N(v, {
|
|
82
84
|
id: "epod-recipient-name",
|
|
83
85
|
value: I,
|
|
84
86
|
onChange: (e) => L(e.target.value),
|
|
85
87
|
placeholder: "Who received the delivery?"
|
|
86
88
|
})]
|
|
87
89
|
}),
|
|
88
|
-
/* @__PURE__ */
|
|
90
|
+
/* @__PURE__ */ P("div", {
|
|
89
91
|
className: "space-y-1.5",
|
|
90
92
|
children: [
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
+
/* @__PURE__ */ N(y, { children: "Signature" }),
|
|
94
|
+
/* @__PURE__ */ P("div", {
|
|
93
95
|
className: "flex gap-2",
|
|
94
|
-
children: [/* @__PURE__ */
|
|
96
|
+
children: [/* @__PURE__ */ P(p, {
|
|
95
97
|
type: "button",
|
|
96
98
|
variant: R === "drawn" ? "default" : "outline",
|
|
97
99
|
size: "sm",
|
|
98
100
|
onClick: () => z("drawn"),
|
|
99
|
-
children: [/* @__PURE__ */
|
|
100
|
-
}), /* @__PURE__ */
|
|
101
|
+
children: [/* @__PURE__ */ N(i, { size: 14 }), " Draw"]
|
|
102
|
+
}), /* @__PURE__ */ P(p, {
|
|
101
103
|
type: "button",
|
|
102
104
|
variant: R === "typed" ? "default" : "outline",
|
|
103
105
|
size: "sm",
|
|
104
106
|
onClick: () => z("typed"),
|
|
105
|
-
children: [/* @__PURE__ */
|
|
107
|
+
children: [/* @__PURE__ */ N(o, { size: 14 }), " Type name instead"]
|
|
106
108
|
})]
|
|
107
109
|
}),
|
|
108
|
-
R === "drawn" ? /* @__PURE__ */ k
|
|
110
|
+
R === "drawn" ? /* @__PURE__ */ N(k, { ref: O }) : /* @__PURE__ */ N(v, {
|
|
109
111
|
value: B,
|
|
110
112
|
onChange: (e) => V(e.target.value),
|
|
111
113
|
placeholder: "Type full name as signature"
|
|
112
114
|
})
|
|
113
115
|
]
|
|
114
116
|
}),
|
|
115
|
-
/* @__PURE__ */
|
|
117
|
+
/* @__PURE__ */ P("div", {
|
|
116
118
|
className: "space-y-1.5",
|
|
117
119
|
children: [
|
|
118
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ N(y, {
|
|
119
121
|
htmlFor: "epod-photo",
|
|
120
122
|
children: "Delivery photo (optional)"
|
|
121
123
|
}),
|
|
122
|
-
/* @__PURE__ */
|
|
124
|
+
/* @__PURE__ */ P("div", {
|
|
123
125
|
className: "flex items-center gap-2",
|
|
124
|
-
children: [/* @__PURE__ */
|
|
126
|
+
children: [/* @__PURE__ */ N("input", {
|
|
125
127
|
id: "epod-photo",
|
|
126
128
|
type: "file",
|
|
127
129
|
accept: "image/*",
|
|
128
130
|
capture: "environment",
|
|
129
131
|
onChange: (e) => U(e.target.files?.[0] ?? null),
|
|
130
132
|
className: "text-sm"
|
|
131
|
-
}), H && /* @__PURE__ */
|
|
133
|
+
}), H && /* @__PURE__ */ N(s, {
|
|
132
134
|
size: 14,
|
|
133
135
|
className: "text-text-secondary"
|
|
134
136
|
})]
|
|
135
137
|
}),
|
|
136
|
-
H && /* @__PURE__ */
|
|
138
|
+
H && /* @__PURE__ */ N("p", {
|
|
137
139
|
className: "text-xs text-text-secondary",
|
|
138
140
|
children: H.name
|
|
139
141
|
})
|
|
140
142
|
]
|
|
141
143
|
}),
|
|
142
|
-
/* @__PURE__ */
|
|
144
|
+
/* @__PURE__ */ P("div", {
|
|
143
145
|
className: "space-y-1.5",
|
|
144
|
-
children: [/* @__PURE__ */
|
|
146
|
+
children: [/* @__PURE__ */ N(y, {
|
|
145
147
|
htmlFor: "epod-notes",
|
|
146
148
|
children: "Notes (optional)"
|
|
147
|
-
}), /* @__PURE__ */
|
|
149
|
+
}), /* @__PURE__ */ N(b, {
|
|
148
150
|
id: "epod-notes",
|
|
149
151
|
value: W,
|
|
150
152
|
onChange: (e) => G(e.target.value),
|
|
@@ -152,88 +154,99 @@ function M({ job: r, onCaptured: u, onCancel: y }) {
|
|
|
152
154
|
rows: 2
|
|
153
155
|
})]
|
|
154
156
|
}),
|
|
155
|
-
/* @__PURE__ */
|
|
157
|
+
/* @__PURE__ */ P("p", {
|
|
156
158
|
className: "flex items-center gap-1.5 text-xs text-text-secondary",
|
|
157
|
-
children: [/* @__PURE__ */
|
|
159
|
+
children: [/* @__PURE__ */ N(n, { size: 12 }), " Device GPS is captured automatically when permitted by the browser."]
|
|
158
160
|
}),
|
|
159
|
-
K && /* @__PURE__ */
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
/* @__PURE__ */
|
|
161
|
+
K && /* @__PURE__ */ N(w, { message: K }),
|
|
162
|
+
S && /* @__PURE__ */ N(w, { message: S.message }),
|
|
163
|
+
E && /* @__PURE__ */ N(w, { message: E.message }),
|
|
164
|
+
/* @__PURE__ */ P("div", {
|
|
163
165
|
className: "flex gap-2 justify-end",
|
|
164
|
-
children: [/* @__PURE__ */
|
|
166
|
+
children: [/* @__PURE__ */ N(p, {
|
|
165
167
|
type: "button",
|
|
166
168
|
variant: "outline",
|
|
167
|
-
onClick:
|
|
169
|
+
onClick: l,
|
|
168
170
|
disabled: Y,
|
|
169
171
|
children: "Cancel"
|
|
170
|
-
}), /* @__PURE__ */
|
|
172
|
+
}), /* @__PURE__ */ N(p, {
|
|
171
173
|
type: "button",
|
|
172
174
|
onClick: () => void J(),
|
|
173
175
|
disabled: Y,
|
|
174
|
-
children: Y ? /* @__PURE__ */
|
|
176
|
+
children: Y ? /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(t, {
|
|
175
177
|
size: 14,
|
|
176
178
|
className: "animate-spin"
|
|
177
|
-
}), " Submitting…"] }) : /* @__PURE__ */
|
|
179
|
+
}), " Submitting…"] }) : /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(e, { size: 14 }), " Confirm delivery"] })
|
|
178
180
|
})]
|
|
179
181
|
})
|
|
180
182
|
]
|
|
181
183
|
})] });
|
|
182
184
|
}
|
|
183
|
-
function
|
|
184
|
-
let { jobs: t, isLoading: n, error: i, refetch: o } =
|
|
185
|
-
return /* @__PURE__ */
|
|
185
|
+
function L() {
|
|
186
|
+
let { jobs: t, isLoading: n, error: i, refetch: o } = f(), [s, u] = j(null), { message: d, notify: g } = E();
|
|
187
|
+
return /* @__PURE__ */ N(x, {
|
|
186
188
|
title: "My Deliveries",
|
|
187
189
|
subtitle: "Capture proof of delivery for your assigned stops",
|
|
188
|
-
icon: /* @__PURE__ */
|
|
189
|
-
children: /* @__PURE__ */
|
|
190
|
+
icon: /* @__PURE__ */ N(a, { size: 24 }),
|
|
191
|
+
children: /* @__PURE__ */ P("div", {
|
|
190
192
|
className: "space-y-4",
|
|
191
|
-
children: [/* @__PURE__ */
|
|
193
|
+
children: [/* @__PURE__ */ N(T, { message: d }), s ? /* @__PURE__ */ N(I, {
|
|
192
194
|
job: s,
|
|
193
195
|
onCaptured: () => {
|
|
194
|
-
|
|
196
|
+
g("Proof of delivery captured — delivery marked complete."), u(null), o();
|
|
195
197
|
},
|
|
196
|
-
onCancel: () =>
|
|
197
|
-
}) : n ? /* @__PURE__ */
|
|
198
|
+
onCancel: () => u(null)
|
|
199
|
+
}) : n ? /* @__PURE__ */ N("p", {
|
|
198
200
|
className: "text-text-secondary text-center py-8",
|
|
199
201
|
children: "Loading your deliveries…"
|
|
200
|
-
}) : i ? /* @__PURE__ */
|
|
202
|
+
}) : i ? /* @__PURE__ */ N(w, { message: i.message }) : t.length > 0 ? /* @__PURE__ */ N("div", {
|
|
201
203
|
className: "space-y-3",
|
|
202
|
-
children: t.map((e) => /* @__PURE__ */
|
|
204
|
+
children: t.map((e) => /* @__PURE__ */ N(m, { children: /* @__PURE__ */ P(h, {
|
|
203
205
|
className: "flex items-center justify-between gap-3 py-4",
|
|
204
|
-
children: [/* @__PURE__ */
|
|
206
|
+
children: [/* @__PURE__ */ P("div", {
|
|
205
207
|
className: "min-w-0",
|
|
206
208
|
children: [
|
|
207
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ P("p", {
|
|
208
210
|
className: "font-medium flex items-center gap-2",
|
|
209
211
|
children: [
|
|
210
|
-
/* @__PURE__ */
|
|
212
|
+
/* @__PURE__ */ N(r, { size: 16 }),
|
|
211
213
|
" ",
|
|
212
214
|
e.deliveryJobNumber
|
|
213
215
|
]
|
|
214
216
|
}),
|
|
215
|
-
|
|
217
|
+
/* @__PURE__ */ P("div", {
|
|
218
|
+
className: "flex flex-wrap items-center gap-1.5 py-1",
|
|
219
|
+
children: [/* @__PURE__ */ N(C, {
|
|
220
|
+
status: l(e.status),
|
|
221
|
+
type: "order",
|
|
222
|
+
size: "sm"
|
|
223
|
+
}), /* @__PURE__ */ N(S, {
|
|
224
|
+
priority: c(e.priority),
|
|
225
|
+
size: "sm"
|
|
226
|
+
})]
|
|
227
|
+
}),
|
|
228
|
+
e.deliveryAddress && /* @__PURE__ */ N("p", {
|
|
216
229
|
className: "text-sm text-text-secondary truncate",
|
|
217
|
-
children:
|
|
230
|
+
children: D(e.deliveryAddress)
|
|
218
231
|
}),
|
|
219
|
-
e.scheduledDelivery && /* @__PURE__ */
|
|
232
|
+
e.scheduledDelivery && /* @__PURE__ */ P("p", {
|
|
220
233
|
className: "text-xs text-text-secondary",
|
|
221
|
-
children: ["Scheduled ",
|
|
234
|
+
children: ["Scheduled ", O(e.scheduledDelivery, "short")]
|
|
222
235
|
})
|
|
223
236
|
]
|
|
224
|
-
}), /* @__PURE__ */
|
|
237
|
+
}), /* @__PURE__ */ N(p, {
|
|
225
238
|
type: "button",
|
|
226
239
|
size: "sm",
|
|
227
|
-
onClick: () =>
|
|
240
|
+
onClick: () => u(e),
|
|
228
241
|
children: "Capture"
|
|
229
242
|
})]
|
|
230
243
|
}) }, e.id))
|
|
231
|
-
}) : /* @__PURE__ */
|
|
244
|
+
}) : /* @__PURE__ */ P("div", {
|
|
232
245
|
className: "text-center py-12",
|
|
233
|
-
children: [/* @__PURE__ */
|
|
246
|
+
children: [/* @__PURE__ */ N(e, {
|
|
234
247
|
size: 40,
|
|
235
248
|
className: "mx-auto mb-3 text-text-secondary opacity-50"
|
|
236
|
-
}), /* @__PURE__ */
|
|
249
|
+
}), /* @__PURE__ */ N("p", {
|
|
237
250
|
className: "text-text-secondary",
|
|
238
251
|
children: "No deliveries awaiting proof of delivery."
|
|
239
252
|
})]
|
|
@@ -242,4 +255,4 @@ function N() {
|
|
|
242
255
|
});
|
|
243
256
|
}
|
|
244
257
|
//#endregion
|
|
245
|
-
export {
|
|
258
|
+
export { L as default };
|