@burdenoff/microfe-movethewheels 2026.822.1 → 2026.827.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/useInventory.js +163 -70
- package/dist/hooks/useOrders.js +2 -2
- 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/useInventory.d.ts +67 -12
- package/dist/movethewheels/hooks/useOrders.d.ts +25 -2
- 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/ProductDetailsPage.js +212 -156
- package/dist/pages/VehicleDetailsPage.js +257 -193
- package/dist/utils/formatters.js +4 -1
- package/package.json +1 -1
- 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/useInventory.ts +311 -53
- package/src/movethewheels/hooks/useOrders.ts +31 -7
- 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/ProductDetailsPage.tsx +68 -3
- 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/src/operations/wspace/movethewheels/queries/marketplace-reports.graphql +0 -40
|
@@ -1,147 +1,289 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
1
|
+
import { ArrowDownRight as e } from "../node_modules/lucide-react/dist/esm/icons/arrow-down-right.js";
|
|
2
|
+
import { ArrowLeftRight as t } from "../node_modules/lucide-react/dist/esm/icons/arrow-left-right.js";
|
|
3
|
+
import { ArrowUpRight as n } from "../node_modules/lucide-react/dist/esm/icons/arrow-up-right.js";
|
|
4
|
+
import { Boxes as r } from "../node_modules/lucide-react/dist/esm/icons/boxes.js";
|
|
5
|
+
import { ChevronRight as i } from "../node_modules/lucide-react/dist/esm/icons/chevron-right.js";
|
|
6
|
+
import { CircleCheck as a } from "../node_modules/lucide-react/dist/esm/icons/circle-check.js";
|
|
7
|
+
import { History as o } from "../node_modules/lucide-react/dist/esm/icons/history.js";
|
|
8
|
+
import { Lock as s } from "../node_modules/lucide-react/dist/esm/icons/lock.js";
|
|
9
|
+
import { Package as c } from "../node_modules/lucide-react/dist/esm/icons/package.js";
|
|
10
|
+
import { Plus as l } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
|
|
11
|
+
import { TriangleAlert as u } from "../node_modules/lucide-react/dist/esm/icons/triangle-alert.js";
|
|
12
|
+
import { Warehouse as d } from "../node_modules/lucide-react/dist/esm/icons/warehouse.js";
|
|
13
|
+
import { joinPath as f } from "../utils/navigation.js";
|
|
14
|
+
import { useMoveTheWheels as p } from "../providers/MoveTheWheelsProvider.js";
|
|
15
|
+
import { useInventory as ee, useInventoryStats as m, useInventoryTransactions as h } from "../hooks/useInventory.js";
|
|
16
|
+
import { Badge as g, Button as _, Card as v, CardContent as y, CardHeader as b, CardTitle as x, Progress as S } from "../components/ui.js";
|
|
17
|
+
import { PageLayout as C, PageSection as w } from "../components/PageLayout.js";
|
|
18
|
+
import { MetricCard as T, MetricCardSkeleton as E, MetricGrid as D } from "../components/MetricCard.js";
|
|
19
|
+
import { StatusBadge as te } from "../components/StatusBadge.js";
|
|
20
|
+
import { DataTable as ne } from "../components/DataTable.js";
|
|
21
|
+
import { formatCurrency as re, formatDate as ie } from "../utils/formatters.js";
|
|
22
|
+
import { useMemo as ae } from "react";
|
|
23
|
+
import { jsx as O, jsxs as k } from "react/jsx-runtime";
|
|
24
|
+
import { CTAOverflowMenu as A, EmphasisPanel as j, PagePurpose as M } from "@burdenoff/fe-libs/ui";
|
|
25
|
+
import { useI18n as N } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
18
26
|
//#region src/movethewheels/pages/InventoryPage.tsx
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
27
|
+
var P = {
|
|
28
|
+
out_of_stock: {
|
|
29
|
+
bg: "bg-status-error-bg-subtle",
|
|
30
|
+
text: "text-status-error-text"
|
|
31
|
+
},
|
|
32
|
+
low: {
|
|
33
|
+
bg: "bg-status-warning-bg-subtle",
|
|
34
|
+
text: "text-status-warning-text"
|
|
35
|
+
},
|
|
36
|
+
in_stock: {
|
|
37
|
+
bg: "bg-status-success-bg-subtle",
|
|
38
|
+
text: "text-status-success-text"
|
|
39
|
+
}
|
|
40
|
+
}, F = {
|
|
41
|
+
RECEIPT: "in",
|
|
42
|
+
RETURN: "in",
|
|
43
|
+
ISSUE: "out",
|
|
44
|
+
TRANSFER: "neutral",
|
|
45
|
+
ADJUSTMENT: "neutral"
|
|
46
|
+
}, I = {
|
|
47
|
+
RECEIPT: "Inbound",
|
|
48
|
+
RETURN: "Return",
|
|
49
|
+
ISSUE: "Outbound",
|
|
50
|
+
TRANSFER: "Transfer",
|
|
51
|
+
ADJUSTMENT: "Adjustment"
|
|
52
|
+
};
|
|
53
|
+
function L() {
|
|
54
|
+
let { t: L } = N(), R = (e, t) => {
|
|
55
|
+
let n = L(e);
|
|
22
56
|
return n === e ? t : n;
|
|
23
|
-
}, { basePath:
|
|
57
|
+
}, { basePath: z, navigate: B } = p(), { inventory: V, products: H, warehouses: U, isLoading: W, error: G, refetch: K } = ee(), { stats: q } = m(), { transactions: J, isLoading: oe, error: Y } = h({ limit: 8 }), X = (e) => B?.(f(z, e)), Z = (e, t) => {
|
|
24
58
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), t());
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
59
|
+
}, Q = V.filter((e) => e.availableQuantity <= e.reorderLevel), $ = R("movethewheels.inventory.lowStock.unknownProduct", "Unknown Product"), se = ae(() => {
|
|
60
|
+
let e = new Map(H.map((e) => [e.id, e])), t = new Map(U.map((e) => [e.id, e]));
|
|
61
|
+
return V.map((n) => {
|
|
62
|
+
let r = e.get(n.productId);
|
|
63
|
+
return {
|
|
64
|
+
id: n.id,
|
|
65
|
+
productId: n.productId,
|
|
66
|
+
productName: r?.name ?? $,
|
|
67
|
+
sku: r?.sku ?? "—",
|
|
68
|
+
warehouseName: t.get(n.warehouseId)?.name ?? "—",
|
|
69
|
+
onHand: n.quantity,
|
|
70
|
+
allocated: n.reservedQuantity,
|
|
71
|
+
available: n.availableQuantity,
|
|
72
|
+
reorderLevel: n.reorderLevel,
|
|
73
|
+
stockState: n.quantity === 0 ? "out_of_stock" : n.availableQuantity <= n.reorderLevel ? "low" : "in_stock"
|
|
74
|
+
};
|
|
75
|
+
});
|
|
76
|
+
}, [
|
|
77
|
+
V,
|
|
78
|
+
H,
|
|
79
|
+
U,
|
|
80
|
+
$
|
|
81
|
+
]), ce = [
|
|
82
|
+
{
|
|
83
|
+
id: "product",
|
|
84
|
+
header: R("movethewheels.inventory.stock.product", "Product"),
|
|
85
|
+
accessorKey: "productName",
|
|
86
|
+
sortable: !0,
|
|
87
|
+
cell: (e) => /* @__PURE__ */ O("span", {
|
|
88
|
+
className: "font-medium",
|
|
89
|
+
children: e.productName
|
|
90
|
+
})
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
id: "sku",
|
|
94
|
+
header: R("movethewheels.inventory.stock.sku", "SKU"),
|
|
95
|
+
accessorKey: "sku",
|
|
96
|
+
sortable: !0,
|
|
97
|
+
cell: (e) => /* @__PURE__ */ O("span", {
|
|
98
|
+
className: "text-sm text-text-secondary",
|
|
99
|
+
children: e.sku
|
|
100
|
+
})
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
id: "warehouse",
|
|
104
|
+
header: R("movethewheels.inventory.stock.warehouse", "Warehouse"),
|
|
105
|
+
accessorKey: "warehouseName",
|
|
106
|
+
sortable: !0
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
id: "onHand",
|
|
110
|
+
header: R("movethewheels.inventory.stock.onHand", "On hand"),
|
|
111
|
+
accessorKey: "onHand",
|
|
112
|
+
sortable: !0,
|
|
113
|
+
cell: (e) => /* @__PURE__ */ O("span", {
|
|
114
|
+
className: "font-medium",
|
|
115
|
+
children: e.onHand.toLocaleString()
|
|
116
|
+
})
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
id: "allocated",
|
|
120
|
+
header: R("movethewheels.inventory.stock.allocated", "Allocated"),
|
|
121
|
+
accessorKey: "allocated",
|
|
122
|
+
sortable: !0,
|
|
123
|
+
cell: (e) => e.allocated.toLocaleString()
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
id: "available",
|
|
127
|
+
header: R("movethewheels.inventory.stock.available", "Available"),
|
|
128
|
+
accessorKey: "available",
|
|
129
|
+
sortable: !0,
|
|
130
|
+
cell: (e) => /* @__PURE__ */ O("span", {
|
|
131
|
+
className: "font-medium",
|
|
132
|
+
children: e.available.toLocaleString()
|
|
133
|
+
})
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
id: "reorderPoint",
|
|
137
|
+
header: R("movethewheels.inventory.stock.reorderPoint", "Reorder point"),
|
|
138
|
+
accessorKey: "reorderLevel",
|
|
139
|
+
sortable: !0,
|
|
140
|
+
cell: (e) => e.reorderLevel > 0 ? e.reorderLevel.toLocaleString() : "—"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
id: "state",
|
|
144
|
+
header: R("movethewheels.inventory.stock.status", "Status"),
|
|
145
|
+
cell: (e) => /* @__PURE__ */ O(te, {
|
|
146
|
+
status: e.stockState === "out_of_stock" ? R("movethewheels.inventory.stock.outOfStock", "Out of stock") : e.stockState === "low" ? R("movethewheels.inventory.stock.low", "Low") : R("movethewheels.inventory.stock.inStock", "In stock"),
|
|
147
|
+
customColors: P[e.stockState],
|
|
148
|
+
size: "sm"
|
|
149
|
+
})
|
|
150
|
+
}
|
|
151
|
+
];
|
|
152
|
+
return /* @__PURE__ */ k(C, {
|
|
153
|
+
title: R("movethewheels.inventory.title", "Inventory"),
|
|
154
|
+
subtitle: R("movethewheels.inventory.subtitle", "Manage your products and warehouses"),
|
|
155
|
+
icon: /* @__PURE__ */ O(c, { size: 24 }),
|
|
156
|
+
headerActions: /* @__PURE__ */ O(A, {
|
|
31
157
|
primary: {
|
|
32
|
-
label:
|
|
33
|
-
icon: /* @__PURE__ */
|
|
34
|
-
onSelect: () =>
|
|
158
|
+
label: R("movethewheels.inventory.actions.addProduct", "Add Product"),
|
|
159
|
+
icon: /* @__PURE__ */ O(l, { size: 16 }),
|
|
160
|
+
onSelect: () => X("inventory/products/new")
|
|
35
161
|
},
|
|
36
162
|
actions: [{
|
|
37
|
-
label:
|
|
38
|
-
onSelect: () =>
|
|
163
|
+
label: R("movethewheels.inventory.actions.products", "Products"),
|
|
164
|
+
onSelect: () => X("inventory/products")
|
|
39
165
|
}, {
|
|
40
|
-
label:
|
|
41
|
-
onSelect: () =>
|
|
166
|
+
label: R("movethewheels.inventory.actions.warehouses", "Warehouses"),
|
|
167
|
+
onSelect: () => X("inventory/warehouses")
|
|
42
168
|
}]
|
|
43
169
|
}),
|
|
44
170
|
children: [
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
icon: /* @__PURE__ */
|
|
47
|
-
children:
|
|
171
|
+
/* @__PURE__ */ O(M, {
|
|
172
|
+
icon: /* @__PURE__ */ O(c, { size: 18 }),
|
|
173
|
+
children: R("movethewheels.inventory.purpose", "A real-time view of what you have and where. Track on-hand, allocated and free-to-promise quantities across warehouses, follow every stock movement, catch low-stock items before they run out, and drill into products or warehouses to manage what you can promise on an order.")
|
|
48
174
|
}),
|
|
49
|
-
|
|
175
|
+
G && !W ? /* @__PURE__ */ O(v, {
|
|
50
176
|
className: "border-status-error-border",
|
|
51
|
-
children: /* @__PURE__ */
|
|
177
|
+
children: /* @__PURE__ */ k(y, {
|
|
52
178
|
className: "p-6 text-center space-y-3",
|
|
53
179
|
children: [
|
|
54
|
-
/* @__PURE__ */
|
|
180
|
+
/* @__PURE__ */ O("p", {
|
|
55
181
|
className: "text-status-error-text font-medium",
|
|
56
|
-
children:
|
|
182
|
+
children: R("movethewheels.inventory.error.title", "Couldn't load inventory")
|
|
57
183
|
}),
|
|
58
|
-
/* @__PURE__ */
|
|
184
|
+
/* @__PURE__ */ O("p", {
|
|
59
185
|
className: "text-sm text-text-secondary",
|
|
60
|
-
children:
|
|
186
|
+
children: G.message
|
|
61
187
|
}),
|
|
62
|
-
/* @__PURE__ */
|
|
188
|
+
/* @__PURE__ */ O(_, {
|
|
63
189
|
variant: "outline",
|
|
64
|
-
onClick:
|
|
65
|
-
children:
|
|
190
|
+
onClick: K,
|
|
191
|
+
children: R("movethewheels.inventory.error.retry", "Retry")
|
|
66
192
|
})
|
|
67
193
|
]
|
|
68
194
|
})
|
|
69
|
-
}) :
|
|
70
|
-
columns:
|
|
71
|
-
children: Array.from({ length:
|
|
72
|
-
}) : /* @__PURE__ */
|
|
73
|
-
columns:
|
|
195
|
+
}) : W ? /* @__PURE__ */ O(D, {
|
|
196
|
+
columns: 6,
|
|
197
|
+
children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */ O(E, {}, t))
|
|
198
|
+
}) : /* @__PURE__ */ k(D, {
|
|
199
|
+
columns: 6,
|
|
74
200
|
children: [
|
|
75
|
-
/* @__PURE__ */
|
|
76
|
-
label:
|
|
77
|
-
value:
|
|
78
|
-
icon: /* @__PURE__ */
|
|
201
|
+
/* @__PURE__ */ O(T, {
|
|
202
|
+
label: R("movethewheels.inventory.metrics.totalOnHand", "Total on-hand"),
|
|
203
|
+
value: q.totalOnHand.toLocaleString(),
|
|
204
|
+
icon: /* @__PURE__ */ O(r, { size: 20 }),
|
|
79
205
|
accent: "brand",
|
|
80
|
-
|
|
206
|
+
subtitle: R("movethewheels.inventory.metrics.onHandHint", "Units in the network")
|
|
81
207
|
}),
|
|
82
|
-
/* @__PURE__ */
|
|
83
|
-
label:
|
|
84
|
-
value:
|
|
85
|
-
icon: /* @__PURE__ */
|
|
86
|
-
accent: "success"
|
|
208
|
+
/* @__PURE__ */ O(T, {
|
|
209
|
+
label: R("movethewheels.inventory.metrics.available", "Available"),
|
|
210
|
+
value: q.totalAvailable.toLocaleString(),
|
|
211
|
+
icon: /* @__PURE__ */ O(a, { size: 20 }),
|
|
212
|
+
accent: "success",
|
|
213
|
+
subtitle: R("movethewheels.inventory.metrics.availableHint", "Free to promise")
|
|
87
214
|
}),
|
|
88
|
-
/* @__PURE__ */
|
|
89
|
-
label:
|
|
90
|
-
value:
|
|
91
|
-
icon: /* @__PURE__ */
|
|
92
|
-
accent: "blue"
|
|
215
|
+
/* @__PURE__ */ O(T, {
|
|
216
|
+
label: R("movethewheels.inventory.metrics.allocated", "Allocated"),
|
|
217
|
+
value: q.totalAllocated.toLocaleString(),
|
|
218
|
+
icon: /* @__PURE__ */ O(s, { size: 20 }),
|
|
219
|
+
accent: "blue",
|
|
220
|
+
subtitle: R("movethewheels.inventory.metrics.allocatedHint", "Committed to orders")
|
|
93
221
|
}),
|
|
94
|
-
/* @__PURE__ */
|
|
95
|
-
label:
|
|
96
|
-
value:
|
|
97
|
-
icon: /* @__PURE__ */
|
|
222
|
+
/* @__PURE__ */ O(T, {
|
|
223
|
+
label: R("movethewheels.inventory.metrics.lowStock", "Low-stock items"),
|
|
224
|
+
value: q.lowStockCount.toLocaleString(),
|
|
225
|
+
icon: /* @__PURE__ */ O(u, { size: 20 }),
|
|
226
|
+
accent: "warning",
|
|
227
|
+
subtitle: R("movethewheels.inventory.metrics.lowStockHint", "At or under reorder point")
|
|
228
|
+
}),
|
|
229
|
+
/* @__PURE__ */ O(T, {
|
|
230
|
+
label: R("movethewheels.inventory.metrics.totalProducts", "Catalog items"),
|
|
231
|
+
value: q.totalProducts.toLocaleString(),
|
|
232
|
+
icon: /* @__PURE__ */ O(c, { size: 20 }),
|
|
233
|
+
accent: "neutral",
|
|
234
|
+
onClick: () => X("inventory/products")
|
|
235
|
+
}),
|
|
236
|
+
/* @__PURE__ */ O(T, {
|
|
237
|
+
label: R("movethewheels.inventory.metrics.warehouses", "Warehouses"),
|
|
238
|
+
value: q.totalWarehouses.toLocaleString(),
|
|
239
|
+
icon: /* @__PURE__ */ O(d, { size: 20 }),
|
|
98
240
|
accent: "neutral",
|
|
99
|
-
onClick: () =>
|
|
241
|
+
onClick: () => X("inventory/warehouses")
|
|
100
242
|
})
|
|
101
243
|
]
|
|
102
244
|
}),
|
|
103
|
-
|
|
245
|
+
Q.length > 0 && /* @__PURE__ */ k(j, {
|
|
104
246
|
className: "space-y-4",
|
|
105
|
-
children: [/* @__PURE__ */
|
|
247
|
+
children: [/* @__PURE__ */ k("h2", {
|
|
106
248
|
className: "flex items-center gap-2 text-base font-semibold text-status-warning-text",
|
|
107
249
|
children: [
|
|
108
|
-
/* @__PURE__ */
|
|
109
|
-
|
|
250
|
+
/* @__PURE__ */ O(u, { size: 18 }),
|
|
251
|
+
R("movethewheels.inventory.lowStock.title", "Low Stock Alert"),
|
|
110
252
|
" (",
|
|
111
|
-
|
|
253
|
+
Q.length,
|
|
112
254
|
" ",
|
|
113
|
-
|
|
255
|
+
R("movethewheels.inventory.lowStock.items", "items"),
|
|
114
256
|
")"
|
|
115
257
|
]
|
|
116
|
-
}), /* @__PURE__ */
|
|
258
|
+
}), /* @__PURE__ */ O("div", { children: /* @__PURE__ */ O("div", {
|
|
117
259
|
className: "space-y-3",
|
|
118
|
-
children:
|
|
119
|
-
let t =
|
|
120
|
-
return /* @__PURE__ */
|
|
260
|
+
children: Q.slice(0, 5).map((e) => {
|
|
261
|
+
let t = H.find((t) => t.id === e.productId);
|
|
262
|
+
return /* @__PURE__ */ k("div", {
|
|
121
263
|
className: "flex items-center justify-between p-3 bg-status-warning-bg/10 rounded-lg",
|
|
122
|
-
children: [/* @__PURE__ */
|
|
264
|
+
children: [/* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
|
|
123
265
|
className: "font-medium",
|
|
124
|
-
children: t?.name ||
|
|
125
|
-
}), /* @__PURE__ */
|
|
266
|
+
children: t?.name || R("movethewheels.inventory.lowStock.unknownProduct", "Unknown Product")
|
|
267
|
+
}), /* @__PURE__ */ k("p", {
|
|
126
268
|
className: "text-sm text-text-secondary",
|
|
127
269
|
children: [
|
|
128
|
-
|
|
270
|
+
R("movethewheels.inventory.lowStock.sku", "SKU:"),
|
|
129
271
|
" ",
|
|
130
272
|
t?.sku
|
|
131
273
|
]
|
|
132
|
-
})] }), /* @__PURE__ */
|
|
274
|
+
})] }), /* @__PURE__ */ k("div", {
|
|
133
275
|
className: "text-right",
|
|
134
|
-
children: [/* @__PURE__ */
|
|
276
|
+
children: [/* @__PURE__ */ k("p", {
|
|
135
277
|
className: "font-medium text-status-warning-text",
|
|
136
278
|
children: [
|
|
137
279
|
e.availableQuantity,
|
|
138
280
|
" ",
|
|
139
|
-
|
|
281
|
+
R("movethewheels.inventory.lowStock.left", "left")
|
|
140
282
|
]
|
|
141
|
-
}), /* @__PURE__ */
|
|
283
|
+
}), /* @__PURE__ */ k("p", {
|
|
142
284
|
className: "text-sm text-text-secondary",
|
|
143
285
|
children: [
|
|
144
|
-
|
|
286
|
+
R("movethewheels.inventory.lowStock.reorderAt", "Reorder at:"),
|
|
145
287
|
" ",
|
|
146
288
|
e.reorderLevel
|
|
147
289
|
]
|
|
@@ -151,54 +293,137 @@ function O() {
|
|
|
151
293
|
})
|
|
152
294
|
}) })]
|
|
153
295
|
}),
|
|
154
|
-
/* @__PURE__ */
|
|
296
|
+
/* @__PURE__ */ k("div", {
|
|
297
|
+
className: "grid grid-cols-1 xl:grid-cols-3 gap-6",
|
|
298
|
+
children: [/* @__PURE__ */ O("div", {
|
|
299
|
+
className: "xl:col-span-2",
|
|
300
|
+
children: /* @__PURE__ */ O(w, {
|
|
301
|
+
title: R("movethewheels.inventory.stock.title", "Stock position"),
|
|
302
|
+
children: /* @__PURE__ */ O(ne, {
|
|
303
|
+
columns: ce,
|
|
304
|
+
data: se,
|
|
305
|
+
isLoading: W,
|
|
306
|
+
error: G,
|
|
307
|
+
onRetry: K,
|
|
308
|
+
searchable: !0,
|
|
309
|
+
searchPlaceholder: R("movethewheels.inventory.stock.search", "Search product, SKU or warehouse..."),
|
|
310
|
+
searchFields: [
|
|
311
|
+
"productName",
|
|
312
|
+
"sku",
|
|
313
|
+
"warehouseName"
|
|
314
|
+
],
|
|
315
|
+
onRowClick: (e) => X(`inventory/products/${e.productId}`),
|
|
316
|
+
getRowId: (e) => e.id,
|
|
317
|
+
emptyIllustration: "empty-data",
|
|
318
|
+
emptyTitle: R("movethewheels.inventory.stock.emptyTitle", "No stock recorded yet"),
|
|
319
|
+
emptyDescription: R("movethewheels.inventory.stock.emptyDescription", "Stock lines appear here once a product is received into a warehouse.")
|
|
320
|
+
})
|
|
321
|
+
})
|
|
322
|
+
}), /* @__PURE__ */ k(v, {
|
|
323
|
+
className: "h-fit",
|
|
324
|
+
children: [/* @__PURE__ */ O(b, { children: /* @__PURE__ */ k(x, {
|
|
325
|
+
className: "flex items-center gap-2",
|
|
326
|
+
children: [/* @__PURE__ */ O(o, { size: 18 }), R("movethewheels.inventory.transactions.title", "Recent transactions")]
|
|
327
|
+
}) }), /* @__PURE__ */ O(y, {
|
|
328
|
+
className: "p-0",
|
|
329
|
+
children: Y ? /* @__PURE__ */ O("p", {
|
|
330
|
+
className: "p-6 text-sm text-status-error-text",
|
|
331
|
+
children: Y.message
|
|
332
|
+
}) : oe ? /* @__PURE__ */ O("p", {
|
|
333
|
+
className: "p-6 text-sm text-text-secondary",
|
|
334
|
+
children: R("movethewheels.inventory.transactions.loading", "Loading movements…")
|
|
335
|
+
}) : J.length === 0 ? /* @__PURE__ */ O("p", {
|
|
336
|
+
className: "p-6 text-sm text-text-secondary",
|
|
337
|
+
children: R("movethewheels.inventory.transactions.empty", "No stock movements recorded yet. Receipts, issues and adjustments show up here as they happen.")
|
|
338
|
+
}) : /* @__PURE__ */ O("ul", {
|
|
339
|
+
className: "divide-y",
|
|
340
|
+
children: J.map((r) => {
|
|
341
|
+
let i = F[r.type], a = H.find((e) => e.id === r.productId)?.name ?? r.transactionNumber;
|
|
342
|
+
return /* @__PURE__ */ k("li", {
|
|
343
|
+
className: "flex items-start justify-between gap-3 p-4",
|
|
344
|
+
children: [/* @__PURE__ */ k("div", {
|
|
345
|
+
className: "min-w-0",
|
|
346
|
+
children: [
|
|
347
|
+
/* @__PURE__ */ k("p", {
|
|
348
|
+
className: "flex items-center gap-1.5 font-medium",
|
|
349
|
+
children: [i === "in" ? /* @__PURE__ */ O(e, {
|
|
350
|
+
size: 14,
|
|
351
|
+
className: "text-status-success-text"
|
|
352
|
+
}) : i === "out" ? /* @__PURE__ */ O(n, {
|
|
353
|
+
size: 14,
|
|
354
|
+
className: "text-status-warning-text"
|
|
355
|
+
}) : /* @__PURE__ */ O(t, {
|
|
356
|
+
size: 14,
|
|
357
|
+
className: "text-text-secondary"
|
|
358
|
+
}), I[r.type]]
|
|
359
|
+
}),
|
|
360
|
+
/* @__PURE__ */ O("p", {
|
|
361
|
+
className: "truncate text-sm text-text-secondary",
|
|
362
|
+
children: a
|
|
363
|
+
}),
|
|
364
|
+
/* @__PURE__ */ O("p", {
|
|
365
|
+
className: "text-xs text-text-secondary",
|
|
366
|
+
children: ie(r.createdAt, "short")
|
|
367
|
+
})
|
|
368
|
+
]
|
|
369
|
+
}), /* @__PURE__ */ k("span", {
|
|
370
|
+
className: i === "in" ? "font-medium text-status-success-text" : i === "out" ? "font-medium text-status-warning-text" : "font-medium text-text-primary",
|
|
371
|
+
children: [i === "in" ? "+" : i === "out" ? "−" : "", Math.abs(r.quantity).toLocaleString()]
|
|
372
|
+
})]
|
|
373
|
+
}, r.id);
|
|
374
|
+
})
|
|
375
|
+
})
|
|
376
|
+
})]
|
|
377
|
+
})]
|
|
378
|
+
}),
|
|
379
|
+
/* @__PURE__ */ k("div", {
|
|
155
380
|
className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
|
|
156
|
-
children: [/* @__PURE__ */
|
|
157
|
-
title:
|
|
158
|
-
actions: /* @__PURE__ */
|
|
381
|
+
children: [/* @__PURE__ */ O(w, {
|
|
382
|
+
title: R("movethewheels.inventory.warehouses.title", "Warehouses"),
|
|
383
|
+
actions: /* @__PURE__ */ k(_, {
|
|
159
384
|
variant: "ghost",
|
|
160
385
|
size: "sm",
|
|
161
|
-
onClick: () =>
|
|
386
|
+
onClick: () => X("inventory/warehouses"),
|
|
162
387
|
children: [
|
|
163
|
-
|
|
388
|
+
R("movethewheels.inventory.common.viewAll", "View all"),
|
|
164
389
|
" ",
|
|
165
|
-
/* @__PURE__ */
|
|
390
|
+
/* @__PURE__ */ O(i, { size: 16 })
|
|
166
391
|
]
|
|
167
392
|
}),
|
|
168
|
-
children: /* @__PURE__ */
|
|
393
|
+
children: /* @__PURE__ */ O(v, { children: /* @__PURE__ */ O(y, {
|
|
169
394
|
className: "p-0",
|
|
170
|
-
children: /* @__PURE__ */
|
|
395
|
+
children: /* @__PURE__ */ O("div", {
|
|
171
396
|
className: "divide-y",
|
|
172
|
-
children:
|
|
397
|
+
children: U.map((e) => /* @__PURE__ */ O("div", {
|
|
173
398
|
role: "button",
|
|
174
399
|
tabIndex: 0,
|
|
175
400
|
"aria-label": `View warehouse ${e.name}`,
|
|
176
401
|
className: "p-4 hover:bg-bg-sunken/50 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-bg",
|
|
177
|
-
onClick: () =>
|
|
178
|
-
onKeyDown: (t) =>
|
|
179
|
-
children: /* @__PURE__ */
|
|
402
|
+
onClick: () => X(`inventory/warehouses/${e.id}`),
|
|
403
|
+
onKeyDown: (t) => Z(t, () => X(`inventory/warehouses/${e.id}`)),
|
|
404
|
+
children: /* @__PURE__ */ k("div", {
|
|
180
405
|
className: "flex items-center justify-between",
|
|
181
|
-
children: [/* @__PURE__ */
|
|
406
|
+
children: [/* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
|
|
182
407
|
className: "font-medium",
|
|
183
408
|
children: e.name
|
|
184
|
-
}), /* @__PURE__ */
|
|
409
|
+
}), /* @__PURE__ */ k("p", {
|
|
185
410
|
className: "text-sm text-text-secondary",
|
|
186
411
|
children: [
|
|
187
412
|
e.address.city,
|
|
188
413
|
", ",
|
|
189
414
|
e.address.state
|
|
190
415
|
]
|
|
191
|
-
})] }), /* @__PURE__ */
|
|
416
|
+
})] }), /* @__PURE__ */ k("div", {
|
|
192
417
|
className: "text-right",
|
|
193
|
-
children: [/* @__PURE__ */
|
|
418
|
+
children: [/* @__PURE__ */ O(g, {
|
|
194
419
|
variant: e.isActive ? "default" : "secondary",
|
|
195
|
-
children: e.isActive ?
|
|
196
|
-
}), /* @__PURE__ */
|
|
420
|
+
children: e.isActive ? R("movethewheels.inventory.warehouses.active", "Active") : R("movethewheels.inventory.warehouses.inactive", "Inactive")
|
|
421
|
+
}), /* @__PURE__ */ k("div", {
|
|
197
422
|
className: "mt-2",
|
|
198
|
-
children: [/* @__PURE__ */
|
|
423
|
+
children: [/* @__PURE__ */ O("p", {
|
|
199
424
|
className: "text-xs text-text-secondary",
|
|
200
|
-
children:
|
|
201
|
-
}), /* @__PURE__ */ S
|
|
425
|
+
children: R("movethewheels.inventory.warehouses.utilization", "Utilization")
|
|
426
|
+
}), /* @__PURE__ */ O(S, {
|
|
202
427
|
value: e.capacity.usedSpace / e.capacity.totalSpace * 100,
|
|
203
428
|
className: "w-24 h-2"
|
|
204
429
|
})]
|
|
@@ -208,43 +433,43 @@ function O() {
|
|
|
208
433
|
}, e.id))
|
|
209
434
|
})
|
|
210
435
|
}) })
|
|
211
|
-
}), /* @__PURE__ */
|
|
212
|
-
title:
|
|
213
|
-
actions: /* @__PURE__ */
|
|
436
|
+
}), /* @__PURE__ */ O(w, {
|
|
437
|
+
title: R("movethewheels.inventory.products.title", "Recent Products"),
|
|
438
|
+
actions: /* @__PURE__ */ k(_, {
|
|
214
439
|
variant: "ghost",
|
|
215
440
|
size: "sm",
|
|
216
|
-
onClick: () =>
|
|
441
|
+
onClick: () => X("inventory/products"),
|
|
217
442
|
children: [
|
|
218
|
-
|
|
443
|
+
R("movethewheels.inventory.common.viewAll", "View all"),
|
|
219
444
|
" ",
|
|
220
|
-
/* @__PURE__ */
|
|
445
|
+
/* @__PURE__ */ O(i, { size: 16 })
|
|
221
446
|
]
|
|
222
447
|
}),
|
|
223
|
-
children: /* @__PURE__ */
|
|
448
|
+
children: /* @__PURE__ */ O(v, { children: /* @__PURE__ */ O(y, {
|
|
224
449
|
className: "p-0",
|
|
225
|
-
children: /* @__PURE__ */
|
|
450
|
+
children: /* @__PURE__ */ O("div", {
|
|
226
451
|
className: "divide-y",
|
|
227
|
-
children:
|
|
452
|
+
children: H.slice(0, 5).map((e) => /* @__PURE__ */ O("div", {
|
|
228
453
|
role: "button",
|
|
229
454
|
tabIndex: 0,
|
|
230
455
|
"aria-label": `View product ${e.name}`,
|
|
231
456
|
className: "p-4 hover:bg-bg-sunken/50 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-bg",
|
|
232
|
-
onClick: () =>
|
|
233
|
-
onKeyDown: (t) =>
|
|
234
|
-
children: /* @__PURE__ */
|
|
457
|
+
onClick: () => X(`inventory/products/${e.id}`),
|
|
458
|
+
onKeyDown: (t) => Z(t, () => X(`inventory/products/${e.id}`)),
|
|
459
|
+
children: /* @__PURE__ */ k("div", {
|
|
235
460
|
className: "flex items-center justify-between",
|
|
236
|
-
children: [/* @__PURE__ */
|
|
461
|
+
children: [/* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
|
|
237
462
|
className: "font-medium",
|
|
238
463
|
children: e.name
|
|
239
|
-
}), /* @__PURE__ */
|
|
464
|
+
}), /* @__PURE__ */ O("p", {
|
|
240
465
|
className: "text-sm text-text-secondary",
|
|
241
466
|
children: e.sku
|
|
242
|
-
})] }), /* @__PURE__ */
|
|
467
|
+
})] }), /* @__PURE__ */ k("div", {
|
|
243
468
|
className: "text-right",
|
|
244
|
-
children: [/* @__PURE__ */
|
|
469
|
+
children: [/* @__PURE__ */ O("p", {
|
|
245
470
|
className: "font-medium",
|
|
246
|
-
children:
|
|
247
|
-
}), /* @__PURE__ */
|
|
471
|
+
children: re(e.value)
|
|
472
|
+
}), /* @__PURE__ */ O(g, {
|
|
248
473
|
variant: "outline",
|
|
249
474
|
children: e.category
|
|
250
475
|
})]
|
|
@@ -259,4 +484,4 @@ function O() {
|
|
|
259
484
|
});
|
|
260
485
|
}
|
|
261
486
|
//#endregion
|
|
262
|
-
export {
|
|
487
|
+
export { L as default };
|