@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.
- package/dist/{AIAssistantPage-AvsMbunM.js → AIAssistantPage-C3cPsWt-.js} +100 -73
- package/dist/AnalyticsPage-Dz6g2MvK.js +215 -0
- package/dist/{CreateOrderPage-CjlnEtk3.js → CreateOrderPage-C5iwnjp4.js} +36 -67
- package/dist/CustomerDetailsPage-B6nwFyLO.js +406 -0
- package/dist/{CustomersPage-CGGfD4ki.js → CustomersPage-2Y05LVyh.js} +26 -28
- package/dist/{DashboardPage-D2HRqwg9.js → DashboardPage-BVjQi0EB.js} +85 -83
- package/dist/{DataTable-CD9ZhpLB.js → DataTable-DmciIKKM.js} +3 -3
- package/dist/DriverDetailsPage-CN3WQ0B9.js +507 -0
- package/dist/{DriversPage-DKiynISH.js → DriversPage-B0Zpx8OQ.js} +25 -27
- package/dist/{FinancePage-Vg8WPs38.js → FinancePage-DEDykSOP.js} +9 -9
- package/dist/FleetPage-DqkFi3s3.js +365 -0
- package/dist/FormError-BlOjnXOq.js +15 -0
- package/dist/ImportExportPage-DKJRCezl.js +290 -0
- package/dist/InventoryPage-DwfgCUQq.js +253 -0
- package/dist/{LiveTrackingPage-DQ1q4Id3.js → LiveTrackingPage-DCX-K-LR.js} +60 -56
- package/dist/MarketplacePage-CIQ97_zp.js +247 -0
- package/dist/{MetricCard-B7yMyvMX.js → MetricCard-BY0QrMD4.js} +1 -1
- package/dist/{OrderDetailsPage-CFASgsYX.js → OrderDetailsPage-DYiZ-9UK.js} +83 -85
- package/dist/{OrdersListPage-BHeT8S5o.js → OrdersListPage-BjDlCKJd.js} +31 -33
- package/dist/{PageLayout-D3N8MCTm.js → PageLayout-D4LDHJJq.js} +483 -422
- package/dist/ProductDetailsPage-C9uOiYLp.js +350 -0
- package/dist/{ProductsPage--xEpbQ8A.js → ProductsPage-C1G9h7Xd.js} +22 -24
- package/dist/ReportsPage-Zp53q3_8.js +284 -0
- package/dist/RouteDetailsPage-DUStXSf9.js +531 -0
- package/dist/RoutesPage-DMfoicM1.js +144 -0
- package/dist/SettingsPage-Bn-v0mbQ.js +421 -0
- package/dist/StatusBadge-BZurYHMy.js +152 -0
- package/dist/{TrackingPage-CcRc_dva.js → TrackingPage-W-jtdM3Y.js} +59 -61
- package/dist/VehicleDetailsPage-Bceo5oz3.js +410 -0
- package/dist/{VehiclesPage-UlxPWP9K.js → VehiclesPage-VBtOep91.js} +20 -22
- package/dist/WarehouseDetailsPage-L_6sWigM.js +493 -0
- package/dist/{WarehousesPage-CuTO-OPp.js → WarehousesPage-DCbXXXWE.js} +16 -18
- package/dist/{arrow-left-CBpZKkpq.js → arrow-left-n48Y-Wis.js} +1 -1
- package/dist/{box-CAaiElsb.js → box-D9Pal4HM.js} +1 -1
- package/dist/{chart-column-D1Ym15-S.js → chart-column-BFIJysDR.js} +1 -1
- package/dist/{chevron-right-BIFGi0UA.js → chevron-right-EMIIyyJ1.js} +1 -1
- package/dist/{circle-alert-DjmNo5_L.js → circle-alert-iY24lSlp.js} +1 -1
- package/dist/{circle-check-big-CjuPVo3_.js → circle-check-big-w0TrLKMF.js} +1 -1
- package/dist/{clock-BjkdnddD.js → clock-DJZtdl8u.js} +1 -1
- package/dist/{dollar-sign-IB4O0wuQ.js → dollar-sign-CgKQRz_e.js} +1 -1
- package/dist/{download-Dpa9vqoG.js → download-DRXxoiQR.js} +1 -1
- package/dist/{file-text-C8Uioy11.js → file-text-DWWY6_f5.js} +1 -1
- package/dist/{filter-Da5OZaHI.js → filter-DloLC2eE.js} +1 -1
- package/dist/index.js +186 -162
- package/dist/{map-_Per4sT9.js → map-CkJaULb2.js} +1 -1
- package/dist/{map-pin-BSaf5IDL.js → map-pin-BGiCvyCs.js} +1 -1
- package/dist/{navigation-DaTbrhw2.js → navigation-D36prnAn.js} +1 -1
- package/dist/{package-BE7U0wQE.js → package-BChUzpJS.js} +1 -1
- package/dist/{phone-DV4StZiA.js → phone-Ac9s3mo_.js} +1 -1
- package/dist/{plus-Dl1rLeJR.js → plus-Z76q-FZm.js} +1 -1
- package/dist/{refresh-cw-CWfERAit.js → refresh-cw-DKt6f5T6.js} +1 -1
- package/dist/{save-XH8vydOn.js → save-CojywNhG.js} +1 -1
- package/dist/{search-OxoIiL_C.js → search-CDGefqb3.js} +1 -1
- package/dist/{square-pen-hLIbFQFV.js → square-pen-CopE9GmB.js} +1 -1
- package/dist/{star-YsVV3MNQ.js → star-nHlLjDKR.js} +1 -1
- package/dist/{store-RCBl7HB-.js → store-BR9Voi5E.js} +1 -1
- package/dist/trash-2-BKhar6Hs.js +32 -0
- package/dist/{trending-up-C-85AwGT.js → trending-up-Dohgd4t_.js} +1 -1
- package/dist/{triangle-alert-BOhfGgmh.js → triangle-alert-i-XQL9Rd.js} +1 -1
- package/dist/{truck-CtDjNFbi.js → truck-C0v_hbLR.js} +1 -1
- package/dist/{useAnalytics-ph7eTIK6.js → useAnalytics-DS8n0xgg.js} +40 -40
- package/dist/useAssistant-D4v3oxD3.js +84 -0
- package/dist/{useCustomers-bS3a4ytk.js → useCustomers-BmTNGxiI.js} +24 -24
- package/dist/{useFleet-BdETplNE.js → useFleet-DKqXZ16m.js} +133 -109
- package/dist/useImportExport-DHr-SWSw.js +55 -0
- package/dist/{useInventory-Dwn18FPz.js → useInventory-DkyiVY_A.js} +95 -75
- package/dist/{useOrders-D_3_hGMp.js → useOrders-Cfk1GLiq.js} +42 -42
- package/dist/useReports-CTqZr-AB.js +78 -0
- package/dist/{useRoutes-v4aBaS-E.js → useRoutes-BQWO607N.js} +31 -31
- package/dist/useSettings-CkDH_-gM.js +81 -0
- package/dist/{useTracking-De2KIUNu.js → useTracking-B-va1kO3.js} +22 -22
- package/dist/{user-Dz5TJZFs.js → user-jyFU3lXk.js} +1 -1
- package/dist/{users-g2N0eL-Z.js → users-DZ-ilS6B.js} +1 -1
- package/dist/{warehouse-D3WWDeTX.js → warehouse-6m5kXMLu.js} +1 -1
- package/dist/{wrench-CmxY1n4I.js → wrench-CANXWxF-.js} +1 -1
- package/package.json +1 -1
- package/src/movethewheels/MoveTheWheelsRoutes.tsx +31 -3
- package/src/movethewheels/components/FormError.tsx +25 -0
- package/src/movethewheels/components/StatusBadge.tsx +18 -37
- package/src/movethewheels/constants/index.ts +67 -26
- package/src/movethewheels/hooks/index.ts +12 -0
- package/src/movethewheels/hooks/useAnalytics.ts +20 -6
- package/src/movethewheels/hooks/useAssistant.ts +74 -0
- package/src/movethewheels/hooks/useFleet.ts +170 -59
- package/src/movethewheels/hooks/useImportExport.ts +101 -0
- package/src/movethewheels/hooks/useInventory.ts +107 -0
- package/src/movethewheels/hooks/useReports.ts +158 -0
- package/src/movethewheels/hooks/useSettings.ts +120 -0
- package/src/movethewheels/pages/AIAssistantPage.tsx +53 -15
- package/src/movethewheels/pages/AnalyticsPage.tsx +67 -64
- package/src/movethewheels/pages/CustomerDetailsPage.tsx +154 -21
- package/src/movethewheels/pages/CustomersPage.tsx +1 -1
- package/src/movethewheels/pages/DashboardPage.tsx +42 -22
- package/src/movethewheels/pages/DriverDetailsPage.tsx +160 -3
- package/src/movethewheels/pages/DriversPage.tsx +6 -2
- package/src/movethewheels/pages/FleetPage.tsx +96 -38
- package/src/movethewheels/pages/ImportExportPage.tsx +174 -68
- package/src/movethewheels/pages/InventoryPage.tsx +66 -28
- package/src/movethewheels/pages/LiveTrackingPage.tsx +12 -3
- package/src/movethewheels/pages/MarketplacePage.tsx +87 -45
- package/src/movethewheels/pages/OrderDetailsPage.tsx +2 -2
- package/src/movethewheels/pages/ProductDetailsPage.tsx +146 -3
- package/src/movethewheels/pages/ProductsPage.tsx +5 -1
- package/src/movethewheels/pages/ReportsPage.tsx +194 -90
- package/src/movethewheels/pages/RouteDetailsPage.tsx +290 -36
- package/src/movethewheels/pages/RoutesPage.tsx +4 -9
- package/src/movethewheels/pages/SettingsPage.tsx +234 -56
- package/src/movethewheels/pages/TrackingPage.tsx +6 -6
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +158 -2
- package/src/movethewheels/pages/VehiclesPage.tsx +5 -1
- package/src/movethewheels/pages/WarehouseDetailsPage.tsx +224 -2
- package/src/movethewheels/pages/WarehousesPage.tsx +5 -1
- package/src/movethewheels/providers/MoveTheWheelsProvider.tsx +7 -6
- package/src/movethewheels/store/movethewheelsStore.ts +1 -1
- package/dist/AnalyticsPage-CCLfHgQZ.js +0 -212
- package/dist/CustomerDetailsPage-I6cdDHUi.js +0 -265
- package/dist/DriverDetailsPage-rg_pGNuP.js +0 -330
- package/dist/FleetPage-DddXt8r8.js +0 -332
- package/dist/ImportExportPage-BW6qO3kc.js +0 -248
- package/dist/InventoryPage-rMGuaJN-.js +0 -222
- package/dist/MarketplacePage-DKrXAv62.js +0 -219
- package/dist/ProductDetailsPage-CFGcbaHo.js +0 -195
- package/dist/ReportsPage-Bb7_90rK.js +0 -235
- package/dist/RouteDetailsPage-CVtDVb1N.js +0 -282
- package/dist/RoutesPage-s57PtgcQ.js +0 -163
- package/dist/SettingsPage-BYNCBOpN.js +0 -298
- package/dist/StatusBadge-CijYQXtb.js +0 -209
- package/dist/VehicleDetailsPage-3YDMPsPs.js +0 -220
- package/dist/WarehouseDetailsPage-Db7KeN-d.js +0 -238
- package/dist/graphqlClient-CdJyR_ed.js +0 -55
- package/dist/navigation-BgnOfsVd.js +0 -6
- package/dist/route-Dp9JiN_E.js +0 -51
- package/dist/settings-3Rw5NwFF.js +0 -28
- package/src/movethewheels/constants/mockData.ts +0 -1342
- /package/dist/{formatters-_vJlC-47.js → formatters-CF2S2l1m.js} +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
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
|
|
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
|
|
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
|
|
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
|
|
96
|
-
let { apiGatewayUrl:
|
|
95
|
+
function v() {
|
|
96
|
+
let { apiGatewayUrl: e, authToken: n, workspaceToken: r, workspaceId: a, tenantId: o, currentUser: s } = t();
|
|
97
97
|
return i(() => ({
|
|
98
|
-
apiGatewayUrl:
|
|
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
|
-
|
|
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
|
|
114
|
-
let { filters: 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 =
|
|
119
|
-
|
|
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 [
|
|
122
|
-
|
|
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
|
-
|
|
132
|
+
e(d, s, { pagination: {
|
|
133
133
|
limit: 500,
|
|
134
134
|
offset: 0
|
|
135
135
|
} }),
|
|
136
|
-
|
|
136
|
+
e(d, c, { pagination: {
|
|
137
137
|
limit: 500,
|
|
138
138
|
offset: 0
|
|
139
139
|
} })
|
|
140
|
-
]), i =
|
|
141
|
-
u?.lowStock && (i = i.filter((e) => e.availableQuantity <= e.reorderLevel)),
|
|
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
|
-
|
|
143
|
+
O(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load inventory data"));
|
|
144
144
|
} finally {
|
|
145
|
-
|
|
145
|
+
E(!1);
|
|
146
146
|
}
|
|
147
147
|
}, [u, d]);
|
|
148
148
|
r(() => {
|
|
149
|
-
|
|
150
|
-
}, [
|
|
151
|
-
let
|
|
152
|
-
|
|
153
|
-
}, [
|
|
154
|
-
let i =
|
|
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 =
|
|
157
|
-
id:
|
|
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
|
|
164
|
-
}, [d,
|
|
165
|
-
let i =
|
|
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
|
|
168
|
-
let a =
|
|
169
|
-
a && await
|
|
170
|
-
}, [
|
|
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:
|
|
174
|
-
warehouses:
|
|
175
|
-
totalItems:
|
|
176
|
-
isLoading:
|
|
177
|
-
error:
|
|
178
|
-
refetch:
|
|
179
|
-
updateStock:
|
|
180
|
-
transferStock:
|
|
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
|
|
184
|
-
let
|
|
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
|
|
207
|
+
o((await e(t, s, { pagination: {
|
|
188
208
|
limit: 500,
|
|
189
209
|
offset: 0
|
|
190
|
-
} })).products.map(
|
|
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
|
-
}, [
|
|
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
|
|
208
|
-
let i =
|
|
209
|
-
if (!
|
|
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
|
|
216
|
-
s(n.product ?
|
|
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,
|
|
242
|
+
}, [i, t]);
|
|
223
243
|
return r(() => {
|
|
224
|
-
|
|
225
|
-
}, [
|
|
244
|
+
p();
|
|
245
|
+
}, [p]), {
|
|
226
246
|
product: o,
|
|
227
247
|
isLoading: c,
|
|
228
248
|
error: d,
|
|
229
|
-
refetch: () => void
|
|
249
|
+
refetch: () => void p()
|
|
230
250
|
};
|
|
231
251
|
}
|
|
232
|
-
function
|
|
233
|
-
let
|
|
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
|
|
256
|
+
o((await e(t, c, { pagination: {
|
|
237
257
|
limit: 500,
|
|
238
258
|
offset: 0
|
|
239
|
-
} })).warehouses.map(
|
|
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
|
-
}, [
|
|
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
|
|
257
|
-
let i =
|
|
258
|
-
if (!
|
|
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
|
|
265
|
-
s(n.warehouse ?
|
|
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,
|
|
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
|
|
282
|
-
let
|
|
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
|
|
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
|
-
}, [
|
|
336
|
+
}, [t]), {
|
|
317
337
|
stats: n,
|
|
318
338
|
isLoading: o,
|
|
319
339
|
error: l
|
|
320
340
|
};
|
|
321
341
|
}
|
|
322
342
|
//#endregion
|
|
323
|
-
export {
|
|
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 {
|
|
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 } =
|
|
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
|
|
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 (
|
|
158
|
-
let n = b((await
|
|
159
|
-
orderNumber:
|
|
160
|
-
orderType: _(
|
|
161
|
-
status: g(
|
|
162
|
-
priority: v(
|
|
163
|
-
customerId:
|
|
164
|
-
pickupAddress:
|
|
165
|
-
deliveryAddress:
|
|
166
|
-
items:
|
|
167
|
-
pricing:
|
|
168
|
-
specialInstructions:
|
|
169
|
-
trackingNumber:
|
|
170
|
-
scheduledDelivery:
|
|
171
|
-
vehicleId:
|
|
172
|
-
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 (
|
|
176
|
-
let r = b((await
|
|
177
|
-
id:
|
|
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((
|
|
195
|
-
}, [j]), I = n(async (
|
|
196
|
-
await
|
|
197
|
-
}, [j]), L = n(async (
|
|
198
|
-
let r = b((await
|
|
199
|
-
id:
|
|
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((
|
|
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 } =
|
|
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
|
|
239
|
-
h(
|
|
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 } =
|
|
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
|
|
291
|
+
let t = await e(y, c);
|
|
292
292
|
v({
|
|
293
|
-
total:
|
|
293
|
+
total: t.orderStats.total,
|
|
294
294
|
byStatus: {
|
|
295
|
-
pending:
|
|
295
|
+
pending: t.orderStats.pending,
|
|
296
296
|
confirmed: 0,
|
|
297
297
|
assigned: 0,
|
|
298
298
|
picked_up: 0,
|
|
299
|
-
in_transit:
|
|
299
|
+
in_transit: t.orderStats.inTransit,
|
|
300
300
|
out_for_delivery: 0,
|
|
301
|
-
delivered:
|
|
302
|
-
cancelled:
|
|
303
|
-
failed:
|
|
301
|
+
delivered: t.orderStats.delivered,
|
|
302
|
+
cancelled: t.orderStats.cancelled,
|
|
303
|
+
failed: t.orderStats.failed
|
|
304
304
|
},
|
|
305
|
-
totalRevenue:
|
|
305
|
+
totalRevenue: t.financeMetrics.revenue.totalRevenue,
|
|
306
306
|
todayOrders: 0,
|
|
307
|
-
avgOrderValue:
|
|
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 };
|