@burdenoff/microfe-movethewheels 2026.929.3 → 2026.930.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. package/dist/components/CustomerPicker.js +52 -48
  2. package/dist/components/EntityCombobox.js +25 -23
  3. package/dist/components/OrderItemRow.js +123 -78
  4. package/dist/generated/wspace-types.d.ts +1547 -64
  5. package/dist/hooks/useCustomers.js +55 -26
  6. package/dist/hooks/useFleet.js +236 -157
  7. package/dist/hooks/useInventory.js +214 -153
  8. package/dist/hooks/useMultiModalShipments.js +30 -26
  9. package/dist/hooks/useRoutes.js +64 -24
  10. package/dist/hooks/useTracking.js +14 -16
  11. package/dist/movethewheels/components/CustomerPicker.d.ts +5 -1
  12. package/dist/movethewheels/components/EntityCombobox.d.ts +6 -3
  13. package/dist/movethewheels/components/OrderItemRow.d.ts +7 -1
  14. package/dist/movethewheels/hooks/useCustomers.d.ts +3 -0
  15. package/dist/movethewheels/hooks/useFleet.d.ts +15 -2
  16. package/dist/movethewheels/hooks/useInventory.d.ts +15 -12
  17. package/dist/movethewheels/hooks/useMultiModalShipments.d.ts +1 -0
  18. package/dist/movethewheels/hooks/useRoutes.d.ts +7 -1
  19. package/dist/movethewheels/types/index.d.ts +33 -23
  20. package/dist/movethewheels/utils/formatters.d.ts +1 -1
  21. package/dist/movethewheels/utils/orderValidation.d.ts +11 -0
  22. package/dist/pages/CreateOrderPage.js +349 -297
  23. package/dist/pages/CustomerDetailsPage.js +6 -6
  24. package/dist/pages/CustomersPage.js +2 -2
  25. package/dist/pages/DashboardPage.js +1 -1
  26. package/dist/pages/DriverDetailsPage.js +340 -332
  27. package/dist/pages/DriversPage.js +7 -5
  28. package/dist/pages/FleetPage.js +1 -1
  29. package/dist/pages/InventoryPage.js +11 -12
  30. package/dist/pages/LiveTrackingPage.js +4 -4
  31. package/dist/pages/MultiModalShipmentPage.js +139 -125
  32. package/dist/pages/OrderDetailsPage.js +132 -140
  33. package/dist/pages/ProductDetailsPage.js +408 -249
  34. package/dist/pages/ProductsPage.js +5 -5
  35. package/dist/pages/RouteDetailsPage.js +208 -210
  36. package/dist/pages/RoutesPage.js +2 -2
  37. package/dist/pages/TrackingPage.js +16 -9
  38. package/dist/pages/WarehouseDetailsPage.js +166 -163
  39. package/dist/pages/WarehousesPage.js +29 -21
  40. package/dist/utils/orderValidation.js +18 -0
  41. package/package.json +1 -1
  42. package/src/generated/wspace-types.ts +1762 -64
  43. package/src/movethewheels/components/CustomerPicker.tsx +12 -0
  44. package/src/movethewheels/components/EntityCombobox.tsx +30 -11
  45. package/src/movethewheels/components/OrderItemRow.tsx +44 -0
  46. package/src/movethewheels/hooks/useCustomers.ts +45 -9
  47. package/src/movethewheels/hooks/useFleet.ts +214 -36
  48. package/src/movethewheels/hooks/useInventory.ts +185 -49
  49. package/src/movethewheels/hooks/useMultiModalShipments.ts +9 -7
  50. package/src/movethewheels/hooks/useRoutes.ts +87 -16
  51. package/src/movethewheels/hooks/useTracking.ts +23 -15
  52. package/src/movethewheels/pages/CreateOrderPage.tsx +66 -2
  53. package/src/movethewheels/pages/CustomerDetailsPage.tsx +14 -8
  54. package/src/movethewheels/pages/CustomersPage.tsx +5 -2
  55. package/src/movethewheels/pages/DashboardPage.tsx +3 -1
  56. package/src/movethewheels/pages/DriverDetailsPage.tsx +25 -4
  57. package/src/movethewheels/pages/DriversPage.tsx +8 -2
  58. package/src/movethewheels/pages/FleetPage.tsx +1 -1
  59. package/src/movethewheels/pages/InventoryPage.tsx +20 -16
  60. package/src/movethewheels/pages/LiveTrackingPage.tsx +6 -4
  61. package/src/movethewheels/pages/MultiModalShipmentPage.tsx +15 -1
  62. package/src/movethewheels/pages/OrderDetailsPage.tsx +25 -25
  63. package/src/movethewheels/pages/ProductDetailsPage.tsx +228 -49
  64. package/src/movethewheels/pages/ProductsPage.tsx +13 -5
  65. package/src/movethewheels/pages/RouteDetailsPage.tsx +24 -12
  66. package/src/movethewheels/pages/RoutesPage.tsx +4 -2
  67. package/src/movethewheels/pages/TrackingPage.tsx +32 -12
  68. package/src/movethewheels/pages/WarehouseDetailsPage.tsx +42 -29
  69. package/src/movethewheels/pages/WarehousesPage.tsx +23 -15
  70. package/src/movethewheels/types/index.ts +36 -24
  71. package/src/movethewheels/utils/formatters.ts +1 -1
  72. package/src/movethewheels/utils/orderValidation.ts +53 -0
