@burdenoff/microfe-movethewheels 2026.920.3 → 2026.923.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/components/CarbonFootprintPanel.js +1 -1
- package/dist/components/CustomerPicker.js +76 -65
- package/dist/components/DataTable.js +140 -139
- package/dist/components/DocumentsCard.js +14 -8
- package/dist/generated/wspace-types.d.ts +2719 -8
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/useAnalytics.js +21 -1
- package/dist/hooks/useCustomers.js +94 -78
- package/dist/hooks/useDebouncedValue.js +11 -0
- package/dist/hooks/useEntityDocuments.js +28 -18
- package/dist/hooks/useEpod.js +24 -17
- package/dist/hooks/useFleet.js +148 -125
- package/dist/hooks/useInventory.js +255 -186
- package/dist/hooks/useMultiModalShipments.js +35 -27
- package/dist/hooks/useOrders.js +139 -134
- package/dist/hooks/useRoutes.js +97 -75
- package/dist/hooks/useTracking.js +100 -88
- package/dist/index.js +6 -6
- package/dist/movethewheels/components/CustomerPicker.d.ts +3 -1
- package/dist/movethewheels/components/DataTable.d.ts +5 -1
- package/dist/movethewheels/hooks/useCustomers.d.ts +0 -1
- package/dist/movethewheels/hooks/useDebouncedValue.d.ts +1 -0
- package/dist/movethewheels/hooks/useEntityDocuments.d.ts +2 -0
- package/dist/movethewheels/hooks/useEpod.d.ts +6 -1
- package/dist/movethewheels/hooks/useFleet.d.ts +49 -5
- package/dist/movethewheels/hooks/useInventory.d.ts +24 -17
- package/dist/movethewheels/hooks/useMultiModalShipments.d.ts +6 -1
- package/dist/movethewheels/hooks/useOrders.d.ts +48 -5
- package/dist/movethewheels/hooks/useRoutes.d.ts +18 -1
- package/dist/movethewheels/hooks/useTracking.d.ts +12 -11
- package/dist/movethewheels/types/index.d.ts +12 -5
- package/dist/pages/CreateOrderPage.js +191 -129
- package/dist/pages/CustomersPage.js +61 -54
- package/dist/pages/DeliveryCapturePage.js +131 -109
- package/dist/pages/DriversPage.js +100 -92
- package/dist/pages/InventoryPage.js +239 -236
- package/dist/pages/MultiModalShipmentPage.js +163 -130
- package/dist/pages/OrderDetailsPage.js +190 -106
- package/dist/pages/OrdersListPage.js +66 -60
- package/dist/pages/ProductDetailsPage.js +241 -200
- package/dist/pages/ProductsPage.js +59 -52
- package/dist/pages/RouteDetailsPage.js +324 -293
- package/dist/pages/RoutesPage.js +55 -48
- package/dist/pages/VehiclesPage.js +63 -56
- package/dist/pages/WarehousesPage.js +60 -53
- package/package.json +1 -1
- package/src/generated/wspace-types.ts +3136 -8
- package/src/movethewheels/components/CarbonFootprintPanel.tsx +0 -1
- package/src/movethewheels/components/CustomerPicker.tsx +14 -0
- package/src/movethewheels/components/DataTable.tsx +34 -18
- package/src/movethewheels/components/DocumentsCard.tsx +6 -1
- package/src/movethewheels/components/maps/leaflet-setup.ts +1 -8
- package/src/movethewheels/hooks/useAnalytics.ts +27 -0
- package/src/movethewheels/hooks/useCustomers.ts +64 -24
- package/src/movethewheels/hooks/useDebouncedValue.ts +12 -0
- package/src/movethewheels/hooks/useEntityDocuments.ts +43 -25
- package/src/movethewheels/hooks/useEpod.ts +14 -7
- package/src/movethewheels/hooks/useFleet.ts +66 -38
- package/src/movethewheels/hooks/useFleetIntelligence.ts +1 -4
- package/src/movethewheels/hooks/useInventory.ts +211 -90
- package/src/movethewheels/hooks/useMultiModalShipments.ts +15 -11
- package/src/movethewheels/hooks/useOrders.ts +48 -14
- package/src/movethewheels/hooks/useRoutes.ts +81 -24
- package/src/movethewheels/hooks/useTracking.ts +130 -98
- package/src/movethewheels/pages/CreateOrderPage.tsx +93 -2
- package/src/movethewheels/pages/CustomersPage.tsx +11 -1
- package/src/movethewheels/pages/DeliveryCapturePage.tsx +31 -1
- package/src/movethewheels/pages/DriversPage.tsx +24 -12
- package/src/movethewheels/pages/InventoryPage.tsx +57 -32
- package/src/movethewheels/pages/MultiModalShipmentPage.tsx +52 -3
- package/src/movethewheels/pages/OrderDetailsPage.tsx +91 -6
- package/src/movethewheels/pages/OrdersListPage.tsx +20 -3
- package/src/movethewheels/pages/ProductDetailsPage.tsx +52 -3
- package/src/movethewheels/pages/ProductsPage.tsx +11 -1
- package/src/movethewheels/pages/RouteDetailsPage.tsx +45 -5
- package/src/movethewheels/pages/RoutesPage.tsx +11 -1
- package/src/movethewheels/pages/VehiclesPage.tsx +19 -2
- package/src/movethewheels/pages/WarehousesPage.tsx +11 -1
- package/src/movethewheels/types/index.ts +12 -5
|
@@ -11,25 +11,26 @@ import { Package as i } from "../node_modules/lucide-react/dist/esm/icons/packag
|
|
|
11
11
|
import { Phone as ae } from "../node_modules/lucide-react/dist/esm/icons/phone.js";
|
|
12
12
|
import { Printer as a } from "../node_modules/lucide-react/dist/esm/icons/printer.js";
|
|
13
13
|
import { SquarePen as o } from "../node_modules/lucide-react/dist/esm/icons/square-pen.js";
|
|
14
|
-
import { Truck as
|
|
15
|
-
import { UserCheck as
|
|
16
|
-
import { User as
|
|
17
|
-
import { joinPath as
|
|
18
|
-
import { useMoveTheWheels as
|
|
19
|
-
import { useOrder as
|
|
20
|
-
import { useFleet as
|
|
21
|
-
import { Badge as
|
|
14
|
+
import { Truck as s } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
|
|
15
|
+
import { UserCheck as oe } from "../node_modules/lucide-react/dist/esm/icons/user-check.js";
|
|
16
|
+
import { User as se } from "../node_modules/lucide-react/dist/esm/icons/user.js";
|
|
17
|
+
import { joinPath as c } from "../utils/navigation.js";
|
|
18
|
+
import { useMoveTheWheels as ce } from "../providers/MoveTheWheelsProvider.js";
|
|
19
|
+
import { useOrder as le, useOrders as ue } from "../hooks/useOrders.js";
|
|
20
|
+
import { useFleet as l } from "../hooks/useFleet.js";
|
|
21
|
+
import { Badge as u, Button as d, Card as f, CardContent as p, CardHeader as m, CardTitle as h, Input as de, Label as g, Select as _, SelectContent as v, SelectItem as y, SelectTrigger as fe, SelectValue as b, Separator as x, Table as pe, TableBody as me, TableCell as S, TableHead as C, TableHeader as he, TableRow as w } from "../components/ui.js";
|
|
22
22
|
import { ErrorState as ge, LoadingState as _e, PageLayout as ve } from "../components/PageLayout.js";
|
|
23
|
-
import { PaymentStatusBadge as ye, PriorityBadge as be, StatusBadge as
|
|
23
|
+
import { PaymentStatusBadge as ye, PriorityBadge as be, StatusBadge as T } from "../components/StatusBadge.js";
|
|
24
24
|
import { FormError as xe } from "../components/FormError.js";
|
|
25
|
-
import { Notice as Se, useNotice as
|
|
25
|
+
import { Notice as Se, useNotice as Ce } from "../components/Notice.js";
|
|
26
26
|
import { formatAddress as E, formatCurrency as D, formatDate as O } from "../utils/formatters.js";
|
|
27
|
-
import { DocumentsCard as
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
27
|
+
import { DocumentsCard as we } from "../components/DocumentsCard.js";
|
|
28
|
+
import { useDebouncedValue as Te } from "../hooks/useDebouncedValue.js";
|
|
29
|
+
import { ProofOfDeliveryCard as Ee } from "../components/ProofOfDeliveryCard.js";
|
|
30
|
+
import { useEffect as De, useState as k } from "react";
|
|
31
|
+
import { useParams as Oe } from "react-router";
|
|
31
32
|
import { jsx as A, jsxs as j } from "react/jsx-runtime";
|
|
32
|
-
import { EmphasisPanel as
|
|
33
|
+
import { EmphasisPanel as ke, NextSteps as Ae, PagePurpose as je } from "@burdenoff/fe-libs/ui";
|
|
33
34
|
//#region src/movethewheels/pages/OrderDetailsPage.tsx
|
|
34
35
|
var M = [
|
|
35
36
|
"pending",
|
|
@@ -50,42 +51,68 @@ var M = [
|
|
|
50
51
|
cancelled: "Cancelled",
|
|
51
52
|
failed: "Failed"
|
|
52
53
|
};
|
|
53
|
-
function
|
|
54
|
+
function Me(e) {
|
|
54
55
|
let t = M.indexOf(e);
|
|
55
56
|
return t === -1 || t >= M.length - 1 ? null : M[t + 1];
|
|
56
57
|
}
|
|
57
58
|
function P() {
|
|
58
|
-
let { orderId: M } =
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
let { orderId: M } = Oe(), { basePath: P, navigate: F } = ce(), { order: I, isLoading: Ne, error: Pe, refetch: L } = le(M), { updateOrder: Fe, updateOrderStatus: Ie } = ue(), [R, Le] = k(""), [z, B] = k(""), [V, H] = k(""), [U, W] = k(!1), [G, K] = k(!1), [q, J] = k(null), Y = Te(R), { vehicles: X, isLoading: Z } = l({
|
|
60
|
+
limit: 20,
|
|
61
|
+
filters: {
|
|
62
|
+
search: Y || void 0,
|
|
63
|
+
driverId: V || void 0
|
|
64
|
+
}
|
|
65
|
+
}), { drivers: Q, isLoading: Re } = l({
|
|
66
|
+
limit: 20,
|
|
67
|
+
filters: {
|
|
68
|
+
search: Y || void 0,
|
|
69
|
+
vehicleId: z || void 0
|
|
70
|
+
}
|
|
71
|
+
}), { message: ze, notify: Be } = Ce(), Ve = X.filter((e) => e.status === "available" || e.id === I?.vehicleId), He = Q.filter((e) => e.status === "available" || e.id === I?.driverId);
|
|
72
|
+
De(() => {
|
|
73
|
+
!Re && V && !Q.some((e) => e.id === V) && H("");
|
|
74
|
+
}, [
|
|
75
|
+
Q,
|
|
76
|
+
Re,
|
|
77
|
+
V
|
|
78
|
+
]), De(() => {
|
|
79
|
+
!Z && z && !X.some((e) => e.id === z) && B("");
|
|
80
|
+
}, [
|
|
81
|
+
z,
|
|
82
|
+
X,
|
|
83
|
+
Z
|
|
84
|
+
]);
|
|
85
|
+
let Ue = async () => {
|
|
86
|
+
if (!M || !z && !V) {
|
|
87
|
+
J("Pick a vehicle and/or a driver to assign.");
|
|
61
88
|
return;
|
|
62
89
|
}
|
|
63
|
-
|
|
90
|
+
W(!0), J(null);
|
|
64
91
|
try {
|
|
65
|
-
await
|
|
66
|
-
vehicleId:
|
|
67
|
-
driverId:
|
|
68
|
-
}),
|
|
92
|
+
await Fe(M, {
|
|
93
|
+
vehicleId: z || void 0,
|
|
94
|
+
driverId: V || void 0
|
|
95
|
+
}), Be("Assignment updated."), B(""), H(""), L();
|
|
69
96
|
} catch (e) {
|
|
70
|
-
|
|
97
|
+
J(e instanceof Error ? e.message : "Failed to update assignment.");
|
|
71
98
|
} finally {
|
|
72
|
-
|
|
99
|
+
W(!1);
|
|
73
100
|
}
|
|
74
|
-
},
|
|
101
|
+
}, We = async (e, t) => {
|
|
75
102
|
if (M) {
|
|
76
|
-
|
|
103
|
+
K(!0), J(null);
|
|
77
104
|
try {
|
|
78
|
-
await
|
|
105
|
+
await Ie(M, e), Be(t), L();
|
|
79
106
|
} catch (e) {
|
|
80
|
-
|
|
107
|
+
J(e instanceof Error ? e.message : "Failed to update status.");
|
|
81
108
|
} finally {
|
|
82
|
-
|
|
109
|
+
K(!1);
|
|
83
110
|
}
|
|
84
111
|
}
|
|
85
112
|
}, $ = (e) => {
|
|
86
|
-
F && F(
|
|
113
|
+
F && F(c(P, e));
|
|
87
114
|
};
|
|
88
|
-
return
|
|
115
|
+
return Ne ? /* @__PURE__ */ A(_e, { message: "Loading order details..." }) : Pe || !I ? /* @__PURE__ */ A(ge, {
|
|
89
116
|
title: "Order not found",
|
|
90
117
|
message: "The order you're looking for doesn't exist or has been removed.",
|
|
91
118
|
onRetry: L
|
|
@@ -96,18 +123,19 @@ function P() {
|
|
|
96
123
|
headerActions: /* @__PURE__ */ j("div", {
|
|
97
124
|
className: "flex gap-2",
|
|
98
125
|
children: [
|
|
99
|
-
/* @__PURE__ */ j(
|
|
126
|
+
/* @__PURE__ */ j(d, {
|
|
100
127
|
variant: "outline",
|
|
101
128
|
onClick: () => {
|
|
102
|
-
F && F(
|
|
129
|
+
F && F(c(P, "orders"));
|
|
103
130
|
},
|
|
104
131
|
children: [/* @__PURE__ */ A(e, { size: 16 }), "Back"]
|
|
105
132
|
}),
|
|
106
|
-
/* @__PURE__ */ j(
|
|
133
|
+
/* @__PURE__ */ j(d, {
|
|
107
134
|
variant: "outline",
|
|
135
|
+
onClick: () => window.print(),
|
|
108
136
|
children: [/* @__PURE__ */ A(a, { size: 16 }), "Print"]
|
|
109
137
|
}),
|
|
110
|
-
/* @__PURE__ */ j(
|
|
138
|
+
/* @__PURE__ */ j(d, {
|
|
111
139
|
onClick: () => $(`orders/${M}/edit`),
|
|
112
140
|
children: [/* @__PURE__ */ A(o, { size: 16 }), "Edit"]
|
|
113
141
|
})
|
|
@@ -116,7 +144,7 @@ function P() {
|
|
|
116
144
|
headerContent: /* @__PURE__ */ j("div", {
|
|
117
145
|
className: "flex flex-wrap gap-2",
|
|
118
146
|
children: [
|
|
119
|
-
/* @__PURE__ */ A(
|
|
147
|
+
/* @__PURE__ */ A(T, {
|
|
120
148
|
status: I.status,
|
|
121
149
|
type: "order"
|
|
122
150
|
}),
|
|
@@ -125,11 +153,11 @@ function P() {
|
|
|
125
153
|
]
|
|
126
154
|
}),
|
|
127
155
|
children: [
|
|
128
|
-
/* @__PURE__ */ A(
|
|
156
|
+
/* @__PURE__ */ A(je, {
|
|
129
157
|
icon: /* @__PURE__ */ A(i, { size: 18 }),
|
|
130
158
|
children: "Everything about this one delivery in a single place — who it's for, where it's going, what's inside, the running cost and the full status history. Use this page to review the order, hand it to a driver, print the docket, or jump into live tracking."
|
|
131
159
|
}),
|
|
132
|
-
/* @__PURE__ */ A(
|
|
160
|
+
/* @__PURE__ */ A(Ae, {
|
|
133
161
|
storageKey: "movethewheels-order-details",
|
|
134
162
|
steps: [
|
|
135
163
|
{
|
|
@@ -160,10 +188,10 @@ function P() {
|
|
|
160
188
|
children: [/* @__PURE__ */ j("div", {
|
|
161
189
|
className: "lg:col-span-2 space-y-6",
|
|
162
190
|
children: [
|
|
163
|
-
/* @__PURE__ */ j(
|
|
191
|
+
/* @__PURE__ */ j(f, { children: [/* @__PURE__ */ A(m, { children: /* @__PURE__ */ j(h, {
|
|
164
192
|
className: "flex items-center gap-2",
|
|
165
|
-
children: [/* @__PURE__ */ A(
|
|
166
|
-
}) }), /* @__PURE__ */ A(
|
|
193
|
+
children: [/* @__PURE__ */ A(se, { size: 18 }), "Customer Information"]
|
|
194
|
+
}) }), /* @__PURE__ */ A(p, { children: /* @__PURE__ */ j("div", {
|
|
167
195
|
className: "grid grid-cols-1 md:grid-cols-2 gap-6",
|
|
168
196
|
children: [/* @__PURE__ */ j("div", { children: [
|
|
169
197
|
/* @__PURE__ */ A("h4", {
|
|
@@ -207,15 +235,15 @@ function P() {
|
|
|
207
235
|
children: I.customerInfo.deliveryInstructions
|
|
208
236
|
})] })] })]
|
|
209
237
|
}) })] }),
|
|
210
|
-
/* @__PURE__ */ j(
|
|
238
|
+
/* @__PURE__ */ j(f, { children: [/* @__PURE__ */ A(m, { children: /* @__PURE__ */ j(h, {
|
|
211
239
|
className: "flex items-center gap-2",
|
|
212
240
|
children: [/* @__PURE__ */ A(r, { size: 18 }), "Addresses"]
|
|
213
|
-
}) }), /* @__PURE__ */ A(
|
|
241
|
+
}) }), /* @__PURE__ */ A(p, { children: /* @__PURE__ */ j("div", {
|
|
214
242
|
className: "grid grid-cols-1 md:grid-cols-2 gap-6",
|
|
215
243
|
children: [/* @__PURE__ */ j("div", { children: [
|
|
216
244
|
/* @__PURE__ */ A("h4", {
|
|
217
245
|
className: "font-medium mb-2 flex items-center gap-2",
|
|
218
|
-
children: /* @__PURE__ */ A(
|
|
246
|
+
children: /* @__PURE__ */ A(u, {
|
|
219
247
|
variant: "outline",
|
|
220
248
|
children: "Pickup"
|
|
221
249
|
})
|
|
@@ -242,7 +270,7 @@ function P() {
|
|
|
242
270
|
] }), /* @__PURE__ */ j("div", { children: [
|
|
243
271
|
/* @__PURE__ */ A("h4", {
|
|
244
272
|
className: "font-medium mb-2 flex items-center gap-2",
|
|
245
|
-
children: /* @__PURE__ */ A(
|
|
273
|
+
children: /* @__PURE__ */ A(u, {
|
|
246
274
|
variant: "outline",
|
|
247
275
|
children: "Delivery"
|
|
248
276
|
})
|
|
@@ -268,7 +296,51 @@ function P() {
|
|
|
268
296
|
})
|
|
269
297
|
] })]
|
|
270
298
|
}) })] }),
|
|
271
|
-
/* @__PURE__ */ j(
|
|
299
|
+
/* @__PURE__ */ j(f, { children: [/* @__PURE__ */ A(m, { children: /* @__PURE__ */ j(h, {
|
|
300
|
+
className: "flex items-center gap-2",
|
|
301
|
+
children: [/* @__PURE__ */ A(s, { size: 18 }), "Saved Route"]
|
|
302
|
+
}) }), /* @__PURE__ */ A(p, { children: I.route ? /* @__PURE__ */ j("div", {
|
|
303
|
+
className: "space-y-3",
|
|
304
|
+
children: [/* @__PURE__ */ j("div", {
|
|
305
|
+
className: "flex items-center justify-between gap-3",
|
|
306
|
+
children: [/* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("p", {
|
|
307
|
+
className: "font-medium",
|
|
308
|
+
children: I.route.name
|
|
309
|
+
}), /* @__PURE__ */ j("p", {
|
|
310
|
+
className: "text-sm text-text-secondary",
|
|
311
|
+
children: [
|
|
312
|
+
I.route.stops.length,
|
|
313
|
+
" stops ·",
|
|
314
|
+
" ",
|
|
315
|
+
I.route.status.replace("_", " ").toLowerCase()
|
|
316
|
+
]
|
|
317
|
+
})] }), /* @__PURE__ */ A(u, {
|
|
318
|
+
variant: "outline",
|
|
319
|
+
children: "Reusable route"
|
|
320
|
+
})]
|
|
321
|
+
}), /* @__PURE__ */ A("div", {
|
|
322
|
+
className: "space-y-2",
|
|
323
|
+
children: I.route.stops.map((e, t) => /* @__PURE__ */ j("div", {
|
|
324
|
+
className: "flex items-start gap-2 text-sm",
|
|
325
|
+
children: [/* @__PURE__ */ j("span", {
|
|
326
|
+
className: "text-text-secondary",
|
|
327
|
+
children: [t + 1, "."]
|
|
328
|
+
}), /* @__PURE__ */ j("span", { children: [
|
|
329
|
+
/* @__PURE__ */ A("span", {
|
|
330
|
+
className: "font-medium capitalize",
|
|
331
|
+
children: e.type
|
|
332
|
+
}),
|
|
333
|
+
" ·",
|
|
334
|
+
" ",
|
|
335
|
+
E(e.address)
|
|
336
|
+
] })]
|
|
337
|
+
}, e.id))
|
|
338
|
+
})]
|
|
339
|
+
}) : /* @__PURE__ */ A("p", {
|
|
340
|
+
className: "text-sm text-text-secondary",
|
|
341
|
+
children: "No saved route was selected for this order."
|
|
342
|
+
}) })] }),
|
|
343
|
+
/* @__PURE__ */ j(f, { children: [/* @__PURE__ */ A(m, { children: /* @__PURE__ */ j(h, {
|
|
272
344
|
className: "flex items-center gap-2",
|
|
273
345
|
children: [
|
|
274
346
|
/* @__PURE__ */ A(i, { size: 18 }),
|
|
@@ -276,53 +348,53 @@ function P() {
|
|
|
276
348
|
I.items.length,
|
|
277
349
|
")"
|
|
278
350
|
]
|
|
279
|
-
}) }), /* @__PURE__ */ A(
|
|
351
|
+
}) }), /* @__PURE__ */ A(p, {
|
|
280
352
|
className: "p-0",
|
|
281
|
-
children: /* @__PURE__ */ j(pe, { children: [/* @__PURE__ */ A(he, { children: /* @__PURE__ */ j(
|
|
282
|
-
/* @__PURE__ */ A(
|
|
283
|
-
/* @__PURE__ */ A(
|
|
284
|
-
/* @__PURE__ */ A(
|
|
353
|
+
children: /* @__PURE__ */ j(pe, { children: [/* @__PURE__ */ A(he, { children: /* @__PURE__ */ j(w, { children: [
|
|
354
|
+
/* @__PURE__ */ A(C, { children: "Item" }),
|
|
355
|
+
/* @__PURE__ */ A(C, { children: "SKU" }),
|
|
356
|
+
/* @__PURE__ */ A(C, {
|
|
285
357
|
className: "text-center",
|
|
286
358
|
children: "Qty"
|
|
287
359
|
}),
|
|
288
|
-
/* @__PURE__ */ A(
|
|
360
|
+
/* @__PURE__ */ A(C, {
|
|
289
361
|
className: "text-right",
|
|
290
362
|
children: "Unit Price"
|
|
291
363
|
}),
|
|
292
|
-
/* @__PURE__ */ A(
|
|
364
|
+
/* @__PURE__ */ A(C, {
|
|
293
365
|
className: "text-right",
|
|
294
366
|
children: "Total"
|
|
295
367
|
})
|
|
296
|
-
] }) }), /* @__PURE__ */ A(me, { children: I.items.map((e) => /* @__PURE__ */ j(
|
|
297
|
-
/* @__PURE__ */ A(
|
|
368
|
+
] }) }), /* @__PURE__ */ A(me, { children: I.items.map((e) => /* @__PURE__ */ j(w, { children: [
|
|
369
|
+
/* @__PURE__ */ A(S, { children: /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("p", {
|
|
298
370
|
className: "font-medium",
|
|
299
371
|
children: e.name
|
|
300
372
|
}), e.description && /* @__PURE__ */ A("p", {
|
|
301
373
|
className: "text-sm text-text-secondary",
|
|
302
374
|
children: e.description
|
|
303
375
|
})] }) }),
|
|
304
|
-
/* @__PURE__ */ A(
|
|
376
|
+
/* @__PURE__ */ A(S, {
|
|
305
377
|
className: "font-mono text-sm",
|
|
306
378
|
children: e.sku
|
|
307
379
|
}),
|
|
308
|
-
/* @__PURE__ */ A(
|
|
380
|
+
/* @__PURE__ */ A(S, {
|
|
309
381
|
className: "text-center",
|
|
310
382
|
children: e.quantity
|
|
311
383
|
}),
|
|
312
|
-
/* @__PURE__ */ A(
|
|
384
|
+
/* @__PURE__ */ A(S, {
|
|
313
385
|
className: "text-right",
|
|
314
386
|
children: D(e.value)
|
|
315
387
|
}),
|
|
316
|
-
/* @__PURE__ */ A(
|
|
388
|
+
/* @__PURE__ */ A(S, {
|
|
317
389
|
className: "text-right font-medium",
|
|
318
390
|
children: D(e.value * e.quantity)
|
|
319
391
|
})
|
|
320
392
|
] }, e.id)) })] })
|
|
321
393
|
})] }),
|
|
322
|
-
/* @__PURE__ */ j(
|
|
394
|
+
/* @__PURE__ */ j(f, { children: [/* @__PURE__ */ A(m, { children: /* @__PURE__ */ j(h, {
|
|
323
395
|
className: "flex items-center gap-2",
|
|
324
396
|
children: [/* @__PURE__ */ A(te, { size: 18 }), "Order Timeline"]
|
|
325
|
-
}) }), /* @__PURE__ */ A(
|
|
397
|
+
}) }), /* @__PURE__ */ A(p, { children: /* @__PURE__ */ A("div", {
|
|
326
398
|
className: "relative",
|
|
327
399
|
children: I.timeline.map((e, t) => /* @__PURE__ */ j("div", {
|
|
328
400
|
className: "flex gap-4 pb-6 last:pb-0",
|
|
@@ -334,7 +406,7 @@ function P() {
|
|
|
334
406
|
children: [
|
|
335
407
|
/* @__PURE__ */ j("div", {
|
|
336
408
|
className: "flex items-center gap-2 mb-1",
|
|
337
|
-
children: [/* @__PURE__ */ A(
|
|
409
|
+
children: [/* @__PURE__ */ A(T, {
|
|
338
410
|
status: e.status,
|
|
339
411
|
type: "order",
|
|
340
412
|
size: "sm"
|
|
@@ -359,7 +431,7 @@ function P() {
|
|
|
359
431
|
}), /* @__PURE__ */ j("div", {
|
|
360
432
|
className: "space-y-6",
|
|
361
433
|
children: [
|
|
362
|
-
/* @__PURE__ */ j(
|
|
434
|
+
/* @__PURE__ */ j(ke, { children: [/* @__PURE__ */ j("h2", {
|
|
363
435
|
className: "flex items-center gap-2 text-base font-semibold text-text-primary mb-4",
|
|
364
436
|
children: [/* @__PURE__ */ A(ne, { size: 18 }), "Order Summary"]
|
|
365
437
|
}), /* @__PURE__ */ j("div", {
|
|
@@ -400,7 +472,7 @@ function P() {
|
|
|
400
472
|
children: "Taxes"
|
|
401
473
|
}), /* @__PURE__ */ A("span", { children: D(I.pricing.taxes) })]
|
|
402
474
|
}),
|
|
403
|
-
/* @__PURE__ */ A(
|
|
475
|
+
/* @__PURE__ */ A(x, {}),
|
|
404
476
|
/* @__PURE__ */ j("div", {
|
|
405
477
|
className: "flex justify-between font-medium",
|
|
406
478
|
children: [/* @__PURE__ */ A("span", { children: "Total" }), /* @__PURE__ */ A("span", {
|
|
@@ -420,14 +492,14 @@ function P() {
|
|
|
420
492
|
})
|
|
421
493
|
]
|
|
422
494
|
})] }),
|
|
423
|
-
/* @__PURE__ */ j(
|
|
495
|
+
/* @__PURE__ */ j(f, { children: [/* @__PURE__ */ A(m, { children: /* @__PURE__ */ j(h, {
|
|
424
496
|
className: "flex items-center gap-2",
|
|
425
|
-
children: [/* @__PURE__ */ A(
|
|
426
|
-
}) }), /* @__PURE__ */ A(
|
|
497
|
+
children: [/* @__PURE__ */ A(s, { size: 18 }), "Assignment"]
|
|
498
|
+
}) }), /* @__PURE__ */ A(p, { children: /* @__PURE__ */ j("div", {
|
|
427
499
|
className: "space-y-4",
|
|
428
500
|
children: [
|
|
429
|
-
|
|
430
|
-
|
|
501
|
+
q && /* @__PURE__ */ A(xe, { message: q }),
|
|
502
|
+
ze && /* @__PURE__ */ A(Se, { message: ze }),
|
|
431
503
|
/* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("p", {
|
|
432
504
|
className: "text-sm text-text-secondary",
|
|
433
505
|
children: "Tracking Number"
|
|
@@ -435,26 +507,38 @@ function P() {
|
|
|
435
507
|
className: "text-sm font-mono",
|
|
436
508
|
children: I.trackingNumber || "—"
|
|
437
509
|
})] }),
|
|
438
|
-
/* @__PURE__ */ A(
|
|
510
|
+
/* @__PURE__ */ A(x, {}),
|
|
439
511
|
/* @__PURE__ */ j("div", {
|
|
440
512
|
className: "space-y-3",
|
|
441
513
|
children: [
|
|
442
514
|
/* @__PURE__ */ j("div", {
|
|
443
515
|
className: "space-y-1.5",
|
|
444
|
-
children: [/* @__PURE__ */ A(
|
|
516
|
+
children: [/* @__PURE__ */ A(g, {
|
|
517
|
+
htmlFor: "assign-fleet-search",
|
|
518
|
+
children: "Search fleet"
|
|
519
|
+
}), /* @__PURE__ */ A(de, {
|
|
520
|
+
id: "assign-fleet-search",
|
|
521
|
+
value: R,
|
|
522
|
+
onChange: (e) => Le(e.target.value),
|
|
523
|
+
placeholder: "Vehicle number, driver name or ID"
|
|
524
|
+
})]
|
|
525
|
+
}),
|
|
526
|
+
/* @__PURE__ */ j("div", {
|
|
527
|
+
className: "space-y-1.5",
|
|
528
|
+
children: [/* @__PURE__ */ A(g, {
|
|
445
529
|
htmlFor: "assign-vehicle",
|
|
446
530
|
children: "Vehicle"
|
|
447
|
-
}), /* @__PURE__ */ j(
|
|
448
|
-
value:
|
|
449
|
-
onValueChange:
|
|
450
|
-
children: [/* @__PURE__ */ A(
|
|
531
|
+
}), /* @__PURE__ */ j(_, {
|
|
532
|
+
value: z,
|
|
533
|
+
onValueChange: B,
|
|
534
|
+
children: [/* @__PURE__ */ A(fe, {
|
|
451
535
|
id: "assign-vehicle",
|
|
452
|
-
children: /* @__PURE__ */ A(
|
|
453
|
-
}), /* @__PURE__ */ A(
|
|
536
|
+
children: /* @__PURE__ */ A(b, { placeholder: I.vehicleId ? `Current: ${I.vehicleId}` : "Select a vehicle" })
|
|
537
|
+
}), /* @__PURE__ */ A(v, { children: Ve.length === 0 ? /* @__PURE__ */ A(y, {
|
|
454
538
|
value: "none",
|
|
455
539
|
disabled: !0,
|
|
456
540
|
children: "No available vehicles"
|
|
457
|
-
}) :
|
|
541
|
+
}) : Ve.map((e) => /* @__PURE__ */ j(y, {
|
|
458
542
|
value: e.id,
|
|
459
543
|
children: [
|
|
460
544
|
e.vehicleNumber,
|
|
@@ -467,20 +551,20 @@ function P() {
|
|
|
467
551
|
}),
|
|
468
552
|
/* @__PURE__ */ j("div", {
|
|
469
553
|
className: "space-y-1.5",
|
|
470
|
-
children: [/* @__PURE__ */ A(
|
|
554
|
+
children: [/* @__PURE__ */ A(g, {
|
|
471
555
|
htmlFor: "assign-driver",
|
|
472
556
|
children: "Driver"
|
|
473
|
-
}), /* @__PURE__ */ j(
|
|
474
|
-
value:
|
|
475
|
-
onValueChange:
|
|
476
|
-
children: [/* @__PURE__ */ A(
|
|
557
|
+
}), /* @__PURE__ */ j(_, {
|
|
558
|
+
value: V,
|
|
559
|
+
onValueChange: H,
|
|
560
|
+
children: [/* @__PURE__ */ A(fe, {
|
|
477
561
|
id: "assign-driver",
|
|
478
|
-
children: /* @__PURE__ */ A(
|
|
479
|
-
}), /* @__PURE__ */ A(
|
|
562
|
+
children: /* @__PURE__ */ A(b, { placeholder: I.driverId ? `Current: ${I.driverId}` : "Select a driver" })
|
|
563
|
+
}), /* @__PURE__ */ A(v, { children: He.length === 0 ? /* @__PURE__ */ A(y, {
|
|
480
564
|
value: "none",
|
|
481
565
|
disabled: !0,
|
|
482
566
|
children: "No available drivers"
|
|
483
|
-
}) :
|
|
567
|
+
}) : He.map((e) => /* @__PURE__ */ j(y, {
|
|
484
568
|
value: e.id,
|
|
485
569
|
children: [
|
|
486
570
|
e.fullName,
|
|
@@ -491,15 +575,15 @@ function P() {
|
|
|
491
575
|
}, e.id)) })]
|
|
492
576
|
})]
|
|
493
577
|
}),
|
|
494
|
-
/* @__PURE__ */ j(
|
|
578
|
+
/* @__PURE__ */ j(d, {
|
|
495
579
|
className: "w-full",
|
|
496
|
-
onClick:
|
|
497
|
-
disabled:
|
|
498
|
-
children: [/* @__PURE__ */ A(
|
|
580
|
+
onClick: Ue,
|
|
581
|
+
disabled: U || !z && !V,
|
|
582
|
+
children: [/* @__PURE__ */ A(oe, { size: 16 }), U ? "Assigning…" : "Assign driver & vehicle"]
|
|
499
583
|
})
|
|
500
584
|
]
|
|
501
585
|
}),
|
|
502
|
-
/* @__PURE__ */ A(
|
|
586
|
+
/* @__PURE__ */ A(x, {}),
|
|
503
587
|
/* @__PURE__ */ j("div", {
|
|
504
588
|
className: "space-y-2",
|
|
505
589
|
children: [
|
|
@@ -515,25 +599,25 @@ function P() {
|
|
|
515
599
|
]
|
|
516
600
|
}),
|
|
517
601
|
(() => {
|
|
518
|
-
let e =
|
|
519
|
-
return e ? /* @__PURE__ */ j(
|
|
602
|
+
let e = Me(I.status);
|
|
603
|
+
return e ? /* @__PURE__ */ j(d, {
|
|
520
604
|
variant: "outline",
|
|
521
605
|
className: "w-full",
|
|
522
|
-
onClick: () =>
|
|
523
|
-
disabled:
|
|
524
|
-
children: [/* @__PURE__ */ A(t, { size: 16 }),
|
|
606
|
+
onClick: () => We(e, `Order advanced to ${N[e]}.`),
|
|
607
|
+
disabled: G,
|
|
608
|
+
children: [/* @__PURE__ */ A(t, { size: 16 }), G ? "Updating…" : `Advance to ${N[e]}`]
|
|
525
609
|
}) : null;
|
|
526
610
|
})(),
|
|
527
|
-
I.status !== "cancelled" && I.status !== "delivered" && /* @__PURE__ */ j(
|
|
611
|
+
I.status !== "cancelled" && I.status !== "delivered" && /* @__PURE__ */ j(d, {
|
|
528
612
|
variant: "outline",
|
|
529
613
|
className: "w-full text-status-error-text",
|
|
530
|
-
onClick: () =>
|
|
531
|
-
disabled:
|
|
614
|
+
onClick: () => We("cancelled", "Order cancelled."),
|
|
615
|
+
disabled: G,
|
|
532
616
|
children: [/* @__PURE__ */ A(ee, { size: 16 }), "Cancel order"]
|
|
533
617
|
})
|
|
534
618
|
]
|
|
535
619
|
}),
|
|
536
|
-
/* @__PURE__ */ j(
|
|
620
|
+
/* @__PURE__ */ j(d, {
|
|
537
621
|
variant: "outline",
|
|
538
622
|
className: "w-full",
|
|
539
623
|
onClick: () => $(`tracking?order=${I.id}`),
|
|
@@ -541,15 +625,15 @@ function P() {
|
|
|
541
625
|
})
|
|
542
626
|
]
|
|
543
627
|
}) })] }),
|
|
544
|
-
/* @__PURE__ */ A(
|
|
628
|
+
/* @__PURE__ */ A(we, {
|
|
545
629
|
entityType: "order",
|
|
546
630
|
entityId: I.id
|
|
547
631
|
}),
|
|
548
|
-
/* @__PURE__ */ A(
|
|
549
|
-
I.specialInstructions && /* @__PURE__ */ j(
|
|
632
|
+
/* @__PURE__ */ A(Ee, { deliveryJobId: I.id }),
|
|
633
|
+
I.specialInstructions && /* @__PURE__ */ j(f, { children: [/* @__PURE__ */ A(m, { children: /* @__PURE__ */ j(h, {
|
|
550
634
|
className: "flex items-center gap-2",
|
|
551
635
|
children: [/* @__PURE__ */ A(re, { size: 18 }), "Special Instructions"]
|
|
552
|
-
}) }), /* @__PURE__ */ A(
|
|
636
|
+
}) }), /* @__PURE__ */ A(p, { children: /* @__PURE__ */ A("p", {
|
|
553
637
|
className: "text-sm",
|
|
554
638
|
children: I.specialInstructions
|
|
555
639
|
}) })] })
|