@burdenoff/microfe-movethewheels 2026.1016.3 → 2026.1016.4
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/README.md +10 -0
- package/dist/MoveTheWheelsRoot.js +5 -0
- package/dist/MoveTheWheelsRoutes.js +25 -21
- package/dist/components/ContainerEvidencePicker.js +55 -55
- package/dist/components/FleetAlertsPanel.js +2 -2
- package/dist/components/freight-invoice/InvoiceForm.js +366 -0
- package/dist/components/freight-invoice/InvoiceResults.js +240 -0
- package/dist/generated/consolidation-operations.d.ts +195 -265
- package/dist/generated/container-condition-operations.d.ts +124 -187
- package/dist/generated/container-operations.d.ts +59 -85
- package/dist/generated/empty-reuse-operations.d.ts +165 -271
- package/dist/generated/free-time-operations.d.ts +120 -184
- package/dist/generated/freight-cost-operations.d.ts +307 -476
- package/dist/generated/freight-invoice-operations.d.ts +1447 -0
- package/dist/generated/logistics-procedure-operations.d.ts +100 -156
- package/dist/generated/pending-pick-operations.d.ts +769 -1025
- package/dist/generated/shipment-status-authority-operations.d.ts +82 -103
- package/dist/generated/stock-binding-operations.d.ts +188 -260
- package/dist/generated/stock-observation-operations.d.ts +103 -138
- package/dist/generated/tracking-quality-operations.d.ts +27 -41
- package/dist/generated/trip-utilization-operations.d.ts +137 -185
- package/dist/generated/wspace-operations.d.ts +628 -2272
- package/dist/generated/wspace-types.d.ts +4 -23
- package/dist/hooks/useInvoiceComparisonRecovery.js +118 -0
- package/dist/movethewheels/components/ContainerEvidencePicker.d.ts +2 -1
- package/dist/movethewheels/components/freight-invoice/InvoiceForm.d.ts +19 -0
- package/dist/movethewheels/components/freight-invoice/InvoiceResults.d.ts +9 -0
- package/dist/movethewheels/hooks/useFleet.d.ts +1 -1
- package/dist/movethewheels/hooks/useFleetIntelligence.d.ts +1 -1
- package/dist/movethewheels/hooks/useInvoiceComparisonRecovery.d.ts +22 -0
- package/dist/movethewheels/hooks/useProcedureSelection.d.ts +1 -3
- package/dist/movethewheels/pages/FreightInvoicePage.d.ts +10 -0
- package/dist/movethewheels/utils/driverLicenseExpiry.d.ts +6 -0
- package/dist/movethewheels/utils/invoiceComparison.d.ts +32 -0
- package/dist/pages/DriverDetailsPage.js +306 -282
- package/dist/pages/FreightEstimatePage.js +1 -0
- package/dist/pages/FreightInvoicePage.js +346 -0
- package/dist/src/generated/consolidation-operations.js +3961 -503
- package/dist/src/generated/container-condition-operations.js +2968 -206
- package/dist/src/generated/container-operations.js +997 -99
- package/dist/src/generated/empty-reuse-operations.js +4811 -747
- package/dist/src/generated/free-time-operations.js +2824 -233
- package/dist/src/generated/freight-cost-operations.js +4852 -812
- package/dist/src/generated/freight-invoice-operations.js +4894 -0
- package/dist/src/generated/logistics-procedure-operations.js +2707 -360
- package/dist/src/generated/pending-pick-operations.js +8244 -1196
- package/dist/src/generated/shipment-status-authority-operations.js +1157 -84
- package/dist/src/generated/stock-binding-operations.js +2779 -173
- package/dist/src/generated/stock-observation-operations.js +1274 -91
- package/dist/src/generated/tracking-quality-operations.js +407 -42
- package/dist/src/generated/trip-utilization-operations.js +1765 -138
- package/dist/src/generated/wspace-operations.js +428 -706
- package/dist/utils/driverLicenseExpiry.js +14 -0
- package/dist/utils/invoiceComparison.js +272 -0
- package/package.json +29 -29
- package/src/generated/consolidation-operations.ts +60 -559
- package/src/generated/container-condition-operations.ts +63 -265
- package/src/generated/container-operations.ts +37 -132
- package/src/generated/empty-reuse-operations.ts +83 -824
- package/src/generated/free-time-operations.ts +55 -284
- package/src/generated/freight-cost-operations.ts +42 -848
- package/src/generated/freight-invoice-operations.ts +830 -0
- package/src/generated/logistics-procedure-operations.ts +60 -414
- package/src/generated/pending-pick-operations.ts +48 -1239
- package/src/generated/shipment-status-authority-operations.ts +33 -113
- package/src/generated/stock-binding-operations.ts +29 -198
- package/src/generated/stock-observation-operations.ts +24 -111
- package/src/generated/tracking-quality-operations.ts +19 -57
- package/src/generated/trip-utilization-operations.ts +32 -166
- package/src/generated/wspace-operations.ts +284 -2906
- package/src/generated/wspace-types.ts +2 -8
- package/src/movethewheels/MoveTheWheelsRoot.tsx +6 -0
- package/src/movethewheels/MoveTheWheelsRoutes.tsx +2 -0
- package/src/movethewheels/components/ContainerEvidencePicker.tsx +12 -4
- package/src/movethewheels/components/FleetAlertsPanel.tsx +4 -2
- package/src/movethewheels/components/freight-invoice/InvoiceForm.tsx +412 -0
- package/src/movethewheels/components/freight-invoice/InvoiceResults.tsx +162 -0
- package/src/movethewheels/hooks/useFleet.ts +1 -1
- package/src/movethewheels/hooks/useFleetIntelligence.ts +5 -1
- package/src/movethewheels/hooks/useInvoiceComparisonRecovery.ts +227 -0
- package/src/movethewheels/pages/DriverDetailsPage.tsx +35 -9
- package/src/movethewheels/pages/FreightEstimatePage.tsx +1 -0
- package/src/movethewheels/pages/FreightInvoicePage.tsx +477 -0
- package/src/movethewheels/utils/driverLicenseExpiry.ts +25 -0
- package/src/movethewheels/utils/invoiceComparison.ts +520 -0
- package/src/operations/freight-invoice/comparison.graphql +40 -0
- package/src/operations/wspace/freight-invoice-evidence.graphql +6 -0
- package/patches/braces@3.0.3.patch +0 -87
|
@@ -8,14 +8,14 @@ import { SquarePen as o } from "../node_modules/lucide-react/dist/esm/icons/squa
|
|
|
8
8
|
import { Star as s } from "../node_modules/lucide-react/dist/esm/icons/star.js";
|
|
9
9
|
import { StickyNote as ee } from "../node_modules/lucide-react/dist/esm/icons/sticky-note.js";
|
|
10
10
|
import { Trash2 as c } from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
|
|
11
|
-
import { Truck as
|
|
12
|
-
import { UserX as
|
|
13
|
-
import { Users as
|
|
14
|
-
import { joinPath as
|
|
15
|
-
import { useMoveTheWheels as
|
|
16
|
-
import { toApiDriverStatus as
|
|
17
|
-
import { Button as h, Card as g, CardContent as _, CardHeader as v, CardTitle as y, Input as b, Label as x, Select as S, SelectContent as
|
|
18
|
-
import { ErrorState as
|
|
11
|
+
import { Truck as te } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
|
|
12
|
+
import { UserX as l } from "../node_modules/lucide-react/dist/esm/icons/user-x.js";
|
|
13
|
+
import { Users as u } from "../node_modules/lucide-react/dist/esm/icons/users.js";
|
|
14
|
+
import { joinPath as d } from "../utils/navigation.js";
|
|
15
|
+
import { useMoveTheWheels as ne } from "../providers/MoveTheWheelsProvider.js";
|
|
16
|
+
import { toApiDriverStatus as f, useDriver as p, useFleet as m, useVehicle as re, useVehicles as ie } from "../hooks/useFleet.js";
|
|
17
|
+
import { Button as h, Card as g, CardContent as _, CardHeader as v, CardTitle as y, Input as b, Label as x, Select as S, SelectContent as ae, SelectItem as C, SelectTrigger as w, SelectValue as T, Textarea as E } from "../components/ui.js";
|
|
18
|
+
import { ErrorState as oe, LoadingState as D, PageLayout as O } from "../components/PageLayout.js";
|
|
19
19
|
import { DRIVER_STATUS_LABELS as k } from "../constants/index.js";
|
|
20
20
|
import { StatusBadge as A } from "../components/StatusBadge.js";
|
|
21
21
|
import { FormError as j } from "../components/FormError.js";
|
|
@@ -24,15 +24,16 @@ import { DocumentsCard as P } from "../components/DocumentsCard.js";
|
|
|
24
24
|
import { useDebouncedValue as se } from "../hooks/useDebouncedValue.js";
|
|
25
25
|
import { EntityCombobox as ce } from "../components/EntityCombobox.js";
|
|
26
26
|
import { useRefetchOnLeaveEdit as F } from "../hooks/useRefetchOnLeaveEdit.js";
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
27
|
+
import { driverLicenseExpiryInput as le, driverLicenseExpiryUpdate as ue, parseDriverLicenseExpiry as de } from "../utils/driverLicenseExpiry.js";
|
|
28
|
+
import { useEffect as fe, useState as I } from "react";
|
|
29
|
+
import { useLocation as L, useParams as pe } from "react-router";
|
|
30
|
+
import { Fragment as me, jsx as R, jsxs as z } from "react/jsx-runtime";
|
|
31
|
+
import { EmphasisPanel as he, NextSteps as B, PagePurpose as V, ResponsiveDialog as H, ResponsiveDialogContent as U, ResponsiveDialogDescription as W, ResponsiveDialogFooter as G, ResponsiveDialogHeader as ge, ResponsiveDialogTitle as _e } from "@burdenoff/fe-libs/ui";
|
|
31
32
|
//#region src/movethewheels/pages/DriverDetailsPage.tsx
|
|
32
|
-
var
|
|
33
|
+
var ve = Object.entries(k).map(([e, t]) => ({
|
|
33
34
|
value: e,
|
|
34
35
|
label: t
|
|
35
|
-
})),
|
|
36
|
+
})), ye = (e) => e ? e.toISOString().slice(0, 10) : "", be = (e) => e ? `${e}T12:00:00.000Z` : void 0, xe = {
|
|
36
37
|
employeeId: "",
|
|
37
38
|
firstName: "",
|
|
38
39
|
lastName: "",
|
|
@@ -53,173 +54,173 @@ var _e = Object.entries(k).map(([e, t]) => ({
|
|
|
53
54
|
onLeaveUntil: ""
|
|
54
55
|
};
|
|
55
56
|
function K({ editId: t }) {
|
|
56
|
-
let { basePath: r, navigate: i } =
|
|
57
|
+
let { basePath: r, navigate: i } = ne(), { createDriver: o, updateDriver: s, deleteDriver: oe } = m(), { driver: D, refetch: k } = p(t), A = !!t, [M, P] = I(xe), [F, L] = I(!1), [pe, B] = I(null), [K, q] = I(!1), [J, Se] = I(""), [Y, Ce] = I(!1), [we, X] = I(null), [Te, Z] = I(!1), [Q, Ee] = I(!1), [De, Oe] = I(null), [ke, Ae] = I(""), { vehicles: je, isLoading: Me, isLoadingMore: Ne, hasMore: Pe, totalVehicles: Fe, loadMore: Ie } = ie({
|
|
57
58
|
limit: 20,
|
|
58
|
-
search: se(
|
|
59
|
-
}), { vehicle:
|
|
60
|
-
|
|
61
|
-
if (!t || !
|
|
62
|
-
let [e, ...n] =
|
|
59
|
+
search: se(ke) || void 0
|
|
60
|
+
}), { vehicle: Le, isLoading: Re } = re(M.vehicleId || void 0);
|
|
61
|
+
fe(() => {
|
|
62
|
+
if (!t || !D) return;
|
|
63
|
+
let [e, ...n] = D.fullName.trim().split(/\s+/);
|
|
63
64
|
P({
|
|
64
|
-
employeeId:
|
|
65
|
+
employeeId: D.employeeId || "",
|
|
65
66
|
firstName: e || "",
|
|
66
67
|
lastName: n.join(" "),
|
|
67
|
-
email:
|
|
68
|
-
phone:
|
|
69
|
-
licenseNumber:
|
|
70
|
-
licenseClass:
|
|
71
|
-
licenseExpiry:
|
|
72
|
-
status:
|
|
73
|
-
vehicleId:
|
|
74
|
-
vehicleIds:
|
|
75
|
-
rating:
|
|
76
|
-
notes:
|
|
77
|
-
hireDate:
|
|
78
|
-
baseSalary:
|
|
79
|
-
bonusYtd:
|
|
80
|
-
payCurrency:
|
|
81
|
-
onLeaveUntil:
|
|
68
|
+
email: D.email || "",
|
|
69
|
+
phone: D.phone || "",
|
|
70
|
+
licenseNumber: D.licenseNumber || "",
|
|
71
|
+
licenseClass: D.licenseType || "",
|
|
72
|
+
licenseExpiry: le(D.licenseExpiry),
|
|
73
|
+
status: D.status,
|
|
74
|
+
vehicleId: D.assignedVehicle || "",
|
|
75
|
+
vehicleIds: D.vehicleIds,
|
|
76
|
+
rating: D.rating ? String(D.rating) : "",
|
|
77
|
+
notes: D.notes || "",
|
|
78
|
+
hireDate: ye(D.hireDate),
|
|
79
|
+
baseSalary: D.baseSalary === void 0 ? "" : String(D.baseSalary),
|
|
80
|
+
bonusYtd: D.bonusYtd === void 0 ? "" : String(D.bonusYtd),
|
|
81
|
+
payCurrency: D.payCurrency || "",
|
|
82
|
+
onLeaveUntil: ye(D.onLeaveUntil)
|
|
82
83
|
});
|
|
83
|
-
}, [t,
|
|
84
|
-
let
|
|
84
|
+
}, [t, D]);
|
|
85
|
+
let ze = () => i?.(d(r, "fleet/drivers")), $ = (e = !0) => ({
|
|
85
86
|
firstName: M.firstName.trim(),
|
|
86
87
|
lastName: M.lastName.trim(),
|
|
87
88
|
email: M.email.trim() || void 0,
|
|
88
89
|
phone: M.phone.trim() || void 0,
|
|
89
90
|
licenseNumber: M.licenseNumber.trim() || void 0,
|
|
90
91
|
licenseClass: M.licenseClass.trim() || void 0,
|
|
91
|
-
licenseExpiry:
|
|
92
|
-
status:
|
|
92
|
+
licenseExpiry: A ? ue(M.licenseExpiry, D?.licenseExpiry) : de(M.licenseExpiry),
|
|
93
|
+
status: f(M.status),
|
|
93
94
|
vehicleId: M.vehicleId || null,
|
|
94
95
|
vehicleIds: M.vehicleIds,
|
|
95
96
|
rating: M.rating.trim() ? Number(M.rating) : void 0,
|
|
96
97
|
notes: M.notes.trim() || void 0,
|
|
97
|
-
hireDate:
|
|
98
|
+
hireDate: be(M.hireDate),
|
|
98
99
|
baseSalary: M.baseSalary.trim() ? Number(M.baseSalary) : void 0,
|
|
99
100
|
bonusYtd: M.bonusYtd.trim() ? Number(M.bonusYtd) : void 0,
|
|
100
101
|
payCurrency: M.payCurrency.trim() || void 0,
|
|
101
|
-
...e ? { onLeaveUntil:
|
|
102
|
-
}),
|
|
102
|
+
...e ? { onLeaveUntil: be(M.onLeaveUntil) ?? null } : {}
|
|
103
|
+
}), Be = () => ({
|
|
103
104
|
employeeId: M.employeeId.trim(),
|
|
104
105
|
...$(!1)
|
|
105
|
-
}),
|
|
106
|
+
}), Ve = async (e) => {
|
|
106
107
|
if (e.preventDefault(), !M.employeeId.trim() || !M.firstName.trim() || !M.lastName.trim()) {
|
|
107
|
-
|
|
108
|
+
B("Employee ID, first name and last name are required.");
|
|
108
109
|
return;
|
|
109
110
|
}
|
|
110
111
|
if (!M.phone.trim()) {
|
|
111
|
-
|
|
112
|
+
B("Phone is required so this driver can be reached.");
|
|
112
113
|
return;
|
|
113
114
|
}
|
|
114
|
-
L(!0),
|
|
115
|
+
L(!0), B(null);
|
|
115
116
|
try {
|
|
116
117
|
if (t) {
|
|
117
118
|
let e = await s(t, $());
|
|
118
|
-
i?.(
|
|
119
|
+
i?.(d(r, `fleet/drivers/${e.id}`));
|
|
119
120
|
} else {
|
|
120
|
-
let e = await o(
|
|
121
|
-
i?.(
|
|
121
|
+
let e = await o(Be());
|
|
122
|
+
i?.(d(r, `fleet/drivers/${e.id}`));
|
|
122
123
|
}
|
|
123
124
|
} catch (e) {
|
|
124
|
-
console.error("Failed to save driver:", e),
|
|
125
|
+
console.error("Failed to save driver:", e), B(e instanceof Error ? e.message : "Failed to save driver. Please try again."), L(!1);
|
|
125
126
|
}
|
|
126
|
-
},
|
|
127
|
+
}, He = async () => {
|
|
127
128
|
if (!t || !J.trim()) {
|
|
128
129
|
X("A reason is required to dismiss a driver.");
|
|
129
130
|
return;
|
|
130
131
|
}
|
|
131
|
-
|
|
132
|
+
Ce(!0), X(null);
|
|
132
133
|
try {
|
|
133
134
|
await s(t, {
|
|
134
135
|
...$(),
|
|
135
136
|
terminatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
136
137
|
terminationReason: J.trim()
|
|
137
|
-
}), q(!1), await k(), i?.(
|
|
138
|
+
}), q(!1), await k(), i?.(d(r, `fleet/drivers/${t}`));
|
|
138
139
|
} catch (e) {
|
|
139
140
|
X(e instanceof Error ? e.message : "Failed to dismiss driver.");
|
|
140
141
|
} finally {
|
|
141
|
-
|
|
142
|
+
Ce(!1);
|
|
142
143
|
}
|
|
143
|
-
},
|
|
144
|
+
}, Ue = async () => {
|
|
144
145
|
if (t) {
|
|
145
|
-
|
|
146
|
+
Ee(!0), Oe(null);
|
|
146
147
|
try {
|
|
147
|
-
await
|
|
148
|
+
await oe(t), Z(!1), i?.(d(r, "fleet/drivers"));
|
|
148
149
|
} catch (e) {
|
|
149
|
-
|
|
150
|
+
Oe(e instanceof Error ? e.message : "Failed to delete driver.");
|
|
150
151
|
} finally {
|
|
151
|
-
|
|
152
|
+
Ee(!1);
|
|
152
153
|
}
|
|
153
154
|
}
|
|
154
|
-
},
|
|
155
|
-
return /* @__PURE__ */
|
|
155
|
+
}, We = A && !!D?.terminatedAt;
|
|
156
|
+
return /* @__PURE__ */ z(O, {
|
|
156
157
|
title: A ? "Edit Driver" : "Add Driver",
|
|
157
158
|
subtitle: "Add a driver to your workforce",
|
|
158
|
-
icon: /* @__PURE__ */
|
|
159
|
-
headerActions: /* @__PURE__ */
|
|
159
|
+
icon: /* @__PURE__ */ R(u, { size: 24 }),
|
|
160
|
+
headerActions: /* @__PURE__ */ z("div", {
|
|
160
161
|
className: "flex gap-2",
|
|
161
|
-
children: [/* @__PURE__ */
|
|
162
|
+
children: [/* @__PURE__ */ z(h, {
|
|
162
163
|
variant: "outline",
|
|
163
|
-
onClick:
|
|
164
|
+
onClick: ze,
|
|
164
165
|
disabled: F,
|
|
165
|
-
children: [/* @__PURE__ */
|
|
166
|
-
}), /* @__PURE__ */
|
|
167
|
-
onClick:
|
|
166
|
+
children: [/* @__PURE__ */ R(e, { size: 16 }), " Cancel"]
|
|
167
|
+
}), /* @__PURE__ */ z(h, {
|
|
168
|
+
onClick: Ve,
|
|
168
169
|
disabled: F,
|
|
169
170
|
children: [
|
|
170
|
-
/* @__PURE__ */
|
|
171
|
+
/* @__PURE__ */ R(a, { size: 16 }),
|
|
171
172
|
" ",
|
|
172
173
|
A ? F ? "Saving..." : "Save Changes" : F ? "Saving..." : "Add Driver"
|
|
173
174
|
]
|
|
174
175
|
})]
|
|
175
176
|
}),
|
|
176
177
|
children: [
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
-
icon: /* @__PURE__ */
|
|
178
|
+
/* @__PURE__ */ R(V, {
|
|
179
|
+
icon: /* @__PURE__ */ R(u, { size: 18 }),
|
|
179
180
|
children: "Add a driver so they can be assigned to orders and routes. An employee ID, name and phone get them on the roster — add licensing, a vehicle and HR details to keep the record complete."
|
|
180
181
|
}),
|
|
181
|
-
|
|
182
|
+
We && D?.terminatedAt && /* @__PURE__ */ z("div", {
|
|
182
183
|
className: "rounded-card border border-status-error-border bg-status-error-bg-subtle p-4 text-sm text-status-error-text",
|
|
183
|
-
children: [/* @__PURE__ */
|
|
184
|
+
children: [/* @__PURE__ */ z("p", {
|
|
184
185
|
className: "font-medium",
|
|
185
186
|
children: [
|
|
186
187
|
"This driver was dismissed on ",
|
|
187
|
-
N(
|
|
188
|
+
N(D.terminatedAt, "full"),
|
|
188
189
|
"."
|
|
189
190
|
]
|
|
190
|
-
}),
|
|
191
|
+
}), D.terminationReason && /* @__PURE__ */ z("p", {
|
|
191
192
|
className: "mt-1",
|
|
192
|
-
children: ["Reason: ",
|
|
193
|
+
children: ["Reason: ", D.terminationReason]
|
|
193
194
|
})]
|
|
194
195
|
}),
|
|
195
|
-
/* @__PURE__ */
|
|
196
|
-
onSubmit:
|
|
196
|
+
/* @__PURE__ */ z("form", {
|
|
197
|
+
onSubmit: Ve,
|
|
197
198
|
className: "max-w-3xl space-y-6",
|
|
198
199
|
children: [
|
|
199
|
-
/* @__PURE__ */
|
|
200
|
-
/* @__PURE__ */
|
|
200
|
+
/* @__PURE__ */ R(j, { message: pe }),
|
|
201
|
+
/* @__PURE__ */ z(he, { children: [/* @__PURE__ */ R("h2", {
|
|
201
202
|
className: "text-base font-semibold text-text-primary mb-4",
|
|
202
203
|
children: "Driver Details"
|
|
203
|
-
}), /* @__PURE__ */
|
|
204
|
+
}), /* @__PURE__ */ z("div", {
|
|
204
205
|
className: "space-y-4",
|
|
205
206
|
children: [
|
|
206
|
-
/* @__PURE__ */
|
|
207
|
+
/* @__PURE__ */ z("div", {
|
|
207
208
|
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
208
209
|
children: [
|
|
209
|
-
/* @__PURE__ */
|
|
210
|
+
/* @__PURE__ */ z("div", {
|
|
210
211
|
className: "space-y-2",
|
|
211
|
-
children: [/* @__PURE__ */
|
|
212
|
+
children: [/* @__PURE__ */ z(x, {
|
|
212
213
|
htmlFor: "employeeId",
|
|
213
214
|
children: [
|
|
214
215
|
"Employee ID ",
|
|
215
216
|
A ? "(immutable)" : "",
|
|
216
217
|
" ",
|
|
217
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ R("span", {
|
|
218
219
|
className: "text-status-error-text",
|
|
219
220
|
children: !A && "*"
|
|
220
221
|
})
|
|
221
222
|
]
|
|
222
|
-
}), /* @__PURE__ */
|
|
223
|
+
}), /* @__PURE__ */ R(b, {
|
|
223
224
|
id: "employeeId",
|
|
224
225
|
value: M.employeeId,
|
|
225
226
|
onChange: (e) => P((t) => ({
|
|
@@ -231,15 +232,15 @@ function K({ editId: t }) {
|
|
|
231
232
|
disabled: A
|
|
232
233
|
})]
|
|
233
234
|
}),
|
|
234
|
-
/* @__PURE__ */
|
|
235
|
+
/* @__PURE__ */ z("div", {
|
|
235
236
|
className: "space-y-2",
|
|
236
|
-
children: [/* @__PURE__ */
|
|
237
|
+
children: [/* @__PURE__ */ z(x, {
|
|
237
238
|
htmlFor: "firstName",
|
|
238
|
-
children: ["First Name ", /* @__PURE__ */
|
|
239
|
+
children: ["First Name ", /* @__PURE__ */ R("span", {
|
|
239
240
|
className: "text-status-error-text",
|
|
240
241
|
children: "*"
|
|
241
242
|
})]
|
|
242
|
-
}), /* @__PURE__ */
|
|
243
|
+
}), /* @__PURE__ */ R(b, {
|
|
243
244
|
id: "firstName",
|
|
244
245
|
value: M.firstName,
|
|
245
246
|
onChange: (e) => P((t) => ({
|
|
@@ -250,15 +251,15 @@ function K({ editId: t }) {
|
|
|
250
251
|
required: !0
|
|
251
252
|
})]
|
|
252
253
|
}),
|
|
253
|
-
/* @__PURE__ */
|
|
254
|
+
/* @__PURE__ */ z("div", {
|
|
254
255
|
className: "space-y-2",
|
|
255
|
-
children: [/* @__PURE__ */
|
|
256
|
+
children: [/* @__PURE__ */ z(x, {
|
|
256
257
|
htmlFor: "lastName",
|
|
257
|
-
children: ["Last Name ", /* @__PURE__ */
|
|
258
|
+
children: ["Last Name ", /* @__PURE__ */ R("span", {
|
|
258
259
|
className: "text-status-error-text",
|
|
259
260
|
children: "*"
|
|
260
261
|
})]
|
|
261
|
-
}), /* @__PURE__ */
|
|
262
|
+
}), /* @__PURE__ */ R(b, {
|
|
262
263
|
id: "lastName",
|
|
263
264
|
value: M.lastName,
|
|
264
265
|
onChange: (e) => P((t) => ({
|
|
@@ -271,15 +272,15 @@ function K({ editId: t }) {
|
|
|
271
272
|
})
|
|
272
273
|
]
|
|
273
274
|
}),
|
|
274
|
-
/* @__PURE__ */
|
|
275
|
+
/* @__PURE__ */ z("div", {
|
|
275
276
|
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
276
277
|
children: [
|
|
277
|
-
/* @__PURE__ */
|
|
278
|
+
/* @__PURE__ */ z("div", {
|
|
278
279
|
className: "space-y-2",
|
|
279
|
-
children: [/* @__PURE__ */
|
|
280
|
+
children: [/* @__PURE__ */ R(x, {
|
|
280
281
|
htmlFor: "email",
|
|
281
282
|
children: "Email"
|
|
282
|
-
}), /* @__PURE__ */
|
|
283
|
+
}), /* @__PURE__ */ R(b, {
|
|
283
284
|
id: "email",
|
|
284
285
|
type: "email",
|
|
285
286
|
value: M.email,
|
|
@@ -290,15 +291,15 @@ function K({ editId: t }) {
|
|
|
290
291
|
placeholder: "jane.doe@example.com"
|
|
291
292
|
})]
|
|
292
293
|
}),
|
|
293
|
-
/* @__PURE__ */
|
|
294
|
+
/* @__PURE__ */ z("div", {
|
|
294
295
|
className: "space-y-2",
|
|
295
|
-
children: [/* @__PURE__ */
|
|
296
|
+
children: [/* @__PURE__ */ z(x, {
|
|
296
297
|
htmlFor: "phone",
|
|
297
|
-
children: ["Phone ", /* @__PURE__ */
|
|
298
|
+
children: ["Phone ", /* @__PURE__ */ R("span", {
|
|
298
299
|
className: "text-status-error-text",
|
|
299
300
|
children: "*"
|
|
300
301
|
})]
|
|
301
|
-
}), /* @__PURE__ */
|
|
302
|
+
}), /* @__PURE__ */ R(b, {
|
|
302
303
|
id: "phone",
|
|
303
304
|
value: M.phone,
|
|
304
305
|
onChange: (e) => P((t) => ({
|
|
@@ -309,21 +310,21 @@ function K({ editId: t }) {
|
|
|
309
310
|
required: !0
|
|
310
311
|
})]
|
|
311
312
|
}),
|
|
312
|
-
/* @__PURE__ */
|
|
313
|
+
/* @__PURE__ */ z("div", {
|
|
313
314
|
className: "space-y-2",
|
|
314
|
-
children: [/* @__PURE__ */
|
|
315
|
+
children: [/* @__PURE__ */ R(x, {
|
|
315
316
|
htmlFor: "status",
|
|
316
317
|
children: "Status"
|
|
317
|
-
}), /* @__PURE__ */
|
|
318
|
+
}), /* @__PURE__ */ z(S, {
|
|
318
319
|
value: M.status,
|
|
319
320
|
onValueChange: (e) => P((t) => ({
|
|
320
321
|
...t,
|
|
321
322
|
status: e
|
|
322
323
|
})),
|
|
323
|
-
children: [/* @__PURE__ */
|
|
324
|
+
children: [/* @__PURE__ */ R(w, {
|
|
324
325
|
id: "status",
|
|
325
|
-
children: /* @__PURE__ */
|
|
326
|
-
}), /* @__PURE__ */
|
|
326
|
+
children: /* @__PURE__ */ R(T, {})
|
|
327
|
+
}), /* @__PURE__ */ R(ae, { children: ve.map((e) => /* @__PURE__ */ R(C, {
|
|
327
328
|
value: e.value,
|
|
328
329
|
children: e.label
|
|
329
330
|
}, e.value)) })]
|
|
@@ -331,15 +332,15 @@ function K({ editId: t }) {
|
|
|
331
332
|
})
|
|
332
333
|
]
|
|
333
334
|
}),
|
|
334
|
-
/* @__PURE__ */
|
|
335
|
+
/* @__PURE__ */ z("div", {
|
|
335
336
|
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
336
337
|
children: [
|
|
337
|
-
/* @__PURE__ */
|
|
338
|
+
/* @__PURE__ */ z("div", {
|
|
338
339
|
className: "space-y-2",
|
|
339
|
-
children: [/* @__PURE__ */
|
|
340
|
+
children: [/* @__PURE__ */ R(x, {
|
|
340
341
|
htmlFor: "licenseNumber",
|
|
341
342
|
children: "License Number"
|
|
342
|
-
}), /* @__PURE__ */
|
|
343
|
+
}), /* @__PURE__ */ R(b, {
|
|
343
344
|
id: "licenseNumber",
|
|
344
345
|
value: M.licenseNumber,
|
|
345
346
|
onChange: (e) => P((t) => ({
|
|
@@ -349,12 +350,12 @@ function K({ editId: t }) {
|
|
|
349
350
|
placeholder: "D1234567"
|
|
350
351
|
})]
|
|
351
352
|
}),
|
|
352
|
-
/* @__PURE__ */
|
|
353
|
+
/* @__PURE__ */ z("div", {
|
|
353
354
|
className: "space-y-2",
|
|
354
|
-
children: [/* @__PURE__ */
|
|
355
|
+
children: [/* @__PURE__ */ R(x, {
|
|
355
356
|
htmlFor: "licenseClass",
|
|
356
357
|
children: "License Class"
|
|
357
|
-
}), /* @__PURE__ */
|
|
358
|
+
}), /* @__PURE__ */ R(b, {
|
|
358
359
|
id: "licenseClass",
|
|
359
360
|
value: M.licenseClass,
|
|
360
361
|
onChange: (e) => P((t) => ({
|
|
@@ -364,42 +365,65 @@ function K({ editId: t }) {
|
|
|
364
365
|
placeholder: "Class A"
|
|
365
366
|
})]
|
|
366
367
|
}),
|
|
367
|
-
/* @__PURE__ */
|
|
368
|
-
className: "space-y-2",
|
|
369
|
-
children: [
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
368
|
+
/* @__PURE__ */ z("div", {
|
|
369
|
+
className: "space-y-2 md:col-span-3",
|
|
370
|
+
children: [
|
|
371
|
+
/* @__PURE__ */ z("div", {
|
|
372
|
+
className: "flex items-center justify-between gap-2",
|
|
373
|
+
children: [/* @__PURE__ */ R(x, {
|
|
374
|
+
htmlFor: "licenseExpiry",
|
|
375
|
+
children: "Licence expiry (UTC)"
|
|
376
|
+
}), M.licenseExpiry && /* @__PURE__ */ R(h, {
|
|
377
|
+
type: "button",
|
|
378
|
+
variant: "ghost",
|
|
379
|
+
size: "sm",
|
|
380
|
+
"aria-label": "Clear recorded licence expiry",
|
|
381
|
+
onClick: () => P((e) => ({
|
|
382
|
+
...e,
|
|
383
|
+
licenseExpiry: ""
|
|
384
|
+
})),
|
|
385
|
+
children: "Clear"
|
|
386
|
+
})]
|
|
387
|
+
}),
|
|
388
|
+
/* @__PURE__ */ R(b, {
|
|
389
|
+
id: "licenseExpiry",
|
|
390
|
+
type: "datetime-local",
|
|
391
|
+
step: "0.001",
|
|
392
|
+
"aria-describedby": "licenseExpiryHelp",
|
|
393
|
+
value: M.licenseExpiry,
|
|
394
|
+
onChange: (e) => P((t) => ({
|
|
395
|
+
...t,
|
|
396
|
+
licenseExpiry: e.target.value
|
|
397
|
+
}))
|
|
398
|
+
}),
|
|
399
|
+
/* @__PURE__ */ R("p", {
|
|
400
|
+
id: "licenseExpiryHelp",
|
|
401
|
+
className: "text-xs text-text-secondary",
|
|
402
|
+
children: "Enter the recorded UTC time. Blank means expiry not recorded; clearing removes it. A recorded expiry does not certify legal driving eligibility."
|
|
403
|
+
})
|
|
404
|
+
]
|
|
381
405
|
})
|
|
382
406
|
]
|
|
383
407
|
}),
|
|
384
|
-
/* @__PURE__ */
|
|
408
|
+
/* @__PURE__ */ z("div", {
|
|
385
409
|
className: "grid grid-cols-1 md:grid-cols-2 gap-4",
|
|
386
|
-
children: [/* @__PURE__ */
|
|
410
|
+
children: [/* @__PURE__ */ z("div", {
|
|
387
411
|
className: "space-y-2",
|
|
388
|
-
children: [/* @__PURE__ */
|
|
412
|
+
children: [/* @__PURE__ */ R(x, {
|
|
389
413
|
htmlFor: "vehicleSearch",
|
|
390
414
|
children: "Search vehicles"
|
|
391
|
-
}), /* @__PURE__ */
|
|
415
|
+
}), /* @__PURE__ */ R(b, {
|
|
392
416
|
id: "vehicleSearch",
|
|
393
|
-
value:
|
|
394
|
-
onChange: (e) =>
|
|
417
|
+
value: ke,
|
|
418
|
+
onChange: (e) => Ae(e.target.value),
|
|
395
419
|
placeholder: "Vehicle number or type"
|
|
396
420
|
})]
|
|
397
|
-
}), /* @__PURE__ */
|
|
421
|
+
}), /* @__PURE__ */ z("div", {
|
|
398
422
|
className: "space-y-2",
|
|
399
|
-
children: [/* @__PURE__ */
|
|
423
|
+
children: [/* @__PURE__ */ R(x, {
|
|
400
424
|
htmlFor: "vehicle",
|
|
401
425
|
children: "Assigned Vehicle"
|
|
402
|
-
}), /* @__PURE__ */
|
|
426
|
+
}), /* @__PURE__ */ R(ce, {
|
|
403
427
|
id: "vehicle",
|
|
404
428
|
value: M.vehicleId,
|
|
405
429
|
onChange: (e) => P((t) => ({
|
|
@@ -407,12 +431,12 @@ function K({ editId: t }) {
|
|
|
407
431
|
vehicleId: e,
|
|
408
432
|
vehicleIds: e ? [e] : []
|
|
409
433
|
})),
|
|
410
|
-
options:
|
|
411
|
-
loading:
|
|
434
|
+
options: je,
|
|
435
|
+
loading: Me,
|
|
412
436
|
getId: (e) => e.id,
|
|
413
437
|
getLabel: (e) => `${e.vehicleNumber} (${e.type})`,
|
|
414
|
-
renderOption: (e) => /* @__PURE__ */
|
|
415
|
-
/* @__PURE__ */
|
|
438
|
+
renderOption: (e) => /* @__PURE__ */ z(me, { children: [
|
|
439
|
+
/* @__PURE__ */ R(te, {
|
|
416
440
|
size: 14,
|
|
417
441
|
className: "mr-2 inline text-text-secondary"
|
|
418
442
|
}),
|
|
@@ -421,26 +445,26 @@ function K({ editId: t }) {
|
|
|
421
445
|
e.type,
|
|
422
446
|
")"
|
|
423
447
|
] }),
|
|
424
|
-
selectedOption:
|
|
425
|
-
selectedLoading:
|
|
426
|
-
hasMore:
|
|
427
|
-
totalCount:
|
|
428
|
-
onLoadMore:
|
|
429
|
-
loadingMore:
|
|
448
|
+
selectedOption: Le,
|
|
449
|
+
selectedLoading: Re,
|
|
450
|
+
hasMore: Pe,
|
|
451
|
+
totalCount: Fe,
|
|
452
|
+
onLoadMore: Ie,
|
|
453
|
+
loadingMore: Ne,
|
|
430
454
|
placeholder: "Unassigned",
|
|
431
455
|
emptyText: "No vehicles match that search."
|
|
432
456
|
})]
|
|
433
457
|
})]
|
|
434
458
|
}),
|
|
435
|
-
/* @__PURE__ */
|
|
459
|
+
/* @__PURE__ */ z("div", {
|
|
436
460
|
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
437
461
|
children: [
|
|
438
|
-
/* @__PURE__ */
|
|
462
|
+
/* @__PURE__ */ z("div", {
|
|
439
463
|
className: "space-y-2",
|
|
440
|
-
children: [/* @__PURE__ */
|
|
464
|
+
children: [/* @__PURE__ */ R(x, {
|
|
441
465
|
htmlFor: "rating",
|
|
442
466
|
children: "Rating (0–5)"
|
|
443
|
-
}), /* @__PURE__ */
|
|
467
|
+
}), /* @__PURE__ */ R(b, {
|
|
444
468
|
id: "rating",
|
|
445
469
|
type: "number",
|
|
446
470
|
min: 0,
|
|
@@ -454,12 +478,12 @@ function K({ editId: t }) {
|
|
|
454
478
|
placeholder: "4.8"
|
|
455
479
|
})]
|
|
456
480
|
}),
|
|
457
|
-
/* @__PURE__ */
|
|
481
|
+
/* @__PURE__ */ z("div", {
|
|
458
482
|
className: "space-y-2",
|
|
459
|
-
children: [/* @__PURE__ */
|
|
483
|
+
children: [/* @__PURE__ */ R(x, {
|
|
460
484
|
htmlFor: "hireDate",
|
|
461
485
|
children: "Hire Date"
|
|
462
|
-
}), /* @__PURE__ */
|
|
486
|
+
}), /* @__PURE__ */ R(b, {
|
|
463
487
|
id: "hireDate",
|
|
464
488
|
type: "date",
|
|
465
489
|
value: M.hireDate,
|
|
@@ -469,14 +493,14 @@ function K({ editId: t }) {
|
|
|
469
493
|
}))
|
|
470
494
|
})]
|
|
471
495
|
}),
|
|
472
|
-
/* @__PURE__ */
|
|
496
|
+
/* @__PURE__ */ z("div", {
|
|
473
497
|
className: "space-y-2",
|
|
474
|
-
children: [/* @__PURE__ */
|
|
498
|
+
children: [/* @__PURE__ */ z("div", {
|
|
475
499
|
className: "flex items-center justify-between gap-2",
|
|
476
|
-
children: [/* @__PURE__ */
|
|
500
|
+
children: [/* @__PURE__ */ R(x, {
|
|
477
501
|
htmlFor: "onLeaveUntil",
|
|
478
502
|
children: "On Leave Until"
|
|
479
|
-
}), M.onLeaveUntil && /* @__PURE__ */
|
|
503
|
+
}), M.onLeaveUntil && /* @__PURE__ */ R(h, {
|
|
480
504
|
type: "button",
|
|
481
505
|
variant: "ghost",
|
|
482
506
|
size: "sm",
|
|
@@ -486,7 +510,7 @@ function K({ editId: t }) {
|
|
|
486
510
|
})),
|
|
487
511
|
children: "Clear"
|
|
488
512
|
})]
|
|
489
|
-
}), /* @__PURE__ */
|
|
513
|
+
}), /* @__PURE__ */ R(b, {
|
|
490
514
|
id: "onLeaveUntil",
|
|
491
515
|
type: "date",
|
|
492
516
|
value: M.onLeaveUntil,
|
|
@@ -500,18 +524,18 @@ function K({ editId: t }) {
|
|
|
500
524
|
})
|
|
501
525
|
]
|
|
502
526
|
})] }),
|
|
503
|
-
/* @__PURE__ */
|
|
527
|
+
/* @__PURE__ */ z(g, { children: [/* @__PURE__ */ R(v, { children: /* @__PURE__ */ z(y, {
|
|
504
528
|
className: "flex items-center gap-2",
|
|
505
|
-
children: [/* @__PURE__ */
|
|
506
|
-
}) }), /* @__PURE__ */
|
|
529
|
+
children: [/* @__PURE__ */ R(n, { size: 18 }), " Compensation"]
|
|
530
|
+
}) }), /* @__PURE__ */ R(_, { children: /* @__PURE__ */ z("div", {
|
|
507
531
|
className: "grid grid-cols-1 md:grid-cols-3 gap-4",
|
|
508
532
|
children: [
|
|
509
|
-
/* @__PURE__ */
|
|
533
|
+
/* @__PURE__ */ z("div", {
|
|
510
534
|
className: "space-y-2",
|
|
511
|
-
children: [/* @__PURE__ */
|
|
535
|
+
children: [/* @__PURE__ */ R(x, {
|
|
512
536
|
htmlFor: "baseSalary",
|
|
513
537
|
children: "Base Salary (annual)"
|
|
514
|
-
}), /* @__PURE__ */
|
|
538
|
+
}), /* @__PURE__ */ R(b, {
|
|
515
539
|
id: "baseSalary",
|
|
516
540
|
type: "number",
|
|
517
541
|
min: 0,
|
|
@@ -524,12 +548,12 @@ function K({ editId: t }) {
|
|
|
524
548
|
placeholder: "55000"
|
|
525
549
|
})]
|
|
526
550
|
}),
|
|
527
|
-
/* @__PURE__ */
|
|
551
|
+
/* @__PURE__ */ z("div", {
|
|
528
552
|
className: "space-y-2",
|
|
529
|
-
children: [/* @__PURE__ */
|
|
553
|
+
children: [/* @__PURE__ */ R(x, {
|
|
530
554
|
htmlFor: "bonusYtd",
|
|
531
555
|
children: "Bonus (YTD)"
|
|
532
|
-
}), /* @__PURE__ */
|
|
556
|
+
}), /* @__PURE__ */ R(b, {
|
|
533
557
|
id: "bonusYtd",
|
|
534
558
|
type: "number",
|
|
535
559
|
min: 0,
|
|
@@ -542,12 +566,12 @@ function K({ editId: t }) {
|
|
|
542
566
|
placeholder: "1200"
|
|
543
567
|
})]
|
|
544
568
|
}),
|
|
545
|
-
/* @__PURE__ */
|
|
569
|
+
/* @__PURE__ */ z("div", {
|
|
546
570
|
className: "space-y-2",
|
|
547
|
-
children: [/* @__PURE__ */
|
|
571
|
+
children: [/* @__PURE__ */ R(x, {
|
|
548
572
|
htmlFor: "payCurrency",
|
|
549
573
|
children: "Currency"
|
|
550
|
-
}), /* @__PURE__ */
|
|
574
|
+
}), /* @__PURE__ */ R(b, {
|
|
551
575
|
id: "payCurrency",
|
|
552
576
|
value: M.payCurrency,
|
|
553
577
|
onChange: (e) => P((t) => ({
|
|
@@ -560,10 +584,10 @@ function K({ editId: t }) {
|
|
|
560
584
|
})
|
|
561
585
|
]
|
|
562
586
|
}) })] }),
|
|
563
|
-
/* @__PURE__ */
|
|
587
|
+
/* @__PURE__ */ z(g, { children: [/* @__PURE__ */ R(v, { children: /* @__PURE__ */ z(y, {
|
|
564
588
|
className: "flex items-center gap-2",
|
|
565
|
-
children: [/* @__PURE__ */
|
|
566
|
-
}) }), /* @__PURE__ */
|
|
589
|
+
children: [/* @__PURE__ */ R(ee, { size: 18 }), " HR Notes"]
|
|
590
|
+
}) }), /* @__PURE__ */ R(_, { children: /* @__PURE__ */ R(E, {
|
|
567
591
|
value: M.notes,
|
|
568
592
|
onChange: (e) => P((t) => ({
|
|
569
593
|
...t,
|
|
@@ -572,99 +596,99 @@ function K({ editId: t }) {
|
|
|
572
596
|
placeholder: "Performance notes, disciplinary history, anything worth tracking for this driver...",
|
|
573
597
|
rows: 4
|
|
574
598
|
}) })] }),
|
|
575
|
-
A && !
|
|
599
|
+
A && !We && /* @__PURE__ */ z(g, {
|
|
576
600
|
className: "border-status-error-border",
|
|
577
|
-
children: [/* @__PURE__ */
|
|
601
|
+
children: [/* @__PURE__ */ R(v, { children: /* @__PURE__ */ z(y, {
|
|
578
602
|
className: "flex items-center gap-2 text-status-error-text",
|
|
579
|
-
children: [/* @__PURE__ */
|
|
580
|
-
}) }), /* @__PURE__ */
|
|
603
|
+
children: [/* @__PURE__ */ R(l, { size: 18 }), " Dismiss Driver"]
|
|
604
|
+
}) }), /* @__PURE__ */ z(_, { children: [/* @__PURE__ */ R("p", {
|
|
581
605
|
className: "mb-3 text-sm text-text-secondary",
|
|
582
606
|
children: "Dismissing a driver marks them as no longer employed. Their delivery and route history stays visible; they can no longer be assigned new work. This cannot be undone from here."
|
|
583
|
-
}), /* @__PURE__ */
|
|
607
|
+
}), /* @__PURE__ */ z(h, {
|
|
584
608
|
type: "button",
|
|
585
609
|
variant: "outline",
|
|
586
610
|
className: "border-status-error-border text-status-error-text hover:bg-status-error-bg-subtle",
|
|
587
611
|
onClick: () => q(!0),
|
|
588
|
-
children: [/* @__PURE__ */
|
|
612
|
+
children: [/* @__PURE__ */ R(l, { size: 16 }), " Dismiss this driver"]
|
|
589
613
|
})] })]
|
|
590
614
|
}),
|
|
591
|
-
A && /* @__PURE__ */
|
|
615
|
+
A && /* @__PURE__ */ z(g, {
|
|
592
616
|
className: "border-status-error-border",
|
|
593
|
-
children: [/* @__PURE__ */
|
|
617
|
+
children: [/* @__PURE__ */ R(v, { children: /* @__PURE__ */ z(y, {
|
|
594
618
|
className: "flex items-center gap-2 text-status-error-text",
|
|
595
|
-
children: [/* @__PURE__ */
|
|
596
|
-
}) }), /* @__PURE__ */
|
|
619
|
+
children: [/* @__PURE__ */ R(c, { size: 18 }), " Delete Driver"]
|
|
620
|
+
}) }), /* @__PURE__ */ z(_, { children: [/* @__PURE__ */ R("p", {
|
|
597
621
|
className: "mb-3 text-sm text-text-secondary",
|
|
598
622
|
children: "Removes this driver record, for example one entered by mistake, and unlinks them from any vehicle. To keep delivery history for someone who has left, dismiss them instead. This cannot be undone from here."
|
|
599
|
-
}), /* @__PURE__ */
|
|
623
|
+
}), /* @__PURE__ */ z(h, {
|
|
600
624
|
type: "button",
|
|
601
625
|
variant: "outline",
|
|
602
626
|
className: "border-status-error-border text-status-error-text hover:bg-status-error-bg-subtle",
|
|
603
627
|
onClick: () => Z(!0),
|
|
604
|
-
children: [/* @__PURE__ */
|
|
628
|
+
children: [/* @__PURE__ */ R(c, { size: 16 }), " Delete this driver"]
|
|
605
629
|
})] })]
|
|
606
630
|
})
|
|
607
631
|
]
|
|
608
632
|
}),
|
|
609
|
-
/* @__PURE__ */
|
|
610
|
-
open:
|
|
633
|
+
/* @__PURE__ */ R(H, {
|
|
634
|
+
open: Te,
|
|
611
635
|
onOpenChange: Z,
|
|
612
|
-
children: /* @__PURE__ */
|
|
613
|
-
/* @__PURE__ */
|
|
636
|
+
children: /* @__PURE__ */ z(U, { children: [
|
|
637
|
+
/* @__PURE__ */ z(ge, { children: [/* @__PURE__ */ R(_e, { children: "Delete this driver?" }), /* @__PURE__ */ z(W, { children: [
|
|
614
638
|
"This removes ",
|
|
615
639
|
`${M.firstName} ${M.lastName}`.trim() || "this driver",
|
|
616
640
|
" and unlinks them from any vehicle. It cannot be undone from here."
|
|
617
641
|
] })] }),
|
|
618
|
-
/* @__PURE__ */
|
|
642
|
+
/* @__PURE__ */ R("div", {
|
|
619
643
|
className: "px-1",
|
|
620
|
-
children: /* @__PURE__ */
|
|
644
|
+
children: /* @__PURE__ */ R(j, { message: De })
|
|
621
645
|
}),
|
|
622
|
-
/* @__PURE__ */
|
|
646
|
+
/* @__PURE__ */ z(G, { children: [/* @__PURE__ */ R(h, {
|
|
623
647
|
variant: "outline",
|
|
624
648
|
onClick: () => Z(!1),
|
|
625
649
|
disabled: Q,
|
|
626
650
|
children: "Cancel"
|
|
627
|
-
}), /* @__PURE__ */
|
|
651
|
+
}), /* @__PURE__ */ R(h, {
|
|
628
652
|
className: "bg-status-error-text text-text-inverse hover:opacity-90",
|
|
629
|
-
onClick:
|
|
653
|
+
onClick: Ue,
|
|
630
654
|
disabled: Q,
|
|
631
655
|
children: Q ? "Deleting..." : "Delete driver"
|
|
632
656
|
})] })
|
|
633
657
|
] })
|
|
634
658
|
}),
|
|
635
|
-
/* @__PURE__ */
|
|
659
|
+
/* @__PURE__ */ R(H, {
|
|
636
660
|
open: K,
|
|
637
661
|
onOpenChange: q,
|
|
638
|
-
children: /* @__PURE__ */
|
|
639
|
-
/* @__PURE__ */
|
|
640
|
-
/* @__PURE__ */
|
|
662
|
+
children: /* @__PURE__ */ z(U, { children: [
|
|
663
|
+
/* @__PURE__ */ z(ge, { children: [/* @__PURE__ */ R(_e, { children: "Dismiss this driver?" }), /* @__PURE__ */ R(W, { children: "This records the driver as dismissed and requires a reason. It cannot be undone from here." })] }),
|
|
664
|
+
/* @__PURE__ */ z("div", {
|
|
641
665
|
className: "space-y-2 px-1",
|
|
642
666
|
children: [
|
|
643
|
-
/* @__PURE__ */
|
|
667
|
+
/* @__PURE__ */ z(x, {
|
|
644
668
|
htmlFor: "dismissReason",
|
|
645
|
-
children: ["Reason ", /* @__PURE__ */
|
|
669
|
+
children: ["Reason ", /* @__PURE__ */ R("span", {
|
|
646
670
|
className: "text-status-error-text",
|
|
647
671
|
children: "*"
|
|
648
672
|
})]
|
|
649
673
|
}),
|
|
650
|
-
/* @__PURE__ */
|
|
674
|
+
/* @__PURE__ */ R(E, {
|
|
651
675
|
id: "dismissReason",
|
|
652
676
|
value: J,
|
|
653
|
-
onChange: (e) =>
|
|
677
|
+
onChange: (e) => Se(e.target.value),
|
|
654
678
|
placeholder: "e.g. Repeated policy violations, voluntary resignation, performance...",
|
|
655
679
|
rows: 3
|
|
656
680
|
}),
|
|
657
|
-
/* @__PURE__ */
|
|
681
|
+
/* @__PURE__ */ R(j, { message: we })
|
|
658
682
|
]
|
|
659
683
|
}),
|
|
660
|
-
/* @__PURE__ */
|
|
684
|
+
/* @__PURE__ */ z(G, { children: [/* @__PURE__ */ R(h, {
|
|
661
685
|
variant: "outline",
|
|
662
686
|
onClick: () => q(!1),
|
|
663
687
|
disabled: Y,
|
|
664
688
|
children: "Cancel"
|
|
665
|
-
}), /* @__PURE__ */
|
|
689
|
+
}), /* @__PURE__ */ R(h, {
|
|
666
690
|
className: "bg-status-error-text text-text-inverse hover:opacity-90",
|
|
667
|
-
onClick:
|
|
691
|
+
onClick: He,
|
|
668
692
|
disabled: Y,
|
|
669
693
|
children: Y ? "Dismissing..." : "Confirm dismissal"
|
|
670
694
|
})] })
|
|
@@ -674,40 +698,40 @@ function K({ editId: t }) {
|
|
|
674
698
|
});
|
|
675
699
|
}
|
|
676
700
|
function q() {
|
|
677
|
-
let { driverId: a } =
|
|
701
|
+
let { driverId: a } = pe(), c = L().pathname.endsWith("/edit"), { basePath: l, navigate: f } = ne(), { driver: m, isLoading: ie, error: b, refetch: x } = p(a);
|
|
678
702
|
F(c, x);
|
|
679
|
-
let { vehicle: S } = re(m?.assignedVehicle),
|
|
680
|
-
if (!a) return /* @__PURE__ */
|
|
681
|
-
if (c) return /* @__PURE__ */
|
|
682
|
-
if (ie) return /* @__PURE__ */
|
|
683
|
-
if (b || !m) return /* @__PURE__ */
|
|
703
|
+
let { vehicle: S } = re(m?.assignedVehicle), ae = () => f?.(d(l, "fleet/drivers")), C = (e) => f?.(d(l, e));
|
|
704
|
+
if (!a) return /* @__PURE__ */ R(K, {});
|
|
705
|
+
if (c) return /* @__PURE__ */ R(K, { editId: a });
|
|
706
|
+
if (ie) return /* @__PURE__ */ R(D, { message: "Loading driver details..." });
|
|
707
|
+
if (b || !m) return /* @__PURE__ */ R(oe, {
|
|
684
708
|
title: "Driver not found",
|
|
685
709
|
onRetry: x
|
|
686
710
|
});
|
|
687
|
-
let
|
|
688
|
-
return /* @__PURE__ */
|
|
711
|
+
let w = !!m.terminatedAt, T = m.onLeaveUntil && m.onLeaveUntil.getTime() > (/* @__PURE__ */ new Date()).getTime() ? m.onLeaveUntil : void 0, E = m.baseSalary !== void 0 || m.bonusYtd !== void 0;
|
|
712
|
+
return /* @__PURE__ */ z(O, {
|
|
689
713
|
title: m.fullName,
|
|
690
714
|
subtitle: `Employee ID: ${m.employeeId}`,
|
|
691
|
-
icon: /* @__PURE__ */
|
|
692
|
-
headerActions: /* @__PURE__ */
|
|
715
|
+
icon: /* @__PURE__ */ R(u, { size: 24 }),
|
|
716
|
+
headerActions: /* @__PURE__ */ z("div", {
|
|
693
717
|
className: "flex gap-2",
|
|
694
|
-
children: [/* @__PURE__ */
|
|
718
|
+
children: [/* @__PURE__ */ z(h, {
|
|
695
719
|
variant: "outline",
|
|
696
|
-
onClick:
|
|
697
|
-
children: [/* @__PURE__ */
|
|
698
|
-
}), /* @__PURE__ */
|
|
699
|
-
onClick: () =>
|
|
700
|
-
children: [/* @__PURE__ */
|
|
720
|
+
onClick: ae,
|
|
721
|
+
children: [/* @__PURE__ */ R(e, { size: 16 }), " Back"]
|
|
722
|
+
}), /* @__PURE__ */ z(h, {
|
|
723
|
+
onClick: () => f?.(d(l, "fleet/drivers/" + a + "/edit")),
|
|
724
|
+
children: [/* @__PURE__ */ R(o, { size: 16 }), " Edit"]
|
|
701
725
|
})]
|
|
702
726
|
}),
|
|
703
|
-
headerContent: /* @__PURE__ */
|
|
727
|
+
headerContent: /* @__PURE__ */ z("div", {
|
|
704
728
|
className: "flex flex-wrap items-center gap-4",
|
|
705
729
|
children: [
|
|
706
|
-
/* @__PURE__ */
|
|
730
|
+
/* @__PURE__ */ R(A, {
|
|
707
731
|
status: m.status,
|
|
708
732
|
type: "driver"
|
|
709
733
|
}),
|
|
710
|
-
|
|
734
|
+
w && /* @__PURE__ */ R(A, {
|
|
711
735
|
status: "dismissed",
|
|
712
736
|
label: "Dismissed",
|
|
713
737
|
customColors: {
|
|
@@ -715,20 +739,20 @@ function q() {
|
|
|
715
739
|
text: "text-status-error-text"
|
|
716
740
|
}
|
|
717
741
|
}),
|
|
718
|
-
|
|
742
|
+
T && !w && /* @__PURE__ */ R(A, {
|
|
719
743
|
status: "on_leave",
|
|
720
|
-
label: `On leave until ${N(
|
|
744
|
+
label: `On leave until ${N(T, "short")}`,
|
|
721
745
|
customColors: {
|
|
722
746
|
bg: "bg-status-warning-bg-subtle",
|
|
723
747
|
text: "text-status-warning-text"
|
|
724
748
|
}
|
|
725
749
|
}),
|
|
726
|
-
m.rating !== void 0 && /* @__PURE__ */
|
|
750
|
+
m.rating !== void 0 && /* @__PURE__ */ z("div", {
|
|
727
751
|
className: "flex items-center gap-1",
|
|
728
|
-
children: [/* @__PURE__ */
|
|
752
|
+
children: [/* @__PURE__ */ R(s, {
|
|
729
753
|
size: 16,
|
|
730
754
|
className: "text-status-warning-text fill-current"
|
|
731
|
-
}), /* @__PURE__ */
|
|
755
|
+
}), /* @__PURE__ */ R("span", {
|
|
732
756
|
className: "font-medium",
|
|
733
757
|
children: m.rating.toFixed(1)
|
|
734
758
|
})]
|
|
@@ -736,145 +760,145 @@ function q() {
|
|
|
736
760
|
]
|
|
737
761
|
}),
|
|
738
762
|
children: [
|
|
739
|
-
/* @__PURE__ */
|
|
740
|
-
icon: /* @__PURE__ */
|
|
741
|
-
children: "
|
|
763
|
+
/* @__PURE__ */ R(V, {
|
|
764
|
+
icon: /* @__PURE__ */ R(u, { size: 18 }),
|
|
765
|
+
children: "Review the recorded licensing, assigned vehicle, documents and HR facts before assignment. These records do not certify legal driving eligibility or duty-hours availability."
|
|
742
766
|
}),
|
|
743
|
-
/* @__PURE__ */
|
|
767
|
+
/* @__PURE__ */ R(B, {
|
|
744
768
|
storageKey: "movethewheels-driver-details",
|
|
745
769
|
steps: [
|
|
746
770
|
{
|
|
747
771
|
id: "assign",
|
|
748
772
|
label: "Assign to an order",
|
|
749
773
|
description: "Hand a pending delivery to this driver.",
|
|
750
|
-
icon: /* @__PURE__ */
|
|
751
|
-
onClick: () =>
|
|
774
|
+
icon: /* @__PURE__ */ R(i, { size: 16 }),
|
|
775
|
+
onClick: () => C("orders")
|
|
752
776
|
},
|
|
753
777
|
{
|
|
754
778
|
id: "routes",
|
|
755
779
|
label: "Plan their route",
|
|
756
780
|
description: "Batch nearby drop-offs into an optimized itinerary.",
|
|
757
|
-
icon: /* @__PURE__ */
|
|
758
|
-
onClick: () =>
|
|
781
|
+
icon: /* @__PURE__ */ R(t, { size: 16 }),
|
|
782
|
+
onClick: () => C("routes")
|
|
759
783
|
},
|
|
760
784
|
{
|
|
761
785
|
id: "edit",
|
|
762
786
|
label: "Update driver record",
|
|
763
787
|
description: "Refresh documents, license or HR details.",
|
|
764
|
-
icon: /* @__PURE__ */
|
|
788
|
+
icon: /* @__PURE__ */ R(o, { size: 16 }),
|
|
765
789
|
onClick: () => {}
|
|
766
790
|
}
|
|
767
791
|
]
|
|
768
792
|
}),
|
|
769
|
-
|
|
793
|
+
w && /* @__PURE__ */ z("div", {
|
|
770
794
|
className: "rounded-card border border-status-error-border bg-status-error-bg-subtle p-4 text-sm text-status-error-text",
|
|
771
|
-
children: [/* @__PURE__ */
|
|
795
|
+
children: [/* @__PURE__ */ z("p", {
|
|
772
796
|
className: "font-medium",
|
|
773
797
|
children: ["Dismissed ", m.terminatedAt && N(m.terminatedAt, "full")]
|
|
774
|
-
}), m.terminationReason && /* @__PURE__ */
|
|
798
|
+
}), m.terminationReason && /* @__PURE__ */ z("p", {
|
|
775
799
|
className: "mt-1",
|
|
776
800
|
children: ["Reason: ", m.terminationReason]
|
|
777
801
|
})]
|
|
778
802
|
}),
|
|
779
|
-
/* @__PURE__ */
|
|
803
|
+
/* @__PURE__ */ z("div", {
|
|
780
804
|
className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
|
|
781
|
-
children: [/* @__PURE__ */
|
|
805
|
+
children: [/* @__PURE__ */ z("div", {
|
|
782
806
|
className: "lg:col-span-2 space-y-6",
|
|
783
807
|
children: [
|
|
784
|
-
/* @__PURE__ */
|
|
808
|
+
/* @__PURE__ */ z(g, { children: [/* @__PURE__ */ R(v, { children: /* @__PURE__ */ z(y, {
|
|
785
809
|
className: "flex items-center gap-2",
|
|
786
|
-
children: [/* @__PURE__ */
|
|
787
|
-
}) }), /* @__PURE__ */
|
|
810
|
+
children: [/* @__PURE__ */ R(r, { size: 18 }), " License"]
|
|
811
|
+
}) }), /* @__PURE__ */ R(_, { children: /* @__PURE__ */ R("div", {
|
|
788
812
|
className: "flex items-center justify-between p-3 border rounded-lg",
|
|
789
|
-
children: /* @__PURE__ */
|
|
790
|
-
/* @__PURE__ */
|
|
813
|
+
children: /* @__PURE__ */ z("div", { children: [
|
|
814
|
+
/* @__PURE__ */ R("p", {
|
|
791
815
|
className: "font-medium",
|
|
792
816
|
children: "Driver's License"
|
|
793
817
|
}),
|
|
794
|
-
/* @__PURE__ */
|
|
818
|
+
/* @__PURE__ */ z("p", {
|
|
795
819
|
className: "text-sm text-text-secondary",
|
|
796
820
|
children: [m.licenseNumber || "—", m.licenseType ? ` - ${m.licenseType}` : ""]
|
|
797
821
|
}),
|
|
798
|
-
/* @__PURE__ */
|
|
799
|
-
className: "text-sm text-text-secondary",
|
|
800
|
-
children: m.licenseExpiry ? `
|
|
822
|
+
/* @__PURE__ */ R("p", {
|
|
823
|
+
className: "text-sm text-text-secondary break-all",
|
|
824
|
+
children: m.licenseExpiry ? `Recorded expiry (UTC): ${m.licenseExpiry.toISOString()}` : "Expiry not recorded"
|
|
801
825
|
})
|
|
802
826
|
] })
|
|
803
827
|
}) })] }),
|
|
804
|
-
m.notes && /* @__PURE__ */
|
|
828
|
+
m.notes && /* @__PURE__ */ z(g, { children: [/* @__PURE__ */ R(v, { children: /* @__PURE__ */ z(y, {
|
|
805
829
|
className: "flex items-center gap-2",
|
|
806
|
-
children: [/* @__PURE__ */
|
|
807
|
-
}) }), /* @__PURE__ */
|
|
830
|
+
children: [/* @__PURE__ */ R(ee, { size: 18 }), " HR Notes"]
|
|
831
|
+
}) }), /* @__PURE__ */ R(_, { children: /* @__PURE__ */ R("p", {
|
|
808
832
|
className: "text-sm whitespace-pre-wrap",
|
|
809
833
|
children: m.notes
|
|
810
834
|
}) })] }),
|
|
811
|
-
/* @__PURE__ */
|
|
835
|
+
/* @__PURE__ */ R(P, {
|
|
812
836
|
entityType: "driver",
|
|
813
837
|
entityId: m.id
|
|
814
838
|
})
|
|
815
839
|
]
|
|
816
|
-
}), /* @__PURE__ */
|
|
840
|
+
}), /* @__PURE__ */ z("div", {
|
|
817
841
|
className: "space-y-6",
|
|
818
842
|
children: [
|
|
819
|
-
/* @__PURE__ */
|
|
843
|
+
/* @__PURE__ */ z(g, { children: [/* @__PURE__ */ R(v, { children: /* @__PURE__ */ z(y, {
|
|
820
844
|
className: "flex items-center gap-2",
|
|
821
|
-
children: [/* @__PURE__ */
|
|
822
|
-
}) }), /* @__PURE__ */
|
|
845
|
+
children: [/* @__PURE__ */ R(te, { size: 18 }), " Assigned Vehicle"]
|
|
846
|
+
}) }), /* @__PURE__ */ R(_, { children: m.assignedVehicle ? S ? /* @__PURE__ */ z("button", {
|
|
823
847
|
type: "button",
|
|
824
848
|
className: "text-sm font-medium text-primary hover:underline",
|
|
825
|
-
onClick: () =>
|
|
849
|
+
onClick: () => C(`fleet/vehicles/${S.id}`),
|
|
826
850
|
children: [
|
|
827
851
|
S.vehicleNumber,
|
|
828
852
|
" (",
|
|
829
853
|
S.type,
|
|
830
854
|
")"
|
|
831
855
|
]
|
|
832
|
-
}) : /* @__PURE__ */
|
|
856
|
+
}) : /* @__PURE__ */ R("p", {
|
|
833
857
|
className: "text-sm text-text-secondary",
|
|
834
858
|
children: "Loading…"
|
|
835
|
-
}) : /* @__PURE__ */
|
|
859
|
+
}) : /* @__PURE__ */ R("p", {
|
|
836
860
|
className: "text-sm text-text-secondary",
|
|
837
861
|
children: "No vehicle assigned"
|
|
838
862
|
}) })] }),
|
|
839
|
-
/* @__PURE__ */
|
|
863
|
+
/* @__PURE__ */ z(g, { children: [/* @__PURE__ */ R(v, { children: /* @__PURE__ */ R(y, { children: "Record" }) }), /* @__PURE__ */ R(_, {
|
|
840
864
|
className: "space-y-4",
|
|
841
|
-
children: /* @__PURE__ */
|
|
865
|
+
children: /* @__PURE__ */ z("div", { children: [/* @__PURE__ */ R("p", {
|
|
842
866
|
className: "text-sm text-text-secondary",
|
|
843
867
|
children: "Hire Date"
|
|
844
|
-
}), /* @__PURE__ */
|
|
868
|
+
}), /* @__PURE__ */ R("p", {
|
|
845
869
|
className: "font-medium",
|
|
846
870
|
children: m.hireDate ? N(m.hireDate) : "Not recorded"
|
|
847
871
|
})] })
|
|
848
872
|
})] }),
|
|
849
|
-
/* @__PURE__ */
|
|
873
|
+
/* @__PURE__ */ z(g, { children: [/* @__PURE__ */ R(v, { children: /* @__PURE__ */ z(y, {
|
|
850
874
|
className: "flex items-center gap-2",
|
|
851
|
-
children: [/* @__PURE__ */
|
|
852
|
-
}) }), /* @__PURE__ */
|
|
875
|
+
children: [/* @__PURE__ */ R(n, { size: 18 }), " Compensation"]
|
|
876
|
+
}) }), /* @__PURE__ */ R(_, {
|
|
853
877
|
className: "space-y-3",
|
|
854
|
-
children:
|
|
878
|
+
children: E ? /* @__PURE__ */ z(me, { children: [m.baseSalary !== void 0 && /* @__PURE__ */ z("div", { children: [/* @__PURE__ */ R("p", {
|
|
855
879
|
className: "text-sm text-text-secondary",
|
|
856
880
|
children: "Base Salary"
|
|
857
|
-
}), /* @__PURE__ */
|
|
881
|
+
}), /* @__PURE__ */ z("p", {
|
|
858
882
|
className: "font-medium",
|
|
859
883
|
children: [M(m.baseSalary, m.payCurrency || void 0), "/year"]
|
|
860
|
-
})] }), m.bonusYtd !== void 0 && /* @__PURE__ */
|
|
884
|
+
})] }), m.bonusYtd !== void 0 && /* @__PURE__ */ z("div", { children: [/* @__PURE__ */ R("p", {
|
|
861
885
|
className: "text-sm text-text-secondary",
|
|
862
886
|
children: "Bonus (YTD)"
|
|
863
|
-
}), /* @__PURE__ */
|
|
887
|
+
}), /* @__PURE__ */ R("p", {
|
|
864
888
|
className: "font-medium",
|
|
865
889
|
children: M(m.bonusYtd, m.payCurrency || void 0)
|
|
866
|
-
})] })] }) : /* @__PURE__ */
|
|
890
|
+
})] })] }) : /* @__PURE__ */ R("p", {
|
|
867
891
|
className: "text-sm text-text-secondary",
|
|
868
892
|
children: "Not recorded"
|
|
869
893
|
})
|
|
870
894
|
})] }),
|
|
871
|
-
m.currentLocation && /* @__PURE__ */
|
|
895
|
+
m.currentLocation && /* @__PURE__ */ z(g, { children: [/* @__PURE__ */ R(v, { children: /* @__PURE__ */ z(y, {
|
|
872
896
|
className: "flex items-center gap-2",
|
|
873
|
-
children: [/* @__PURE__ */
|
|
874
|
-
}) }), /* @__PURE__ */
|
|
897
|
+
children: [/* @__PURE__ */ R(i, { size: 18 }), " Current Location"]
|
|
898
|
+
}) }), /* @__PURE__ */ z(_, { children: [/* @__PURE__ */ R("p", {
|
|
875
899
|
className: "text-sm",
|
|
876
900
|
children: m.currentLocation.address || "Location updating..."
|
|
877
|
-
}), /* @__PURE__ */
|
|
901
|
+
}), /* @__PURE__ */ R("p", {
|
|
878
902
|
className: "text-xs text-text-secondary mt-1",
|
|
879
903
|
children: m.currentLocation.timestamp ? `Updated ${N(m.currentLocation.timestamp, "relative")}` : "Update time not recorded"
|
|
880
904
|
})] })] })
|