@burdenoff/microfe-movethewheels 2026.626.2 → 2026.703.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.
Files changed (135) hide show
  1. package/dist/{AIAssistantPage-AvsMbunM.js → AIAssistantPage-C3cPsWt-.js} +100 -73
  2. package/dist/AnalyticsPage-Dz6g2MvK.js +215 -0
  3. package/dist/{CreateOrderPage-CjlnEtk3.js → CreateOrderPage-C5iwnjp4.js} +36 -67
  4. package/dist/CustomerDetailsPage-B6nwFyLO.js +406 -0
  5. package/dist/{CustomersPage-CGGfD4ki.js → CustomersPage-2Y05LVyh.js} +26 -28
  6. package/dist/{DashboardPage-D2HRqwg9.js → DashboardPage-BVjQi0EB.js} +85 -83
  7. package/dist/{DataTable-CD9ZhpLB.js → DataTable-DmciIKKM.js} +3 -3
  8. package/dist/DriverDetailsPage-CN3WQ0B9.js +507 -0
  9. package/dist/{DriversPage-DKiynISH.js → DriversPage-B0Zpx8OQ.js} +25 -27
  10. package/dist/{FinancePage-Vg8WPs38.js → FinancePage-DEDykSOP.js} +9 -9
  11. package/dist/FleetPage-DqkFi3s3.js +365 -0
  12. package/dist/FormError-BlOjnXOq.js +15 -0
  13. package/dist/ImportExportPage-DKJRCezl.js +290 -0
  14. package/dist/InventoryPage-DwfgCUQq.js +253 -0
  15. package/dist/{LiveTrackingPage-DQ1q4Id3.js → LiveTrackingPage-DCX-K-LR.js} +60 -56
  16. package/dist/MarketplacePage-CIQ97_zp.js +247 -0
  17. package/dist/{MetricCard-B7yMyvMX.js → MetricCard-BY0QrMD4.js} +1 -1
  18. package/dist/{OrderDetailsPage-CFASgsYX.js → OrderDetailsPage-DYiZ-9UK.js} +83 -85
  19. package/dist/{OrdersListPage-BHeT8S5o.js → OrdersListPage-BjDlCKJd.js} +31 -33
  20. package/dist/{PageLayout-D3N8MCTm.js → PageLayout-D4LDHJJq.js} +483 -422
  21. package/dist/ProductDetailsPage-C9uOiYLp.js +350 -0
  22. package/dist/{ProductsPage--xEpbQ8A.js → ProductsPage-C1G9h7Xd.js} +22 -24
  23. package/dist/ReportsPage-Zp53q3_8.js +284 -0
  24. package/dist/RouteDetailsPage-DUStXSf9.js +531 -0
  25. package/dist/RoutesPage-DMfoicM1.js +144 -0
  26. package/dist/SettingsPage-Bn-v0mbQ.js +421 -0
  27. package/dist/StatusBadge-BZurYHMy.js +152 -0
  28. package/dist/{TrackingPage-CcRc_dva.js → TrackingPage-W-jtdM3Y.js} +59 -61
  29. package/dist/VehicleDetailsPage-Bceo5oz3.js +410 -0
  30. package/dist/{VehiclesPage-UlxPWP9K.js → VehiclesPage-VBtOep91.js} +20 -22
  31. package/dist/WarehouseDetailsPage-L_6sWigM.js +493 -0
  32. package/dist/{WarehousesPage-CuTO-OPp.js → WarehousesPage-DCbXXXWE.js} +16 -18
  33. package/dist/{arrow-left-CBpZKkpq.js → arrow-left-n48Y-Wis.js} +1 -1
  34. package/dist/{box-CAaiElsb.js → box-D9Pal4HM.js} +1 -1
  35. package/dist/{chart-column-D1Ym15-S.js → chart-column-BFIJysDR.js} +1 -1
  36. package/dist/{chevron-right-BIFGi0UA.js → chevron-right-EMIIyyJ1.js} +1 -1
  37. package/dist/{circle-alert-DjmNo5_L.js → circle-alert-iY24lSlp.js} +1 -1
  38. package/dist/{circle-check-big-CjuPVo3_.js → circle-check-big-w0TrLKMF.js} +1 -1
  39. package/dist/{clock-BjkdnddD.js → clock-DJZtdl8u.js} +1 -1
  40. package/dist/{dollar-sign-IB4O0wuQ.js → dollar-sign-CgKQRz_e.js} +1 -1
  41. package/dist/{download-Dpa9vqoG.js → download-DRXxoiQR.js} +1 -1
  42. package/dist/{file-text-C8Uioy11.js → file-text-DWWY6_f5.js} +1 -1
  43. package/dist/{filter-Da5OZaHI.js → filter-DloLC2eE.js} +1 -1
  44. package/dist/index.js +186 -162
  45. package/dist/{map-_Per4sT9.js → map-CkJaULb2.js} +1 -1
  46. package/dist/{map-pin-BSaf5IDL.js → map-pin-BGiCvyCs.js} +1 -1
  47. package/dist/{navigation-DaTbrhw2.js → navigation-D36prnAn.js} +1 -1
  48. package/dist/{package-BE7U0wQE.js → package-BChUzpJS.js} +1 -1
  49. package/dist/{phone-DV4StZiA.js → phone-Ac9s3mo_.js} +1 -1
  50. package/dist/{plus-Dl1rLeJR.js → plus-Z76q-FZm.js} +1 -1
  51. package/dist/{refresh-cw-CWfERAit.js → refresh-cw-DKt6f5T6.js} +1 -1
  52. package/dist/{save-XH8vydOn.js → save-CojywNhG.js} +1 -1
  53. package/dist/{search-OxoIiL_C.js → search-CDGefqb3.js} +1 -1
  54. package/dist/{square-pen-hLIbFQFV.js → square-pen-CopE9GmB.js} +1 -1
  55. package/dist/{star-YsVV3MNQ.js → star-nHlLjDKR.js} +1 -1
  56. package/dist/{store-RCBl7HB-.js → store-BR9Voi5E.js} +1 -1
  57. package/dist/trash-2-BKhar6Hs.js +32 -0
  58. package/dist/{trending-up-C-85AwGT.js → trending-up-Dohgd4t_.js} +1 -1
  59. package/dist/{triangle-alert-BOhfGgmh.js → triangle-alert-i-XQL9Rd.js} +1 -1
  60. package/dist/{truck-CtDjNFbi.js → truck-C0v_hbLR.js} +1 -1
  61. package/dist/{useAnalytics-ph7eTIK6.js → useAnalytics-DS8n0xgg.js} +40 -40
  62. package/dist/useAssistant-D4v3oxD3.js +84 -0
  63. package/dist/{useCustomers-bS3a4ytk.js → useCustomers-BmTNGxiI.js} +24 -24
  64. package/dist/{useFleet-BdETplNE.js → useFleet-DKqXZ16m.js} +133 -109
  65. package/dist/useImportExport-DHr-SWSw.js +55 -0
  66. package/dist/{useInventory-Dwn18FPz.js → useInventory-DkyiVY_A.js} +95 -75
  67. package/dist/{useOrders-D_3_hGMp.js → useOrders-Cfk1GLiq.js} +42 -42
  68. package/dist/useReports-CTqZr-AB.js +78 -0
  69. package/dist/{useRoutes-v4aBaS-E.js → useRoutes-BQWO607N.js} +31 -31
  70. package/dist/useSettings-CkDH_-gM.js +81 -0
  71. package/dist/{useTracking-De2KIUNu.js → useTracking-B-va1kO3.js} +22 -22
  72. package/dist/{user-Dz5TJZFs.js → user-jyFU3lXk.js} +1 -1
  73. package/dist/{users-g2N0eL-Z.js → users-DZ-ilS6B.js} +1 -1
  74. package/dist/{warehouse-D3WWDeTX.js → warehouse-6m5kXMLu.js} +1 -1
  75. package/dist/{wrench-CmxY1n4I.js → wrench-CANXWxF-.js} +1 -1
  76. package/package.json +1 -1
  77. package/src/movethewheels/MoveTheWheelsRoutes.tsx +31 -3
  78. package/src/movethewheels/components/FormError.tsx +25 -0
  79. package/src/movethewheels/components/StatusBadge.tsx +18 -37
  80. package/src/movethewheels/constants/index.ts +67 -26
  81. package/src/movethewheels/hooks/index.ts +12 -0
  82. package/src/movethewheels/hooks/useAnalytics.ts +20 -6
  83. package/src/movethewheels/hooks/useAssistant.ts +74 -0
  84. package/src/movethewheels/hooks/useFleet.ts +170 -59
  85. package/src/movethewheels/hooks/useImportExport.ts +101 -0
  86. package/src/movethewheels/hooks/useInventory.ts +107 -0
  87. package/src/movethewheels/hooks/useReports.ts +158 -0
  88. package/src/movethewheels/hooks/useSettings.ts +120 -0
  89. package/src/movethewheels/pages/AIAssistantPage.tsx +53 -15
  90. package/src/movethewheels/pages/AnalyticsPage.tsx +67 -64
  91. package/src/movethewheels/pages/CustomerDetailsPage.tsx +154 -21
  92. package/src/movethewheels/pages/CustomersPage.tsx +1 -1
  93. package/src/movethewheels/pages/DashboardPage.tsx +42 -22
  94. package/src/movethewheels/pages/DriverDetailsPage.tsx +160 -3
  95. package/src/movethewheels/pages/DriversPage.tsx +6 -2
  96. package/src/movethewheels/pages/FleetPage.tsx +96 -38
  97. package/src/movethewheels/pages/ImportExportPage.tsx +174 -68
  98. package/src/movethewheels/pages/InventoryPage.tsx +66 -28
  99. package/src/movethewheels/pages/LiveTrackingPage.tsx +12 -3
  100. package/src/movethewheels/pages/MarketplacePage.tsx +87 -45
  101. package/src/movethewheels/pages/OrderDetailsPage.tsx +2 -2
  102. package/src/movethewheels/pages/ProductDetailsPage.tsx +146 -3
  103. package/src/movethewheels/pages/ProductsPage.tsx +5 -1
  104. package/src/movethewheels/pages/ReportsPage.tsx +194 -90
  105. package/src/movethewheels/pages/RouteDetailsPage.tsx +290 -36
  106. package/src/movethewheels/pages/RoutesPage.tsx +4 -9
  107. package/src/movethewheels/pages/SettingsPage.tsx +234 -56
  108. package/src/movethewheels/pages/TrackingPage.tsx +6 -6
  109. package/src/movethewheels/pages/VehicleDetailsPage.tsx +158 -2
  110. package/src/movethewheels/pages/VehiclesPage.tsx +5 -1
  111. package/src/movethewheels/pages/WarehouseDetailsPage.tsx +224 -2
  112. package/src/movethewheels/pages/WarehousesPage.tsx +5 -1
  113. package/src/movethewheels/providers/MoveTheWheelsProvider.tsx +7 -6
  114. package/src/movethewheels/store/movethewheelsStore.ts +1 -1
  115. package/dist/AnalyticsPage-CCLfHgQZ.js +0 -212
  116. package/dist/CustomerDetailsPage-I6cdDHUi.js +0 -265
  117. package/dist/DriverDetailsPage-rg_pGNuP.js +0 -330
  118. package/dist/FleetPage-DddXt8r8.js +0 -332
  119. package/dist/ImportExportPage-BW6qO3kc.js +0 -248
  120. package/dist/InventoryPage-rMGuaJN-.js +0 -222
  121. package/dist/MarketplacePage-DKrXAv62.js +0 -219
  122. package/dist/ProductDetailsPage-CFGcbaHo.js +0 -195
  123. package/dist/ReportsPage-Bb7_90rK.js +0 -235
  124. package/dist/RouteDetailsPage-CVtDVb1N.js +0 -282
  125. package/dist/RoutesPage-s57PtgcQ.js +0 -163
  126. package/dist/SettingsPage-BYNCBOpN.js +0 -298
  127. package/dist/StatusBadge-CijYQXtb.js +0 -209
  128. package/dist/VehicleDetailsPage-3YDMPsPs.js +0 -220
  129. package/dist/WarehouseDetailsPage-Db7KeN-d.js +0 -238
  130. package/dist/graphqlClient-CdJyR_ed.js +0 -55
  131. package/dist/navigation-BgnOfsVd.js +0 -6
  132. package/dist/route-Dp9JiN_E.js +0 -51
  133. package/dist/settings-3Rw5NwFF.js +0 -28
  134. package/src/movethewheels/constants/mockData.ts +0 -1342
  135. /package/dist/{formatters-_vJlC-47.js → formatters-CF2S2l1m.js} +0 -0
