@burdenoff/microfe-movethewheels 2026.1107.5 → 2026.1107.7
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/CarrierRecommendationDialog.js +21 -0
- package/dist/components/DispatchDecisionCard.js +111 -97
- package/dist/components/ShipmentDecisionPanel.js +362 -0
- package/dist/components/ShipmentRiskDialog.js +134 -89
- package/dist/generated/tracking-quality-operations.d.ts +288 -0
- package/dist/generated/wspace-types.d.ts +1206 -5
- package/dist/hooks/useShipmentDecision.js +111 -0
- package/dist/movethewheels/components/CarrierRecommendationDialog.d.ts +20 -0
- package/dist/movethewheels/components/DispatchDecisionCard.d.ts +5 -1
- package/dist/movethewheels/components/ShipmentDecisionPanel.d.ts +14 -0
- package/dist/movethewheels/hooks/useDispatchPlan.d.ts +1 -1
- package/dist/movethewheels/hooks/useShipmentDecision.d.ts +67 -0
- package/dist/pages/DispatchPlanPage.js +198 -171
- package/package.json +1 -1
- package/src/generated/tracking-quality-operations.ts +321 -0
- package/src/generated/wspace-types.ts +1379 -5
- package/src/movethewheels/components/CarrierRecommendationDialog.tsx +54 -0
- package/src/movethewheels/components/DispatchDecisionCard.tsx +17 -2
- package/src/movethewheels/components/ShipmentDecisionPanel.tsx +459 -0
- package/src/movethewheels/components/ShipmentRiskDialog.tsx +67 -1
- package/src/movethewheels/hooks/useShipmentDecision.ts +318 -0
- package/src/movethewheels/pages/DispatchPlanPage.tsx +30 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Dialog as e, DialogContent as t, DialogDescription as n, DialogHeader as r, DialogTitle as i } from "./ui.js";
|
|
2
|
+
import { ShipmentDecisionPanel as a } from "./ShipmentDecisionPanel.js";
|
|
3
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
4
|
+
//#region src/movethewheels/components/CarrierRecommendationDialog.tsx
|
|
5
|
+
function c({ shipment: c, onOpenChange: l, onApplied: u, t: d }) {
|
|
6
|
+
return /* @__PURE__ */ o(e, {
|
|
7
|
+
open: c !== null,
|
|
8
|
+
onOpenChange: l,
|
|
9
|
+
children: /* @__PURE__ */ s(t, {
|
|
10
|
+
className: "max-h-[90vh] max-w-xl overflow-y-auto",
|
|
11
|
+
children: [/* @__PURE__ */ s(r, { children: [/* @__PURE__ */ s(i, { children: [d("movethewheels.carrierDecision.title", "Carrier recommendation"), c ? ` · ${c.number ?? c.id}` : ""] }), /* @__PURE__ */ o(n, { children: d("movethewheels.carrierDecision.description", "Carriers ranked for this shipment’s lane from your own delivery history: on-time record on the lane and overall, and recorded lane cost. Nothing changes until you accept one.") })] }), c && /* @__PURE__ */ o(a, {
|
|
12
|
+
shipmentId: c.id,
|
|
13
|
+
kind: "CARRIER_RECOMMENDATION",
|
|
14
|
+
onApplied: u,
|
|
15
|
+
t: d
|
|
16
|
+
})]
|
|
17
|
+
})
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { c as CarrierRecommendationDialog };
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import { Building2 as e } from "../node_modules/lucide-react/dist/esm/icons/building-2.js";
|
|
2
|
+
import { Check as t } from "../node_modules/lucide-react/dist/esm/icons/check.js";
|
|
3
|
+
import { Route as n } from "../node_modules/lucide-react/dist/esm/icons/route.js";
|
|
4
|
+
import { Sparkles as r } from "../node_modules/lucide-react/dist/esm/icons/sparkles.js";
|
|
5
|
+
import { Truck as i } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
|
|
6
|
+
import { User as a } from "../node_modules/lucide-react/dist/esm/icons/user.js";
|
|
7
|
+
import { X as o } from "../node_modules/lucide-react/dist/esm/icons/x.js";
|
|
8
|
+
import { formatDateTime as s } from "../utils/formatters.js";
|
|
9
|
+
import { Badge as c, Button as l, Card as u, CardContent as d } from "./ui.js";
|
|
10
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
10
11
|
//#region src/movethewheels/components/DispatchDecisionCard.tsx
|
|
11
|
-
var
|
|
12
|
+
var m = {
|
|
12
13
|
EARLIEST_DUE: ["movethewheels.dispatch.reason.earliestDue", "Earliest due"],
|
|
13
14
|
MAINTENANCE_OK: ["movethewheels.dispatch.reason.maintenanceOk", "No service due"],
|
|
14
15
|
MAINTENANCE_DUE_SOON: ["movethewheels.dispatch.reason.maintenanceDueSoon", "Service due soon"],
|
|
@@ -22,182 +23,195 @@ var p = {
|
|
|
22
23
|
LINKED_PAIR: ["movethewheels.dispatch.reason.linkedPair", "Linked vehicle and driver"],
|
|
23
24
|
DISTANCE_MEASURED: ["movethewheels.dispatch.reason.distanceMeasured", "Distance measured"],
|
|
24
25
|
DISTANCE_UNKNOWN: ["movethewheels.dispatch.reason.distanceUnknown", "No coordinates"]
|
|
25
|
-
},
|
|
26
|
+
}, h = new Set([
|
|
26
27
|
"MAINTENANCE_DUE_SOON",
|
|
27
28
|
"MAINTENANCE_OVERDUE",
|
|
28
29
|
"CAPACITY_UNKNOWN",
|
|
29
30
|
"LICENSE_EXPIRING",
|
|
30
31
|
"DISTANCE_UNKNOWN"
|
|
31
32
|
]);
|
|
32
|
-
function
|
|
33
|
-
let n =
|
|
33
|
+
function g(e, t) {
|
|
34
|
+
let n = m[e];
|
|
34
35
|
return n ? t(n[0], n[1]) : e;
|
|
35
36
|
}
|
|
36
|
-
function
|
|
37
|
+
function _(e) {
|
|
37
38
|
return e >= .75 ? "text-status-success-text" : e >= .5 ? "text-status-warning-text" : "text-status-error-text";
|
|
38
39
|
}
|
|
39
|
-
function
|
|
40
|
-
return e.decision === "ACCEPTED" ? /* @__PURE__ */
|
|
40
|
+
function v({ assignment: e, onOpenRoute: t, t: r }) {
|
|
41
|
+
return e.decision === "ACCEPTED" ? /* @__PURE__ */ p("div", {
|
|
41
42
|
className: "flex flex-wrap items-center gap-2",
|
|
42
|
-
children: [/* @__PURE__ */
|
|
43
|
+
children: [/* @__PURE__ */ f(c, {
|
|
43
44
|
variant: "default",
|
|
44
45
|
children: r("movethewheels.dispatch.decision.accepted", "Accepted")
|
|
45
|
-
}), e.routeId && /* @__PURE__ */
|
|
46
|
+
}), e.routeId && /* @__PURE__ */ p(l, {
|
|
46
47
|
size: "sm",
|
|
47
48
|
variant: "outline",
|
|
48
|
-
onClick: () =>
|
|
49
|
-
children: [/* @__PURE__ */
|
|
49
|
+
onClick: () => t(e.routeId),
|
|
50
|
+
children: [/* @__PURE__ */ f(n, {
|
|
50
51
|
size: 14,
|
|
51
52
|
"aria-hidden": "true"
|
|
52
53
|
}), r("movethewheels.dispatch.openRoute", "Open route")]
|
|
53
54
|
})]
|
|
54
|
-
}) : e.decision === "STALE" ? /* @__PURE__ */
|
|
55
|
+
}) : e.decision === "STALE" ? /* @__PURE__ */ p("div", {
|
|
55
56
|
className: "space-y-1",
|
|
56
|
-
children: [/* @__PURE__ */
|
|
57
|
+
children: [/* @__PURE__ */ f(c, {
|
|
57
58
|
variant: "outline",
|
|
58
59
|
children: r("movethewheels.dispatch.decision.stale", "Not applied")
|
|
59
|
-
}), e.decisionReason && /* @__PURE__ */
|
|
60
|
+
}), e.decisionReason && /* @__PURE__ */ f("p", {
|
|
60
61
|
className: "text-xs text-status-warning-text",
|
|
61
62
|
children: e.decisionReason
|
|
62
63
|
})]
|
|
63
|
-
}) : e.decision === "REJECTED" ? /* @__PURE__ */
|
|
64
|
+
}) : e.decision === "REJECTED" ? /* @__PURE__ */ f(c, {
|
|
64
65
|
variant: "secondary",
|
|
65
66
|
children: r("movethewheels.dispatch.decision.rejected", "Rejected")
|
|
66
|
-
}) : /* @__PURE__ */
|
|
67
|
+
}) : /* @__PURE__ */ f(c, {
|
|
67
68
|
variant: "outline",
|
|
68
69
|
children: r("movethewheels.dispatch.decision.pending", "Not decided")
|
|
69
70
|
});
|
|
70
71
|
}
|
|
71
|
-
function
|
|
72
|
-
let
|
|
73
|
-
return
|
|
74
|
-
className:
|
|
75
|
-
"data-assignment-id":
|
|
72
|
+
function y({ assignment: n, open: m, choice: y, disabled: b, onChoose: x, onOpenRoute: S, onRecommendCarrier: C, t: w }) {
|
|
73
|
+
let T = Math.round(n.confidence * 100), E = n.shipmentNumber ?? n.shipmentId, D = "border-border-default";
|
|
74
|
+
return m && y === "accept" ? D = "border-status-success-border" : m && y === "reject" && (D = "border-status-error-border"), /* @__PURE__ */ f(u, {
|
|
75
|
+
className: D,
|
|
76
|
+
"data-assignment-id": n.id,
|
|
76
77
|
"data-testid": "dispatch-decision-card",
|
|
77
|
-
children: /* @__PURE__ */
|
|
78
|
+
children: /* @__PURE__ */ p(d, {
|
|
78
79
|
className: "space-y-3 p-4",
|
|
79
80
|
children: [
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ p("div", {
|
|
81
82
|
className: "flex flex-wrap items-start justify-between gap-3",
|
|
82
|
-
children: [/* @__PURE__ */
|
|
83
|
+
children: [/* @__PURE__ */ p("div", {
|
|
83
84
|
className: "min-w-0 space-y-1",
|
|
84
|
-
children: [/* @__PURE__ */
|
|
85
|
+
children: [/* @__PURE__ */ p("p", {
|
|
85
86
|
className: "text-sm font-semibold break-words text-text-primary",
|
|
86
87
|
children: [
|
|
87
|
-
|
|
88
|
+
w("movethewheels.dispatch.shipment", "Shipment"),
|
|
88
89
|
" ",
|
|
89
|
-
|
|
90
|
+
E
|
|
90
91
|
]
|
|
91
|
-
}),
|
|
92
|
+
}), n.estimatedDelivery && /* @__PURE__ */ p("p", {
|
|
92
93
|
className: "text-xs text-text-secondary",
|
|
93
94
|
children: [
|
|
94
|
-
|
|
95
|
+
w("movethewheels.dispatch.due", "Due"),
|
|
95
96
|
" ",
|
|
96
|
-
|
|
97
|
+
s(n.estimatedDelivery)
|
|
97
98
|
]
|
|
98
99
|
})]
|
|
99
|
-
}), /* @__PURE__ */
|
|
100
|
+
}), /* @__PURE__ */ p("div", {
|
|
100
101
|
className: "text-right",
|
|
101
|
-
children: [/* @__PURE__ */
|
|
102
|
-
className: `text-lg font-bold tabular-nums ${
|
|
103
|
-
children: [
|
|
104
|
-
}), /* @__PURE__ */
|
|
102
|
+
children: [/* @__PURE__ */ p("p", {
|
|
103
|
+
className: `text-lg font-bold tabular-nums ${_(n.confidence)}`,
|
|
104
|
+
children: [T, "%"]
|
|
105
|
+
}), /* @__PURE__ */ f("p", {
|
|
105
106
|
className: "text-xs text-text-secondary",
|
|
106
|
-
children:
|
|
107
|
+
children: w("movethewheels.dispatch.confidence", "Planner confidence")
|
|
107
108
|
})]
|
|
108
109
|
})]
|
|
109
110
|
}),
|
|
110
|
-
/* @__PURE__ */
|
|
111
|
+
/* @__PURE__ */ p("div", {
|
|
111
112
|
className: "grid gap-2 text-sm sm:grid-cols-2",
|
|
112
|
-
children: [/* @__PURE__ */
|
|
113
|
+
children: [/* @__PURE__ */ p("p", {
|
|
113
114
|
className: "flex items-center gap-2 break-words",
|
|
114
|
-
children: [/* @__PURE__ */
|
|
115
|
+
children: [/* @__PURE__ */ f(i, {
|
|
115
116
|
size: 16,
|
|
116
117
|
className: "shrink-0 text-text-secondary",
|
|
117
118
|
"aria-hidden": "true"
|
|
118
|
-
}), /* @__PURE__ */
|
|
119
|
+
}), /* @__PURE__ */ p("span", { children: [n.vehicleNumber ?? n.vehicleId, n.vehicleType && /* @__PURE__ */ p("span", {
|
|
119
120
|
className: "text-text-secondary",
|
|
120
|
-
children: [" · ",
|
|
121
|
+
children: [" · ", n.vehicleType]
|
|
121
122
|
})] })]
|
|
122
|
-
}), /* @__PURE__ */
|
|
123
|
+
}), /* @__PURE__ */ p("p", {
|
|
123
124
|
className: "flex items-center gap-2 break-words",
|
|
124
|
-
children: [/* @__PURE__ */
|
|
125
|
+
children: [/* @__PURE__ */ f(a, {
|
|
125
126
|
size: 16,
|
|
126
127
|
className: "shrink-0 text-text-secondary",
|
|
127
128
|
"aria-hidden": "true"
|
|
128
|
-
}), /* @__PURE__ */
|
|
129
|
+
}), /* @__PURE__ */ f("span", { children: n.driverName ?? n.driverId })]
|
|
129
130
|
})]
|
|
130
131
|
}),
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
+
/* @__PURE__ */ f("ul", {
|
|
132
133
|
className: "flex flex-wrap gap-1.5",
|
|
133
|
-
"aria-label":
|
|
134
|
-
children:
|
|
135
|
-
variant:
|
|
136
|
-
children:
|
|
134
|
+
"aria-label": w("movethewheels.dispatch.reasons", "Reasons"),
|
|
135
|
+
children: n.reasons.map((e) => /* @__PURE__ */ f("li", { children: /* @__PURE__ */ f(c, {
|
|
136
|
+
variant: h.has(e) ? "outline" : "secondary",
|
|
137
|
+
children: g(e, w)
|
|
137
138
|
}) }, e))
|
|
138
139
|
}),
|
|
139
|
-
/* @__PURE__ */
|
|
140
|
+
/* @__PURE__ */ f("p", {
|
|
140
141
|
className: "text-sm text-text-secondary",
|
|
141
|
-
children:
|
|
142
|
+
children: n.rationale
|
|
142
143
|
}),
|
|
143
|
-
|
|
144
|
+
n.aiRationale && /* @__PURE__ */ p("p", {
|
|
144
145
|
className: "flex items-start gap-2 rounded-md bg-surface-secondary p-2 text-sm text-text-primary",
|
|
145
|
-
children: [/* @__PURE__ */
|
|
146
|
+
children: [/* @__PURE__ */ f(r, {
|
|
146
147
|
size: 14,
|
|
147
148
|
className: "mt-0.5 shrink-0",
|
|
148
149
|
"aria-hidden": "true"
|
|
149
|
-
}), /* @__PURE__ */
|
|
150
|
+
}), /* @__PURE__ */ p("span", { children: [/* @__PURE__ */ p("span", {
|
|
150
151
|
className: "sr-only",
|
|
151
152
|
children: [
|
|
152
|
-
|
|
153
|
+
w("movethewheels.dispatch.aiWritten", "AI-written"),
|
|
153
154
|
":",
|
|
154
155
|
" "
|
|
155
156
|
]
|
|
156
|
-
}),
|
|
157
|
+
}), n.aiRationale] })]
|
|
157
158
|
}),
|
|
158
|
-
|
|
159
|
+
n.estimatedDistanceKm !== null && /* @__PURE__ */ p("p", {
|
|
159
160
|
className: "text-xs text-text-secondary",
|
|
160
161
|
children: [
|
|
161
|
-
|
|
162
|
+
w("movethewheels.dispatch.distance", "Straight-line distance"),
|
|
162
163
|
" ",
|
|
163
|
-
|
|
164
|
+
n.estimatedDistanceKm,
|
|
164
165
|
" km",
|
|
165
|
-
|
|
166
|
+
n.estimatedDurationMinutes !== null && ` · ~${Math.round(n.estimatedDurationMinutes)} min`
|
|
166
167
|
]
|
|
167
168
|
}),
|
|
168
|
-
|
|
169
|
+
m ? /* @__PURE__ */ p("div", {
|
|
169
170
|
className: "flex flex-wrap gap-2",
|
|
170
171
|
role: "group",
|
|
171
|
-
"aria-label":
|
|
172
|
-
children: [
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
172
|
+
"aria-label": w("movethewheels.dispatch.decide", "Decide this assignment"),
|
|
173
|
+
children: [
|
|
174
|
+
/* @__PURE__ */ p(l, {
|
|
175
|
+
size: "sm",
|
|
176
|
+
variant: y === "accept" ? "default" : "outline",
|
|
177
|
+
"aria-pressed": y === "accept",
|
|
178
|
+
disabled: b,
|
|
179
|
+
onClick: () => x(y === "accept" ? null : "accept"),
|
|
180
|
+
children: [/* @__PURE__ */ f(t, {
|
|
181
|
+
size: 14,
|
|
182
|
+
"aria-hidden": "true"
|
|
183
|
+
}), w("movethewheels.dispatch.accept", "Accept")]
|
|
184
|
+
}),
|
|
185
|
+
/* @__PURE__ */ p(l, {
|
|
186
|
+
size: "sm",
|
|
187
|
+
variant: y === "reject" ? "destructive" : "outline",
|
|
188
|
+
"aria-pressed": y === "reject",
|
|
189
|
+
disabled: b,
|
|
190
|
+
onClick: () => x(y === "reject" ? null : "reject"),
|
|
191
|
+
children: [/* @__PURE__ */ f(o, {
|
|
192
|
+
size: 14,
|
|
193
|
+
"aria-hidden": "true"
|
|
194
|
+
}), w("movethewheels.dispatch.reject", "Reject")]
|
|
195
|
+
}),
|
|
196
|
+
C && /* @__PURE__ */ p(l, {
|
|
197
|
+
size: "sm",
|
|
198
|
+
variant: "ghost",
|
|
199
|
+
disabled: b,
|
|
200
|
+
onClick: () => C(n.shipmentId, n.shipmentNumber),
|
|
201
|
+
children: [/* @__PURE__ */ f(e, {
|
|
202
|
+
size: 14,
|
|
203
|
+
"aria-hidden": "true"
|
|
204
|
+
}), w("movethewheels.carrierDecision.useCarrier", "Use a carrier instead")]
|
|
205
|
+
})
|
|
206
|
+
]
|
|
207
|
+
}) : /* @__PURE__ */ f(v, {
|
|
208
|
+
assignment: n,
|
|
209
|
+
onOpenRoute: S,
|
|
210
|
+
t: w
|
|
197
211
|
})
|
|
198
212
|
]
|
|
199
213
|
})
|
|
200
214
|
});
|
|
201
215
|
}
|
|
202
216
|
//#endregion
|
|
203
|
-
export {
|
|
217
|
+
export { y as DispatchDecisionCard, _ as confidenceTone };
|