@burdenoff/microfe-movethewheels 2026.703.2 → 2026.703.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.
Files changed (126) hide show
  1. package/dist/{AIAssistantPage-C3cPsWt-.js → AIAssistantPage-3YOnHO9Y.js} +3 -3
  2. package/dist/{AnalyticsPage-Dz6g2MvK.js → AnalyticsPage-CMpI1070.js} +11 -11
  3. package/dist/CreateOrderPage-DRAgGo9i.js +490 -0
  4. package/dist/CustomerDetailsPage-BCeMmOFe.js +615 -0
  5. package/dist/{CustomersPage-2Y05LVyh.js → CustomersPage-CaNBMXmM.js} +64 -53
  6. package/dist/{DashboardPage-BVjQi0EB.js → DashboardPage-DIKlXde3.js} +16 -16
  7. package/dist/DataTable-XvUcTjwi.js +340 -0
  8. package/dist/DocumentsCard-U2lSe-cn.js +169 -0
  9. package/dist/{DriverDetailsPage-CN3WQ0B9.js → DriverDetailsPage-BQrYd_Lp.js} +178 -195
  10. package/dist/{DriversPage-B0Zpx8OQ.js → DriversPage-PYmdFiby.js} +65 -54
  11. package/dist/FinancePage-Cwh9Bw4M.js +136 -0
  12. package/dist/{FleetPage-DqkFi3s3.js → FleetPage-3ZHsB-TN.js} +23 -22
  13. package/dist/{FormError-BlOjnXOq.js → FormError-cuLV2jVD.js} +1 -1
  14. package/dist/{ImportExportPage-DKJRCezl.js → ImportExportPage-C6f7DqhM.js} +50 -70
  15. package/dist/{InventoryPage-DwfgCUQq.js → InventoryPage-DpiqVu1v.js} +9 -9
  16. package/dist/{LiveTrackingPage-DCX-K-LR.js → LiveTrackingPage-FAzzlVnX.js} +9 -9
  17. package/dist/MarketplacePage-Bh_2ns4v.js +426 -0
  18. package/dist/Notice-CSoDYKw9.js +46 -0
  19. package/dist/OrderDetailsPage-zCj0lW0j.js +584 -0
  20. package/dist/{OrdersListPage-BjDlCKJd.js → OrdersListPage-CAMsuUck.js} +166 -89
  21. package/dist/{ProductDetailsPage-C9uOiYLp.js → ProductDetailsPage-wsxAQkA0.js} +12 -12
  22. package/dist/{ProductsPage-C1G9h7Xd.js → ProductsPage-DC5qDLfz.js} +60 -49
  23. package/dist/ReportsPage-BwUJ37eO.js +356 -0
  24. package/dist/RouteDetailsPage-DyMJE9AS.js +583 -0
  25. package/dist/{RoutesPage-DMfoicM1.js → RoutesPage-Dtc669yc.js} +57 -46
  26. package/dist/{SettingsPage-Bn-v0mbQ.js → SettingsPage-CpH9xhQg.js} +5 -27
  27. package/dist/{TrackingPage-W-jtdM3Y.js → TrackingPage-DaNEFG_h.js} +10 -10
  28. package/dist/{VehicleDetailsPage-Bceo5oz3.js → VehicleDetailsPage-DldYNsYV.js} +125 -142
  29. package/dist/{VehiclesPage-VBtOep91.js → VehiclesPage-BFw13iMt.js} +61 -50
  30. package/dist/{WarehouseDetailsPage-L_6sWigM.js → WarehouseDetailsPage-CMG7or6G.js} +17 -17
  31. package/dist/{WarehousesPage-DCbXXXWE.js → WarehousesPage-Wkytnt86.js} +58 -47
  32. package/dist/arrow-right-Q3XQpTPR.js +11 -0
  33. package/dist/arrow-up-xNF1zJUG.js +17 -0
  34. package/dist/chevron-left-B2_r0Elx.js +8 -0
  35. package/dist/{wrench-CANXWxF-.js → fuel-B6_lnKDs.js} +2 -5
  36. package/dist/index.js +163 -174
  37. package/dist/upload-CHZofOqb.js +21 -0
  38. package/dist/{useAnalytics-DS8n0xgg.js → useAnalytics-D7HW2XRb.js} +52 -2
  39. package/dist/{useCustomers-BmTNGxiI.js → useCustomers-BPW4__PR.js} +29 -26
  40. package/dist/{useFleet-DKqXZ16m.js → useFleet-ChBkxAd6.js} +81 -69
  41. package/dist/{useInventory-DkyiVY_A.js → useInventory-CAAVMRp6.js} +83 -38
  42. package/dist/{useOrders-Cfk1GLiq.js → useOrders-B465S2nt.js} +58 -47
  43. package/dist/{useReports-CTqZr-AB.js → useReports-jQ3GpNOm.js} +40 -34
  44. package/dist/{useRoutes-BQWO607N.js → useRoutes-hS3d5-xr.js} +49 -41
  45. package/dist/{useTracking-B-va1kO3.js → useTracking-RjGz9PZG.js} +2 -2
  46. package/dist/user-check-BEKRCi7v.js +20 -0
  47. package/dist/wrench-q_rgJfaP.js +8 -0
  48. package/dist/x-tMeDMcCw.js +11 -0
  49. package/package.json +1 -1
  50. package/src/movethewheels/components/DataTable.tsx +252 -84
  51. package/src/movethewheels/components/DocumentsCard.tsx +102 -0
  52. package/src/movethewheels/components/Notice.tsx +61 -0
  53. package/src/movethewheels/components/index.ts +7 -0
  54. package/src/movethewheels/hooks/index.ts +9 -0
  55. package/src/movethewheels/hooks/useAnalytics.ts +95 -0
  56. package/src/movethewheels/hooks/useCustomers.ts +11 -4
  57. package/src/movethewheels/hooks/useEntityDocuments.ts +132 -0
  58. package/src/movethewheels/hooks/useFleet.ts +26 -7
  59. package/src/movethewheels/hooks/useInventory.ts +70 -7
  60. package/src/movethewheels/hooks/useOrders.ts +32 -2
  61. package/src/movethewheels/hooks/useReports.ts +14 -4
  62. package/src/movethewheels/hooks/useRoutes.ts +20 -3
  63. package/src/movethewheels/pages/AnalyticsPage.tsx +2 -2
  64. package/src/movethewheels/pages/CreateOrderPage.tsx +44 -16
  65. package/src/movethewheels/pages/CustomerDetailsPage.tsx +239 -33
  66. package/src/movethewheels/pages/CustomersPage.tsx +27 -11
  67. package/src/movethewheels/pages/DriverDetailsPage.tsx +16 -30
  68. package/src/movethewheels/pages/DriversPage.tsx +26 -9
  69. package/src/movethewheels/pages/FinancePage.tsx +67 -84
  70. package/src/movethewheels/pages/InventoryPage.tsx +1 -1
  71. package/src/movethewheels/pages/MarketplacePage.tsx +265 -50
  72. package/src/movethewheels/pages/OrderDetailsPage.tsx +214 -10
  73. package/src/movethewheels/pages/OrdersListPage.tsx +77 -14
  74. package/src/movethewheels/pages/ProductsPage.tsx +27 -7
  75. package/src/movethewheels/pages/ReportsPage.tsx +65 -4
  76. package/src/movethewheels/pages/RouteDetailsPage.tsx +74 -13
  77. package/src/movethewheels/pages/RoutesPage.tsx +22 -6
  78. package/src/movethewheels/pages/SettingsPage.tsx +3 -19
  79. package/src/movethewheels/pages/VehicleDetailsPage.tsx +3 -33
  80. package/src/movethewheels/pages/VehiclesPage.tsx +26 -5
  81. package/src/movethewheels/pages/WarehousesPage.tsx +22 -17
  82. package/src/movethewheels/types/index.ts +8 -0
  83. package/src/movethewheels/utils/download.ts +62 -0
  84. package/dist/CreateOrderPage-C5iwnjp4.js +0 -479
  85. package/dist/CustomerDetailsPage-B6nwFyLO.js +0 -406
  86. package/dist/DataTable-DmciIKKM.js +0 -249
  87. package/dist/FinancePage-DEDykSOP.js +0 -158
  88. package/dist/MarketplacePage-CIQ97_zp.js +0 -247
  89. package/dist/OrderDetailsPage-DYiZ-9UK.js +0 -429
  90. package/dist/ReportsPage-Zp53q3_8.js +0 -284
  91. package/dist/RouteDetailsPage-DUStXSf9.js +0 -531
  92. /package/dist/{MetricCard-BY0QrMD4.js → MetricCard-CVBVpu7o.js} +0 -0
  93. /package/dist/{StatusBadge-BZurYHMy.js → StatusBadge-C87mDpDP.js} +0 -0
  94. /package/dist/{box-D9Pal4HM.js → box-Eu05PXDh.js} +0 -0
  95. /package/dist/{chart-column-BFIJysDR.js → chart-column-ouzgxIv_.js} +0 -0
  96. /package/dist/{chevron-right-EMIIyyJ1.js → chevron-right-eV4LjaSi.js} +0 -0
  97. /package/dist/{circle-alert-iY24lSlp.js → circle-alert-Bzh2DBSF.js} +0 -0
  98. /package/dist/{circle-check-big-w0TrLKMF.js → circle-check-big-CGMSpQmD.js} +0 -0
  99. /package/dist/{clock-DJZtdl8u.js → clock-Bl3ptexL.js} +0 -0
  100. /package/dist/{dollar-sign-CgKQRz_e.js → dollar-sign-CAVU95SO.js} +0 -0
  101. /package/dist/{download-DRXxoiQR.js → download-C5NbvVDc.js} +0 -0
  102. /package/dist/{file-text-DWWY6_f5.js → file-text-D-1uvLZG.js} +0 -0
  103. /package/dist/{filter-DloLC2eE.js → filter-DUfUg6BO.js} +0 -0
  104. /package/dist/{formatters-CF2S2l1m.js → formatters-BQr-aR5W.js} +0 -0
  105. /package/dist/{map-CkJaULb2.js → map-C-M-FQLR.js} +0 -0
  106. /package/dist/{map-pin-BGiCvyCs.js → map-pin-Dznl5l40.js} +0 -0
  107. /package/dist/{navigation-D36prnAn.js → navigation-BJSJl-VG.js} +0 -0
  108. /package/dist/{package-BChUzpJS.js → package-CcRttV2N.js} +0 -0
  109. /package/dist/{phone-Ac9s3mo_.js → phone-DVSZHt_j.js} +0 -0
  110. /package/dist/{plus-Z76q-FZm.js → plus-C_XZDwBz.js} +0 -0
  111. /package/dist/{refresh-cw-DKt6f5T6.js → refresh-cw-CfgN67l3.js} +0 -0
  112. /package/dist/{save-CojywNhG.js → save-DJE8Fpdv.js} +0 -0
  113. /package/dist/{search-CDGefqb3.js → search-D_VyGcZT.js} +0 -0
  114. /package/dist/{square-pen-CopE9GmB.js → square-pen-D-6JYrVQ.js} +0 -0
  115. /package/dist/{star-nHlLjDKR.js → star-BpRlUZuU.js} +0 -0
  116. /package/dist/{store-BR9Voi5E.js → store-B-8HMuyZ.js} +0 -0
  117. /package/dist/{trash-2-BKhar6Hs.js → trash-2-8vmv-XV_.js} +0 -0
  118. /package/dist/{trending-up-Dohgd4t_.js → trending-up-Dz6PqPRj.js} +0 -0
  119. /package/dist/{triangle-alert-i-XQL9Rd.js → triangle-alert-D7Y3J_4z.js} +0 -0
  120. /package/dist/{truck-C0v_hbLR.js → truck-D-y2IDzv.js} +0 -0
  121. /package/dist/{useAssistant-D4v3oxD3.js → useAssistant-DVW4QgQb.js} +0 -0
  122. /package/dist/{useImportExport-DHr-SWSw.js → useImportExport-DrPDHEDK.js} +0 -0
  123. /package/dist/{useSettings-CkDH_-gM.js → useSettings-BB8X2RLh.js} +0 -0
  124. /package/dist/{user-jyFU3lXk.js → user-DzfTn4dE.js} +0 -0
  125. /package/dist/{users-DZ-ilS6B.js → users-CCrq-w0C.js} +0 -0
  126. /package/dist/{warehouse-6m5kXMLu.js → warehouse-CaqfmMKh.js} +0 -0