@@ -1,8 +1,8 @@
1
- import { r as e, t } from "./graphqlClient-CdJyR_ed.js";
1
+ import { it as e, ot as t } from "./PageLayout-D4LDHJJq.js";
2
2
  import { useCallback as n, useEffect as r, useMemo as i, useState as a } from "react";
3
3
  //#region src/movethewheels/hooks/useInventory.ts
4
- var o = "\n query ListInventoryItems($filter: InventoryFilterInput, $pagination: PaginationInput) {\n inventoryItems(filter: $filter, pagination: $pagination) {\n id\n productId\n warehouseId\n onHand\n available\n allocated\n damaged\n reorderPoint\n createdAt\n updatedAt\n }\n }\n", s = "\n query ListProducts($filter: ProductFilterInput, $pagination: PaginationInput) {\n products(filter: $filter, pagination: $pagination) {\n id\n sku\n name\n description\n category\n brand\n dimensions\n weight\n value\n hazardous\n fragile\n temperatureControlled\n createdAt\n updatedAt\n }\n }\n", c = "\n query ListWarehouses($filter: WarehouseFilterInput, $pagination: PaginationInput) {\n warehouses(filter: $filter, pagination: $pagination) {\n id\n name\n code\n type\n address\n totalCapacity\n usedCapacity\n createdAt\n }\n }\n", l = "\n query GetProduct($id: ID!) {\n product(id: $id) {\n id\n sku\n name\n description\n category\n brand\n dimensions\n weight\n value\n hazardous\n fragile\n temperatureControlled\n createdAt\n updatedAt\n }\n }\n", u = "\n query GetWarehouse($id: ID!) {\n warehouse(id: $id) {\n id\n name\n code\n type\n address\n totalCapacity\n usedCapacity\n createdAt\n }\n }\n", d = "\n query GetInventoryStats {\n inventoryStats {\n totalOnHand\n totalAvailable\n totalAllocated\n totalDamaged\n lowStockCount\n }\n }\n", f = "\n mutation AdjustInventoryStock($input: AdjustInventoryStockInput!) {\n adjustInventoryStock(input: $input) {\n id\n productId\n warehouseId\n onHand\n available\n allocated\n damaged\n reorderPoint\n createdAt\n updatedAt\n }\n }\n";
5
- function p(e) {
4
+ var o = "\n query ListInventoryItems($filter: InventoryFilterInput, $pagination: PaginationInput) {\n inventoryItems(filter: $filter, pagination: $pagination) {\n id\n productId\n warehouseId\n onHand\n available\n allocated\n damaged\n reorderPoint\n createdAt\n updatedAt\n }\n }\n", s = "\n query ListProducts($filter: ProductFilterInput, $pagination: PaginationInput) {\n products(filter: $filter, pagination: $pagination) {\n id\n sku\n name\n description\n category\n brand\n dimensions\n weight\n value\n hazardous\n fragile\n temperatureControlled\n createdAt\n updatedAt\n }\n }\n", c = "\n query ListWarehouses($filter: WarehouseFilterInput, $pagination: PaginationInput) {\n warehouses(filter: $filter, pagination: $pagination) {\n id\n name\n code\n type\n address\n totalCapacity\n usedCapacity\n createdAt\n }\n }\n", l = "\n query GetProduct($id: ID!) {\n product(id: $id) {\n id\n sku\n name\n description\n category\n brand\n dimensions\n weight\n value\n hazardous\n fragile\n temperatureControlled\n createdAt\n updatedAt\n }\n }\n", u = "\n query GetWarehouse($id: ID!) {\n warehouse(id: $id) {\n id\n name\n code\n type\n address\n totalCapacity\n usedCapacity\n createdAt\n }\n }\n", d = "\n query GetInventoryStats {\n inventoryStats {\n totalOnHand\n totalAvailable\n totalAllocated\n totalDamaged\n lowStockCount\n }\n }\n", f = "\n mutation CreateProduct($input: CreateProductInput!) {\n createProduct(input: $input) {\n id\n sku\n name\n description\n category\n brand\n dimensions\n weight\n value\n hazardous\n fragile\n temperatureControlled\n createdAt\n updatedAt\n }\n }\n", p = "\n mutation CreateWarehouse($input: CreateWarehouseInput!) {\n createWarehouse(input: $input) {\n id\n name\n code\n type\n address\n totalCapacity\n usedCapacity\n createdAt\n }\n }\n", m = "\n mutation AdjustInventoryStock($input: AdjustInventoryStockInput!) {\n adjustInventoryStock(input: $input) {\n id\n productId\n warehouseId\n onHand\n available\n allocated\n damaged\n reorderPoint\n createdAt\n updatedAt\n }\n }\n";
5
+ function h(e) {
6
6
  return {
7
7
  id: e.id,
8
8
  sku: e.sku,
@@ -29,7 +29,7 @@ function p(e) {
29
29
  updatedAt: new Date(e.updatedAt)
30
30
  };
31
31
  }
32
- function m(e) {
32
+ function g(e) {
33
33
  let t = e.totalCapacity ?? 0, n = e.usedCapacity ?? 0;
34
34
  return {
35
35
  id: e.id,
@@ -69,7 +69,7 @@ function m(e) {
69
69
  createdAt: new Date(e.createdAt)
70
70
  };
71
71
  }
72
- function h(e) {
72
+ function _(e) {
73
73
  return {
74
74
  id: e.id,
75
75
  productId: e.productId,
@@ -92,17 +92,17 @@ function h(e) {
92
92
  updatedAt: new Date(e.updatedAt)
93
93
  };
94
94
  }
95
- function g() {
96
- let { apiGatewayUrl: t, authToken: n, workspaceToken: r, workspaceId: a, tenantId: o, currentUser: s } = e();
95
+ function v() {
96
+ let { apiGatewayUrl: e, authToken: n, workspaceToken: r, workspaceId: a, tenantId: o, currentUser: s } = t();
97
97
  return i(() => ({
98
- apiGatewayUrl: t,
98
+ apiGatewayUrl: e,
99
99
  authToken: n,
100
100
  workspaceToken: r,
101
101
  workspaceId: a,
102
102
  tenantId: o,
103
103
  actorId: s?.id
104
104
  }), [
105
- t,
105
+ e,
106
106
  n,
107
107
  r,
108
108
  a,
@@ -110,16 +110,16 @@ function g() {
110
110
  s?.id
111
111
  ]);
112
112
  }
113
- function _(e = {}) {
114
- let { filters: l } = e, u = i(() => l, [
113
+ function y(t = {}) {
114
+ let { filters: l } = t, u = i(() => l, [
115
115
  l?.lowStock,
116
116
  l?.productId,
117
117
  l?.warehouseId
118
- ]), d = g(), [_, v] = a([]), [y, b] = a([]), [x, S] = a([]), [C, w] = a(!1), [T, E] = a(null), D = n(async () => {
119
- w(!0), E(null);
118
+ ]), d = v(), [y, b] = a([]), [x, S] = a([]), [C, w] = a([]), [T, E] = a(!1), [D, O] = a(null), k = n(async () => {
119
+ E(!0), O(null);
120
120
  try {
121
- let [e, n, r] = await Promise.all([
122
- t(d, o, {
121
+ let [t, n, r] = await Promise.all([
122
+ e(d, o, {
123
123
  filter: {
124
124
  warehouseId: u?.warehouseId,
125
125
  productId: u?.productId
@@ -129,71 +129,91 @@ function _(e = {}) {
129
129
  offset: 0
130
130
  }
131
131
  }),
132
- t(d, s, { pagination: {
132
+ e(d, s, { pagination: {
133
133
  limit: 500,
134
134
  offset: 0
135
135
  } }),
136
- t(d, c, { pagination: {
136
+ e(d, c, { pagination: {
137
137
  limit: 500,
138
138
  offset: 0
139
139
  } })
140
- ]), i = e.inventoryItems.map(h);
141
- u?.lowStock && (i = i.filter((e) => e.availableQuantity <= e.reorderLevel)), v(i), b(n.products.map(p)), S(r.warehouses.map(m));
140
+ ]), i = t.inventoryItems.map(_);
141
+ u?.lowStock && (i = i.filter((e) => e.availableQuantity <= e.reorderLevel)), b(i), S(n.products.map(h)), w(r.warehouses.map(g));
142
142
  } catch (e) {
143
- E(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load inventory data"));
143
+ O(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load inventory data"));
144
144
  } finally {
145
- w(!1);
145
+ E(!1);
146
146
  }
147
147
  }, [u, d]);
148
148
  r(() => {
149
- D();
150
- }, [D]);
151
- let O = n(() => {
152
- D();
153
- }, [D]), k = n(async (e, n, r) => {
154
- let i = _.find((t) => t.id === e);
149
+ k();
150
+ }, [k]);
151
+ let A = n(() => {
152
+ k();
153
+ }, [k]), j = n(async (t, n, r) => {
154
+ let i = y.find((e) => e.id === t);
155
155
  if (!i) throw Error("Inventory item not found");
156
- let a = h((await t(d, f, { input: {
157
- id: e,
156
+ let a = _((await e(d, m, { input: {
157
+ id: t,
158
158
  onHand: i.quantity + n,
159
159
  available: i.availableQuantity + n,
160
160
  allocated: i.reservedQuantity,
161
161
  damaged: 0
162
162
  } })).adjustInventoryStock);
163
- return v((t) => t.map((t) => t.id === e ? a : t)), a;
164
- }, [d, _]), A = n(async (e, t, n, r) => {
165
- let i = _.find((t) => t.warehouseId === e && t.productId === n);
163
+ return b((e) => e.map((e) => e.id === t ? a : e)), a;
164
+ }, [d, y]), M = n(async (e, t, n, r) => {
165
+ let i = y.find((t) => t.warehouseId === e && t.productId === n);
166
166
  if (!i) throw Error("Source inventory not found");
167
- await k(i.id, -Math.abs(r), "transfer out");
168
- let a = _.find((e) => e.warehouseId === t && e.productId === n);
169
- a && await k(a.id, Math.abs(r), "transfer in");
170
- }, [_, k]);
167
+ await j(i.id, -Math.abs(r), "transfer out");
168
+ let a = y.find((e) => e.warehouseId === t && e.productId === n);
169
+ a && await j(a.id, Math.abs(r), "transfer in");
170
+ }, [y, j]), N = n(async (t) => {
171
+ let n = h((await e(d, f, { input: {
172
+ name: t.name,
173
+ sku: t.sku,
174
+ category: t.category,
175
+ brand: t.brand,
176
+ weight: t.weight
177
+ } })).createProduct);
178
+ return S((e) => [n, ...e]), n;
179
+ }, [d]), P = n(async (t) => {
180
+ let n = g((await e(d, p, { input: {
181
+ code: t.code,
182
+ name: t.name,
183
+ type: t.type,
184
+ address: t.address,
185
+ totalCapacity: t.totalCapacity
186
+ } })).createWarehouse);
187
+ return w((e) => [n, ...e]), n;
188
+ }, [d]);
171
189
  return {
172
- inventory: _,
173
- products: y,
174
- warehouses: x,
175
- totalItems: _.length,
176
- isLoading: C,
177
- error: T,
178
- refetch: O,
179
- updateStock: k,
180
- transferStock: A
190
+ inventory: y,
191
+ products: x,
192
+ warehouses: C,
193
+ totalItems: y.length,
194
+ isLoading: T,
195
+ error: D,
196
+ refetch: A,
197
+ updateStock: j,
198
+ transferStock: M,
199
+ createProduct: N,
200
+ createWarehouse: P
181
201
  };
182
202
  }
183
- function v() {
184
- let e = g(), [i, o] = a([]), [c, l] = a(!1), [u, d] = a(null), f = n(async () => {
203
+ function b() {
204
+ let t = v(), [i, o] = a([]), [c, l] = a(!1), [u, d] = a(null), f = n(async () => {
185
205
  l(!0), d(null);
186
206
  try {
187
- o((await t(e, s, { pagination: {
207
+ o((await e(t, s, { pagination: {
188
208
  limit: 500,
189
209
  offset: 0
190
- } })).products.map(p));
210
+ } })).products.map(h));
191
211
  } catch (e) {
192
212
  d(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load products"));
193
213
  } finally {
194
214
  l(!1);
195
215
  }
196
- }, [e]);
216
+ }, [t]);
197
217
  return r(() => {
198
218
  f();
199
219
  }, [f]), {
@@ -204,45 +224,45 @@ function v() {
204
224
  refetch: () => void f()
205
225
  };
206
226
  }
207
- function y(e) {
208
- let i = g(), [o, s] = a(null), [c, u] = a(!1), [d, f] = a(null), m = n(async () => {
209
- if (!e) {
227
+ function x(t) {
228
+ let i = v(), [o, s] = a(null), [c, u] = a(!1), [d, f] = a(null), p = n(async () => {
229
+ if (!t) {
210
230
  s(null);
211
231
  return;
212
232
  }
213
233
  u(!0), f(null);
214
234
  try {
215
- let n = await t(i, l, { id: e });
216
- s(n.product ? p(n.product) : null);
235
+ let n = await e(i, l, { id: t });
236
+ s(n.product ? h(n.product) : null);
217
237
  } catch (e) {
218
238
  f(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load product"));
219
239
  } finally {
220
240
  u(!1);
221
241
  }
222
- }, [i, e]);
242
+ }, [i, t]);
223
243
  return r(() => {
224
- m();
225
- }, [m]), {
244
+ p();
245
+ }, [p]), {
226
246
  product: o,
227
247
  isLoading: c,
228
248
  error: d,
229
- refetch: () => void m()
249
+ refetch: () => void p()
230
250
  };
231
251
  }
232
- function b() {
233
- let e = g(), [i, o] = a([]), [s, l] = a(!1), [u, d] = a(null), f = n(async () => {
252
+ function S() {
253
+ let t = v(), [i, o] = a([]), [s, l] = a(!1), [u, d] = a(null), f = n(async () => {
234
254
  l(!0), d(null);
235
255
  try {
236
- o((await t(e, c, { pagination: {
256
+ o((await e(t, c, { pagination: {
237
257
  limit: 500,
238
258
  offset: 0
239
- } })).warehouses.map(m));
259
+ } })).warehouses.map(g));
240
260
  } catch (e) {
241
261
  d(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load warehouses"));
242
262
  } finally {
243
263
  l(!1);
244
264
  }
245
- }, [e]);
265
+ }, [t]);
246
266
  return r(() => {
247
267
  f();
248
268
  }, [f]), {
@@ -253,22 +273,22 @@ function b() {
253
273
  refetch: () => void f()
254
274
  };
255
275
  }
256
- function x(e) {
257
- let i = g(), [o, s] = a(null), [c, l] = a(!1), [d, f] = a(null), p = n(async () => {
258
- if (!e) {
276
+ function C(t) {
277
+ let i = v(), [o, s] = a(null), [c, l] = a(!1), [d, f] = a(null), p = n(async () => {
278
+ if (!t) {
259
279
  s(null);
260
280
  return;
261
281
  }
262
282
  l(!0), f(null);
263
283
  try {
264
- let n = await t(i, u, { id: e });
265
- s(n.warehouse ? m(n.warehouse) : null);
284
+ let n = await e(i, u, { id: t });
285
+ s(n.warehouse ? g(n.warehouse) : null);
266
286
  } catch (e) {
267
287
  f(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load warehouse"));
268
288
  } finally {
269
289
  l(!1);
270
290
  }
271
- }, [i, e]);
291
+ }, [i, t]);
272
292
  return r(() => {
273
293
  p();
274
294
  }, [p]), {
@@ -278,8 +298,8 @@ function x(e) {
278
298
  refetch: () => void p()
279
299
  };
280
300
  }
281
- function S() {
282
- let e = g(), [n, i] = a({
301
+ function w() {
302
+ let t = v(), [n, i] = a({
283
303
  totalItems: 0,
284
304
  lowStockItems: 0,
285
305
  totalValue: 0,
@@ -291,7 +311,7 @@ function S() {
291
311
  (async () => {
292
312
  s(!0), u(null);
293
313
  try {
294
- let [n, r] = await Promise.all([t(e, d), t(e, c, { pagination: {
314
+ let [n, r] = await Promise.all([e(t, d), e(t, c, { pagination: {
295
315
  limit: 500,
296
316
  offset: 0
297
317
  } })]);
@@ -313,11 +333,11 @@ function S() {
313
333
  s(!1);
314
334
  }
315
335
  })();
316
- }, [e]), {
336
+ }, [t]), {
317
337
  stats: n,
318
338
  isLoading: o,
319
339
  error: l
320
340
  };
321
341
  }
322
342
  //#endregion
323
- export { x as a, v as i, S as n, b as o, y as r, _ as t };
343
+ export { C as a, b as i, w as n, S as o, x as r, y as t };
@@ -1,4 +1,4 @@
1
- import { r as e, t } from "./graphqlClient-CdJyR_ed.js";
1
+ import { it as e, ot as t } from "./PageLayout-D4LDHJJq.js";
2
2
  import { useCallback as n, useEffect as r, useMemo as i, useState as a } from "react";
3
3
  //#region src/movethewheels/hooks/useOrders.ts
4
4
  var o = "\n query ListMovethewheelsOrders($filter: OrderFilterInput, $pagination: PaginationInput) {\n movethewheelsOrders(filter: $filter, pagination: $pagination) {\n id\n orderNumber\n customerId\n orderType\n status\n priority\n pickupAddress\n deliveryAddress\n items\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 statusHistory {\n status\n notes\n location\n createdAt\n createdBy\n }\n }\n }\n", s = "\n query GetMovethewheelsOrder($id: ID!) {\n movethewheelsOrder(id: $id) {\n id\n orderNumber\n customerId\n orderType\n status\n priority\n pickupAddress\n deliveryAddress\n items\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 statusHistory {\n status\n notes\n location\n createdAt\n createdBy\n }\n }\n }\n", c = "\n query GetOrderStatsBundle {\n orderStats {\n total\n pending\n inTransit\n delivered\n cancelled\n failed\n }\n financeMetrics {\n revenue {\n totalRevenue\n averageOrderValue\n }\n }\n }\n", l = "\n mutation CreateMovethewheelsOrder($input: CreateOrderInput!) {\n createMovethewheelsOrder(input: $input) {\n id\n orderNumber\n customerId\n orderType\n status\n priority\n pickupAddress\n deliveryAddress\n items\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 statusHistory {\n status\n notes\n location\n createdAt\n createdBy\n }\n }\n }\n", u = "\n mutation UpdateMovethewheelsOrder($id: ID!, $input: UpdateOrderInput!) {\n updateMovethewheelsOrder(id: $id, input: $input) {\n id\n orderNumber\n customerId\n orderType\n status\n priority\n pickupAddress\n deliveryAddress\n items\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 statusHistory {\n status\n notes\n location\n createdAt\n createdBy\n }\n }\n }\n", d = "\n mutation UpdateMovethewheelsOrderStatus($id: ID!, $input: UpdateOrderStatusInput!) {\n updateMovethewheelsOrderStatus(id: $id, input: $input) {\n id\n orderNumber\n customerId\n orderType\n status\n priority\n pickupAddress\n deliveryAddress\n items\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 statusHistory {\n status\n notes\n location\n createdAt\n createdBy\n }\n }\n }\n", f = "\n mutation DeleteMovethewheelsOrder($id: ID!) {\n deleteMovethewheelsOrder(id: $id)\n }\n";
@@ -108,7 +108,7 @@ 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 } = e(), [T, E] = a([]), [D, O] = a(!1), [k, A] = a(null), j = i(() => ({
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
112
  apiGatewayUrl: h,
113
113
  authToken: y,
114
114
  workspaceToken: x,
@@ -125,7 +125,7 @@ function x(s = {}) {
125
125
  ]), M = n(async () => {
126
126
  O(!0), A(null);
127
127
  try {
128
- E((await t(j, o, {
128
+ E((await e(j, o, {
129
129
  filter: {
130
130
  status: c?.status ? g(c.status) : void 0,
131
131
  priority: c?.priority ? v(c.priority) : void 0,
@@ -154,27 +154,27 @@ function x(s = {}) {
154
154
  }, [M]);
155
155
  let N = n(() => {
156
156
  M();
157
- }, [M]), P = n(async (e) => {
158
- let n = b((await t(j, l, { input: {
159
- orderNumber: e.orderNumber ?? `ORD-${(/* @__PURE__ */ new Date()).getFullYear()}-${Date.now().toString().slice(-6)}`,
160
- orderType: _(e.orderType),
161
- status: g(e.status ?? "pending"),
162
- priority: v(e.priority),
163
- customerId: e.customerId,
164
- pickupAddress: e.pickupAddress ?? {},
165
- deliveryAddress: e.deliveryAddress ?? {},
166
- items: e.items ?? [],
167
- pricing: e.pricing ?? null,
168
- specialInstructions: e.specialInstructions,
169
- trackingNumber: e.trackingNumber,
170
- scheduledDelivery: e.scheduledDelivery?.toISOString(),
171
- vehicleId: e.vehicleId,
172
- driverId: e.driverId
157
+ }, [M]), P = n(async (t) => {
158
+ let n = b((await e(j, l, { input: {
159
+ orderNumber: t.orderNumber ?? `ORD-${(/* @__PURE__ */ new Date()).getFullYear()}-${Date.now().toString().slice(-6)}`,
160
+ orderType: _(t.orderType),
161
+ status: g(t.status ?? "pending"),
162
+ priority: v(t.priority),
163
+ customerId: t.customerId,
164
+ pickupAddress: t.pickupAddress ?? {},
165
+ deliveryAddress: t.deliveryAddress ?? {},
166
+ items: t.items ?? [],
167
+ pricing: t.pricing ?? null,
168
+ specialInstructions: t.specialInstructions,
169
+ trackingNumber: t.trackingNumber,
170
+ scheduledDelivery: t.scheduledDelivery?.toISOString(),
171
+ vehicleId: t.vehicleId,
172
+ driverId: t.driverId
173
173
  } })).createMovethewheelsOrder);
174
174
  return E((e) => [n, ...e]), n;
175
- }, [j]), F = n(async (e, n) => {
176
- let r = b((await t(j, u, {
177
- id: e,
175
+ }, [j]), F = n(async (t, n) => {
176
+ let r = b((await e(j, u, {
177
+ id: t,
178
178
  input: {
179
179
  orderType: n.orderType ? _(n.orderType) : void 0,
180
180
  status: n.status ? g(n.status) : void 0,
@@ -191,15 +191,15 @@ function x(s = {}) {
191
191
  driverId: n.driverId
192
192
  }
193
193
  })).updateMovethewheelsOrder);
194
- return E((t) => t.map((t) => t.id === e ? r : t)), r;
195
- }, [j]), I = n(async (e) => {
196
- await t(j, f, { id: e }), E((t) => t.filter((t) => t.id !== e));
197
- }, [j]), L = n(async (e, n) => {
198
- let r = b((await t(j, d, {
199
- id: e,
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, {
199
+ id: t,
200
200
  input: { status: g(n) }
201
201
  })).updateMovethewheelsOrderStatus);
202
- return E((t) => t.map((t) => t.id === e ? r : t)), r;
202
+ return E((e) => e.map((e) => e.id === t ? r : e)), r;
203
203
  }, [j]);
204
204
  return {
205
205
  orders: T,
@@ -214,7 +214,7 @@ function x(s = {}) {
214
214
  };
215
215
  }
216
216
  function S(o) {
217
- let { apiGatewayUrl: c, authToken: l, workspaceToken: u, workspaceId: d, tenantId: f, currentUser: p } = e(), [m, h] = a(null), [g, _] = a(!1), [v, y] = a(null), x = i(() => ({
217
+ let { apiGatewayUrl: c, authToken: l, workspaceToken: u, workspaceId: d, tenantId: f, currentUser: p } = t(), [m, h] = a(null), [g, _] = a(!1), [v, y] = a(null), x = i(() => ({
218
218
  apiGatewayUrl: c,
219
219
  authToken: l,
220
220
  workspaceToken: u,
@@ -235,8 +235,8 @@ function S(o) {
235
235
  }
236
236
  _(!0), y(null);
237
237
  try {
238
- let e = await t(x, s, { id: o });
239
- h(e.movethewheelsOrder ? b(e.movethewheelsOrder) : null);
238
+ let t = await e(x, s, { id: o });
239
+ h(t.movethewheelsOrder ? b(t.movethewheelsOrder) : null);
240
240
  } catch (e) {
241
241
  y(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load order"));
242
242
  } finally {
@@ -255,7 +255,7 @@ function S(o) {
255
255
  };
256
256
  }
257
257
  function C() {
258
- let { apiGatewayUrl: o, authToken: s, workspaceToken: l, workspaceId: u, tenantId: d, currentUser: f } = e(), [p, m] = a(!1), [h, g] = a(null), [_, v] = a({
258
+ let { apiGatewayUrl: o, authToken: s, workspaceToken: l, workspaceId: u, tenantId: d, currentUser: f } = t(), [p, m] = a(!1), [h, g] = a(null), [_, v] = a({
259
259
  total: 0,
260
260
  byStatus: {
261
261
  pending: 0,
@@ -288,23 +288,23 @@ function C() {
288
288
  ]), b = n(async () => {
289
289
  m(!0), g(null);
290
290
  try {
291
- let e = await t(y, c);
291
+ let t = await e(y, c);
292
292
  v({
293
- total: e.orderStats.total,
293
+ total: t.orderStats.total,
294
294
  byStatus: {
295
- pending: e.orderStats.pending,
295
+ pending: t.orderStats.pending,
296
296
  confirmed: 0,
297
297
  assigned: 0,
298
298
  picked_up: 0,
299
- in_transit: e.orderStats.inTransit,
299
+ in_transit: t.orderStats.inTransit,
300
300
  out_for_delivery: 0,
301
- delivered: e.orderStats.delivered,
302
- cancelled: e.orderStats.cancelled,
303
- failed: e.orderStats.failed
301
+ delivered: t.orderStats.delivered,
302
+ cancelled: t.orderStats.cancelled,
303
+ failed: t.orderStats.failed
304
304
  },
305
- totalRevenue: e.financeMetrics.revenue.totalRevenue,
305
+ totalRevenue: t.financeMetrics.revenue.totalRevenue,
306
306
  todayOrders: 0,
307
- avgOrderValue: e.financeMetrics.revenue.averageOrderValue
307
+ avgOrderValue: t.financeMetrics.revenue.averageOrderValue
308
308
  });
309
309
  } catch (e) {
310
310
  g(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load order stats"));
@@ -0,0 +1,78 @@
1
+ import { it as e, ot as t } from "./PageLayout-D4LDHJJq.js";
2
+ import { useCallback as n, useEffect as r, useMemo as i, useState as a } from "react";
3
+ //#region src/movethewheels/hooks/useReports.ts
4
+ var o = "\n id\n name\n description\n type\n status\n schedule\n lastGenerated\n createdAt\n updatedAt\n", s = `
5
+ query MovethewheelsReports($filter: MovethewheelsReportFilterInput, $pagination: PaginationInput) {
6
+ movethewheelsReports(filter: $filter, pagination: $pagination) {
7
+ ${o}
8
+ }
9
+ }
10
+ `, c = `
11
+ mutation CreateMovethewheelsReport($input: CreateMovethewheelsReportInput!) {
12
+ createMovethewheelsReport(input: $input) {
13
+ ${o}
14
+ }
15
+ }
16
+ `, l = `
17
+ mutation GenerateMovethewheelsReport($input: GenerateMovethewheelsReportInput!) {
18
+ generateMovethewheelsReport(input: $input) {
19
+ generatedAt
20
+ result
21
+ report {
22
+ ${o}
23
+ }
24
+ }
25
+ }
26
+ `;
27
+ function u() {
28
+ let { apiGatewayUrl: o, authToken: u, workspaceToken: d, workspaceId: f, tenantId: p, currentUser: m } = t(), [h, g] = a([]), [_, v] = a(!1), [y, b] = a(null), x = i(() => ({
29
+ apiGatewayUrl: o,
30
+ authToken: u,
31
+ workspaceToken: d,
32
+ workspaceId: f,
33
+ tenantId: p,
34
+ actorId: m?.id
35
+ }), [
36
+ o,
37
+ u,
38
+ d,
39
+ f,
40
+ p,
41
+ m?.id
42
+ ]), S = n(async () => {
43
+ v(!0), b(null);
44
+ try {
45
+ g((await e(x, s, { pagination: {
46
+ limit: 100,
47
+ offset: 0
48
+ } })).movethewheelsReports);
49
+ } catch (e) {
50
+ b(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load reports"));
51
+ } finally {
52
+ v(!1);
53
+ }
54
+ }, [x]);
55
+ return r(() => {
56
+ S();
57
+ }, [S]), {
58
+ reports: h,
59
+ isLoading: _,
60
+ error: y,
61
+ refetch: n(() => {
62
+ S();
63
+ }, [S]),
64
+ createReport: n(async (t) => {
65
+ let n = (await e(x, c, { input: t })).createMovethewheelsReport;
66
+ return g((e) => [n, ...e]), n;
67
+ }, [x]),
68
+ generateReport: n(async (t, n) => {
69
+ let r = (await e(x, l, { input: {
70
+ reportId: t,
71
+ parameters: n
72
+ } })).generateMovethewheelsReport;
73
+ return g((e) => e.map((e) => e.id === t ? r.report : e)), r;
74
+ }, [x])
75
+ };
76
+ }
77
+ //#endregion
78
+ export { u as t };