@burdenoff/microfe-movethewheels 2026.925.1 → 2026.925.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,49 +1,49 @@
1
1
  import { cn as e } from "../utils/cn.js";
2
2
  import { Badge as t } from "./ui.js";
3
- import { DRIVER_STATUS_COLORS as n, ORDER_STATUS_COLORS as r, PRIORITY_COLORS as i, VEHICLE_STATUS_COLORS as a } from "../constants/index.js";
4
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
3
+ import { DRIVER_STATUS_COLORS as n, DRIVER_STATUS_LABELS as r, ORDER_STATUS_COLORS as i, PRIORITY_COLORS as a, VEHICLE_STATUS_COLORS as o } from "../constants/index.js";
4
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
5
5
  //#region src/movethewheels/components/StatusBadge.tsx
6
- var c = {
6
+ var l = {
7
7
  sm: "text-xs px-2 py-0.5",
8
8
  md: "text-sm px-2.5 py-1",
9
9
  lg: "text-base px-3 py-1.5"
10
10
  };
11
- function l({ status: i, type: l = "custom", customColors: u, size: d = "md", showDot: f = !0, className: p }) {
12
- let m = u, h = {
11
+ function u({ status: a, type: u = "custom", customColors: d, label: f, size: p = "md", showDot: m = !0, className: h }) {
12
+ let g = d, _ = {
13
13
  bg: "bg-bg-sunken",
14
14
  text: "text-text-secondary"
15
15
  };
16
- if (!m) switch (l) {
16
+ if (!g) switch (u) {
17
17
  case "order":
18
- m = r[i] || h;
18
+ g = i[a] || _;
19
19
  break;
20
20
  case "vehicle":
21
- m = a[i] || h;
21
+ g = o[a] || _;
22
22
  break;
23
23
  case "driver":
24
- m = n[i] || h;
24
+ g = n[a] || _;
25
25
  break;
26
- default: m = h;
26
+ default: g = _;
27
27
  }
28
- let g = i.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
29
- return /* @__PURE__ */ s(t, {
28
+ let v = f ?? (u === "driver" ? r[a] : void 0) ?? a.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
29
+ return /* @__PURE__ */ c(t, {
30
30
  variant: "outline",
31
- className: e("inline-flex items-center gap-1.5 whitespace-nowrap rounded-full border-0 font-medium capitalize", "ring-1 ring-inset ring-border-seam/60", m.bg, m.text, c[d], p),
32
- children: [f && /* @__PURE__ */ o("span", {
31
+ className: e("inline-flex items-center gap-1.5 whitespace-nowrap rounded-full border-0 font-medium capitalize", "ring-1 ring-inset ring-border-seam/60", g.bg, g.text, l[p], h),
32
+ children: [m && /* @__PURE__ */ s("span", {
33
33
  "aria-hidden": "true",
34
- className: e("h-1.5 w-1.5 flex-shrink-0 rounded-full motion-safe:animate-vc-glow-pulse", m.text.replace("text-", "bg-"))
35
- }), g]
34
+ className: e("h-1.5 w-1.5 flex-shrink-0 rounded-full motion-safe:animate-vc-glow-pulse", g.text.replace("text-", "bg-"))
35
+ }), v]
36
36
  });
37
37
  }
38
- function u({ priority: n, size: r = "md", className: a }) {
39
- let s = i[n];
40
- return /* @__PURE__ */ o(t, {
38
+ function d({ priority: n, size: r = "md", className: i }) {
39
+ let o = a[n];
40
+ return /* @__PURE__ */ s(t, {
41
41
  variant: "outline",
42
- className: e("rounded-full font-medium capitalize border-0 whitespace-nowrap ring-1 ring-inset ring-border-seam/60", s.bg, s.text, c[r], a),
42
+ className: e("rounded-full font-medium capitalize border-0 whitespace-nowrap ring-1 ring-inset ring-border-seam/60", o.bg, o.text, l[r], i),
43
43
  children: n
44
44
  });
45
45
  }
46
- function d({ type: n, size: r = "md", className: i }) {
46
+ function f({ type: n, size: r = "md", className: i }) {
47
47
  let a = {
48
48
  b2b: {
49
49
  bg: "bg-status-info-bg-subtle",
@@ -54,13 +54,13 @@ function d({ type: n, size: r = "md", className: i }) {
54
54
  text: "text-status-success-text"
55
55
  }
56
56
  }[n];
57
- return /* @__PURE__ */ o(t, {
57
+ return /* @__PURE__ */ s(t, {
58
58
  variant: "outline",
59
- className: e("rounded-full font-medium uppercase border-0 whitespace-nowrap ring-1 ring-inset ring-border-seam/60", a.bg, a.text, c[r], i),
59
+ className: e("rounded-full font-medium uppercase border-0 whitespace-nowrap ring-1 ring-inset ring-border-seam/60", a.bg, a.text, l[r], i),
60
60
  children: n
61
61
  });
62
62
  }
63
- function f({ status: n, size: r = "md", className: i }) {
63
+ function p({ status: n, size: r = "md", className: i }) {
64
64
  let a = {
65
65
  pending: {
66
66
  bg: "bg-status-warning-bg-subtle",
@@ -79,17 +79,17 @@ function f({ status: n, size: r = "md", className: i }) {
79
79
  text: "text-text-secondary"
80
80
  }
81
81
  }[n];
82
- return /* @__PURE__ */ o(t, {
82
+ return /* @__PURE__ */ s(t, {
83
83
  variant: "outline",
84
- className: e("rounded-full font-medium capitalize border-0 whitespace-nowrap ring-1 ring-inset ring-border-seam/60", a.bg, a.text, c[r], i),
84
+ className: e("rounded-full font-medium capitalize border-0 whitespace-nowrap ring-1 ring-inset ring-border-seam/60", a.bg, a.text, l[r], i),
85
85
  children: n
86
86
  });
87
87
  }
88
- function p({ type: n, size: r = "md", className: i }) {
89
- return /* @__PURE__ */ s(t, {
88
+ function m({ type: n, size: r = "md", className: i }) {
89
+ return /* @__PURE__ */ c(t, {
90
90
  variant: "outline",
91
- className: e("rounded-full font-medium capitalize whitespace-nowrap inline-flex items-center ring-1 ring-inset ring-border-seam/60", c[r], i),
92
- children: [/* @__PURE__ */ o("span", {
91
+ className: e("rounded-full font-medium capitalize whitespace-nowrap inline-flex items-center ring-1 ring-inset ring-border-seam/60", l[r], i),
92
+ children: [/* @__PURE__ */ s("span", {
93
93
  className: "mr-1",
94
94
  children: {
95
95
  van: "🚐",
@@ -102,4 +102,4 @@ function p({ type: n, size: r = "md", className: i }) {
102
102
  });
103
103
  }
104
104
  //#endregion
105
- export { f as PaymentStatusBadge, u as PriorityBadge, l as StatusBadge, d as TypeBadge, p as VehicleTypeBadge };
105
+ export { p as PaymentStatusBadge, d as PriorityBadge, u as StatusBadge, f as TypeBadge, m as VehicleTypeBadge };
@@ -38,17 +38,24 @@ var e = {
38
38
  available: e,
39
39
  busy: r,
40
40
  offline: i,
41
- on_break: t
41
+ on_break: t,
42
+ inactive: n
42
43
  }, c = {
44
+ available: "Available",
45
+ busy: "On Delivery",
46
+ offline: "Off Duty",
47
+ on_break: "On Break",
48
+ inactive: "Inactive"
49
+ }, l = {
43
50
  low: i,
44
51
  normal: r,
45
52
  high: t,
46
53
  urgent: n
47
- }, l = {
54
+ }, u = {
48
55
  planned: r,
49
56
  in_progress: t,
50
57
  completed: e,
51
58
  cancelled: n
52
59
  };
53
60
  //#endregion
54
- export { s as DRIVER_STATUS_COLORS, a as ORDER_STATUS_COLORS, c as PRIORITY_COLORS, l as ROUTE_STATUS_COLORS, o as VEHICLE_STATUS_COLORS };
61
+ export { s as DRIVER_STATUS_COLORS, c as DRIVER_STATUS_LABELS, a as ORDER_STATUS_COLORS, l as PRIORITY_COLORS, u as ROUTE_STATUS_COLORS, o as VEHICLE_STATUS_COLORS };
@@ -2,7 +2,7 @@ import { useMoveTheWheels as e } from "../providers/MoveTheWheelsProvider.js";
2
2
  import { executeGraphQL as t } from "../utils/graphqlClient.js";
3
3
  import { useCallback as n, useEffect as r, useMemo as i, useState as a } from "react";
4
4
  //#region src/movethewheels/hooks/useFleet.ts
5
- var o = "\n query ListVehicles($filter: VehicleFilterInput, $pagination: PaginationInput) {\n vehicles(filter: $filter, pagination: $pagination) {\n id\n vehicleNumber\n type\n make\n model\n licensePlate\n ownershipType\n year\n capacity\n status\n currentLocation\n fuelLevel\n mileage\n lastServiceDate\n nextServiceDueDate\n nextServiceDueMileage\n createdAt\n updatedAt\n }\n vehiclesCount(filter: $filter)\n }\n", s = "\n query ListDrivers($filter: DriverFilterInput, $pagination: PaginationInput) {\n drivers(filter: $filter, pagination: $pagination) {\n id\n userId\n firstName\n lastName\n email\n phone\n employeeId\n licenseNumber\n licenseClass\n licenseExpiry\n status\n currentLocation\n rating\n vehicleId\n createdAt\n }\n driversCount(filter: $filter)\n }\n", c = "\n query GetVehicle($id: ID!) {\n vehicle(id: $id) {\n id\n vehicleNumber\n type\n make\n model\n licensePlate\n ownershipType\n year\n capacity\n status\n currentLocation\n fuelLevel\n mileage\n lastServiceDate\n nextServiceDueDate\n nextServiceDueMileage\n createdAt\n updatedAt\n }\n }\n", l = "\n query GetDriver($id: ID!) {\n driver(id: $id) {\n id\n userId\n firstName\n lastName\n email\n phone\n employeeId\n licenseNumber\n licenseClass\n licenseExpiry\n status\n currentLocation\n rating\n vehicleId\n createdAt\n }\n }\n", u = "\n mutation UpdateVehicleStatus($id: ID!, $status: VehicleStatus!) {\n updateVehicleStatus(id: $id, status: $status) {\n id\n vehicleNumber\n type\n make\n model\n licensePlate\n ownershipType\n year\n capacity\n status\n currentLocation\n fuelLevel\n mileage\n createdAt\n updatedAt\n }\n }\n", d = "\n mutation AssignDriverVehicle($id: ID!, $vehicleId: ID) {\n assignDriverVehicle(id: $id, vehicleId: $vehicleId) {\n id\n userId\n firstName\n lastName\n email\n phone\n employeeId\n licenseNumber\n licenseClass\n licenseExpiry\n status\n currentLocation\n rating\n vehicleId\n createdAt\n }\n }\n", f = "\n mutation UpdateDriverStatus($id: ID!, $status: DriverStatus!) {\n updateDriverStatus(id: $id, status: $status) {\n id\n userId\n firstName\n lastName\n email\n phone\n employeeId\n licenseNumber\n licenseClass\n licenseExpiry\n status\n currentLocation\n rating\n vehicleId\n createdAt\n }\n }\n", p = "\n mutation CreateVehicle($input: CreateVehicleInput!) {\n createVehicle(input: $input) {\n id\n vehicleNumber\n type\n make\n model\n licensePlate\n ownershipType\n year\n capacity\n status\n currentLocation\n fuelLevel\n mileage\n createdAt\n updatedAt\n }\n }\n", m = "\n mutation CreateDriver($input: CreateDriverInput!) {\n createDriver(input: $input) {\n id\n userId\n firstName\n lastName\n email\n phone\n employeeId\n licenseNumber\n licenseClass\n licenseExpiry\n status\n currentLocation\n rating\n vehicleId\n createdAt\n }\n }\n", h = "\n mutation UpdateVehicle($id: ID!, $input: UpdateVehicleInput!) {\n updateVehicle(id: $id, input: $input) {\n id\n vehicleNumber\n type\n make\n model\n licensePlate\n ownershipType\n year\n capacity\n status\n currentLocation\n fuelLevel\n mileage\n createdAt\n updatedAt\n }\n }\n", g = "\n mutation UpdateDriver($id: ID!, $input: UpdateDriverInput!) {\n updateDriver(id: $id, input: $input) {\n id\n userId\n firstName\n lastName\n email\n phone\n employeeId\n licenseNumber\n licenseClass\n licenseExpiry\n status\n currentLocation\n rating\n vehicleId\n createdAt\n }\n }\n", _ = "\n query GetDriverStatusCounts {\n onBreak: driversCount(filter: { status: ON_BREAK })\n offDuty: driversCount(filter: { status: OFF_DUTY })\n inactive: driversCount(filter: { status: INACTIVE })\n }\n", v = "\n query GetFleetStats {\n fleetStats {\n totalVehicles\n activeVehicles\n inTransitVehicles\n maintenanceVehicles\n totalDrivers\n availableDrivers\n onDeliveryDrivers\n avgDriverRating\n }\n }\n";
5
+ var o = "\n query ListVehicles($filter: VehicleFilterInput, $pagination: PaginationInput) {\n vehicles(filter: $filter, pagination: $pagination) {\n id\n vehicleNumber\n type\n make\n model\n licensePlate\n ownershipType\n year\n capacity\n status\n currentLocation\n fuelType\n fuelEfficiencyLPer100Km\n fuelLevel\n mileage\n lastServiceDate\n nextServiceDueDate\n nextServiceDueMileage\n createdAt\n updatedAt\n }\n vehiclesCount(filter: $filter)\n }\n", s = "\n query ListDrivers($filter: DriverFilterInput, $pagination: PaginationInput) {\n drivers(filter: $filter, pagination: $pagination) {\n id\n userId\n firstName\n lastName\n email\n phone\n employeeId\n licenseNumber\n licenseClass\n licenseExpiry\n status\n currentLocation\n rating\n vehicleId\n notes\n hireDate\n baseSalary\n bonusYtd\n payCurrency\n onLeaveUntil\n terminatedAt\n terminationReason\n createdAt\n }\n driversCount(filter: $filter)\n }\n", c = "\n query GetVehicle($id: ID!) {\n vehicle(id: $id) {\n id\n vehicleNumber\n type\n make\n model\n licensePlate\n ownershipType\n year\n capacity\n status\n currentLocation\n fuelType\n fuelEfficiencyLPer100Km\n fuelLevel\n mileage\n lastServiceDate\n nextServiceDueDate\n nextServiceDueMileage\n createdAt\n updatedAt\n }\n }\n", l = "\n query GetDriver($id: ID!) {\n driver(id: $id) {\n id\n userId\n firstName\n lastName\n email\n phone\n employeeId\n licenseNumber\n licenseClass\n licenseExpiry\n status\n currentLocation\n rating\n vehicleId\n notes\n hireDate\n baseSalary\n bonusYtd\n payCurrency\n onLeaveUntil\n terminatedAt\n terminationReason\n createdAt\n }\n }\n", u = "\n mutation UpdateVehicleStatus($id: ID!, $status: VehicleStatus!) {\n updateVehicleStatus(id: $id, status: $status) {\n id\n vehicleNumber\n type\n make\n model\n licensePlate\n ownershipType\n year\n capacity\n status\n currentLocation\n fuelType\n fuelEfficiencyLPer100Km\n fuelLevel\n mileage\n createdAt\n updatedAt\n }\n }\n", d = "\n mutation AssignDriverVehicle($id: ID!, $vehicleId: ID) {\n assignDriverVehicle(id: $id, vehicleId: $vehicleId) {\n id\n userId\n firstName\n lastName\n email\n phone\n employeeId\n licenseNumber\n licenseClass\n licenseExpiry\n status\n currentLocation\n rating\n vehicleId\n notes\n hireDate\n baseSalary\n bonusYtd\n payCurrency\n onLeaveUntil\n terminatedAt\n terminationReason\n createdAt\n }\n }\n", f = "\n mutation UpdateDriverStatus($id: ID!, $status: DriverStatus!) {\n updateDriverStatus(id: $id, status: $status) {\n id\n userId\n firstName\n lastName\n email\n phone\n employeeId\n licenseNumber\n licenseClass\n licenseExpiry\n status\n currentLocation\n rating\n vehicleId\n notes\n hireDate\n baseSalary\n bonusYtd\n payCurrency\n onLeaveUntil\n terminatedAt\n terminationReason\n createdAt\n }\n }\n", p = "\n mutation CreateVehicle($input: CreateVehicleInput!) {\n createVehicle(input: $input) {\n id\n vehicleNumber\n type\n make\n model\n licensePlate\n ownershipType\n year\n capacity\n status\n currentLocation\n fuelType\n fuelEfficiencyLPer100Km\n fuelLevel\n mileage\n createdAt\n updatedAt\n }\n }\n", m = "\n mutation CreateDriver($input: CreateDriverInput!) {\n createDriver(input: $input) {\n id\n userId\n firstName\n lastName\n email\n phone\n employeeId\n licenseNumber\n licenseClass\n licenseExpiry\n status\n currentLocation\n rating\n vehicleId\n notes\n hireDate\n baseSalary\n bonusYtd\n payCurrency\n onLeaveUntil\n terminatedAt\n terminationReason\n createdAt\n }\n }\n", h = "\n mutation UpdateVehicle($id: ID!, $input: UpdateVehicleInput!) {\n updateVehicle(id: $id, input: $input) {\n id\n vehicleNumber\n type\n make\n model\n licensePlate\n ownershipType\n year\n capacity\n status\n currentLocation\n fuelType\n fuelEfficiencyLPer100Km\n fuelLevel\n mileage\n createdAt\n updatedAt\n }\n }\n", g = "\n mutation UpdateDriver($id: ID!, $input: UpdateDriverInput!) {\n updateDriver(id: $id, input: $input) {\n id\n userId\n firstName\n lastName\n email\n phone\n employeeId\n licenseNumber\n licenseClass\n licenseExpiry\n status\n currentLocation\n rating\n vehicleId\n notes\n hireDate\n baseSalary\n bonusYtd\n payCurrency\n onLeaveUntil\n terminatedAt\n terminationReason\n createdAt\n }\n }\n", _ = "\n query GetDriverStatusCounts {\n onBreak: driversCount(filter: { status: ON_BREAK })\n offDuty: driversCount(filter: { status: OFF_DUTY })\n inactive: driversCount(filter: { status: INACTIVE })\n }\n", v = "\n query GetFleetStats {\n fleetStats {\n totalVehicles\n activeVehicles\n inTransitVehicles\n maintenanceVehicles\n totalDrivers\n availableDrivers\n onDeliveryDrivers\n avgDriverRating\n }\n }\n";
6
6
  function y(e) {
7
7
  switch (e) {
8
8
  case "ACTIVE": return "available";
@@ -24,6 +24,7 @@ function x(e) {
24
24
  case "AVAILABLE": return "available";
25
25
  case "ON_DELIVERY": return "busy";
26
26
  case "ON_BREAK": return "on_break";
27
+ case "INACTIVE": return "inactive";
27
28
  default: return "offline";
28
29
  }
29
30
  }
@@ -32,6 +33,7 @@ function S(e) {
32
33
  case "available": return "AVAILABLE";
33
34
  case "busy": return "ON_DELIVERY";
34
35
  case "on_break": return "ON_BREAK";
36
+ case "inactive": return "INACTIVE";
35
37
  default: return "OFF_DUTY";
36
38
  }
37
39
  }
@@ -61,6 +63,8 @@ function C(e) {
61
63
  lastMaintenance: e.lastServiceDate ? new Date(e.lastServiceDate) : void 0,
62
64
  nextMaintenance: e.nextServiceDueDate ? new Date(e.nextServiceDueDate) : void 0,
63
65
  nextMaintenanceMileage: e.nextServiceDueMileage ?? void 0,
66
+ fuelType: e.fuelType ?? void 0,
67
+ fuelEfficiencyLPer100Km: e.fuelEfficiencyLPer100Km ?? void 0,
64
68
  fuelLevel: e.fuelLevel ?? void 0,
65
69
  mileage: e.mileage ?? void 0,
66
70
  documents: [],
@@ -87,50 +91,16 @@ function w(e) {
87
91
  address: e.currentLocation.address ?? void 0,
88
92
  timestamp: /* @__PURE__ */ new Date()
89
93
  } : void 0,
90
- joinDate: new Date(e.createdAt),
91
- baseSalary: 0,
92
- completedOrders: 0,
93
- todayOrders: 0,
94
- specializations: [],
95
- workingHours: {
96
- startTime: "09:00",
97
- endTime: "18:00",
98
- workingDays: [
99
- "Mon",
100
- "Tue",
101
- "Wed",
102
- "Thu",
103
- "Fri"
104
- ],
105
- maxHoursPerDay: 8,
106
- maxHoursPerWeek: 40,
107
- currentHoursToday: 0,
108
- currentHoursThisWeek: 0
109
- },
110
- ratings: {
111
- overall: e.rating ?? 0,
112
- punctuality: e.rating ?? 0,
113
- communication: e.rating ?? 0,
114
- carefulHandling: e.rating ?? 0,
115
- professionalism: e.rating ?? 0,
116
- onTimeDelivery: e.rating ?? 0,
117
- totalRatings: 0
118
- },
94
+ rating: e.rating ?? 0,
95
+ notes: e.notes ?? void 0,
96
+ hireDate: e.hireDate ? new Date(e.hireDate) : void 0,
97
+ baseSalary: e.baseSalary ?? void 0,
98
+ bonusYtd: e.bonusYtd ?? void 0,
99
+ payCurrency: e.payCurrency ?? void 0,
100
+ onLeaveUntil: e.onLeaveUntil ? new Date(e.onLeaveUntil) : void 0,
101
+ terminatedAt: e.terminatedAt ? new Date(e.terminatedAt) : void 0,
102
+ terminationReason: e.terminationReason ?? void 0,
119
103
  documents: [],
120
- earnings: {
121
- totalEarnings: 0,
122
- weeklyEarnings: 0,
123
- monthlyEarnings: 0,
124
- pendingPayments: 0,
125
- completedDeliveries: 0,
126
- bonuses: 0
127
- },
128
- compliance: {
129
- hoursOfService: !0,
130
- documentation: !0,
131
- vehicleInspection: !0,
132
- lastUpdate: /* @__PURE__ */ new Date()
133
- },
134
104
  createdAt: new Date(e.createdAt)
135
105
  };
136
106
  }
@@ -205,7 +175,12 @@ function E(e = {}) {
205
175
  type: e.type,
206
176
  make: e.make,
207
177
  model: e.model,
208
- licensePlate: e.licensePlate
178
+ licensePlate: e.licensePlate,
179
+ ownershipType: e.ownershipType,
180
+ year: e.year,
181
+ status: e.status,
182
+ fuelType: e.fuelType,
183
+ fuelEfficiencyLPer100Km: e.fuelEfficiencyLPer100Km
209
184
  } })).createVehicle);
210
185
  return _((e) => [n, ...e]), n;
211
186
  }, [d]), j = n(async (e) => {
@@ -215,7 +190,17 @@ function E(e = {}) {
215
190
  lastName: e.lastName,
216
191
  email: e.email,
217
192
  phone: e.phone,
218
- licenseNumber: e.licenseNumber
193
+ licenseNumber: e.licenseNumber,
194
+ licenseClass: e.licenseClass,
195
+ licenseExpiry: e.licenseExpiry,
196
+ status: e.status,
197
+ vehicleId: e.vehicleId,
198
+ rating: e.rating,
199
+ notes: e.notes,
200
+ hireDate: e.hireDate,
201
+ baseSalary: e.baseSalary,
202
+ bonusYtd: e.bonusYtd,
203
+ payCurrency: e.payCurrency
219
204
  } })).createDriver);
220
205
  return y((e) => [n, ...e]), n;
221
206
  }, [d]), M = n(async (e, n) => {
@@ -226,7 +211,12 @@ function E(e = {}) {
226
211
  type: n.type,
227
212
  make: n.make,
228
213
  model: n.model,
229
- licensePlate: n.licensePlate
214
+ licensePlate: n.licensePlate,
215
+ ownershipType: n.ownershipType,
216
+ year: n.year,
217
+ status: n.status,
218
+ fuelType: n.fuelType,
219
+ fuelEfficiencyLPer100Km: n.fuelEfficiencyLPer100Km
230
220
  }
231
221
  })).updateVehicle);
232
222
  return _((t) => t.map((t) => t.id === e ? r : t)), r;
@@ -238,7 +228,20 @@ function E(e = {}) {
238
228
  lastName: n.lastName,
239
229
  email: n.email,
240
230
  phone: n.phone,
241
- licenseNumber: n.licenseNumber
231
+ licenseNumber: n.licenseNumber,
232
+ licenseClass: n.licenseClass,
233
+ licenseExpiry: n.licenseExpiry,
234
+ status: n.status,
235
+ vehicleId: n.vehicleId,
236
+ rating: n.rating,
237
+ notes: n.notes,
238
+ hireDate: n.hireDate,
239
+ baseSalary: n.baseSalary,
240
+ bonusYtd: n.bonusYtd,
241
+ payCurrency: n.payCurrency,
242
+ onLeaveUntil: n.onLeaveUntil,
243
+ terminatedAt: n.terminatedAt,
244
+ terminationReason: n.terminationReason
242
245
  }
243
246
  })).updateDriver);
244
247
  return y((t) => t.map((t) => t.id === e ? r : t)), r;
@@ -258,68 +261,74 @@ function E(e = {}) {
258
261
  };
259
262
  }
260
263
  function D(e = {}) {
261
- let { limit: i = 20, offset: s = 0, search: c, status: l, vehicleType: f, driverId: p } = e, m = T(), [h, g] = a([]), [_, v] = a(0), [y, x] = a(!1), [S, w] = a(!1), [E, D] = a(null), O = n(async () => {
262
- w(!0), D(null);
264
+ let { limit: i = 20, offset: s = 0, search: c, status: l, vehicleType: f, driverId: p, ids: m } = e, h = T(), [g, _] = a([]), [v, y] = a(0), [x, S] = a(!1), [w, E] = a(!1), [D, O] = a(null), k = n(async () => {
265
+ if (m && m.length === 0) {
266
+ _([]), y(0), S(!1);
267
+ return;
268
+ }
269
+ E(!0), O(null);
263
270
  try {
264
- let e = await t(m, o, {
271
+ let e = await t(h, o, {
265
272
  filter: {
266
273
  search: c || void 0,
267
274
  status: l ? b(l) : void 0,
268
275
  type: f?.toUpperCase(),
269
- driverId: p || void 0
276
+ driverId: p || void 0,
277
+ ids: m && m.length > 0 ? [...m] : void 0
270
278
  },
271
279
  pagination: {
272
- limit: i,
273
- offset: s
280
+ limit: m && m.length > 0 ? m.length : i,
281
+ offset: m ? 0 : s
274
282
  }
275
283
  });
276
- x(s + e.vehicles.length < e.vehiclesCount), v(e.vehiclesCount), g(e.vehicles.map(C));
284
+ S(s + e.vehicles.length < e.vehiclesCount), y(e.vehiclesCount), _(e.vehicles.map(C));
277
285
  } catch (e) {
278
- D(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load vehicles"));
286
+ O(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load vehicles"));
279
287
  } finally {
280
- w(!1);
288
+ E(!1);
281
289
  }
282
290
  }, [
283
- m,
291
+ h,
284
292
  i,
285
293
  s,
286
294
  c,
287
295
  l,
288
296
  f,
289
- p
297
+ p,
298
+ m ? [...m].sort().join(",") : ""
290
299
  ]);
291
300
  return r(() => {
292
- O();
293
- }, [O]), {
294
- vehicles: h,
295
- totalVehicles: _,
296
- hasMore: y,
297
- isLoading: S,
298
- error: E,
301
+ k();
302
+ }, [k]), {
303
+ vehicles: g,
304
+ totalVehicles: v,
305
+ hasMore: x,
306
+ isLoading: w,
307
+ error: D,
299
308
  refetch: n(() => {
300
- O();
301
- }, [O]),
309
+ k();
310
+ }, [k]),
302
311
  updateVehicleStatus: n(async (e, n) => {
303
- let r = C((await t(m, u, {
312
+ let r = C((await t(h, u, {
304
313
  id: e,
305
314
  status: b(n)
306
315
  })).updateVehicleStatus);
307
- return g((t) => t.map((t) => t.id === e ? r : t)), r;
308
- }, [m]),
316
+ return _((t) => t.map((t) => t.id === e ? r : t)), r;
317
+ }, [h]),
309
318
  assignDriver: n(async (e, n) => {
310
- await t(m, d, {
319
+ await t(h, d, {
311
320
  id: n,
312
321
  vehicleId: e
313
322
  });
314
- let r = h.find((t) => t.id === e);
323
+ let r = g.find((t) => t.id === e);
315
324
  if (!r) throw Error("Vehicle not found");
316
325
  let i = {
317
326
  ...r,
318
327
  driverId: n,
319
328
  status: "assigned"
320
329
  };
321
- return g((t) => t.map((t) => t.id === e ? i : t)), i;
322
- }, [m, h])
330
+ return _((t) => t.map((t) => t.id === e ? i : t)), i;
331
+ }, [h, g])
323
332
  };
324
333
  }
325
334
  function O(e) {
@@ -557,4 +566,4 @@ function N() {
557
566
  };
558
567
  }
559
568
  //#endregion
560
- export { w as mapDriver, C as mapVehicle, A as useDriver, j as useDriverStatusCounts, k as useDrivers, E as useFleet, N as useFleetStats, O as useVehicle, M as useVehicleDrivers, D as useVehicles };
569
+ export { w as mapDriver, C as mapVehicle, S as toApiDriverStatus, b as toApiVehicleStatus, A as useDriver, j as useDriverStatusCounts, k as useDrivers, E as useFleet, N as useFleetStats, O as useVehicle, M as useVehicleDrivers, D as useVehicles };
@@ -6,6 +6,8 @@ interface StatusBadgeProps {
6
6
  bg: string;
7
7
  text: string;
8
8
  };
9
+ /** Override the auto-derived display text (title-cased raw status). */
10
+ label?: string;
9
11
  size?: 'sm' | 'md' | 'lg';
10
12
  showDot?: boolean;
11
13
  className?: string;
@@ -13,7 +15,7 @@ interface StatusBadgeProps {
13
15
  /**
14
16
  * StatusBadge - Displays status with appropriate colors
15
17
  */
16
- export declare function StatusBadge({ status, type, customColors, size, showDot, className, }: StatusBadgeProps): import("react").JSX.Element;
18
+ export declare function StatusBadge({ status, type, customColors, label, size, showDot, className, }: StatusBadgeProps): import("react").JSX.Element;
17
19
  /**
18
20
  * Priority Badge - Displays priority level
19
21
  */
@@ -13,6 +13,7 @@ export interface StatusColor {
13
13
  export declare const ORDER_STATUS_COLORS: Record<string, StatusColor>;
14
14
  export declare const VEHICLE_STATUS_COLORS: Record<string, StatusColor>;
15
15
  export declare const DRIVER_STATUS_COLORS: Record<string, StatusColor>;
16
+ export declare const DRIVER_STATUS_LABELS: Record<string, string>;
16
17
  export declare const PRIORITY_COLORS: Record<string, StatusColor>;
17
18
  export declare const ROUTE_STATUS_COLORS: Record<string, StatusColor>;
18
19
  export declare const CUSTOMER_TYPE_LABELS: Record<string, string>;
@@ -11,6 +11,13 @@ export interface CreateVehicleInput {
11
11
  make?: string;
12
12
  model?: string;
13
13
  licensePlate?: string;
14
+ /** Free-text, e.g. "owned", "leased". */
15
+ ownershipType?: string;
16
+ year?: number;
17
+ /** VehicleStatus enum value, e.g. `ACTIVE`, `MAINTENANCE`. */
18
+ status?: string;
19
+ fuelType?: string;
20
+ fuelEfficiencyLPer100Km?: number;
14
21
  }
15
22
  export interface CreateDriverInput {
16
23
  employeeId: string;
@@ -19,6 +26,23 @@ export interface CreateDriverInput {
19
26
  email?: string;
20
27
  phone?: string;
21
28
  licenseNumber?: string;
29
+ licenseClass?: string;
30
+ licenseExpiry?: string;
31
+ /** DriverStatus enum value, e.g. `AVAILABLE`, `OFF_DUTY`. */
32
+ status?: string;
33
+ vehicleId?: string;
34
+ rating?: number;
35
+ notes?: string;
36
+ hireDate?: string;
37
+ baseSalary?: number;
38
+ bonusYtd?: number;
39
+ payCurrency?: string;
40
+ }
41
+ /** Superset of `CreateDriverInput` with fields that only make sense on an existing driver. */
42
+ export interface UpdateDriverInput extends CreateDriverInput {
43
+ onLeaveUntil?: string | null;
44
+ terminatedAt?: string;
45
+ terminationReason?: string;
22
46
  }
23
47
  interface UseFleetResult {
24
48
  vehicles: Vehicle[];
@@ -31,7 +55,7 @@ interface UseFleetResult {
31
55
  createVehicle: (input: CreateVehicleInput) => Promise<Vehicle>;
32
56
  createDriver: (input: CreateDriverInput) => Promise<Driver>;
33
57
  updateVehicle: (id: string, input: CreateVehicleInput) => Promise<Vehicle>;
34
- updateDriver: (id: string, input: CreateDriverInput) => Promise<Driver>;
58
+ updateDriver: (id: string, input: UpdateDriverInput) => Promise<Driver>;
35
59
  }
36
60
  export interface ApiVehicle {
37
61
  id: string;
@@ -45,6 +69,8 @@ export interface ApiVehicle {
45
69
  capacity?: Record<string, unknown> | null;
46
70
  status: string;
47
71
  currentLocation?: Record<string, unknown> | null;
72
+ fuelType?: string | null;
73
+ fuelEfficiencyLPer100Km?: number | null;
48
74
  fuelLevel?: number | null;
49
75
  mileage?: number | null;
50
76
  lastServiceDate?: string | null;
@@ -68,8 +94,20 @@ export interface ApiDriver {
68
94
  currentLocation?: Record<string, unknown> | null;
69
95
  rating?: number | null;
70
96
  vehicleId?: string | null;
97
+ notes?: string | null;
98
+ hireDate?: string | null;
99
+ baseSalary?: number | null;
100
+ bonusYtd?: number | null;
101
+ payCurrency?: string | null;
102
+ onLeaveUntil?: string | null;
103
+ terminatedAt?: string | null;
104
+ terminationReason?: string | null;
71
105
  createdAt: string;
72
106
  }
107
+ /** Exported so the vehicle edit form's status field can round-trip (BOFF-7909). */
108
+ export declare function toApiVehicleStatus(status: VehicleStatus): string;
109
+ /** Exported so the driver edit form's status field can round-trip losslessly (BOFF-7909). */
110
+ export declare function toApiDriverStatus(status: DriverStatus): string;
73
111
  export declare function mapVehicle(vehicle: ApiVehicle): Vehicle;
74
112
  export declare function mapDriver(driver: ApiDriver): Driver;
75
113
  export declare function useFleet(options?: UseFleetOptions): UseFleetResult;
@@ -83,6 +121,8 @@ interface UseVehiclesOptions extends UseListOptions {
83
121
  vehicleType?: Vehicle['type'];
84
122
  /** Narrows to vehicles linked to this driver server-side (VehicleFilterInput.driverId). */
85
123
  driverId?: string;
124
+ /** Fetch exactly these vehicles by id, regardless of how many there are. */
125
+ ids?: readonly string[];
86
126
  }
87
127
  interface UseVehiclesResult {
88
128
  vehicles: Vehicle[];
@@ -281,12 +281,15 @@ export interface Vehicle {
281
281
  nextMaintenance?: Date;
282
282
  /** Odometer reading (km) at which the next service is due. */
283
283
  nextMaintenanceMileage?: number;
284
+ fuelType?: string;
285
+ /** Fuel consumption, litres per 100km. */
286
+ fuelEfficiencyLPer100Km?: number;
284
287
  fuelLevel?: number;
285
288
  mileage?: number;
286
289
  documents: VehicleDocument[];
287
290
  createdAt: Date;
288
291
  }
289
- export type DriverStatus = 'available' | 'busy' | 'offline' | 'on_break';
292
+ export type DriverStatus = 'available' | 'busy' | 'offline' | 'on_break' | 'inactive';
290
293
  export interface DriverDocument {
291
294
  id: string;
292
295
  type: 'license' | 'insurance' | 'certification' | 'background_check';
@@ -308,44 +311,19 @@ export interface Driver {
308
311
  assignedVehicle?: string;
309
312
  status: DriverStatus;
310
313
  currentLocation?: Location;
311
- joinDate: Date;
312
- baseSalary: number;
313
- completedOrders: number;
314
- todayOrders: number;
315
- specializations: string[];
316
- workingHours: {
317
- startTime: string;
318
- endTime: string;
319
- workingDays: string[];
320
- maxHoursPerDay: number;
321
- maxHoursPerWeek: number;
322
- currentHoursToday: number;
323
- currentHoursThisWeek: number;
324
- };
325
- ratings: {
326
- overall: number;
327
- punctuality: number;
328
- communication: number;
329
- carefulHandling: number;
330
- professionalism: number;
331
- onTimeDelivery: number;
332
- totalRatings: number;
333
- };
314
+ /** MtwDriver.rating — a single overall rating; the backend does not track per-category breakdowns. */
315
+ rating: number;
316
+ /** Free-text HR/performance notes. */
317
+ notes?: string;
318
+ hireDate?: Date;
319
+ baseSalary?: number;
320
+ bonusYtd?: number;
321
+ payCurrency?: string;
322
+ /** Set and in the future means the driver is currently on leave. */
323
+ onLeaveUntil?: Date;
324
+ terminatedAt?: Date;
325
+ terminationReason?: string;
334
326
  documents: DriverDocument[];
335
- earnings: {
336
- totalEarnings: number;
337
- weeklyEarnings: number;
338
- monthlyEarnings: number;
339
- pendingPayments: number;
340
- completedDeliveries: number;
341
- bonuses: number;
342
- };
343
- compliance: {
344
- hoursOfService: boolean;
345
- documentation: boolean;
346
- vehicleInspection: boolean;
347
- lastUpdate: Date;
348
- };
349
327
  createdAt: Date;
350
328
  }
351
329
  export interface WarehouseZone {
@@ -0,0 +1,11 @@
1
+ import { createLucideIcon as e } from "../createLucideIcon.js";
2
+ //#region node_modules/lucide-react/dist/esm/icons/sticky-note.js
3
+ var t = e("StickyNote", [["path", {
4
+ d: "M16 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8Z",
5
+ key: "qazsjp"
6
+ }], ["path", {
7
+ d: "M15 3v4a2 2 0 0 0 2 2h4",
8
+ key: "40519r"
9
+ }]]);
10
+ //#endregion
11
+ export { t as StickyNote };
@@ -0,0 +1,30 @@
1
+ import { createLucideIcon as e } from "../createLucideIcon.js";
2
+ //#region node_modules/lucide-react/dist/esm/icons/user-x.js
3
+ var t = e("UserX", [
4
+ ["path", {
5
+ d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",
6
+ key: "1yyitq"
7
+ }],
8
+ ["circle", {
9
+ cx: "9",
10
+ cy: "7",
11
+ r: "4",
12
+ key: "nufk8"
13
+ }],
14
+ ["line", {
15
+ x1: "17",
16
+ x2: "22",
17
+ y1: "8",
18
+ y2: "13",
19
+ key: "3nzzx3"
20
+ }],
21
+ ["line", {
22
+ x1: "22",
23
+ x2: "17",
24
+ y1: "8",
25
+ y2: "13",
26
+ key: "1swrse"
27
+ }]
28
+ ]);
29
+ //#endregion
30
+ export { t as UserX };