@@ -3,11 +3,11 @@ 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/useMultiModalShipments.ts
5
5
  var o = "\n id\n shipmentNumber\n status\n primaryMode\n isMultiModal\n totalFreightCost\n freightCurrency\n origin\n destination\n createdAt\n legs(pagination: { limit: 20, offset: 0 }) {\n \n id\n legNumber\n mode\n status\n origin\n destination\n distanceKm\n weightKg\n lengthCm\n widthCm\n heightCm\n volumeCbm\n containerType\n containerCount\n carrierName\n chargeableWeightKg\n calculatedCost\n currency\n\n }\n", s = `
6
- query ListMultiModalShipments($pagination: PaginationInput) {
7
- shipments(filter: { isMultiModal: true }, pagination: $pagination) {
6
+ query ListMultiModalShipments($search: String, $pagination: PaginationInput) {
7
+ shipments(filter: { isMultiModal: true, search: $search }, pagination: $pagination) {
8
8
  ${o}
9
9
  }
10
- shipmentsCount(filter: { isMultiModal: true })
10
+ shipmentsCount(filter: { isMultiModal: true, search: $search })
11
11
  }
12
12
  `, c = "\n query CalculateFreightRate($input: FreightRateInput!) {\n calculateFreightRate(input: $input) {\n mode\n chargeableWeightKg\n ratePerUnit\n calculatedCost\n currency\n breakdown {\n label\n amount\n }\n }\n }\n", l = `
13
13
  mutation PlanMultiModalShipment($input: PlanMultiModalShipmentInput!) {
@@ -101,44 +101,48 @@ function m() {
101
101
  ]);
102
102
  }
103
103
  function h(e = {}) {
104
- let { limit: i = 10, offset: o = 0 } = e, f = m(), [h, g] = a([]), [_, v] = a(0), [y, b] = a(!1), [x, S] = a(!1), [C, w] = a(null), T = n(async () => {
105
- S(!0), w(null);
104
+ let { limit: i = 10, offset: o = 0, search: f = "" } = e, h = m(), [g, _] = a([]), [v, y] = a(0), [b, x] = a(!1), [S, C] = a(!1), [w, T] = a(null), E = n(async () => {
105
+ C(!0), T(null);
106
106
  try {
107
- let e = await t(f, s, { pagination: {
108
- limit: i,
109
- offset: o
110
- } });
111
- g(e.shipments.map(p)), v(e.shipmentsCount), b(o + e.shipments.length < e.shipmentsCount);
107
+ let e = await t(h, s, {
108
+ search: f.trim() || void 0,
109
+ pagination: {
110
+ limit: i,
111
+ offset: o
112
+ }
113
+ });
114
+ _(e.shipments.map(p)), y(e.shipmentsCount), x(o + e.shipments.length < e.shipmentsCount);
112
115
  } catch (e) {
113
- w(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load multi-modal shipments"));
116
+ T(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load multi-modal shipments"));
114
117
  } finally {
115
- S(!1);
118
+ C(!1);
116
119
  }
117
120
  }, [
118
- f,
121
+ h,
119
122
  i,
120
- o
123
+ o,
124
+ f
121
125
  ]);
122
126
  return r(() => {
123
- T();
124
- }, [T]), {
125
- shipments: h,
126
- totalShipments: _,
127
- hasMore: y,
128
- isLoading: x,
129
- error: C,
130
- refetch: () => void T(),
131
- calculateFreightRate: n(async (e) => (await t(f, c, { input: d(e) })).calculateFreightRate, [f]),
127
+ E();
128
+ }, [E]), {
129
+ shipments: g,
130
+ totalShipments: v,
131
+ hasMore: b,
132
+ isLoading: S,
133
+ error: w,
134
+ refetch: () => void E(),
135
+ calculateFreightRate: n(async (e) => (await t(h, c, { input: d(e) })).calculateFreightRate, [h]),
132
136
  planMultiModalShipment: n(async (e) => {
133
- let n = p((await t(f, l, { input: {
137
+ let n = p((await t(h, l, { input: {
134
138
  shipmentNumber: e.shipmentNumber,
135
139
  customerId: e.customerId,
136
140
  origin: e.origin,
137
141
  destination: e.destination,
138
142
  legs: e.legs.map(u)
139
143
  } })).planMultiModalShipment);
140
- return g((e) => [n, ...e]), v((e) => e + 1), n;
141
- }, [f])
144
+ return _((e) => [n, ...e]), y((e) => e + 1), n;
145
+ }, [h])
142
146
  };
143
147
  }
144
148
  //#endregion
@@ -32,13 +32,13 @@ function m(e) {
32
32
  state: String(i.state ?? n.state ?? ""),
33
33
  postalCode: String(i.postalCode ?? n.postalCode ?? ""),
34
34
  country: String(i.country ?? n.country ?? ""),
35
- latitude: Number(i.latitude ?? n.latitude ?? n.lat ?? 0),
36
- longitude: Number(i.longitude ?? n.longitude ?? n.lng ?? 0)
35
+ latitude: typeof (i.latitude ?? n.latitude ?? n.lat) == "number" ? i.latitude ?? n.latitude ?? n.lat : void 0,
36
+ longitude: typeof (i.longitude ?? n.longitude ?? n.lng) == "number" ? i.longitude ?? n.longitude ?? n.lng : void 0
37
37
  },
38
38
  type: n.type === "pickup" ? "pickup" : "delivery",
39
- scheduledTime: n.scheduledTime ? new Date(String(n.scheduledTime)) : /* @__PURE__ */ new Date(),
39
+ scheduledTime: n.scheduledTime ? new Date(String(n.scheduledTime)) : void 0,
40
40
  actualTime: n.actualTime ? new Date(String(n.actualTime)) : void 0,
41
- duration: Number(n.duration ?? 0),
41
+ duration: typeof n.duration == "number" ? n.duration : void 0,
42
42
  status: n.status ?? "pending",
43
43
  notes: n.notes ? String(n.notes) : void 0
44
44
  };
@@ -48,15 +48,15 @@ function h(e) {
48
48
  return {
49
49
  id: e.id,
50
50
  name: e.name,
51
- driverId: e.driverId ?? "",
52
- vehicleId: e.vehicleId ?? "",
51
+ driverId: e.driverId ?? void 0,
52
+ vehicleId: e.vehicleId ?? void 0,
53
53
  status: f(e.status),
54
54
  stops: m(e.waypoints),
55
55
  distance: e.actualDistance ?? e.estimatedDistance ?? 0,
56
56
  estimatedDuration: e.estimatedDuration ?? 0,
57
57
  fuelCost: e.fuelCost ?? void 0,
58
58
  actualDuration: e.actualDuration ?? void 0,
59
- optimized: (e.estimatedDistance ?? 0) > 0,
59
+ optimized: void 0,
60
60
  createdAt: new Date(e.createdAt)
61
61
  };
62
62
  }
@@ -79,8 +79,8 @@ function g() {
79
79
  ]);
80
80
  }
81
81
  function _(e = {}) {
82
- let { driverId: i, vehicleId: s, status: f, search: m, limit: _ = 20, offset: v = 0 } = e, y = g(), [b, x] = a([]), [S, C] = a(0), [w, T] = a(!1), [E, D] = a(!1), [O, k] = a(null), A = n(async () => {
83
- D(!0), k(null);
82
+ let { driverId: i, vehicleId: s, status: f, search: m, limit: _ = 20, offset: v = 0 } = e, y = g(), [b, x] = a([]), [S, C] = a(0), [w, T] = a(!1), [E, D] = a(!1), [O, k] = a(!1), [A, j] = a(null), M = n(async () => {
83
+ D(!0), j(null);
84
84
  try {
85
85
  let e = await t(y, o, {
86
86
  filter: {
@@ -96,7 +96,7 @@ function _(e = {}) {
96
96
  });
97
97
  C(e.routesCount), T(v + e.routes.length < e.routesCount), x(e.routes.map(h));
98
98
  } catch (e) {
99
- k(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load routes"));
99
+ j(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load routes"));
100
100
  } finally {
101
101
  D(!1);
102
102
  }
@@ -108,13 +108,51 @@ function _(e = {}) {
108
108
  s,
109
109
  _,
110
110
  v
111
+ ]), N = n(async () => {
112
+ if (!w || E || O) return;
113
+ let e = v + b.length;
114
+ k(!0), j(null);
115
+ try {
116
+ let n = await t(y, o, {
117
+ filter: {
118
+ driverId: i,
119
+ vehicleId: s,
120
+ status: f ? p(f) : void 0,
121
+ search: m || void 0
122
+ },
123
+ pagination: {
124
+ limit: _,
125
+ offset: e
126
+ }
127
+ }), r = n.routes.map(h);
128
+ C(n.routesCount), T(e + r.length < n.routesCount), x((e) => {
129
+ let t = new Set(e.map((e) => e.id));
130
+ return [...e, ...r.filter((e) => !t.has(e.id))];
131
+ });
132
+ } catch (e) {
133
+ j(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load more routes"));
134
+ } finally {
135
+ k(!1);
136
+ }
137
+ }, [
138
+ i,
139
+ y,
140
+ w,
141
+ E,
142
+ O,
143
+ _,
144
+ v,
145
+ b.length,
146
+ m,
147
+ f,
148
+ s
111
149
  ]);
112
150
  r(() => {
113
- A();
114
- }, [A]);
115
- let j = n(() => {
116
- A();
117
- }, [A]), M = n(async (e) => {
151
+ M();
152
+ }, [M]);
153
+ let P = n(() => {
154
+ M();
155
+ }, [M]), F = n(async (e) => {
118
156
  let n = h((await t(y, c, { input: {
119
157
  name: e.name ?? `Route ${(/* @__PURE__ */ new Date()).toLocaleDateString()}`,
120
158
  status: p(e.status),
@@ -126,15 +164,15 @@ function _(e = {}) {
126
164
  fuelCost: e.fuelCost
127
165
  } })).createRoute);
128
166
  return x((e) => [n, ...e]), n;
129
- }, [y]), N = n(async (e, n) => {
167
+ }, [y]), I = n(async (e, n) => {
130
168
  let r = h((await t(y, l, {
131
169
  id: e,
132
170
  input: {
133
171
  name: n.name,
134
172
  status: p(n.status),
135
173
  shipmentId: void 0,
136
- vehicleId: n.vehicleId,
137
- driverId: n.driverId,
174
+ vehicleId: Object.prototype.hasOwnProperty.call(n, "vehicleId") ? n.vehicleId ?? null : void 0,
175
+ driverId: Object.prototype.hasOwnProperty.call(n, "driverId") ? n.driverId ?? null : void 0,
138
176
  waypoints: n.stops,
139
177
  estimatedDuration: n.estimatedDuration,
140
178
  fuelCost: n.fuelCost
@@ -147,10 +185,12 @@ function _(e = {}) {
147
185
  totalRoutes: S,
148
186
  hasMore: w,
149
187
  isLoading: E,
150
- error: O,
151
- refetch: j,
152
- createRoute: M,
153
- updateRoute: N,
188
+ isLoadingMore: O,
189
+ error: A,
190
+ refetch: P,
191
+ loadMore: N,
192
+ createRoute: F,
193
+ updateRoute: I,
154
194
  deleteRoute: n(async (e) => {
155
195
  await t(y, u, { id: e }), x((t) => t.filter((t) => t.id !== e));
156
196
  }, [y]),
@@ -169,11 +209,11 @@ function _(e = {}) {
169
209
  status: n,
170
210
  actualTime: n === "completed" ? /* @__PURE__ */ new Date() : e.actualTime
171
211
  } : e);
172
- return N(e, {
212
+ return I(e, {
173
213
  stops: i,
174
214
  status: i.every((e) => e.status === "completed") ? "completed" : r.status
175
215
  });
176
- }, [b, N])
216
+ }, [b, I])
177
217
  };
178
218
  }
179
219
  function v(e) {
@@ -6,18 +6,21 @@ import { useCallback as u, useEffect as d, useMemo as f, useState as p } from "r
6
6
  //#region src/movethewheels/hooks/useTracking.ts
7
7
  var m = "\n query ListShipments($filter: ShipmentFilterInput, $pagination: PaginationInput) {\n shipments(filter: $filter, pagination: $pagination) {\n id\n shipmentNumber\n deliveryJobId\n status\n trackingNumber\n estimatedDelivery\n }\n }\n", h = "\n query LookupDeliveryJob($id: ID!) {\n deliveryJob(id: $id) {\n id\n }\n }\n", g = "\n query LookupDeliveryJobs($filter: DeliveryJobFilterInput, $pagination: PaginationInput) {\n deliveryJobs(filter: $filter, pagination: $pagination) {\n id\n deliveryJobNumber\n trackingNumber\n }\n }\n", _ = "\n query GetDeliveryJobTracking($deliveryJobId: ID!, $pagination: PaginationInput) {\n deliveryJobTracking(deliveryJobId: $deliveryJobId, pagination: $pagination) {\n id\n shipmentId\n eventType\n location\n details\n timestamp\n }\n }\n", v = "\n query GetActiveDeliveries($pagination: PaginationInput) {\n activeDeliveries(pagination: $pagination) {\n id\n shipmentNumber\n deliveryJobId\n status\n estimatedDelivery\n trackingEvents(pagination: { limit: 1, offset: 0 }) {\n id\n shipmentId\n eventType\n location\n details\n timestamp\n }\n deliveryJob {\n id\n deliveryJobNumber\n customerId\n status\n priority\n pickupAddress\n deliveryAddress\n cargoItems\n pricing\n trackingNumber\n specialInstructions\n scheduledDelivery\n vehicleId\n driverId\n createdAt\n updatedAt\n customer {\n name\n email\n phone\n company\n }\n vehicle {\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 }\n driver {\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 }\n", y = "\n query GetTrackingAlerts {\n trackingAlerts {\n shipmentId\n shipmentNumber\n alertType\n message\n }\n }\n";
8
8
  function b(e) {
9
- return {
10
- latitude: Number(e.location?.latitude ?? 0),
11
- longitude: Number(e.location?.longitude ?? 0),
12
- address: e.location?.address ?? void 0,
9
+ let t = e.location;
10
+ if (!t) return null;
11
+ let n = t.latitude ?? t.lat, r = t.longitude ?? t.lng;
12
+ return typeof n != "number" || !Number.isFinite(n) || typeof r != "number" || !Number.isFinite(r) ? null : {
13
+ latitude: n,
14
+ longitude: r,
15
+ address: typeof t.address == "string" ? t.address : void 0,
13
16
  timestamp: new Date(e.timestamp)
14
17
  };
15
18
  }
16
19
  function x(e, t) {
17
20
  let n = e[0];
18
21
  if (!n) return null;
19
- let r = e.map(b), i = r[0];
20
- return i ? {
22
+ let r = e.map(b).filter((e) => e !== null), i = r[0];
23
+ return {
21
24
  id: n.id,
22
25
  entityId: t,
23
26
  entityType: "order",
@@ -28,7 +31,7 @@ function x(e, t) {
28
31
  nextCheckpoint: n.details ?? void 0,
29
32
  alerts: [],
30
33
  lastUpdated: new Date(n.timestamp)
31
- } : null;
34
+ };
32
35
  }
33
36
  function S() {
34
37
  let { apiGatewayUrl: t, authToken: n, workspaceToken: r, workspaceId: i, tenantId: a, currentUser: o } = e();
@@ -78,17 +81,13 @@ function T(e = {}) {
78
81
  id: e.id,
79
82
  entityId: n ?? e.deliveryJobId ?? e.id,
80
83
  entityType: r ?? "order",
81
- currentLocation: {
82
- latitude: 0,
83
- longitude: 0,
84
- timestamp: /* @__PURE__ */ new Date()
85
- },
84
+ currentLocation: void 0,
86
85
  locationHistory: [],
87
86
  status: e.status.toLowerCase(),
88
87
  estimatedArrival: e.estimatedDelivery ? new Date(e.estimatedDelivery) : void 0,
89
88
  nextCheckpoint: e.shipmentNumber,
90
89
  alerts: [],
91
- lastUpdated: /* @__PURE__ */ new Date()
90
+ lastUpdated: void 0
92
91
  })));
93
92
  } catch (e) {
94
93
  h(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load tracking data"));
@@ -197,7 +196,7 @@ function O(e) {
197
196
  currentLocation: t.currentLocation,
198
197
  locationHistory: [t.currentLocation],
199
198
  status: t.status,
200
- lastUpdated: t.currentLocation.timestamp ?? /* @__PURE__ */ new Date(),
199
+ lastUpdated: t.currentLocation.timestamp,
201
200
  alerts: []
202
201
  }, [t]),
203
202
  vehicle: t,
@@ -216,7 +215,7 @@ function k(e) {
216
215
  currentLocation: t.currentLocation,
217
216
  locationHistory: [t.currentLocation],
218
217
  status: t.status,
219
- lastUpdated: t.currentLocation.timestamp ?? /* @__PURE__ */ new Date(),
218
+ lastUpdated: t.currentLocation.timestamp,
220
219
  alerts: []
221
220
  }, [t]),
222
221
  driver: t,
@@ -266,7 +265,6 @@ function j() {
266
265
  type: "delay",
267
266
  severity: "medium",
268
267
  message: `${e.shipmentNumber}: ${e.message}`,
269
- timestamp: /* @__PURE__ */ new Date(),
270
268
  acknowledged: !1
271
269
  })));
272
270
  } catch (e) {
@@ -7,8 +7,12 @@ interface CustomerPickerProps {
7
7
  onCreated: (customer: Customer) => void;
8
8
  createCustomer: (customer: Partial<Customer>) => Promise<Customer>;
9
9
  isLoading: boolean;
10
+ isLoadingMore?: boolean;
10
11
  error: Error | null;
11
12
  onRetry: () => void;
13
+ onLoadMore?: () => void | Promise<void>;
14
+ hasMore?: boolean;
15
+ totalCount?: number;
12
16
  onOpenCustomers?: () => void;
13
17
  selectedCustomer?: Customer | null;
14
18
  /** Called with the (already debounced) query text as the user types in the
@@ -16,5 +20,5 @@ interface CustomerPickerProps {
16
20
  onSearchQueryChange?: (query: string) => void;
17
21
  disabled?: boolean;
18
22
  }
19
- export declare function CustomerPicker({ customers, value, onValueChange, onCreated, createCustomer, isLoading, error, onRetry, onOpenCustomers, selectedCustomer, onSearchQueryChange, disabled, }: CustomerPickerProps): import("react").JSX.Element;
23
+ export declare function CustomerPicker({ customers, value, onValueChange, onCreated, createCustomer, isLoading, isLoadingMore, error, onRetry, onLoadMore, hasMore, totalCount, onOpenCustomers, selectedCustomer, onSearchQueryChange, disabled, }: CustomerPickerProps): import("react").JSX.Element;
20
24
  export {};
@@ -31,10 +31,13 @@ interface EntityComboboxProps<T> {
31
31
  /** Server-side search callback (debounced). Omit to hide the built-in search
32
32
  * input when a caller already provides one elsewhere for the same list. */
33
33
  onSearchChange?: (value: string) => void;
34
- /** True when the source hook's page doesn't hold every matching record —
35
- * paired with `totalCount` to render a "keep typing to narrow" hint. */
34
+ /** True when the source hook has another server page available. */
36
35
  hasMore?: boolean;
37
36
  totalCount?: number;
37
+ /** Fetches and appends the next server page without replacing the current options. */
38
+ onLoadMore?: () => void | Promise<void>;
39
+ /** True while the next server page is being fetched. */
40
+ loadingMore?: boolean;
38
41
  }
39
- export declare function EntityCombobox<T>({ value, onChange, options, loading, getId, renderOption, getLabel, selectedOption, selectedLoading, required, placeholder, searchPlaceholder, emptyText, noneLabel, disabled, id, error, className, onSearchChange, hasMore, totalCount, }: EntityComboboxProps<T>): import("react").JSX.Element;
42
+ export declare function EntityCombobox<T>({ value, onChange, options, loading, getId, renderOption, getLabel, selectedOption, selectedLoading, required, placeholder, searchPlaceholder, emptyText, noneLabel, disabled, id, error, className, onSearchChange, hasMore, totalCount, onLoadMore, loadingMore, }: EntityComboboxProps<T>): import("react").JSX.Element;
40
43
  export {};
@@ -1,12 +1,18 @@
1
1
  import { OrderItem, Product } from '../types';
2
+ import { OrderItemFieldErrors } from '../utils/orderValidation';
2
3
 
3
4
  interface OrderItemRowProps {
4
5
  item: OrderItem;
5
6
  index: number;
6
7
  products: Product[];
7
8
  productsLoading: boolean;
9
+ productsLoadingMore?: boolean;
10
+ productsHasMore?: boolean;
11
+ productsTotalCount?: number;
12
+ onLoadMoreProducts?: () => void | Promise<void>;
13
+ errors?: OrderItemFieldErrors;
8
14
  onUpdate: (index: number, field: string, value: unknown) => void;
9
15
  onRemove: (index: number) => void;
10
16
  }
11
- export declare function OrderItemRow({ item, index, products, productsLoading, onUpdate, onRemove, }: OrderItemRowProps): import("react").JSX.Element;
17
+ export declare function OrderItemRow({ item, index, products, productsLoading, productsLoadingMore, productsHasMore, productsTotalCount, onLoadMoreProducts, errors, onUpdate, onRemove, }: OrderItemRowProps): import("react").JSX.Element;
12
18
  export {};
@@ -10,8 +10,11 @@ interface UseCustomersResult {
10
10
  totalCustomers: number;
11
11
  hasMore: boolean;
12
12
  isLoading: boolean;
13
+ /** True while an additional server page is appended. */
14
+ isLoadingMore: boolean;
13
15
  error: Error | null;
14
16
  refetch: () => void;
17
+ loadMore: () => Promise<void>;
15
18
  createCustomer: (customer: Partial<Customer>) => Promise<Customer>;
16
19
  updateCustomer: (id: string, updates: Partial<Customer>) => Promise<Customer>;
17
20
  deleteCustomer: (id: string) => Promise<void>;
@@ -36,7 +36,8 @@ export interface CreateDriverInput {
36
36
  licenseExpiry?: string;
37
37
  /** DriverStatus enum value, e.g. `AVAILABLE`, `OFF_DUTY`. */
38
38
  status?: string;
39
- vehicleId?: string;
39
+ vehicleId?: string | null;
40
+ vehicleIds?: string[];
40
41
  rating?: number;
41
42
  notes?: string;
42
43
  hireDate?: string;
@@ -85,6 +86,9 @@ export interface ApiVehicle {
85
86
  nextServiceDueMileage?: number | null;
86
87
  createdAt: string;
87
88
  updatedAt?: string;
89
+ drivers?: Array<{
90
+ id: string;
91
+ }>;
88
92
  }
89
93
  export interface ApiDriver {
90
94
  id: string;
@@ -101,6 +105,9 @@ export interface ApiDriver {
101
105
  currentLocation?: Record<string, unknown> | null;
102
106
  rating?: number | null;
103
107
  vehicleId?: string | null;
108
+ vehicles?: Array<{
109
+ id: string;
110
+ }>;
104
111
  notes?: string | null;
105
112
  hireDate?: string | null;
106
113
  baseSalary?: number | null;
@@ -142,8 +149,11 @@ interface UseVehiclesResult {
142
149
  /** True when the last fetch returned a full page (rawCount === limit). */
143
150
  hasMore: boolean;
144
151
  isLoading: boolean;
152
+ /** True while an additional server page is appended. */
153
+ isLoadingMore: boolean;
145
154
  error: Error | null;
146
155
  refetch: () => void;
156
+ loadMore: () => Promise<void>;
147
157
  updateVehicleStatus: (id: string, status: VehicleStatus) => Promise<Vehicle>;
148
158
  assignDriver: (vehicleId: string, driverId: string) => Promise<Vehicle>;
149
159
  deleteVehicle: (id: string) => Promise<void>;
@@ -161,10 +171,13 @@ interface UseDriversResult {
161
171
  /** True when the last fetch returned a full page (rawCount === limit). */
162
172
  hasMore: boolean;
163
173
  isLoading: boolean;
174
+ /** True while an additional server page is appended. */
175
+ isLoadingMore: boolean;
164
176
  error: Error | null;
165
177
  refetch: () => void;
178
+ loadMore: () => Promise<void>;
166
179
  updateDriverStatus: (id: string, status: DriverStatus) => Promise<Driver>;
167
- assignVehicle: (driverId: string, vehicleId: string) => Promise<Driver>;
180
+ assignVehicle: (driverId: string, vehicleId: string | null) => Promise<Driver>;
168
181
  }
169
182
  interface UseDriversOptions extends UseListOptions {
170
183
  /** Narrows the roster server-side via DriverFilterInput.status. */
@@ -1,4 +1,4 @@
1
- import { Inventory, InventoryFilter, Product, Warehouse } from '../types';
1
+ import { Inventory, InventoryFilter, Product, ProductDimensions, Warehouse } from '../types';
2
2
 
3
3
  interface UseInventoryOptions {
4
4
  filters?: InventoryFilter;
@@ -9,23 +9,23 @@ interface UseInventoryOptions {
9
9
  export interface CreateProductInput {
10
10
  name: string;
11
11
  sku: string;
12
- category?: string;
13
- brand?: string;
14
- weight?: number;
12
+ description?: string | null;
13
+ category?: string | null;
14
+ brand?: string | null;
15
+ dimensions?: ProductDimensions | null;
16
+ weight?: number | null;
17
+ value?: number | null;
18
+ hazardous?: boolean;
19
+ fragile?: boolean;
20
+ temperatureControlled?: boolean;
15
21
  }
16
22
  export interface CreateWarehouseInput {
17
23
  code: string;
18
24
  name: string;
19
25
  /** WarehouseType enum value, e.g. `DISTRIBUTION`, `FULFILLMENT`. */
20
26
  type: string;
21
- address: {
22
- street: string;
23
- city: string;
24
- state: string;
25
- postalCode: string;
26
- country: string;
27
- };
28
- /** Free-text on the backend, e.g. "ACTIVE", "INACTIVE". Defaults to ACTIVE. */
27
+ address: Record<string, string>;
28
+ /** Free-text on the backend, e.g. "ACTIVE", "INACTIVE". */
29
29
  status?: string;
30
30
  contactInfo?: {
31
31
  email?: string;
@@ -49,6 +49,7 @@ interface UseInventoryResult {
49
49
  createProduct: (input: CreateProductInput) => Promise<Product>;
50
50
  createWarehouse: (input: CreateWarehouseInput) => Promise<Warehouse>;
51
51
  updateProduct: (id: string, input: CreateProductInput) => Promise<Product>;
52
+ deleteProduct: (id: string) => Promise<void>;
52
53
  updateWarehouse: (id: string, input: CreateWarehouseInput) => Promise<Warehouse>;
53
54
  deleteWarehouse: (id: string) => Promise<void>;
54
55
  }
@@ -71,8 +72,10 @@ export declare function useProducts(options?: UseProductsOptions): {
71
72
  totalProducts: number;
72
73
  hasMore: boolean;
73
74
  isLoading: boolean;
75
+ isLoadingMore: boolean;
74
76
  error: Error | null;
75
77
  refetch: () => undefined;
78
+ loadMore: () => Promise<void>;
76
79
  };
77
80
  export declare function useProductStats(): {
78
81
  stats: {
@@ -59,6 +59,7 @@ export interface MultiModalShipment {
59
59
  export declare function useMultiModalShipments(options?: {
60
60
  limit?: number;
61
61
  offset?: number;
62
+ search?: string;
62
63
  }): {
63
64
  shipments: MultiModalShipment[];
64
65
  totalShipments: number;
@@ -14,10 +14,16 @@ interface UseRoutesResult {
14
14
  /** True when the last fetch has another server page. */
15
15
  hasMore: boolean;
16
16
  isLoading: boolean;
17
+ /** True while an additional server page is appended. */
18
+ isLoadingMore: boolean;
17
19
  error: Error | null;
18
20
  refetch: () => void;
21
+ loadMore: () => Promise<void>;
19
22
  createRoute: (route: Partial<Route>) => Promise<Route>;
20
- updateRoute: (id: string, updates: Partial<Route>) => Promise<Route>;
23
+ updateRoute: (id: string, updates: Omit<Partial<Route>, 'vehicleId' | 'driverId'> & {
24
+ vehicleId?: string | null;
25
+ driverId?: string | null;
26
+ }) => Promise<Route>;
21
27
  deleteRoute: (id: string) => Promise<void>;
22
28
  optimizeRoute: (routeId: string) => Promise<Route>;
23
29
  updateStopStatus: (routeId: string, stopId: string, status: RouteStop['status']) => Promise<Route>;