@burdenoff/microfe-movethewheels 2026.703.3 → 2026.703.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AIAssistantPage-C3cPsWt-.js → AIAssistantPage-D2gaEL1U.js} +16 -15
- package/dist/AnalyticsPage-DZMlEoBi.js +194 -0
- package/dist/CreateOrderPage-CWHx8yys.js +490 -0
- package/dist/CustomerDetailsPage-nR4oZ_ju.js +615 -0
- package/dist/CustomersPage-Bbvwvn8k.js +205 -0
- package/dist/DashboardPage-DrEhNf7N.js +542 -0
- package/dist/DataTable-CqMUD4er.js +340 -0
- package/dist/DocumentsCard-edDkgnJj.js +169 -0
- package/dist/DriverDetailsPage-whEMOWs9.js +490 -0
- package/dist/DriversPage-CHF2ZEzd.js +221 -0
- package/dist/FinancePage-Dn9GrW-1.js +175 -0
- package/dist/{FleetPage-DqkFi3s3.js → FleetPage-CrtGPy-p.js} +36 -35
- package/dist/{FormError-BlOjnXOq.js → FormError-BKcb_wT-.js} +1 -1
- package/dist/{ImportExportPage-DKJRCezl.js → ImportExportPage-WYdwZomZ.js} +52 -72
- package/dist/InventoryPage-l5A1f753.js +259 -0
- package/dist/LiveTrackingPage-DhEaNKZ4.js +429 -0
- package/dist/MarketplacePage-B9RYOb1Y.js +426 -0
- package/dist/MetricCard-y3bWHKUQ.js +191 -0
- package/dist/Notice-DOO-tjpV.js +46 -0
- package/dist/OrderDetailsPage-CwYHwk1K.js +584 -0
- package/dist/OrdersListPage-DhZJoQeI.js +386 -0
- package/dist/{PageLayout-D4LDHJJq.js → PageLayout-BniRJaQ6.js} +1 -1
- package/dist/{ProductDetailsPage-C9uOiYLp.js → ProductDetailsPage-1Gm9JKy0.js} +56 -56
- package/dist/ProductsPage-C8sn-1tN.js +186 -0
- package/dist/ReportsPage-D1tb0dcz.js +377 -0
- package/dist/RouteDetailsPage-CkMyR9b_.js +610 -0
- package/dist/{RoutesPage-DMfoicM1.js → RoutesPage-QkENzsE5.js} +58 -47
- package/dist/{SettingsPage-Bn-v0mbQ.js → SettingsPage-DV3_tU_X.js} +16 -38
- package/dist/Sparkline-K2RMJ58u.js +16729 -0
- package/dist/{StatusBadge-BZurYHMy.js → StatusBadge-BNHXYvZx.js} +7 -7
- package/dist/TrackingPage-BZrg4RCu.js +368 -0
- package/dist/VehicleDetailsPage-D-8XPZ2G.js +393 -0
- package/dist/VehiclesPage-D5BELbtM.js +184 -0
- package/dist/{WarehouseDetailsPage-L_6sWigM.js → WarehouseDetailsPage-Cmg-8Frn.js} +70 -70
- package/dist/WarehousesPage-C1Y1M867.js +182 -0
- package/dist/{arrow-left-n48Y-Wis.js → arrow-left-ClW4Isj7.js} +1 -1
- package/dist/arrow-right-CmKOmIkh.js +11 -0
- package/dist/arrow-up-BJijRLAZ.js +17 -0
- package/dist/{box-D9Pal4HM.js → box-BT3NsRQP.js} +1 -1
- package/dist/boxes-B_OGvQiW.js +54 -0
- package/dist/{chart-column-BFIJysDR.js → chart-column-DQTTdUPk.js} +1 -1
- package/dist/charts-Tj_PPTfA.js +2018 -0
- package/dist/chevron-left-B1rZyWWb.js +8 -0
- package/dist/{chevron-right-EMIIyyJ1.js → chevron-right-BIcwUJZq.js} +1 -1
- package/dist/chunk-BdsCSvBP.js +20 -0
- package/dist/{circle-alert-iY24lSlp.js → circle-alert-CNkuDNc6.js} +1 -1
- package/dist/circle-check-Cs1OVjtV.js +13 -0
- package/dist/{circle-check-big-w0TrLKMF.js → circle-check-big-C-p4eNwn.js} +1 -1
- package/dist/{clock-DJZtdl8u.js → clock-dRGG4rkF.js} +1 -1
- package/dist/{dollar-sign-CgKQRz_e.js → dollar-sign-B6RoYHHz.js} +1 -1
- package/dist/{download-DRXxoiQR.js → download-DP04iWTd.js} +1 -1
- package/dist/{file-text-DWWY6_f5.js → file-text-BuDx4hZp.js} +1 -1
- package/dist/{filter-DloLC2eE.js → filter-BD483_8g.js} +1 -1
- package/dist/{wrench-CANXWxF-.js → fuel-DLH1ag04.js} +3 -6
- package/dist/index.css +2 -0
- package/dist/index.js +150 -172
- package/dist/{map-CkJaULb2.js → map-DNQn9fyY.js} +1 -1
- package/dist/{map-pin-BGiCvyCs.js → map-pin-CqN1bbT1.js} +1 -1
- package/dist/mapMarkers-NCV9MRKR.js +28 -0
- package/dist/maps-yzLqiK_C.js +5070 -0
- package/dist/{navigation-D36prnAn.js → navigation-CgGUt2tR.js} +1 -1
- package/dist/{package-BChUzpJS.js → package-DmRF7iQD.js} +1 -1
- package/dist/{phone-Ac9s3mo_.js → phone-Cl32EXKW.js} +1 -1
- package/dist/{plus-Z76q-FZm.js → plus-DlANgOFx.js} +1 -1
- package/dist/{refresh-cw-DKt6f5T6.js → refresh-cw-rW59D4b7.js} +1 -1
- package/dist/route-CWjPrtAN.js +22 -0
- package/dist/{save-CojywNhG.js → save-UDlog7hg.js} +1 -1
- package/dist/{search-CDGefqb3.js → search-DNIG5Ck7.js} +1 -1
- package/dist/{square-pen-CopE9GmB.js → square-pen-BcfB3Grd.js} +1 -1
- package/dist/{star-nHlLjDKR.js → star-CVZHFwDx.js} +1 -1
- package/dist/{store-BR9Voi5E.js → store-bwnmCK9f.js} +1 -1
- package/dist/{trash-2-BKhar6Hs.js → trash-2-B80G12d4.js} +1 -1
- package/dist/{trending-up-Dohgd4t_.js → trending-up-CH4R4KOa.js} +1 -1
- package/dist/{triangle-alert-i-XQL9Rd.js → triangle-alert-CmS8AUU6.js} +1 -1
- package/dist/{truck-C0v_hbLR.js → truck-9rLDncav.js} +1 -1
- package/dist/upload-DanJY1Vo.js +21 -0
- package/dist/{useAssistant-D4v3oxD3.js → useAssistant-CnEwkTLm.js} +11 -28
- package/dist/{useCustomers-BmTNGxiI.js → useCustomers-ChJao1ET.js} +30 -27
- package/dist/{useFleet-DKqXZ16m.js → useFleet-g5Yri0G8.js} +82 -70
- package/dist/{useImportExport-DHr-SWSw.js → useImportExport-MYwIT3rE.js} +1 -1
- package/dist/{useInventory-DkyiVY_A.js → useInventory-BSOn-R1c.js} +84 -39
- package/dist/{useOrders-Cfk1GLiq.js → useOrders-BSiqo61w.js} +59 -48
- package/dist/{useReports-CTqZr-AB.js → useReports-fWESfsF9.js} +41 -35
- package/dist/{useRoutes-BQWO607N.js → useRoutes-zD8Yp323.js} +50 -42
- package/dist/{useSettings-CkDH_-gM.js → useSettings-B1lsWeZ1.js} +6 -6
- package/dist/{useTracking-B-va1kO3.js → useTracking-BKG0I2ln.js} +3 -3
- package/dist/{user-jyFU3lXk.js → user-DU51el3m.js} +1 -1
- package/dist/user-check-IMhk-qkX.js +20 -0
- package/dist/{users-DZ-ilS6B.js → users-B8KhJBGg.js} +1 -1
- package/dist/{warehouse-6m5kXMLu.js → warehouse-CcMMioeY.js} +1 -1
- package/dist/wrench-Dg-sgH2e.js +8 -0
- package/dist/x-C4ObLVEa.js +11 -0
- package/package.json +5 -1
- package/src/movethewheels/components/DataTable.tsx +252 -84
- package/src/movethewheels/components/DocumentsCard.tsx +102 -0
- package/src/movethewheels/components/GlassPanel.tsx +71 -0
- package/src/movethewheels/components/MetricCard.tsx +171 -73
- package/src/movethewheels/components/Notice.tsx +61 -0
- package/src/movethewheels/components/StatusBadge.tsx +7 -6
- package/src/movethewheels/components/charts/ChartShell.tsx +78 -0
- package/src/movethewheels/components/charts/Sparkline.tsx +85 -0
- package/src/movethewheels/components/charts/StatusDonut.tsx +115 -0
- package/src/movethewheels/components/charts/TrendChart.tsx +179 -0
- package/src/movethewheels/components/charts/VolumeBar.tsx +97 -0
- package/src/movethewheels/components/charts/chartTokens.ts +43 -0
- package/src/movethewheels/components/charts/index.ts +9 -0
- package/src/movethewheels/components/index.ts +51 -1
- package/src/movethewheels/components/maps/LogisticsMap.tsx +94 -0
- package/src/movethewheels/components/maps/MapCanvas.tsx +118 -0
- package/src/movethewheels/components/maps/RouteMap.tsx +71 -0
- package/src/movethewheels/components/maps/TrackingMap.tsx +102 -0
- package/src/movethewheels/components/maps/index.ts +16 -0
- package/src/movethewheels/components/maps/leaflet-setup.ts +124 -0
- package/src/movethewheels/components/maps/map-markers.css +121 -0
- package/src/movethewheels/hooks/index.ts +9 -0
- package/src/movethewheels/hooks/useAnalytics.ts +109 -4
- package/src/movethewheels/hooks/useCustomers.ts +11 -4
- package/src/movethewheels/hooks/useEntityDocuments.ts +132 -0
- package/src/movethewheels/hooks/useFleet.ts +26 -7
- package/src/movethewheels/hooks/useInventory.ts +70 -7
- package/src/movethewheels/hooks/useOrders.ts +32 -2
- package/src/movethewheels/hooks/useReports.ts +14 -4
- package/src/movethewheels/hooks/useRoutes.ts +20 -3
- package/src/movethewheels/pages/AnalyticsPage.tsx +93 -73
- package/src/movethewheels/pages/CreateOrderPage.tsx +48 -20
- package/src/movethewheels/pages/CustomerDetailsPage.tsx +239 -33
- package/src/movethewheels/pages/CustomersPage.tsx +53 -28
- package/src/movethewheels/pages/DashboardPage.tsx +238 -12
- package/src/movethewheels/pages/DriverDetailsPage.tsx +17 -31
- package/src/movethewheels/pages/DriversPage.tsx +59 -31
- package/src/movethewheels/pages/FinancePage.tsx +103 -82
- package/src/movethewheels/pages/InventoryPage.tsx +15 -3
- package/src/movethewheels/pages/LiveTrackingPage.tsx +124 -16
- package/src/movethewheels/pages/MarketplacePage.tsx +265 -50
- package/src/movethewheels/pages/OrderDetailsPage.tsx +214 -10
- package/src/movethewheels/pages/OrdersListPage.tsx +118 -47
- package/src/movethewheels/pages/ProductsPage.tsx +52 -28
- package/src/movethewheels/pages/ReportsPage.tsx +88 -4
- package/src/movethewheels/pages/RouteDetailsPage.tsx +119 -19
- package/src/movethewheels/pages/RoutesPage.tsx +22 -6
- package/src/movethewheels/pages/SettingsPage.tsx +5 -21
- package/src/movethewheels/pages/TrackingPage.tsx +76 -6
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +4 -34
- package/src/movethewheels/pages/VehiclesPage.tsx +58 -27
- package/src/movethewheels/pages/WarehouseDetailsPage.tsx +1 -1
- package/src/movethewheels/pages/WarehousesPage.tsx +47 -36
- package/src/movethewheels/types/index.ts +9 -1
- package/src/movethewheels/utils/download.ts +62 -0
- package/src/movethewheels/utils/mapMarkers.ts +58 -0
- package/dist/AnalyticsPage-Dz6g2MvK.js +0 -215
- package/dist/CreateOrderPage-C5iwnjp4.js +0 -479
- package/dist/CustomerDetailsPage-B6nwFyLO.js +0 -406
- package/dist/CustomersPage-BKxMS1AV.js +0 -161
- package/dist/DashboardPage-BVjQi0EB.js +0 -387
- package/dist/DataTable-DmciIKKM.js +0 -249
- package/dist/DriverDetailsPage-CN3WQ0B9.js +0 -507
- package/dist/DriversPage-CH9rjQC-.js +0 -165
- package/dist/FinancePage-DEDykSOP.js +0 -158
- package/dist/InventoryPage-e0ze63iX.js +0 -253
- package/dist/LiveTrackingPage-DCX-K-LR.js +0 -379
- package/dist/MarketplacePage-CIQ97_zp.js +0 -247
- package/dist/MetricCard-BY0QrMD4.js +0 -146
- package/dist/OrderDetailsPage-DYiZ-9UK.js +0 -429
- package/dist/OrdersListPage-Cn90P1Xx.js +0 -307
- package/dist/ProductsPage-QJfHHpqB.js +0 -169
- package/dist/ReportsPage-Zp53q3_8.js +0 -284
- package/dist/RouteDetailsPage-DUStXSf9.js +0 -531
- package/dist/TrackingPage-W-jtdM3Y.js +0 -325
- package/dist/VehicleDetailsPage-Bceo5oz3.js +0 -410
- package/dist/VehiclesPage-ApKThYeG.js +0 -165
- package/dist/WarehousesPage-DCbXXXWE.js +0 -162
- package/dist/useAnalytics-DS8n0xgg.js +0 -297
- /package/dist/{formatters-CF2S2l1m.js → formatters-FWJDwTFv.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { at as e, st as t } from "./PageLayout-BniRJaQ6.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
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";
|
|
@@ -200,31 +200,52 @@ function y(t = {}) {
|
|
|
200
200
|
createWarehouse: P
|
|
201
201
|
};
|
|
202
202
|
}
|
|
203
|
-
function b() {
|
|
204
|
-
let t = v(), [
|
|
205
|
-
|
|
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
|
-
|
|
208
|
-
limit:
|
|
209
|
-
offset:
|
|
210
|
-
} })
|
|
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
|
-
|
|
213
|
+
_(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load products"));
|
|
213
214
|
} finally {
|
|
214
|
-
|
|
215
|
+
m(!1);
|
|
215
216
|
}
|
|
216
|
-
}, [
|
|
217
|
+
}, [
|
|
218
|
+
c,
|
|
219
|
+
i,
|
|
220
|
+
o
|
|
221
|
+
]);
|
|
217
222
|
return r(() => {
|
|
218
|
-
|
|
219
|
-
}, [
|
|
220
|
-
products:
|
|
221
|
-
totalProducts:
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
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
|
|
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
|
|
253
|
-
let t = v(), [
|
|
254
|
-
|
|
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
|
-
|
|
257
|
-
limit:
|
|
258
|
-
offset:
|
|
259
|
-
} })
|
|
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
|
-
|
|
283
|
+
_(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load warehouses"));
|
|
262
284
|
} finally {
|
|
263
|
-
|
|
285
|
+
m(!1);
|
|
264
286
|
}
|
|
265
|
-
}, [
|
|
287
|
+
}, [
|
|
288
|
+
s,
|
|
289
|
+
i,
|
|
290
|
+
o
|
|
291
|
+
]);
|
|
266
292
|
return r(() => {
|
|
267
|
-
|
|
268
|
-
}, [
|
|
269
|
-
warehouses:
|
|
270
|
-
totalWarehouses:
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
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
|
|
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
|
|
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 {
|
|
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 };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { at as e, st as t } from "./PageLayout-BniRJaQ6.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,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,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
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
|
|
125
|
-
|
|
126
|
-
|
|
130
|
+
w,
|
|
131
|
+
T?.id
|
|
132
|
+
]), F = n(async () => {
|
|
133
|
+
j(!0), N(null);
|
|
127
134
|
try {
|
|
128
|
-
|
|
135
|
+
let t = (await e(P, o, {
|
|
129
136
|
filter: {
|
|
130
|
-
status:
|
|
131
|
-
priority:
|
|
132
|
-
orderType:
|
|
133
|
-
customerId:
|
|
134
|
-
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
|
|
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
|
-
|
|
152
|
+
N(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load orders"));
|
|
143
153
|
} finally {
|
|
144
|
-
|
|
154
|
+
j(!1);
|
|
145
155
|
}
|
|
146
156
|
}, [
|
|
147
|
-
|
|
148
|
-
|
|
157
|
+
h,
|
|
158
|
+
P,
|
|
149
159
|
p,
|
|
150
160
|
m
|
|
151
161
|
]);
|
|
152
162
|
r(() => {
|
|
153
|
-
|
|
154
|
-
}, [
|
|
155
|
-
let
|
|
156
|
-
|
|
157
|
-
}, [
|
|
158
|
-
let n = b((await e(
|
|
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
|
|
175
|
-
}, [
|
|
176
|
-
let r = b((await e(
|
|
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
|
|
195
|
-
}, [
|
|
196
|
-
await e(
|
|
197
|
-
}, [
|
|
198
|
-
let r = b((await e(
|
|
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
|
|
203
|
-
}, [
|
|
212
|
+
return D((e) => e.map((e) => e.id === t ? r : e)), r;
|
|
213
|
+
}, [P]);
|
|
204
214
|
return {
|
|
205
|
-
orders:
|
|
206
|
-
totalOrders:
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
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) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { at as e, st as t } from "./PageLayout-BniRJaQ6.js";
|
|
2
2
|
import { useCallback as n, useEffect as r, useMemo as i, useState as a } from "react";
|
|
3
3
|
//#region src/movethewheels/hooks/useReports.ts
|
|
4
4
|
var o = "\n id\n name\n description\n type\n status\n schedule\n lastGenerated\n createdAt\n updatedAt\n", s = `
|
|
@@ -24,54 +24,60 @@ var o = "\n id\n name\n description\n type\n status\n schedule\n lastGene
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
`;
|
|
27
|
-
function u() {
|
|
28
|
-
let {
|
|
29
|
-
apiGatewayUrl:
|
|
30
|
-
authToken:
|
|
31
|
-
workspaceToken:
|
|
32
|
-
workspaceId:
|
|
33
|
-
tenantId:
|
|
34
|
-
actorId:
|
|
27
|
+
function u(o = {}) {
|
|
28
|
+
let { limit: u = 100, offset: d = 0 } = o, { apiGatewayUrl: f, authToken: p, workspaceToken: m, workspaceId: h, tenantId: g, currentUser: _ } = t(), [v, y] = a([]), [b, x] = a(!1), [S, C] = a(!1), [w, T] = a(null), E = i(() => ({
|
|
29
|
+
apiGatewayUrl: f,
|
|
30
|
+
authToken: p,
|
|
31
|
+
workspaceToken: m,
|
|
32
|
+
workspaceId: h,
|
|
33
|
+
tenantId: g,
|
|
34
|
+
actorId: _?.id
|
|
35
35
|
}), [
|
|
36
|
-
o,
|
|
37
|
-
u,
|
|
38
|
-
d,
|
|
39
36
|
f,
|
|
40
37
|
p,
|
|
41
|
-
m
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
m,
|
|
39
|
+
h,
|
|
40
|
+
g,
|
|
41
|
+
_?.id
|
|
42
|
+
]), D = n(async () => {
|
|
43
|
+
C(!0), T(null);
|
|
44
44
|
try {
|
|
45
|
-
|
|
46
|
-
limit:
|
|
47
|
-
offset:
|
|
48
|
-
} })
|
|
45
|
+
let t = await e(E, s, { pagination: {
|
|
46
|
+
limit: u,
|
|
47
|
+
offset: d
|
|
48
|
+
} });
|
|
49
|
+
x(t.movethewheelsReports.length === u), y(t.movethewheelsReports);
|
|
49
50
|
} catch (e) {
|
|
50
|
-
|
|
51
|
+
T(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load reports"));
|
|
51
52
|
} finally {
|
|
52
|
-
|
|
53
|
+
C(!1);
|
|
53
54
|
}
|
|
54
|
-
}, [
|
|
55
|
+
}, [
|
|
56
|
+
E,
|
|
57
|
+
u,
|
|
58
|
+
d
|
|
59
|
+
]);
|
|
55
60
|
return r(() => {
|
|
56
|
-
|
|
57
|
-
}, [
|
|
58
|
-
reports:
|
|
59
|
-
|
|
60
|
-
|
|
61
|
+
D();
|
|
62
|
+
}, [D]), {
|
|
63
|
+
reports: v,
|
|
64
|
+
hasMore: b,
|
|
65
|
+
isLoading: S,
|
|
66
|
+
error: w,
|
|
61
67
|
refetch: n(() => {
|
|
62
|
-
|
|
63
|
-
}, [
|
|
68
|
+
D();
|
|
69
|
+
}, [D]),
|
|
64
70
|
createReport: n(async (t) => {
|
|
65
|
-
let n = (await e(
|
|
66
|
-
return
|
|
67
|
-
}, [
|
|
71
|
+
let n = (await e(E, c, { input: t })).createMovethewheelsReport;
|
|
72
|
+
return y((e) => [n, ...e]), n;
|
|
73
|
+
}, [E]),
|
|
68
74
|
generateReport: n(async (t, n) => {
|
|
69
|
-
let r = (await e(
|
|
75
|
+
let r = (await e(E, l, { input: {
|
|
70
76
|
reportId: t,
|
|
71
77
|
parameters: n
|
|
72
78
|
} })).generateMovethewheelsReport;
|
|
73
|
-
return
|
|
74
|
-
}, [
|
|
79
|
+
return y((e) => e.map((e) => e.id === t ? r.report : e)), r;
|
|
80
|
+
}, [E])
|
|
75
81
|
};
|
|
76
82
|
}
|
|
77
83
|
//#endregion
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { at as e, st as t } from "./PageLayout-BniRJaQ6.js";
|
|
2
2
|
import { useCallback as n, useEffect as r, useMemo as i, useState as a } from "react";
|
|
3
3
|
//#region src/movethewheels/hooks/useRoutes.ts
|
|
4
|
-
var o = "\n query ListRoutes($filter: RouteFilterInput, $pagination: PaginationInput) {\n routes(filter: $filter, pagination: $pagination) {\n id\n name\n status\n shipmentId\n vehicleId\n driverId\n waypoints\n estimatedDistance\n estimatedDuration\n actualDistance\n actualDuration\n createdAt\n }\n }\n", s = "\n query GetRoute($id: ID!) {\n route(id: $id) {\n id\n name\n status\n shipmentId\n vehicleId\n driverId\n waypoints\n estimatedDistance\n estimatedDuration\n actualDistance\n actualDuration\n createdAt\n }\n }\n", c = "\n mutation CreateRoute($input: CreateRouteInput!) {\n createRoute(input: $input) {\n id\n name\n status\n shipmentId\n vehicleId\n driverId\n waypoints\n estimatedDistance\n estimatedDuration\n actualDistance\n actualDuration\n createdAt\n }\n }\n", l = "\n mutation UpdateRoute($id: ID!, $input: UpdateRouteInput!) {\n updateRoute(id: $id, input: $input) {\n id\n name\n status\n shipmentId\n vehicleId\n driverId\n waypoints\n estimatedDistance\n estimatedDuration\n actualDistance\n actualDuration\n createdAt\n }\n }\n", u = "\n mutation DeleteRoute($id: ID!) {\n deleteRoute(id: $id)\n }\n", d = "\n mutation OptimizeRoute($id: ID!) {\n optimizeRoute(id: $id) {\n id\n name\n status\n shipmentId\n vehicleId\n driverId\n waypoints\n estimatedDistance\n estimatedDuration\n actualDistance\n actualDuration\n createdAt\n }\n }\n";
|
|
4
|
+
var o = "\n query ListRoutes($filter: RouteFilterInput, $pagination: PaginationInput) {\n routes(filter: $filter, pagination: $pagination) {\n id\n name\n status\n shipmentId\n vehicleId\n driverId\n waypoints\n estimatedDistance\n estimatedDuration\n fuelCost\n actualDistance\n actualDuration\n createdAt\n }\n }\n", s = "\n query GetRoute($id: ID!) {\n route(id: $id) {\n id\n name\n status\n shipmentId\n vehicleId\n driverId\n waypoints\n estimatedDistance\n estimatedDuration\n fuelCost\n actualDistance\n actualDuration\n createdAt\n }\n }\n", c = "\n mutation CreateRoute($input: CreateRouteInput!) {\n createRoute(input: $input) {\n id\n name\n status\n shipmentId\n vehicleId\n driverId\n waypoints\n estimatedDistance\n estimatedDuration\n fuelCost\n actualDistance\n actualDuration\n createdAt\n }\n }\n", l = "\n mutation UpdateRoute($id: ID!, $input: UpdateRouteInput!) {\n updateRoute(id: $id, input: $input) {\n id\n name\n status\n shipmentId\n vehicleId\n driverId\n waypoints\n estimatedDistance\n estimatedDuration\n fuelCost\n actualDistance\n actualDuration\n createdAt\n }\n }\n", u = "\n mutation DeleteRoute($id: ID!) {\n deleteRoute(id: $id)\n }\n", d = "\n mutation OptimizeRoute($id: ID!) {\n optimizeRoute(id: $id) {\n id\n name\n status\n shipmentId\n vehicleId\n driverId\n waypoints\n estimatedDistance\n estimatedDuration\n fuelCost\n actualDistance\n actualDuration\n createdAt\n }\n }\n";
|
|
5
5
|
function f(e) {
|
|
6
6
|
switch (e) {
|
|
7
7
|
case "IN_PROGRESS": return "in_progress";
|
|
@@ -53,6 +53,7 @@ function h(e) {
|
|
|
53
53
|
stops: m(e.waypoints),
|
|
54
54
|
distance: e.estimatedDistance ?? 0,
|
|
55
55
|
estimatedDuration: e.estimatedDuration ?? 0,
|
|
56
|
+
fuelCost: e.fuelCost ?? void 0,
|
|
56
57
|
actualDuration: e.actualDuration ?? void 0,
|
|
57
58
|
startTime: void 0,
|
|
58
59
|
endTime: void 0,
|
|
@@ -80,38 +81,41 @@ function g() {
|
|
|
80
81
|
]);
|
|
81
82
|
}
|
|
82
83
|
function _(t = {}) {
|
|
83
|
-
let { driverId: i, vehicleId: s, status: f } = t,
|
|
84
|
-
|
|
84
|
+
let { driverId: i, vehicleId: s, status: f, limit: m = 500, offset: _ = 0 } = t, v = g(), [y, b] = a([]), [x, S] = a(!1), [C, w] = a(!1), [T, E] = a(null), D = n(async () => {
|
|
85
|
+
w(!0), E(null);
|
|
85
86
|
try {
|
|
86
|
-
|
|
87
|
+
let t = await e(v, o, {
|
|
87
88
|
filter: {
|
|
88
89
|
driverId: i,
|
|
89
90
|
vehicleId: s,
|
|
90
91
|
status: f ? p(f) : void 0
|
|
91
92
|
},
|
|
92
93
|
pagination: {
|
|
93
|
-
limit:
|
|
94
|
-
offset:
|
|
94
|
+
limit: m,
|
|
95
|
+
offset: _
|
|
95
96
|
}
|
|
96
|
-
})
|
|
97
|
+
});
|
|
98
|
+
S(t.routes.length === m), b(t.routes.map(h));
|
|
97
99
|
} catch (e) {
|
|
98
|
-
|
|
100
|
+
E(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load routes"));
|
|
99
101
|
} finally {
|
|
100
|
-
|
|
102
|
+
w(!1);
|
|
101
103
|
}
|
|
102
104
|
}, [
|
|
103
105
|
i,
|
|
104
|
-
|
|
106
|
+
v,
|
|
105
107
|
f,
|
|
106
|
-
s
|
|
108
|
+
s,
|
|
109
|
+
m,
|
|
110
|
+
_
|
|
107
111
|
]);
|
|
108
112
|
r(() => {
|
|
109
|
-
|
|
110
|
-
}, [
|
|
111
|
-
let
|
|
112
|
-
|
|
113
|
-
}, [
|
|
114
|
-
let n = h((await e(
|
|
113
|
+
D();
|
|
114
|
+
}, [D]);
|
|
115
|
+
let O = n(() => {
|
|
116
|
+
D();
|
|
117
|
+
}, [D]), k = n(async (t) => {
|
|
118
|
+
let n = h((await e(v, c, { input: {
|
|
115
119
|
name: t.name ?? `Route ${(/* @__PURE__ */ new Date()).toLocaleDateString()}`,
|
|
116
120
|
status: p(t.status),
|
|
117
121
|
shipmentId: void 0,
|
|
@@ -120,12 +124,13 @@ function _(t = {}) {
|
|
|
120
124
|
waypoints: t.stops ?? [],
|
|
121
125
|
estimatedDistance: t.distance ?? 0,
|
|
122
126
|
estimatedDuration: t.estimatedDuration ?? 0,
|
|
127
|
+
fuelCost: t.fuelCost,
|
|
123
128
|
actualDistance: t.distance,
|
|
124
129
|
actualDuration: t.actualDuration
|
|
125
130
|
} })).createRoute);
|
|
126
|
-
return
|
|
127
|
-
}, [
|
|
128
|
-
let r = h((await e(
|
|
131
|
+
return b((e) => [n, ...e]), n;
|
|
132
|
+
}, [v]), A = n(async (t, n) => {
|
|
133
|
+
let r = h((await e(v, l, {
|
|
129
134
|
id: t,
|
|
130
135
|
input: {
|
|
131
136
|
name: n.name,
|
|
@@ -136,43 +141,45 @@ function _(t = {}) {
|
|
|
136
141
|
waypoints: n.stops,
|
|
137
142
|
estimatedDistance: n.distance,
|
|
138
143
|
estimatedDuration: n.estimatedDuration,
|
|
144
|
+
fuelCost: n.fuelCost,
|
|
139
145
|
actualDistance: n.distance,
|
|
140
146
|
actualDuration: n.actualDuration
|
|
141
147
|
}
|
|
142
148
|
})).updateRoute);
|
|
143
|
-
return
|
|
144
|
-
}, [
|
|
145
|
-
await e(
|
|
146
|
-
}, [
|
|
149
|
+
return b((e) => e.map((e) => e.id === t ? r : e)), r;
|
|
150
|
+
}, [v]), j = n(async (t) => {
|
|
151
|
+
await e(v, u, { id: t }), b((e) => e.filter((e) => e.id !== t));
|
|
152
|
+
}, [v]), M = n(async (t) => {
|
|
147
153
|
let n = {
|
|
148
|
-
...h((await e(
|
|
154
|
+
...h((await e(v, d, { id: t })).optimizeRoute),
|
|
149
155
|
optimized: !0
|
|
150
156
|
};
|
|
151
|
-
return
|
|
152
|
-
}, [
|
|
153
|
-
let r =
|
|
157
|
+
return b((e) => e.map((e) => e.id === t ? n : e)), n;
|
|
158
|
+
}, [v]), N = n(async (e, t, n) => {
|
|
159
|
+
let r = y.find((t) => t.id === e);
|
|
154
160
|
if (!r) throw Error("Route not found");
|
|
155
161
|
let i = r.stops.map((e) => e.id === t ? {
|
|
156
162
|
...e,
|
|
157
163
|
status: n,
|
|
158
164
|
actualTime: n === "completed" ? /* @__PURE__ */ new Date() : e.actualTime
|
|
159
165
|
} : e);
|
|
160
|
-
return
|
|
166
|
+
return A(e, {
|
|
161
167
|
stops: i,
|
|
162
168
|
status: i.every((e) => e.status === "completed") ? "completed" : r.status
|
|
163
169
|
});
|
|
164
|
-
}, [
|
|
170
|
+
}, [y, A]);
|
|
165
171
|
return {
|
|
166
|
-
routes:
|
|
167
|
-
totalRoutes:
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
172
|
+
routes: y,
|
|
173
|
+
totalRoutes: y.length,
|
|
174
|
+
hasMore: x,
|
|
175
|
+
isLoading: C,
|
|
176
|
+
error: T,
|
|
177
|
+
refetch: O,
|
|
178
|
+
createRoute: k,
|
|
179
|
+
updateRoute: A,
|
|
180
|
+
deleteRoute: j,
|
|
181
|
+
optimizeRoute: M,
|
|
182
|
+
updateStopStatus: N
|
|
176
183
|
};
|
|
177
184
|
}
|
|
178
185
|
function v(t) {
|
|
@@ -213,7 +220,8 @@ function y() {
|
|
|
213
220
|
avgDuration: r > 0 ? n / r : 0,
|
|
214
221
|
completedRoutes: e.filter((e) => e.status === "completed").length,
|
|
215
222
|
inProgressRoutes: e.filter((e) => e.status === "in_progress").length,
|
|
216
|
-
plannedRoutes: e.filter((e) => e.status === "planned").length
|
|
223
|
+
plannedRoutes: e.filter((e) => e.status === "planned").length,
|
|
224
|
+
optimizedRoutes: e.filter((e) => e.optimized).length
|
|
217
225
|
};
|
|
218
226
|
}, [e]),
|
|
219
227
|
isLoading: t,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { at as e, st as t, ut as n } from "./PageLayout-BniRJaQ6.js";
|
|
2
2
|
import { useCallback as r, useEffect as i, useMemo as a, useState as o } from "react";
|
|
3
3
|
//#region node_modules/lucide-react/dist/esm/icons/globe.js
|
|
4
|
-
var s =
|
|
4
|
+
var s = n("Globe", [
|
|
5
5
|
["circle", {
|
|
6
6
|
cx: "12",
|
|
7
7
|
cy: "12",
|
|
@@ -16,7 +16,7 @@ var s = t("Globe", [
|
|
|
16
16
|
d: "M2 12h20",
|
|
17
17
|
key: "9i4pu4"
|
|
18
18
|
}]
|
|
19
|
-
]), c =
|
|
19
|
+
]), c = n("Settings", [["path", {
|
|
20
20
|
d: "M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",
|
|
21
21
|
key: "1qme2f"
|
|
22
22
|
}], ["circle", {
|
|
@@ -26,15 +26,15 @@ var s = t("Globe", [
|
|
|
26
26
|
key: "1v7zrd"
|
|
27
27
|
}]]), l = "\n query MovethewheelsModuleSettings {\n moduleSettings {\n preferences\n updatedAt\n workspaceId\n }\n }\n", u = "\n mutation UpdateMovethewheelsModuleSettings($input: UpdateMovethewheelsModuleSettingsInput!) {\n updateModuleSettings(input: $input) {\n preferences\n updatedAt\n workspaceId\n }\n }\n";
|
|
28
28
|
function d() {
|
|
29
|
-
let { apiGatewayUrl:
|
|
30
|
-
apiGatewayUrl:
|
|
29
|
+
let { apiGatewayUrl: n, authToken: s, workspaceToken: c, workspaceId: d, tenantId: f, currentUser: p } = t(), [m, h] = o(null), [g, _] = o(!1), [v, y] = o(!1), [b, x] = o(null), S = a(() => ({
|
|
30
|
+
apiGatewayUrl: n,
|
|
31
31
|
authToken: s,
|
|
32
32
|
workspaceToken: c,
|
|
33
33
|
workspaceId: d,
|
|
34
34
|
tenantId: f,
|
|
35
35
|
actorId: p?.id
|
|
36
36
|
}), [
|
|
37
|
-
|
|
37
|
+
n,
|
|
38
38
|
s,
|
|
39
39
|
c,
|
|
40
40
|
d,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as n, t as r } from "./useOrders-
|
|
3
|
-
import { a as i, n as a, o, t as s } from "./useFleet-
|
|
1
|
+
import { at as e, st as t } from "./PageLayout-BniRJaQ6.js";
|
|
2
|
+
import { r as n, t as r } from "./useOrders-BSiqo61w.js";
|
|
3
|
+
import { a as i, n as a, o, t as s } from "./useFleet-g5Yri0G8.js";
|
|
4
4
|
import { useCallback as c, useEffect as l, useMemo as u, useState as d } from "react";
|
|
5
5
|
//#region src/movethewheels/hooks/useTracking.ts
|
|
6
6
|
var f = "\n query ListShipments($filter: ShipmentFilterInput, $pagination: PaginationInput) {\n shipments(filter: $filter, pagination: $pagination) {\n id\n shipmentNumber\n orderId\n status\n estimatedDelivery\n }\n }\n", p = "\n query GetShipment($id: ID!) {\n shipment(id: $id) {\n id\n shipmentNumber\n orderId\n status\n estimatedDelivery\n trackingEvents {\n id\n shipmentId\n eventType\n location\n details\n timestamp\n }\n }\n }\n", m = "\n query GetOrderTracking($orderId: ID!) {\n orderTracking(orderId: $orderId) {\n id\n shipmentId\n eventType\n location\n details\n timestamp\n }\n }\n", h = "\n query GetActiveDeliveries {\n activeDeliveries {\n id\n shipmentNumber\n orderId\n status\n estimatedDelivery\n }\n }\n", g = "\n query GetTrackingAlerts {\n trackingAlerts {\n shipmentId\n shipmentNumber\n alertType\n message\n }\n }\n";
|