@burdenoff/microfe-movethewheels 2026.822.1 → 2026.828.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generated/wspace-operations.d.ts +168 -912
- package/dist/generated/wspace-types.d.ts +78432 -35831
- package/dist/hooks/useFleet.js +142 -74
- package/dist/hooks/useImportExport.js +22 -51
- package/dist/hooks/useInventory.js +163 -70
- package/dist/hooks/useOrders.js +2 -2
- package/dist/hooks/useReports.js +63 -73
- package/dist/hooks/useSettings.js +52 -44
- package/dist/hooks/useTracking.js +5 -5
- package/dist/index.js +33 -33
- package/dist/movethewheels/hooks/index.d.ts +2 -2
- package/dist/movethewheels/hooks/useFleet.d.ts +32 -1
- package/dist/movethewheels/hooks/useImportExport.d.ts +10 -0
- package/dist/movethewheels/hooks/useInventory.d.ts +67 -12
- package/dist/movethewheels/hooks/useOrders.d.ts +25 -2
- package/dist/movethewheels/pages/MarketplacePage.d.ts +7 -4
- package/dist/movethewheels/types/index.d.ts +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/arrow-down-right.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/arrow-left-right.js +22 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/arrow-up-right.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/calendar-clock.js +32 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/history.js +18 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/lock.js +16 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/user-round.js +13 -0
- package/dist/pages/CreateOrderPage.js +246 -195
- package/dist/pages/DeliveryCapturePage.js +91 -78
- package/dist/pages/DriversPage.js +202 -108
- package/dist/pages/InventoryPage.js +356 -131
- package/dist/pages/MarketplacePage.js +11 -432
- package/dist/pages/ProductDetailsPage.js +212 -156
- package/dist/pages/ReportsPage.js +120 -109
- package/dist/pages/VehicleDetailsPage.js +257 -193
- package/dist/utils/formatters.js +4 -1
- package/package.json +2 -2
- package/src/generated/wspace-operations.ts +134 -929
- package/src/generated/wspace-types.ts +91730 -40059
- package/src/movethewheels/hooks/index.ts +9 -0
- package/src/movethewheels/hooks/useFleet.ts +133 -3
- package/src/movethewheels/hooks/useImportExport.ts +36 -72
- package/src/movethewheels/hooks/useInventory.ts +311 -53
- package/src/movethewheels/hooks/useOrders.ts +31 -7
- package/src/movethewheels/hooks/useReports.ts +73 -87
- package/src/movethewheels/hooks/useSettings.ts +50 -53
- package/src/movethewheels/hooks/useTracking.ts +14 -14
- package/src/movethewheels/pages/CreateOrderPage.tsx +67 -10
- package/src/movethewheels/pages/DeliveryCapturePage.tsx +8 -0
- package/src/movethewheels/pages/DriversPage.tsx +181 -31
- package/src/movethewheels/pages/InventoryPage.tsx +299 -19
- package/src/movethewheels/pages/MarketplacePage.tsx +16 -539
- package/src/movethewheels/pages/ProductDetailsPage.tsx +68 -3
- package/src/movethewheels/pages/ReportsPage.tsx +23 -0
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +86 -27
- package/src/movethewheels/types/index.ts +2 -0
- package/src/operations/wspace/movethewheels/fragments/core.graphql +23 -53
- package/src/operations/wspace/movethewheels/fragments/core.withdrawn.graphql +59 -0
- package/src/operations/wspace/movethewheels/mutations/entities.graphql +5 -5
- package/src/operations/wspace/movethewheels/mutations/marketplace-reports.graphql +18 -78
- package/src/operations/wspace/movethewheels/mutations/marketplace-reports.withdrawn.graphql +93 -0
- package/src/operations/wspace/movethewheels/mutations/orders.graphql +7 -7
- package/src/operations/wspace/movethewheels/queries/dashboard.graphql +3 -3
- package/src/operations/wspace/movethewheels/queries/entities.graphql +3 -3
- package/src/operations/wspace/movethewheels/queries/logistics.graphql +3 -3
- package/src/operations/wspace/movethewheels/queries/marketplace-reports.withdrawn.graphql +58 -0
- package/src/operations/wspace/movethewheels/queries/orders.graphql +3 -3
- package/dist/generated/global-operations.d.ts +0 -1
- package/dist/generated/global-types.d.ts +0 -23526
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.js +0 -8
- package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js +0 -8
- package/src/generated/global-operations.ts +0 -2
- package/src/generated/global-types.ts +0 -27259
- package/src/operations/wspace/movethewheels/queries/marketplace-reports.graphql +0 -40
|
@@ -1,59 +1,67 @@
|
|
|
1
1
|
import { useMoveTheWheels as e } from "../providers/MoveTheWheelsProvider.js";
|
|
2
|
-
import {
|
|
3
|
-
import { useCallback as n, useEffect as r, useMemo as i, useState as a } from "react";
|
|
2
|
+
import { useCallback as t, useEffect as n, useMemo as r, useState as i } from "react";
|
|
4
3
|
//#region src/movethewheels/hooks/useSettings.ts
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
4
|
+
function a(e) {
|
|
5
|
+
if (typeof window > "u") return null;
|
|
6
|
+
try {
|
|
7
|
+
let t = window.localStorage.getItem(`movethewheels:moduleSettings:${e}`);
|
|
8
|
+
if (!t) return null;
|
|
9
|
+
let n = JSON.parse(t);
|
|
10
|
+
return n && typeof n == "object" && "preferences" in n ? n : null;
|
|
11
|
+
} catch {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
function o(e) {
|
|
16
|
+
if (!(typeof window > "u")) try {
|
|
17
|
+
window.localStorage.setItem(`movethewheels:moduleSettings:${e.workspaceId}`, JSON.stringify(e));
|
|
18
|
+
} catch {}
|
|
19
|
+
}
|
|
20
|
+
function s() {
|
|
21
|
+
let { workspaceId: s } = e(), [c, l] = i(null), [u, d] = i(!1), [f, p] = i(!1), [m, h] = i(null), g = t(() => {
|
|
22
|
+
d(!0), h(null);
|
|
23
23
|
try {
|
|
24
|
-
|
|
24
|
+
l((s ? a(s) : null) ?? {
|
|
25
|
+
preferences: {},
|
|
26
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
27
|
+
workspaceId: s ?? ""
|
|
28
|
+
});
|
|
25
29
|
} catch (e) {
|
|
26
|
-
|
|
30
|
+
h(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load settings"));
|
|
27
31
|
} finally {
|
|
28
|
-
|
|
32
|
+
d(!1);
|
|
29
33
|
}
|
|
30
|
-
}, [
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}, [
|
|
34
|
-
let
|
|
35
|
-
|
|
36
|
-
}, [
|
|
37
|
-
|
|
34
|
+
}, [s]);
|
|
35
|
+
n(() => {
|
|
36
|
+
g();
|
|
37
|
+
}, [g]);
|
|
38
|
+
let _ = t(() => {
|
|
39
|
+
g();
|
|
40
|
+
}, [g]), v = t(async (e) => {
|
|
41
|
+
p(!0), h(null);
|
|
38
42
|
try {
|
|
39
|
-
let
|
|
40
|
-
|
|
43
|
+
let t = {
|
|
44
|
+
preferences: e,
|
|
45
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
46
|
+
workspaceId: s ?? ""
|
|
47
|
+
};
|
|
48
|
+
return o(t), l(t), t;
|
|
41
49
|
} catch (e) {
|
|
42
50
|
let t = e instanceof Error ? e : /* @__PURE__ */ Error("Failed to save settings");
|
|
43
|
-
throw
|
|
51
|
+
throw h(t), t;
|
|
44
52
|
} finally {
|
|
45
|
-
|
|
53
|
+
p(!1);
|
|
46
54
|
}
|
|
47
|
-
}, [
|
|
55
|
+
}, [s]);
|
|
48
56
|
return {
|
|
49
|
-
settings:
|
|
50
|
-
preferences:
|
|
51
|
-
isLoading:
|
|
52
|
-
isSaving:
|
|
53
|
-
error:
|
|
54
|
-
refetch:
|
|
55
|
-
savePreferences:
|
|
57
|
+
settings: c,
|
|
58
|
+
preferences: r(() => c?.preferences ?? {}, [c]),
|
|
59
|
+
isLoading: u,
|
|
60
|
+
isSaving: f,
|
|
61
|
+
error: m,
|
|
62
|
+
refetch: _,
|
|
63
|
+
savePreferences: v
|
|
56
64
|
};
|
|
57
65
|
}
|
|
58
66
|
//#endregion
|
|
59
|
-
export {
|
|
67
|
+
export { s as useModuleSettings };
|
|
@@ -4,7 +4,7 @@ import { useOrder as n, useOrders as r } from "./useOrders.js";
|
|
|
4
4
|
import { useDriver as i, useDrivers as a, useVehicle as o, useVehicles as s } from "./useFleet.js";
|
|
5
5
|
import { useCallback as c, useEffect as l, useMemo as u, useState as d } from "react";
|
|
6
6
|
//#region src/movethewheels/hooks/useTracking.ts
|
|
7
|
-
var f = "\n query ListShipments($filter: ShipmentFilterInput, $pagination: PaginationInput) {\n shipments(filter: $filter, pagination: $pagination) {\n id\n shipmentNumber\n
|
|
7
|
+
var f = "\n query ListShipments($filter: ShipmentFilterInput, $pagination: PaginationInput) {\n shipments(filter: $filter, pagination: $pagination) {\n id\n shipmentNumber\n deliveryJobId\n status\n estimatedDelivery\n }\n }\n", p = "\n query GetShipment($id: ID!) {\n shipment(id: $id) {\n id\n shipmentNumber\n deliveryJobId\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 GetDeliveryJobTracking($deliveryJobId: ID!) {\n deliveryJobTracking(deliveryJobId: $deliveryJobId) {\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 deliveryJobId\n status\n estimatedDelivery\n }\n }\n", g = "\n query GetTrackingAlerts {\n trackingAlerts {\n shipmentId\n shipmentNumber\n alertType\n message\n }\n }\n";
|
|
8
8
|
function _(e, t) {
|
|
9
9
|
let n = {
|
|
10
10
|
latitude: Number(e.location?.latitude ?? 0),
|
|
@@ -52,7 +52,7 @@ function y(e = {}) {
|
|
|
52
52
|
offset: 0
|
|
53
53
|
} })).shipments.map((e) => ({
|
|
54
54
|
id: e.id,
|
|
55
|
-
entityId: e.
|
|
55
|
+
entityId: e.deliveryJobId ?? e.id,
|
|
56
56
|
entityType: "order",
|
|
57
57
|
currentLocation: {
|
|
58
58
|
latitude: 0,
|
|
@@ -93,7 +93,7 @@ function b(e) {
|
|
|
93
93
|
}
|
|
94
94
|
u(!0), p(null);
|
|
95
95
|
try {
|
|
96
|
-
let n = await t(r, m, {
|
|
96
|
+
let n = await t(r, m, { deliveryJobId: e }), i = n.deliveryJobTracking[n.deliveryJobTracking.length - 1];
|
|
97
97
|
o(i ? _(i, e) : null);
|
|
98
98
|
} catch (e) {
|
|
99
99
|
p(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load order tracking"));
|
|
@@ -155,12 +155,12 @@ function C() {
|
|
|
155
155
|
try {
|
|
156
156
|
let r = await t(e, h);
|
|
157
157
|
f((await Promise.all(r.activeDeliveries.map(async (r) => {
|
|
158
|
-
let a = (await t(e, p, { id: r.id })).shipment?.trackingEvents ?? [], s = a[a.length - 1], c = n.find((e) => e.id === r.
|
|
158
|
+
let a = (await t(e, p, { id: r.id })).shipment?.trackingEvents ?? [], s = a[a.length - 1], c = n.find((e) => e.id === r.deliveryJobId);
|
|
159
159
|
return c ? {
|
|
160
160
|
order: c,
|
|
161
161
|
driver: c.driverId ? o.find((e) => e.id === c.driverId || e.userId === c.driverId) ?? null : null,
|
|
162
162
|
vehicle: c.vehicleId ? i.find((e) => e.id === c.vehicleId) ?? null : null,
|
|
163
|
-
tracking: s ? _(s, r.
|
|
163
|
+
tracking: s ? _(s, r.deliveryJobId ?? r.id) : null,
|
|
164
164
|
estimatedArrival: r.estimatedDelivery ? new Date(r.estimatedDelivery) : void 0
|
|
165
165
|
} : null;
|
|
166
166
|
}))).filter((e) => e !== null));
|
package/dist/index.js
CHANGED
|
@@ -3,38 +3,38 @@ import { MoveTheWheelsRoot as n } from "./MoveTheWheelsRoot.js";
|
|
|
3
3
|
import { useMoveTheWheelsStore as r } from "./store/movethewheelsStore.js";
|
|
4
4
|
import { useSandboxAssistantTransport as i } from "./services/createSandboxAssistantTransport.js";
|
|
5
5
|
import { useOrder as a, useOrderStats as o, useOrders as s } from "./hooks/useOrders.js";
|
|
6
|
-
import { useDriver as c,
|
|
7
|
-
import { useInventory as
|
|
8
|
-
import { useCustomer as
|
|
9
|
-
import { useRoute as
|
|
10
|
-
import { useAnalytics as
|
|
11
|
-
import { useDriverTracking as
|
|
12
|
-
import { useReports as
|
|
13
|
-
import { useImportExport as
|
|
14
|
-
import { useModuleSettings as
|
|
15
|
-
import { useEntityDocuments as
|
|
16
|
-
import { useCaptureEpod as
|
|
6
|
+
import { useDriver as c, useDriverStatusCounts as l, useDrivers as u, useFleet as d, useFleetStats as f, useVehicle as p, useVehicleDrivers as m, useVehicles as h } from "./hooks/useFleet.js";
|
|
7
|
+
import { useInventory as g, useInventoryStats as _, useInventoryTransactions as v, useProduct as y, useProductStockLevels as b, useProducts as x, useWarehouse as S, useWarehouses as C } from "./hooks/useInventory.js";
|
|
8
|
+
import { useCustomer as w, useCustomerStats as T, useCustomers as E } from "./hooks/useCustomers.js";
|
|
9
|
+
import { useRoute as D, useRouteStats as O, useRoutes as k } from "./hooks/useRoutes.js";
|
|
10
|
+
import { useAnalytics as A, useDashboardMetrics as j, useEmissionsSummary as M, useFinanceMetrics as N, useFleetAnalytics as P, useOrderAnalytics as F, usePerformanceAnalytics as I, useRevenueAnalytics as L } from "./hooks/useAnalytics.js";
|
|
11
|
+
import { useDriverTracking as R, useGeofence as z, useLiveTracking as B, useOrderTracking as V, useTracking as H, useTrackingAlerts as U, useVehicleTracking as W } from "./hooks/useTracking.js";
|
|
12
|
+
import { useReports as G } from "./hooks/useReports.js";
|
|
13
|
+
import { useImportExport as K } from "./hooks/useImportExport.js";
|
|
14
|
+
import { useModuleSettings as q } from "./hooks/useSettings.js";
|
|
15
|
+
import { useEntityDocuments as J } from "./hooks/useEntityDocuments.js";
|
|
16
|
+
import { useCaptureEpod as Y, useEpod as X, useEpodPhotoUpload as Z, useEpodPhotoUrl as Q, useMyPendingEpodDeliveryJobs as $ } from "./hooks/useEpod.js";
|
|
17
17
|
import "./hooks/index.js";
|
|
18
|
-
import { Avatar as
|
|
19
|
-
import { EmptyState as
|
|
20
|
-
import { chartTokens as
|
|
21
|
-
import { Sparkline as
|
|
22
|
-
import { MetricCard as
|
|
23
|
-
import { GlassPanel as
|
|
24
|
-
import { ChartEmpty as
|
|
25
|
-
import { TrendChart as
|
|
26
|
-
import { VolumeBar as
|
|
27
|
-
import { StatusDonut as
|
|
28
|
-
import { createCurrentIcon as
|
|
29
|
-
import { MapCanvas as
|
|
30
|
-
import { LogisticsMap as
|
|
31
|
-
import { RouteMap as
|
|
32
|
-
import { TrackingMap as
|
|
33
|
-
import { PaymentStatusBadge as
|
|
34
|
-
import { DataTable as
|
|
35
|
-
import { FormError as
|
|
36
|
-
import { Notice as
|
|
37
|
-
import { DocumentsCard as
|
|
38
|
-
import { CarbonFootprintPanel as
|
|
18
|
+
import { Avatar as ee, AvatarFallback as te, AvatarImage as ne, Badge as re, Button as ie, Card as ae, CardContent as oe, CardDescription as se, CardFooter as ce, CardHeader as le, CardTitle as ue, Checkbox as de, Dialog as fe, DialogContent as pe, DialogDescription as me, DialogFooter as he, DialogHeader as ge, DialogTitle as _e, DialogTrigger as ve, DropdownMenu as ye, DropdownMenuContent as be, DropdownMenuItem as xe, DropdownMenuSeparator as Se, DropdownMenuTrigger as Ce, Input as we, Label as Te, Progress as Ee, ScrollArea as De, Select as Oe, SelectContent as ke, SelectItem as Ae, SelectTrigger as je, SelectValue as Me, Separator as Ne, Skeleton as Pe, Switch as Fe, Table as Ie, TableBody as Le, TableCell as Re, TableHead as ze, TableHeader as Be, TableRow as Ve, Tabs as He, TabsContent as Ue, TabsList as We, TabsTrigger as Ge, Textarea as Ke, Tooltip as qe, TooltipContent as Je, TooltipProvider as Ye, TooltipTrigger as Xe } from "./components/ui.js";
|
|
19
|
+
import { EmptyState as Ze, ErrorState as Qe, LoadingState as $e, PageLayout as et, PageSection as tt } from "./components/PageLayout.js";
|
|
20
|
+
import { chartTokens as nt, seriesColor as rt } from "./components/charts/chartTokens.js";
|
|
21
|
+
import { Sparkline as it } from "./components/charts/Sparkline.js";
|
|
22
|
+
import { MetricCard as at, MetricCardSkeleton as ot, MetricGrid as st } from "./components/MetricCard.js";
|
|
23
|
+
import { GlassPanel as ct } from "./components/GlassPanel.js";
|
|
24
|
+
import { ChartEmpty as lt, ChartTooltip as ut } from "./components/charts/ChartShell.js";
|
|
25
|
+
import { TrendChart as dt } from "./components/charts/TrendChart.js";
|
|
26
|
+
import { VolumeBar as ft } from "./components/charts/VolumeBar.js";
|
|
27
|
+
import { StatusDonut as pt } from "./components/charts/StatusDonut.js";
|
|
28
|
+
import { createCurrentIcon as mt, createPinIcon as ht, createStopIcon as gt, isRealCoord as _t } from "./components/maps/leaflet-setup.js";
|
|
29
|
+
import { MapCanvas as vt } from "./components/maps/MapCanvas.js";
|
|
30
|
+
import { LogisticsMap as yt } from "./components/maps/LogisticsMap.js";
|
|
31
|
+
import { RouteMap as bt } from "./components/maps/RouteMap.js";
|
|
32
|
+
import { TrackingMap as xt } from "./components/maps/TrackingMap.js";
|
|
33
|
+
import { PaymentStatusBadge as St, PriorityBadge as Ct, StatusBadge as wt, TypeBadge as Tt, VehicleTypeBadge as Et } from "./components/StatusBadge.js";
|
|
34
|
+
import { DataTable as Dt } from "./components/DataTable.js";
|
|
35
|
+
import { FormError as Ot } from "./components/FormError.js";
|
|
36
|
+
import { Notice as kt, useNotice as At } from "./components/Notice.js";
|
|
37
|
+
import { DocumentsCard as jt } from "./components/DocumentsCard.js";
|
|
38
|
+
import { CarbonFootprintPanel as Mt } from "./components/CarbonFootprintPanel.js";
|
|
39
39
|
import "./components/index.js";
|
|
40
|
-
export {
|
|
40
|
+
export { ee as Avatar, te as AvatarFallback, ne as AvatarImage, re as Badge, ie as Button, Mt as CarbonFootprintPanel, ae as Card, oe as CardContent, se as CardDescription, ce as CardFooter, le as CardHeader, ue as CardTitle, lt as ChartEmpty, ut as ChartTooltip, de as Checkbox, Dt as DataTable, fe as Dialog, pe as DialogContent, me as DialogDescription, he as DialogFooter, ge as DialogHeader, _e as DialogTitle, ve as DialogTrigger, jt as DocumentsCard, ye as DropdownMenu, be as DropdownMenuContent, xe as DropdownMenuItem, Se as DropdownMenuSeparator, Ce as DropdownMenuTrigger, Ze as EmptyState, Qe as ErrorState, Ot as FormError, ct as GlassPanel, we as Input, Te as Label, $e as LoadingState, yt as LogisticsMap, vt as MapCanvas, at as MetricCard, ot as MetricCardSkeleton, st as MetricGrid, n as MoveTheWheelsRoot, kt as Notice, et as PageLayout, tt as PageSection, St as PaymentStatusBadge, Ct as PriorityBadge, Ee as Progress, bt as RouteMap, De as ScrollArea, Oe as Select, ke as SelectContent, Ae as SelectItem, je as SelectTrigger, Me as SelectValue, Ne as Separator, Pe as Skeleton, it as Sparkline, wt as StatusBadge, pt as StatusDonut, Fe as Switch, Ie as Table, Le as TableBody, Re as TableCell, ze as TableHead, Be as TableHeader, Ve as TableRow, He as Tabs, Ue as TabsContent, We as TabsList, Ge as TabsTrigger, Ke as Textarea, qe as Tooltip, Je as TooltipContent, Ye as TooltipProvider, Xe as TooltipTrigger, xt as TrackingMap, dt as TrendChart, Tt as TypeBadge, Et as VehicleTypeBadge, ft as VolumeBar, nt as chartTokens, mt as createCurrentIcon, ht as createPinIcon, gt as createStopIcon, _t as isRealCoord, rt as seriesColor, A as useAnalytics, Y as useCaptureEpod, w as useCustomer, T as useCustomerStats, E as useCustomers, j as useDashboardMetrics, c as useDriver, l as useDriverStatusCounts, R as useDriverTracking, u as useDrivers, M as useEmissionsSummary, J as useEntityDocuments, X as useEpod, Z as useEpodPhotoUpload, Q as useEpodPhotoUrl, N as useFinanceMetrics, d as useFleet, P as useFleetAnalytics, f as useFleetStats, z as useGeofence, K as useImportExport, g as useInventory, _ as useInventoryStats, v as useInventoryTransactions, B as useLiveTracking, q as useModuleSettings, e as useMoveTheWheels, t as useMoveTheWheelsNavigate, r as useMoveTheWheelsStore, $ as useMyPendingEpodDeliveryJobs, At as useNotice, a as useOrder, F as useOrderAnalytics, o as useOrderStats, V as useOrderTracking, s as useOrders, I as usePerformanceAnalytics, y as useProduct, b as useProductStockLevels, x as useProducts, G as useReports, L as useRevenueAnalytics, D as useRoute, O as useRouteStats, k as useRoutes, i as useSandboxAssistantTransport, H as useTracking, U as useTrackingAlerts, p as useVehicle, m as useVehicleDrivers, W as useVehicleTracking, h as useVehicles, S as useWarehouse, C as useWarehouses };
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* All custom hooks for data access and operations.
|
|
5
5
|
*/
|
|
6
6
|
export { useOrders, useOrder, useOrderStats } from './useOrders';
|
|
7
|
-
export { useFleet, useVehicles, useVehicle, useDrivers, useDriver, useFleetStats, } from './useFleet';
|
|
8
|
-
export { useInventory, useProducts, useProduct, useWarehouses, useWarehouse, useInventoryStats, } from './useInventory';
|
|
7
|
+
export { useFleet, useVehicles, useVehicle, useVehicleDrivers, useDrivers, useDriver, useDriverStatusCounts, useFleetStats, type DriverStatusCounts, } from './useFleet';
|
|
8
|
+
export { useInventory, useProducts, useProduct, useProductStockLevels, useWarehouses, useWarehouse, useInventoryStats, useInventoryTransactions, type InventoryStats, type InventoryTransaction, type InventoryTransactionType, type ProductStockLevel, } from './useInventory';
|
|
9
9
|
export { useCustomers, useCustomer, useCustomerStats } from './useCustomers';
|
|
10
10
|
export { useRoutes, useRoute, useRouteStats } from './useRoutes';
|
|
11
11
|
export { useAnalytics, useDashboardMetrics, useRevenueAnalytics, useOrderAnalytics, useFleetAnalytics, usePerformanceAnalytics, useFinanceMetrics, type FinanceMetrics, useEmissionsSummary, type EmissionsSummary, } from './useAnalytics';
|
|
@@ -66,13 +66,44 @@ interface UseDriversResult {
|
|
|
66
66
|
updateDriverStatus: (id: string, status: DriverStatus) => Promise<Driver>;
|
|
67
67
|
assignVehicle: (driverId: string, vehicleId: string) => Promise<Driver>;
|
|
68
68
|
}
|
|
69
|
-
|
|
69
|
+
interface UseDriversOptions extends UseListOptions {
|
|
70
|
+
/**
|
|
71
|
+
* Narrows the roster server-side via `DriverFilterInput.status` so the pager
|
|
72
|
+
* still counts whole result sets rather than filtering one fetched page.
|
|
73
|
+
*/
|
|
74
|
+
status?: DriverStatus;
|
|
75
|
+
}
|
|
76
|
+
export declare function useDrivers(options?: UseDriversOptions): UseDriversResult;
|
|
70
77
|
export declare function useDriver(driverId: string | undefined): {
|
|
71
78
|
driver: Driver | null;
|
|
72
79
|
isLoading: boolean;
|
|
73
80
|
error: Error | null;
|
|
74
81
|
refetch: () => void;
|
|
75
82
|
};
|
|
83
|
+
export interface DriverStatusCounts {
|
|
84
|
+
onBreak: number;
|
|
85
|
+
offDuty: number;
|
|
86
|
+
inactive: number;
|
|
87
|
+
}
|
|
88
|
+
/** Exact per-status driver counts for the roster tiles (see DRIVER_STATUS_COUNTS_QUERY). */
|
|
89
|
+
export declare function useDriverStatusCounts(): {
|
|
90
|
+
counts: DriverStatusCounts;
|
|
91
|
+
isLoading: boolean;
|
|
92
|
+
error: Error | null;
|
|
93
|
+
refetch: () => void;
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* The driver(s) currently assigned to a vehicle, resolved server-side through
|
|
97
|
+
* `DriverFilterInput.vehicleId` (the same link `assignDriverVehicle` writes).
|
|
98
|
+
* A vehicle normally has one driver, but the filter returns a list, so the
|
|
99
|
+
* caller gets every assignment rather than a silently-picked first row.
|
|
100
|
+
*/
|
|
101
|
+
export declare function useVehicleDrivers(vehicleId: string | undefined): {
|
|
102
|
+
drivers: Driver[];
|
|
103
|
+
isLoading: boolean;
|
|
104
|
+
error: Error | null;
|
|
105
|
+
refetch: () => void;
|
|
106
|
+
};
|
|
76
107
|
export declare function useFleetStats(): {
|
|
77
108
|
stats: {
|
|
78
109
|
totalVehicles: number;
|
|
@@ -9,5 +9,15 @@ interface UseImportExportResult {
|
|
|
9
9
|
isBusy: boolean;
|
|
10
10
|
error: Error | null;
|
|
11
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Import/export surface withdrawn from wspace-movethewheels-svc by migration
|
|
14
|
+
* 20260707000001_movethewheels_reuse_cleanup. The service now exposes
|
|
15
|
+
* `exportMtwEntities` (async job, returns MtwExportJob) but no import
|
|
16
|
+
* counterpart, so the old synchronous exportData/importData mutations are no
|
|
17
|
+
* longer resolvable. This hook keeps the same contract for consumers but
|
|
18
|
+
* rejects calls with a clear message until a replacement import/export flow is
|
|
19
|
+
* designed. The original operations are preserved in
|
|
20
|
+
* src/operations/wspace/movethewheels/mutations/marketplace-reports.withdrawn.graphql.
|
|
21
|
+
*/
|
|
12
22
|
export declare function useImportExport(): UseImportExportResult;
|
|
13
23
|
export {};
|
|
@@ -102,20 +102,75 @@ export declare function useWarehouse(warehouseId: string | undefined): {
|
|
|
102
102
|
error: Error | null;
|
|
103
103
|
refetch: () => undefined;
|
|
104
104
|
};
|
|
105
|
+
export interface InventoryStats {
|
|
106
|
+
/** Units physically in the warehouses. */
|
|
107
|
+
totalOnHand: number;
|
|
108
|
+
/** Units free to promise on a new order. */
|
|
109
|
+
totalAvailable: number;
|
|
110
|
+
/** Units already committed to open orders. */
|
|
111
|
+
totalAllocated: number;
|
|
112
|
+
/** Units written off as damaged. */
|
|
113
|
+
totalDamaged: number;
|
|
114
|
+
/** Stock lines at or under their reorder point. */
|
|
115
|
+
lowStockCount: number;
|
|
116
|
+
/** Catalog size (`cargoItemsCount`), workspace-wide — not a page length. */
|
|
117
|
+
totalProducts: number;
|
|
118
|
+
/** Warehouse count (`warehousesCount`), workspace-wide. */
|
|
119
|
+
totalWarehouses: number;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Workspace-wide inventory aggregates, every figure served by the module:
|
|
123
|
+
* `inventoryStats` for the stock position, `cargoItemsCount`/`warehousesCount`
|
|
124
|
+
* for catalog and network size. There is no aggregate stock-value field on the
|
|
125
|
+
* subgraph, so no monetary total is reported here.
|
|
126
|
+
*/
|
|
105
127
|
export declare function useInventoryStats(): {
|
|
106
|
-
stats:
|
|
107
|
-
totalItems: number;
|
|
108
|
-
lowStockItems: number;
|
|
109
|
-
totalValue: number;
|
|
110
|
-
totalProducts: number;
|
|
111
|
-
totalWarehouses: number;
|
|
112
|
-
warehouseUtilization: Array<{
|
|
113
|
-
id: string;
|
|
114
|
-
name: string;
|
|
115
|
-
utilization: number;
|
|
116
|
-
}>;
|
|
117
|
-
};
|
|
128
|
+
stats: InventoryStats;
|
|
118
129
|
isLoading: boolean;
|
|
119
130
|
error: Error | null;
|
|
120
131
|
};
|
|
132
|
+
export interface ProductStockLevel {
|
|
133
|
+
inventoryItemId: string;
|
|
134
|
+
warehouseId: string;
|
|
135
|
+
warehouseName: string;
|
|
136
|
+
warehouseCode: string;
|
|
137
|
+
onHand: number;
|
|
138
|
+
available: number;
|
|
139
|
+
allocated: number;
|
|
140
|
+
damaged: number;
|
|
141
|
+
reorderPoint?: number;
|
|
142
|
+
}
|
|
143
|
+
/** Where a catalog item is stocked, and how much of it is free to promise. */
|
|
144
|
+
export declare function useProductStockLevels(productId: string | undefined): {
|
|
145
|
+
levels: ProductStockLevel[];
|
|
146
|
+
isLoading: boolean;
|
|
147
|
+
error: Error | null;
|
|
148
|
+
refetch: () => void;
|
|
149
|
+
};
|
|
150
|
+
export type InventoryTransactionType = 'RECEIPT' | 'ISSUE' | 'TRANSFER' | 'ADJUSTMENT' | 'RETURN';
|
|
151
|
+
export interface InventoryTransaction {
|
|
152
|
+
id: string;
|
|
153
|
+
transactionNumber: string;
|
|
154
|
+
type: InventoryTransactionType;
|
|
155
|
+
/** Signed by `type`: receipts/returns add stock, issues remove it. */
|
|
156
|
+
quantity: number;
|
|
157
|
+
productId: string;
|
|
158
|
+
warehouseId: string;
|
|
159
|
+
notes?: string;
|
|
160
|
+
referenceType?: string;
|
|
161
|
+
referenceId?: string;
|
|
162
|
+
createdAt: Date;
|
|
163
|
+
}
|
|
164
|
+
interface UseInventoryTransactionsOptions {
|
|
165
|
+
limit?: number;
|
|
166
|
+
productId?: string;
|
|
167
|
+
warehouseId?: string;
|
|
168
|
+
}
|
|
169
|
+
/** Recent stock movements from `Query.inventoryTransactions` (newest first). */
|
|
170
|
+
export declare function useInventoryTransactions(options?: UseInventoryTransactionsOptions): {
|
|
171
|
+
transactions: InventoryTransaction[];
|
|
172
|
+
isLoading: boolean;
|
|
173
|
+
error: Error | null;
|
|
174
|
+
refetch: () => void;
|
|
175
|
+
};
|
|
121
176
|
export {};
|
|
@@ -5,6 +5,16 @@ interface UseOrdersOptions {
|
|
|
5
5
|
limit?: number;
|
|
6
6
|
offset?: number;
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* Write shape for create/update. Identical to `Partial<Order>` except that
|
|
10
|
+
* `scheduledDelivery` also accepts `null`: `UpdateDeliveryJobInput.scheduledDelivery`
|
|
11
|
+
* is nullable on the service, so an explicit `null` clears a previously booked
|
|
12
|
+
* slot, while `undefined` leaves it untouched. Without the distinction, clearing
|
|
13
|
+
* the field in the form would silently keep the old date.
|
|
14
|
+
*/
|
|
15
|
+
export type OrderWriteInput = Omit<Partial<Order>, 'scheduledDelivery'> & {
|
|
16
|
+
scheduledDelivery?: Date | null;
|
|
17
|
+
};
|
|
8
18
|
interface UseOrdersResult {
|
|
9
19
|
orders: Order[];
|
|
10
20
|
totalOrders: number;
|
|
@@ -17,11 +27,24 @@ interface UseOrdersResult {
|
|
|
17
27
|
isLoading: boolean;
|
|
18
28
|
error: Error | null;
|
|
19
29
|
refetch: () => void;
|
|
20
|
-
createOrder: (order:
|
|
21
|
-
updateOrder: (id: string, updates:
|
|
30
|
+
createOrder: (order: OrderWriteInput) => Promise<Order>;
|
|
31
|
+
updateOrder: (id: string, updates: OrderWriteInput) => Promise<Order>;
|
|
22
32
|
deleteOrder: (id: string) => Promise<void>;
|
|
23
33
|
updateOrderStatus: (id: string, status: OrderStatus) => Promise<Order>;
|
|
24
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Normalises a service `DeliveryJobStatus` into the MFE's OrderStatus union.
|
|
37
|
+
* Exported so any surface rendering a raw job status badge normalises it the
|
|
38
|
+
* same way — the service casing is upper snake case and would miss the badge
|
|
39
|
+
* colour map otherwise.
|
|
40
|
+
*/
|
|
41
|
+
export declare function mapOrderStatus(status: string): OrderStatus;
|
|
42
|
+
/**
|
|
43
|
+
* Normalises a service `DeliveryPriority` (LOW/MEDIUM/HIGH/URGENT/CRITICAL)
|
|
44
|
+
* into the four-level union PriorityBadge understands. MEDIUM and CRITICAL have
|
|
45
|
+
* no direct badge entry, so rendering the raw value would break the colour map.
|
|
46
|
+
*/
|
|
47
|
+
export declare function mapOrderPriority(priority: string): 'low' | 'normal' | 'high' | 'urgent';
|
|
25
48
|
export declare function useOrders(options?: UseOrdersOptions): UseOrdersResult;
|
|
26
49
|
export declare function useOrder(orderId: string | undefined): {
|
|
27
50
|
order: Order | null;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Marketplace Page
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* The collaborative logistics marketplace (service providers / service offerings)
|
|
5
|
+
* was withdrawn from wspace-movethewheels-svc by migration
|
|
6
|
+
* 20260707000001_movethewheels_reuse_cleanup. The original query and mutation
|
|
7
|
+
* documents are preserved verbatim in
|
|
8
|
+
* src/operations/wspace/movethewheels/{queries,mutations}/marketplace-reports.withdrawn.graphql
|
|
9
|
+
* so they can be restored if the surface returns. Until then the page renders a
|
|
10
|
+
* static "coming soon" state.
|
|
8
11
|
*/
|
|
9
12
|
export default function MarketplacePage(): import("react").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createLucideIcon as e } from "../createLucideIcon.js";
|
|
2
|
+
//#region node_modules/lucide-react/dist/esm/icons/arrow-down-right.js
|
|
3
|
+
var t = e("ArrowDownRight", [["path", {
|
|
4
|
+
d: "m7 7 10 10",
|
|
5
|
+
key: "1fmybs"
|
|
6
|
+
}], ["path", {
|
|
7
|
+
d: "M17 7v10H7",
|
|
8
|
+
key: "6fjiku"
|
|
9
|
+
}]]);
|
|
10
|
+
//#endregion
|
|
11
|
+
export { t as ArrowDownRight };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createLucideIcon as e } from "../createLucideIcon.js";
|
|
2
|
+
//#region node_modules/lucide-react/dist/esm/icons/arrow-left-right.js
|
|
3
|
+
var t = e("ArrowLeftRight", [
|
|
4
|
+
["path", {
|
|
5
|
+
d: "M8 3 4 7l4 4",
|
|
6
|
+
key: "9rb6wj"
|
|
7
|
+
}],
|
|
8
|
+
["path", {
|
|
9
|
+
d: "M4 7h16",
|
|
10
|
+
key: "6tx8e3"
|
|
11
|
+
}],
|
|
12
|
+
["path", {
|
|
13
|
+
d: "m16 21 4-4-4-4",
|
|
14
|
+
key: "siv7j2"
|
|
15
|
+
}],
|
|
16
|
+
["path", {
|
|
17
|
+
d: "M20 17H4",
|
|
18
|
+
key: "h6l3hr"
|
|
19
|
+
}]
|
|
20
|
+
]);
|
|
21
|
+
//#endregion
|
|
22
|
+
export { t as ArrowLeftRight };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createLucideIcon as e } from "../createLucideIcon.js";
|
|
2
|
+
//#region node_modules/lucide-react/dist/esm/icons/arrow-up-right.js
|
|
3
|
+
var t = e("ArrowUpRight", [["path", {
|
|
4
|
+
d: "M7 7h10v10",
|
|
5
|
+
key: "1tivn9"
|
|
6
|
+
}], ["path", {
|
|
7
|
+
d: "M7 17 17 7",
|
|
8
|
+
key: "1vkiza"
|
|
9
|
+
}]]);
|
|
10
|
+
//#endregion
|
|
11
|
+
export { t as ArrowUpRight };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createLucideIcon as e } from "../createLucideIcon.js";
|
|
2
|
+
//#region node_modules/lucide-react/dist/esm/icons/calendar-clock.js
|
|
3
|
+
var t = e("CalendarClock", [
|
|
4
|
+
["path", {
|
|
5
|
+
d: "M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",
|
|
6
|
+
key: "1osxxc"
|
|
7
|
+
}],
|
|
8
|
+
["path", {
|
|
9
|
+
d: "M16 2v4",
|
|
10
|
+
key: "4m81vk"
|
|
11
|
+
}],
|
|
12
|
+
["path", {
|
|
13
|
+
d: "M8 2v4",
|
|
14
|
+
key: "1cmpym"
|
|
15
|
+
}],
|
|
16
|
+
["path", {
|
|
17
|
+
d: "M3 10h5",
|
|
18
|
+
key: "r794hk"
|
|
19
|
+
}],
|
|
20
|
+
["path", {
|
|
21
|
+
d: "M17.5 17.5 16 16.3V14",
|
|
22
|
+
key: "akvzfd"
|
|
23
|
+
}],
|
|
24
|
+
["circle", {
|
|
25
|
+
cx: "16",
|
|
26
|
+
cy: "16",
|
|
27
|
+
r: "6",
|
|
28
|
+
key: "qoo3c4"
|
|
29
|
+
}]
|
|
30
|
+
]);
|
|
31
|
+
//#endregion
|
|
32
|
+
export { t as CalendarClock };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { createLucideIcon as e } from "../createLucideIcon.js";
|
|
2
|
+
//#region node_modules/lucide-react/dist/esm/icons/history.js
|
|
3
|
+
var t = e("History", [
|
|
4
|
+
["path", {
|
|
5
|
+
d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",
|
|
6
|
+
key: "1357e3"
|
|
7
|
+
}],
|
|
8
|
+
["path", {
|
|
9
|
+
d: "M3 3v5h5",
|
|
10
|
+
key: "1xhq8a"
|
|
11
|
+
}],
|
|
12
|
+
["path", {
|
|
13
|
+
d: "M12 7v5l4 2",
|
|
14
|
+
key: "1fdv2h"
|
|
15
|
+
}]
|
|
16
|
+
]);
|
|
17
|
+
//#endregion
|
|
18
|
+
export { t as History };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createLucideIcon as e } from "../createLucideIcon.js";
|
|
2
|
+
//#region node_modules/lucide-react/dist/esm/icons/lock.js
|
|
3
|
+
var t = e("Lock", [["rect", {
|
|
4
|
+
width: "18",
|
|
5
|
+
height: "11",
|
|
6
|
+
x: "3",
|
|
7
|
+
y: "11",
|
|
8
|
+
rx: "2",
|
|
9
|
+
ry: "2",
|
|
10
|
+
key: "1w4ew1"
|
|
11
|
+
}], ["path", {
|
|
12
|
+
d: "M7 11V7a5 5 0 0 1 10 0v4",
|
|
13
|
+
key: "fwvmzm"
|
|
14
|
+
}]]);
|
|
15
|
+
//#endregion
|
|
16
|
+
export { t as Lock };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createLucideIcon as e } from "../createLucideIcon.js";
|
|
2
|
+
//#region node_modules/lucide-react/dist/esm/icons/user-round.js
|
|
3
|
+
var t = e("UserRound", [["circle", {
|
|
4
|
+
cx: "12",
|
|
5
|
+
cy: "8",
|
|
6
|
+
r: "5",
|
|
7
|
+
key: "1hypcn"
|
|
8
|
+
}], ["path", {
|
|
9
|
+
d: "M20 21a8 8 0 0 0-16 0",
|
|
10
|
+
key: "rfgkzh"
|
|
11
|
+
}]]);
|
|
12
|
+
//#endregion
|
|
13
|
+
export { t as UserRound };
|