@@ -0,0 +1,21 @@
1
+ import { lt as e } from "./PageLayout-D4LDHJJq.js";
2
+ //#region node_modules/lucide-react/dist/esm/icons/upload.js
3
+ var t = e("Upload", [
4
+ ["path", {
5
+ d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",
6
+ key: "ih7n3h"
7
+ }],
8
+ ["polyline", {
9
+ points: "17 8 12 3 7 8",
10
+ key: "t8dd8p"
11
+ }],
12
+ ["line", {
13
+ x1: "12",
14
+ x2: "12",
15
+ y1: "3",
16
+ y2: "15",
17
+ key: "widbto"
18
+ }]
19
+ ]);
20
+ //#endregion
21
+ export { t };
@@ -282,7 +282,57 @@ function m() {
282
282
  error: n
283
283
  };
284
284
  }
285
- function h() {
285
+ var h = "\n query GetMovethewheelsFinanceMetrics {\n financeMetrics {\n revenue {\n totalRevenue\n deliveredRevenue\n averageOrderValue\n }\n fuelCost\n openInvoices\n }\n }\n";
286
+ function g() {
287
+ let { apiGatewayUrl: o, authToken: s, workspaceToken: c, workspaceId: l, tenantId: u, currentUser: d } = t(), [f, p] = a({
288
+ totalRevenue: 0,
289
+ deliveredRevenue: 0,
290
+ averageOrderValue: 0,
291
+ fuelCost: 0,
292
+ openInvoices: 0
293
+ }), [m, g] = a(!1), [_, v] = a(null), y = i(() => ({
294
+ apiGatewayUrl: o,
295
+ authToken: s,
296
+ workspaceToken: c,
297
+ workspaceId: l,
298
+ tenantId: u,
299
+ actorId: d?.id
300
+ }), [
301
+ o,
302
+ s,
303
+ c,
304
+ l,
305
+ u,
306
+ d?.id
307
+ ]), b = n(async () => {
308
+ g(!0), v(null);
309
+ try {
310
+ let t = await e(y, h);
311
+ p({
312
+ totalRevenue: t.financeMetrics.revenue.totalRevenue,
313
+ deliveredRevenue: t.financeMetrics.revenue.deliveredRevenue,
314
+ averageOrderValue: t.financeMetrics.revenue.averageOrderValue,
315
+ fuelCost: t.financeMetrics.fuelCost,
316
+ openInvoices: t.financeMetrics.openInvoices
317
+ });
318
+ } catch (e) {
319
+ v(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load finance metrics"));
320
+ } finally {
321
+ g(!1);
322
+ }
323
+ }, [y]);
324
+ return r(() => {
325
+ b();
326
+ }, [b]), {
327
+ metrics: f,
328
+ isLoading: m,
329
+ error: _,
330
+ refetch: n(() => {
331
+ b();
332
+ }, [b])
333
+ };
334
+ }
335
+ function _() {
286
336
  let { analytics: e, isLoading: t, error: n } = u();
287
337
  return {
288
338
  performanceData: i(() => ({
@@ -294,4 +344,4 @@ function h() {
294
344
  };
295
345
  }
296
346
  //#endregion
297
- export { h as a, p as i, d as n, f as o, m as r, u as t };
347
+ export { p as a, m as i, d as n, _ as o, g as r, f as s, u as t };
@@ -33,7 +33,7 @@ function f(s = {}) {
33
33
  f?.isActive,
34
34
  f?.search,
35
35
  f?.type
36
- ]), { apiGatewayUrl: g, authToken: _, workspaceToken: v, workspaceId: y, tenantId: b, currentUser: x } = t(), [S, C] = a([]), [w, T] = a(!1), [E, D] = a(null), O = i(() => ({
36
+ ]), { apiGatewayUrl: g, authToken: _, workspaceToken: v, workspaceId: y, tenantId: b, currentUser: x } = t(), [S, C] = a([]), [w, T] = a(!1), [E, D] = a(!1), [O, k] = a(null), A = i(() => ({
37
37
  apiGatewayUrl: g,
38
38
  authToken: _,
39
39
  workspaceToken: v,
@@ -47,10 +47,10 @@ function f(s = {}) {
47
47
  y,
48
48
  b,
49
49
  x?.id
50
- ]), k = n(async () => {
51
- T(!0), D(null);
50
+ ]), j = n(async () => {
51
+ D(!0), k(null);
52
52
  try {
53
- let t = (await e(O, o, {
53
+ let t = (await e(A, o, {
54
54
  filter: {
55
55
  type: h?.type,
56
56
  search: h?.search
@@ -59,26 +59,28 @@ function f(s = {}) {
59
59
  limit: p,
60
60
  offset: m
61
61
  }
62
- })).customers.map(d);
63
- h?.isActive !== void 0 && (t = t.filter((e) => e.isActive === h.isActive)), C(t);
62
+ })).customers;
63
+ T(t.length === p);
64
+ let n = t.map(d);
65
+ h?.isActive !== void 0 && (n = n.filter((e) => e.isActive === h.isActive)), C(n);
64
66
  } catch (e) {
65
- D(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load customers"));
67
+ k(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load customers"));
66
68
  } finally {
67
- T(!1);
69
+ D(!1);
68
70
  }
69
71
  }, [
70
72
  h,
71
- O,
73
+ A,
72
74
  p,
73
75
  m
74
76
  ]);
75
77
  r(() => {
76
- k();
77
- }, [k]);
78
- let A = n(() => {
79
- k();
80
- }, [k]), j = n(async (t) => {
81
- let n = d((await e(O, c, { input: {
78
+ j();
79
+ }, [j]);
80
+ let M = n(() => {
81
+ j();
82
+ }, [j]), N = n(async (t) => {
83
+ let n = d((await e(A, c, { input: {
82
84
  name: t.name,
83
85
  email: t.email,
84
86
  phone: t.phone,
@@ -90,8 +92,8 @@ function f(s = {}) {
90
92
  rating: t.rating
91
93
  } })).createCustomer);
92
94
  return C((e) => [n, ...e]), n;
93
- }, [O]), M = n(async (t, n) => {
94
- let r = d((await e(O, l, {
95
+ }, [A]), P = n(async (t, n) => {
96
+ let r = d((await e(A, l, {
95
97
  id: t,
96
98
  input: {
97
99
  name: n.name,
@@ -106,18 +108,19 @@ function f(s = {}) {
106
108
  }
107
109
  })).updateCustomer);
108
110
  return C((e) => e.map((e) => e.id === t ? r : e)), r;
109
- }, [O]), N = n(async (t) => {
110
- await e(O, u, { id: t }), C((e) => e.filter((e) => e.id !== t));
111
- }, [O]);
111
+ }, [A]), F = n(async (t) => {
112
+ await e(A, u, { id: t }), C((e) => e.filter((e) => e.id !== t));
113
+ }, [A]);
112
114
  return {
113
115
  customers: S,
114
116
  totalCustomers: S.length,
115
- isLoading: w,
116
- error: E,
117
- refetch: A,
118
- createCustomer: j,
119
- updateCustomer: M,
120
- deleteCustomer: N
117
+ hasMore: w,
118
+ isLoading: E,
119
+ error: O,
120
+ refetch: M,
121
+ createCustomer: N,
122
+ updateCustomer: P,
123
+ deleteCustomer: F
121
124
  };
122
125
  }
123
126
  function p(o) {
@@ -214,53 +214,59 @@ function C(t = {}) {
214
214
  createDriver: O
215
215
  };
216
216
  }
217
- function w() {
218
- let t = S(), [i, s] = a([]), [c, l] = a(!1), [f, p] = a(null), m = n(async () => {
219
- l(!0), p(null);
217
+ function w(t = {}) {
218
+ let { limit: i = 200, offset: s = 0 } = t, c = S(), [l, f] = a([]), [p, m] = a(!1), [h, g] = a(!1), [v, y] = a(null), x = n(async () => {
219
+ g(!0), y(null);
220
220
  try {
221
- s((await e(t, o, { pagination: {
222
- limit: 200,
223
- offset: 0
224
- } })).vehicles.map(b));
221
+ let t = await e(c, o, { pagination: {
222
+ limit: i,
223
+ offset: s
224
+ } });
225
+ m(t.vehicles.length === i), f(t.vehicles.map(b));
225
226
  } catch (e) {
226
- p(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load vehicles"));
227
+ y(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load vehicles"));
227
228
  } finally {
228
- l(!1);
229
+ g(!1);
229
230
  }
230
- }, [t]);
231
+ }, [
232
+ c,
233
+ i,
234
+ s
235
+ ]);
231
236
  r(() => {
232
- m();
233
- }, [m]);
234
- let h = n(() => {
235
- m();
236
- }, [m]), g = n(async (n, r) => {
237
- let i = b((await e(t, u, {
238
- id: n,
239
- status: _(r)
237
+ x();
238
+ }, [x]);
239
+ let C = n(() => {
240
+ x();
241
+ }, [x]), w = n(async (t, n) => {
242
+ let r = b((await e(c, u, {
243
+ id: t,
244
+ status: _(n)
240
245
  })).updateVehicleStatus);
241
- return s((e) => e.map((e) => e.id === n ? i : e)), i;
242
- }, [t]), v = n(async (n, r) => {
243
- await e(t, d, {
244
- id: r,
245
- vehicleId: n
246
+ return f((e) => e.map((e) => e.id === t ? r : e)), r;
247
+ }, [c]), T = n(async (t, n) => {
248
+ await e(c, d, {
249
+ id: n,
250
+ vehicleId: t
246
251
  });
247
- let a = i.find((e) => e.id === n);
248
- if (!a) throw Error("Vehicle not found");
249
- let o = {
250
- ...a,
251
- driverId: r,
252
+ let r = l.find((e) => e.id === t);
253
+ if (!r) throw Error("Vehicle not found");
254
+ let i = {
255
+ ...r,
256
+ driverId: n,
252
257
  status: "assigned"
253
258
  };
254
- return s((e) => e.map((e) => e.id === n ? o : e)), o;
255
- }, [t, i]);
259
+ return f((e) => e.map((e) => e.id === t ? i : e)), i;
260
+ }, [c, l]);
256
261
  return {
257
- vehicles: i,
258
- totalVehicles: i.length,
259
- isLoading: c,
260
- error: f,
261
- refetch: h,
262
- updateVehicleStatus: g,
263
- assignDriver: v
262
+ vehicles: l,
263
+ totalVehicles: l.length,
264
+ hasMore: p,
265
+ isLoading: h,
266
+ error: v,
267
+ refetch: C,
268
+ updateVehicleStatus: w,
269
+ assignDriver: T
264
270
  };
265
271
  }
266
272
  function T(t) {
@@ -290,46 +296,52 @@ function T(t) {
290
296
  }, [p])
291
297
  };
292
298
  }
293
- function E() {
294
- let t = S(), [i, o] = a([]), [c, l] = a(!1), [u, p] = a(null), m = n(async () => {
295
- l(!0), p(null);
299
+ function E(t = {}) {
300
+ let { limit: i = 200, offset: o = 0 } = t, c = S(), [l, u] = a([]), [p, m] = a(!1), [h, g] = a(!1), [_, v] = a(null), b = n(async () => {
301
+ g(!0), v(null);
296
302
  try {
297
- o((await e(t, s, { pagination: {
298
- limit: 200,
299
- offset: 0
300
- } })).drivers.map(x));
303
+ let t = await e(c, s, { pagination: {
304
+ limit: i,
305
+ offset: o
306
+ } });
307
+ m(t.drivers.length === i), u(t.drivers.map(x));
301
308
  } catch (e) {
302
- p(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load drivers"));
309
+ v(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load drivers"));
303
310
  } finally {
304
- l(!1);
311
+ g(!1);
305
312
  }
306
- }, [t]);
313
+ }, [
314
+ c,
315
+ i,
316
+ o
317
+ ]);
307
318
  r(() => {
308
- m();
309
- }, [m]);
310
- let h = n(() => {
311
- m();
312
- }, [m]), g = n(async (n, r) => {
313
- let i = x((await e(t, f, {
314
- id: n,
315
- status: y(r)
319
+ b();
320
+ }, [b]);
321
+ let C = n(() => {
322
+ b();
323
+ }, [b]), w = n(async (t, n) => {
324
+ let r = x((await e(c, f, {
325
+ id: t,
326
+ status: y(n)
316
327
  })).updateDriverStatus);
317
- return o((e) => e.map((e) => e.id === n ? i : e)), i;
318
- }, [t]), _ = n(async (n, r) => {
319
- let i = x((await e(t, d, {
320
- id: n,
321
- vehicleId: r
328
+ return u((e) => e.map((e) => e.id === t ? r : e)), r;
329
+ }, [c]), T = n(async (t, n) => {
330
+ let r = x((await e(c, d, {
331
+ id: t,
332
+ vehicleId: n
322
333
  })).assignDriverVehicle);
323
- return o((e) => e.map((e) => e.id === n ? i : e)), i;
324
- }, [t]);
334
+ return u((e) => e.map((e) => e.id === t ? r : e)), r;
335
+ }, [c]);
325
336
  return {
326
- drivers: i,
327
- totalDrivers: i.length,
328
- isLoading: c,
329
- error: u,
330
- refetch: h,
331
- updateDriverStatus: g,
332
- assignVehicle: _
337
+ drivers: l,
338
+ totalDrivers: l.length,
339
+ hasMore: p,
340
+ isLoading: h,
341
+ error: _,
342
+ refetch: C,
343
+ updateDriverStatus: w,
344
+ assignVehicle: T
333
345
  };
334
346
  }
335
347
  function D(t) {
@@ -200,31 +200,52 @@ function y(t = {}) {
200
200
  createWarehouse: P
201
201
  };
202
202
  }
203
- function b() {
204
- let t = v(), [i, o] = a([]), [c, l] = a(!1), [u, d] = a(null), f = n(async () => {
205
- l(!0), d(null);
203
+ function b(t = {}) {
204
+ let { limit: i = 500, offset: o = 0 } = t, c = v(), [l, u] = a([]), [d, f] = a(!1), [p, m] = a(!1), [g, _] = a(null), y = n(async () => {
205
+ m(!0), _(null);
206
206
  try {
207
- o((await e(t, s, { pagination: {
208
- limit: 500,
209
- offset: 0
210
- } })).products.map(h));
207
+ let t = await e(c, s, { pagination: {
208
+ limit: i,
209
+ offset: o
210
+ } });
211
+ f(t.products.length === i), u(t.products.map(h));
211
212
  } catch (e) {
212
- d(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load products"));
213
+ _(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load products"));
213
214
  } finally {
214
- l(!1);
215
+ m(!1);
215
216
  }
216
- }, [t]);
217
+ }, [
218
+ c,
219
+ i,
220
+ o
221
+ ]);
217
222
  return r(() => {
218
- f();
219
- }, [f]), {
220
- products: i,
221
- totalProducts: i.length,
222
- isLoading: c,
223
- error: u,
224
- refetch: () => void f()
223
+ y();
224
+ }, [y]), {
225
+ products: l,
226
+ totalProducts: l.length,
227
+ hasMore: d,
228
+ isLoading: p,
229
+ error: g,
230
+ refetch: () => void y()
231
+ };
232
+ }
233
+ function x(e = 500) {
234
+ let { products: t, isLoading: n, error: r } = b({
235
+ limit: e,
236
+ offset: 0
237
+ });
238
+ return {
239
+ stats: i(() => ({
240
+ total: t.length,
241
+ specialHandling: t.filter((e) => e.fragile || e.hazardous).length,
242
+ temperatureControlled: t.filter((e) => e.temperatureControlled).length
243
+ }), [t]),
244
+ isLoading: n,
245
+ error: r
225
246
  };
226
247
  }
227
- function x(t) {
248
+ function S(t) {
228
249
  let i = v(), [o, s] = a(null), [c, u] = a(!1), [d, f] = a(null), p = n(async () => {
229
250
  if (!t) {
230
251
  s(null);
@@ -249,31 +270,55 @@ function x(t) {
249
270
  refetch: () => void p()
250
271
  };
251
272
  }
252
- function S() {
253
- let t = v(), [i, o] = a([]), [s, l] = a(!1), [u, d] = a(null), f = n(async () => {
254
- l(!0), d(null);
273
+ function C(t = {}) {
274
+ let { limit: i = 500, offset: o = 0 } = t, s = v(), [l, u] = a([]), [d, f] = a(!1), [p, m] = a(!1), [h, _] = a(null), y = n(async () => {
275
+ m(!0), _(null);
255
276
  try {
256
- o((await e(t, c, { pagination: {
257
- limit: 500,
258
- offset: 0
259
- } })).warehouses.map(g));
277
+ let t = await e(s, c, { pagination: {
278
+ limit: i,
279
+ offset: o
280
+ } });
281
+ f(t.warehouses.length === i), u(t.warehouses.map(g));
260
282
  } catch (e) {
261
- d(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load warehouses"));
283
+ _(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load warehouses"));
262
284
  } finally {
263
- l(!1);
285
+ m(!1);
264
286
  }
265
- }, [t]);
287
+ }, [
288
+ s,
289
+ i,
290
+ o
291
+ ]);
266
292
  return r(() => {
267
- f();
268
- }, [f]), {
269
- warehouses: i,
270
- totalWarehouses: i.length,
271
- isLoading: s,
272
- error: u,
273
- refetch: () => void f()
293
+ y();
294
+ }, [y]), {
295
+ warehouses: l,
296
+ totalWarehouses: l.length,
297
+ hasMore: d,
298
+ isLoading: p,
299
+ error: h,
300
+ refetch: () => void y()
301
+ };
302
+ }
303
+ function w(e = 500) {
304
+ let { warehouses: t, isLoading: n, error: r } = C({
305
+ limit: e,
306
+ offset: 0
307
+ });
308
+ return {
309
+ stats: i(() => {
310
+ let e = t.length;
311
+ return {
312
+ total: e,
313
+ active: t.filter((e) => e.isActive).length,
314
+ avgUtilization: e > 0 ? t.reduce((e, t) => e + (t.capacity.totalSpace > 0 ? t.capacity.usedSpace / t.capacity.totalSpace : 0), 0) / e : 0
315
+ };
316
+ }, [t]),
317
+ isLoading: n,
318
+ error: r
274
319
  };
275
320
  }
276
- function C(t) {
321
+ function T(t) {
277
322
  let i = v(), [o, s] = a(null), [c, l] = a(!1), [d, f] = a(null), p = n(async () => {
278
323
  if (!t) {
279
324
  s(null);
@@ -298,7 +343,7 @@ function C(t) {
298
343
  refetch: () => void p()
299
344
  };
300
345
  }
301
- function w() {
346
+ function E() {
302
347
  let t = v(), [n, i] = a({
303
348
  totalItems: 0,
304
349
  lowStockItems: 0,
@@ -340,4 +385,4 @@ function w() {
340
385
  };
341
386
  }
342
387
  //#endregion
343
- export { C as a, b as i, w as n, S as o, x as r, y as t };
388
+ export { b as a, C as c, x as i, E as n, T as o, S as r, w as s, y as t };
@@ -108,54 +108,64 @@ function b(e) {
108
108
  };
109
109
  }
110
110
  function x(s = {}) {
111
- let { filters: c, limit: p = 20, offset: m = 0 } = s, { apiGatewayUrl: h, authToken: y, workspaceToken: x, workspaceId: S, tenantId: C, currentUser: w } = t(), [T, E] = a([]), [D, O] = a(!1), [k, A] = a(null), j = i(() => ({
112
- apiGatewayUrl: h,
113
- authToken: y,
114
- workspaceToken: x,
115
- workspaceId: S,
116
- tenantId: C,
117
- actorId: w?.id
111
+ let { filters: c, limit: p = 20, offset: m = 0 } = s, h = i(() => c, [
112
+ c?.status,
113
+ c?.priority,
114
+ c?.orderType,
115
+ c?.customerId,
116
+ c?.driverId,
117
+ c?.unassigned
118
+ ]), { apiGatewayUrl: y, authToken: x, workspaceToken: S, workspaceId: C, tenantId: w, currentUser: T } = t(), [E, D] = a([]), [O, k] = a(!1), [A, j] = a(!1), [M, N] = a(null), P = i(() => ({
119
+ apiGatewayUrl: y,
120
+ authToken: x,
121
+ workspaceToken: S,
122
+ workspaceId: C,
123
+ tenantId: w,
124
+ actorId: T?.id
118
125
  }), [
119
- h,
120
126
  y,
121
127
  x,
122
128
  S,
123
129
  C,
124
- w?.id
125
- ]), M = n(async () => {
126
- O(!0), A(null);
130
+ w,
131
+ T?.id
132
+ ]), F = n(async () => {
133
+ j(!0), N(null);
127
134
  try {
128
- E((await e(j, o, {
135
+ let t = (await e(P, o, {
129
136
  filter: {
130
- status: c?.status ? g(c.status) : void 0,
131
- priority: c?.priority ? v(c.priority) : void 0,
132
- orderType: c?.orderType ? _(c.orderType) : void 0,
133
- customerId: c?.customerId,
134
- driverId: c?.driverId
137
+ status: h?.status ? g(h.status) : void 0,
138
+ priority: h?.priority ? v(h.priority) : void 0,
139
+ orderType: h?.orderType ? _(h.orderType) : void 0,
140
+ customerId: h?.customerId,
141
+ driverId: h?.driverId
135
142
  },
136
143
  pagination: {
137
144
  limit: p,
138
145
  offset: m
139
146
  }
140
- })).movethewheelsOrders.map(b));
147
+ })).movethewheelsOrders;
148
+ k(t.length === p);
149
+ let n = t.map(b);
150
+ h?.unassigned && (n = n.filter((e) => !e.driverId)), D(n);
141
151
  } catch (e) {
142
- A(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load orders"));
152
+ N(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load orders"));
143
153
  } finally {
144
- O(!1);
154
+ j(!1);
145
155
  }
146
156
  }, [
147
- c,
148
- j,
157
+ h,
158
+ P,
149
159
  p,
150
160
  m
151
161
  ]);
152
162
  r(() => {
153
- M();
154
- }, [M]);
155
- let N = n(() => {
156
- M();
157
- }, [M]), P = n(async (t) => {
158
- let n = b((await e(j, l, { input: {
163
+ F();
164
+ }, [F]);
165
+ let I = n(() => {
166
+ F();
167
+ }, [F]), L = n(async (t) => {
168
+ let n = b((await e(P, l, { input: {
159
169
  orderNumber: t.orderNumber ?? `ORD-${(/* @__PURE__ */ new Date()).getFullYear()}-${Date.now().toString().slice(-6)}`,
160
170
  orderType: _(t.orderType),
161
171
  status: g(t.status ?? "pending"),
@@ -171,9 +181,9 @@ function x(s = {}) {
171
181
  vehicleId: t.vehicleId,
172
182
  driverId: t.driverId
173
183
  } })).createMovethewheelsOrder);
174
- return E((e) => [n, ...e]), n;
175
- }, [j]), F = n(async (t, n) => {
176
- let r = b((await e(j, u, {
184
+ return D((e) => [n, ...e]), n;
185
+ }, [P]), R = n(async (t, n) => {
186
+ let r = b((await e(P, u, {
177
187
  id: t,
178
188
  input: {
179
189
  orderType: n.orderType ? _(n.orderType) : void 0,
@@ -191,26 +201,27 @@ function x(s = {}) {
191
201
  driverId: n.driverId
192
202
  }
193
203
  })).updateMovethewheelsOrder);
194
- return E((e) => e.map((e) => e.id === t ? r : e)), r;
195
- }, [j]), I = n(async (t) => {
196
- await e(j, f, { id: t }), E((e) => e.filter((e) => e.id !== t));
197
- }, [j]), L = n(async (t, n) => {
198
- let r = b((await e(j, d, {
204
+ return D((e) => e.map((e) => e.id === t ? r : e)), r;
205
+ }, [P]), z = n(async (t) => {
206
+ await e(P, f, { id: t }), D((e) => e.filter((e) => e.id !== t));
207
+ }, [P]), B = n(async (t, n) => {
208
+ let r = b((await e(P, d, {
199
209
  id: t,
200
210
  input: { status: g(n) }
201
211
  })).updateMovethewheelsOrderStatus);
202
- return E((e) => e.map((e) => e.id === t ? r : e)), r;
203
- }, [j]);
212
+ return D((e) => e.map((e) => e.id === t ? r : e)), r;
213
+ }, [P]);
204
214
  return {
205
- orders: T,
206
- totalOrders: T.length,
207
- isLoading: D,
208
- error: k,
209
- refetch: N,
210
- createOrder: P,
211
- updateOrder: F,
212
- deleteOrder: I,
213
- updateOrderStatus: L
215
+ orders: E,
216
+ totalOrders: E.length,
217
+ hasMore: O,
218
+ isLoading: A,
219
+ error: M,
220
+ refetch: I,
221
+ createOrder: L,
222
+ updateOrder: R,
223
+ deleteOrder: z,
224
+ updateOrderStatus: B
214
225
  };
215
226
  }
216
227
  function S(o) {