@burdenoff/microfe-movethewheels 2026.1107.7 → 2026.1108.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/components/ForecastModelsPanel.js +132 -0
- package/dist/components/InventoryCoverPanel.js +401 -0
- package/dist/components/UpcomingDemandPanel.js +70 -65
- package/dist/generated/wspace-operations.d.ts +25 -0
- package/dist/generated/wspace-types.d.ts +3467 -134
- package/dist/hooks/useDemandForecast.js +1 -1
- package/dist/hooks/useForecastModelChoices.js +57 -0
- package/dist/hooks/useInventoryCoverPlan.js +70 -0
- package/dist/movethewheels/components/ForecastModelsPanel.d.ts +4 -0
- package/dist/movethewheels/components/InventoryCoverPanel.d.ts +24 -0
- package/dist/movethewheels/hooks/useDemandForecast.d.ts +9 -0
- package/dist/movethewheels/hooks/useForecastModelChoices.d.ts +34 -0
- package/dist/movethewheels/hooks/useInventoryCoverPlan.d.ts +80 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/sigma.js +8 -0
- package/dist/pages/AnalyticsPage.js +83 -81
- package/dist/pages/InventoryPage.js +219 -214
- package/package.json +1 -1
- package/src/generated/wspace-operations.ts +13 -4
- package/src/generated/wspace-types.ts +3812 -134
- package/src/movethewheels/components/ForecastModelsPanel.tsx +188 -0
- package/src/movethewheels/components/InventoryCoverPanel.tsx +449 -0
- package/src/movethewheels/components/UpcomingDemandPanel.tsx +9 -2
- package/src/movethewheels/hooks/useDemandForecast.ts +13 -0
- package/src/movethewheels/hooks/useForecastModelChoices.ts +138 -0
- package/src/movethewheels/hooks/useInventoryCoverPlan.ts +250 -0
- package/src/movethewheels/pages/AnalyticsPage.tsx +7 -2
- package/src/movethewheels/pages/InventoryPage.tsx +8 -0
- package/src/operations/wspace/movethewheels/queries/forecast.graphql +22 -1
|
@@ -12,24 +12,25 @@ import { Plus as re } from "../node_modules/lucide-react/dist/esm/icons/plus.js"
|
|
|
12
12
|
import { SlidersHorizontal as ie } from "../node_modules/lucide-react/dist/esm/icons/sliders-horizontal.js";
|
|
13
13
|
import { TriangleAlert as s } from "../node_modules/lucide-react/dist/esm/icons/triangle-alert.js";
|
|
14
14
|
import { Warehouse as ae } from "../node_modules/lucide-react/dist/esm/icons/warehouse.js";
|
|
15
|
-
import { joinPath as
|
|
16
|
-
import { useMoveTheWheels as
|
|
17
|
-
import { formatCurrency as
|
|
18
|
-
import { useInventory as
|
|
19
|
-
import { Badge as
|
|
20
|
-
import { PageLayout as
|
|
21
|
-
import { MetricCard as
|
|
22
|
-
import { StatusBadge as
|
|
23
|
-
import { DataTable as
|
|
24
|
-
import { Notice as
|
|
25
|
-
import { useDebouncedValue as
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
15
|
+
import { joinPath as oe } from "../utils/navigation.js";
|
|
16
|
+
import { useMoveTheWheels as se } from "../providers/MoveTheWheelsProvider.js";
|
|
17
|
+
import { formatCurrency as ce, formatDate as le } from "../utils/formatters.js";
|
|
18
|
+
import { useInventory as ue, useInventoryStats as c, useInventoryTransactions as de } from "../hooks/useInventory.js";
|
|
19
|
+
import { Badge as l, Button as u, Card as d, CardContent as f, CardHeader as fe, CardTitle as pe, Progress as me } from "../components/ui.js";
|
|
20
|
+
import { PageLayout as he, PageSection as p } from "../components/PageLayout.js";
|
|
21
|
+
import { MetricCard as m, MetricCardSkeleton as ge, MetricGrid as h } from "../components/MetricCard.js";
|
|
22
|
+
import { StatusBadge as _e } from "../components/StatusBadge.js";
|
|
23
|
+
import { DataTable as ve } from "../components/DataTable.js";
|
|
24
|
+
import { Notice as ye, useNotice as be } from "../components/Notice.js";
|
|
25
|
+
import { useDebouncedValue as xe } from "../hooks/useDebouncedValue.js";
|
|
26
|
+
import { InventoryCoverPanel as Se } from "../components/InventoryCoverPanel.js";
|
|
27
|
+
import { AdjustStockDialog as Ce, ReceiveStockDialog as we, TransferStockDialog as Te } from "../components/StockActionDialogs.js";
|
|
28
|
+
import { useMemo as g, useState as _ } from "react";
|
|
29
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
30
|
+
import { useI18n as Ee } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
31
|
+
import { CTAOverflowMenu as De, EmphasisPanel as b, PagePurpose as x } from "@burdenoff/fe-libs/ui";
|
|
31
32
|
//#region src/movethewheels/pages/InventoryPage.tsx
|
|
32
|
-
var
|
|
33
|
+
var S = {
|
|
33
34
|
out_of_stock: {
|
|
34
35
|
bg: "bg-status-error-bg-subtle",
|
|
35
36
|
text: "text-status-error-text"
|
|
@@ -42,32 +43,35 @@ var w = {
|
|
|
42
43
|
bg: "bg-status-success-bg-subtle",
|
|
43
44
|
text: "text-status-success-text"
|
|
44
45
|
}
|
|
45
|
-
},
|
|
46
|
+
}, C = {
|
|
46
47
|
RECEIPT: "in",
|
|
47
48
|
RETURN: "in",
|
|
48
49
|
ISSUE: "out",
|
|
49
50
|
TRANSFER: "neutral",
|
|
50
51
|
ADJUSTMENT: "neutral"
|
|
51
|
-
},
|
|
52
|
+
}, w = {
|
|
52
53
|
RECEIPT: "Inbound",
|
|
53
54
|
RETURN: "Return",
|
|
54
55
|
ISSUE: "Outbound",
|
|
55
56
|
TRANSFER: "Transfer",
|
|
56
57
|
ADJUSTMENT: "Adjustment"
|
|
57
58
|
};
|
|
58
|
-
function
|
|
59
|
+
function T(e, t) {
|
|
59
60
|
let n = Math.abs(t).toLocaleString();
|
|
60
61
|
return e === "in" ? `+${n}` : e === "out" ? `−${n}` : t > 0 ? `+${n}` : t < 0 ? `−${n}` : n;
|
|
61
62
|
}
|
|
62
|
-
function
|
|
63
|
-
let { t:
|
|
64
|
-
let n =
|
|
63
|
+
function E() {
|
|
64
|
+
let { t: E } = Ee(), D = (e, t) => {
|
|
65
|
+
let n = E(e);
|
|
65
66
|
return n === e ? t : n;
|
|
66
|
-
}, { basePath:
|
|
67
|
-
search:
|
|
68
|
-
limit:
|
|
69
|
-
offset:
|
|
70
|
-
}),
|
|
67
|
+
}, { basePath: Oe, navigate: ke } = se(), [O, Ae] = _(""), [k, A] = _(0), [j, je] = _(10), { inventory: M, lowStockItems: N, products: P, warehouses: F, totalItems: Me, hasMore: Ne, isLoading: I, error: L, refetch: R } = ue({
|
|
68
|
+
search: xe(O),
|
|
69
|
+
limit: j,
|
|
70
|
+
offset: k * j
|
|
71
|
+
}), Pe = g(() => F.map((e) => ({
|
|
72
|
+
id: e.id,
|
|
73
|
+
name: e.name
|
|
74
|
+
})), [F]), { stats: z, refetch: Fe } = c(), { transactions: B, isLoading: Ie, error: V, refetch: Le } = de({ limit: 8 }), { message: H, notify: U } = be(6e3), [Re, W] = _(!1), [G, K] = _(null), [q, J] = _(null), Y = (e) => ({
|
|
71
75
|
id: e.id,
|
|
72
76
|
productName: e.productName,
|
|
73
77
|
sku: e.sku,
|
|
@@ -76,10 +80,10 @@ function O() {
|
|
|
76
80
|
onHand: e.onHand,
|
|
77
81
|
available: e.available
|
|
78
82
|
}), X = (e) => {
|
|
79
|
-
|
|
80
|
-
}, Z = (e) =>
|
|
83
|
+
U(e), R(), Fe(), Le();
|
|
84
|
+
}, Z = (e) => ke?.(oe(Oe, e)), Q = (e, t) => {
|
|
81
85
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), t());
|
|
82
|
-
}, $ =
|
|
86
|
+
}, $ = D("movethewheels.inventory.lowStock.unknownProduct", "Unknown Product"), ze = g(() => M.map((e) => ({
|
|
83
87
|
id: e.id,
|
|
84
88
|
productId: e.productId,
|
|
85
89
|
productName: e.productName ?? $,
|
|
@@ -91,253 +95,253 @@ function O() {
|
|
|
91
95
|
available: e.availableQuantity,
|
|
92
96
|
reorderLevel: e.reorderLevel,
|
|
93
97
|
stockState: e.quantity === 0 ? "out_of_stock" : e.reorderLevel !== void 0 && e.availableQuantity <= e.reorderLevel ? "low" : "in_stock"
|
|
94
|
-
})), [
|
|
98
|
+
})), [M, $]), Be = [
|
|
95
99
|
{
|
|
96
100
|
id: "product",
|
|
97
|
-
header:
|
|
101
|
+
header: D("movethewheels.inventory.stock.product", "Product"),
|
|
98
102
|
accessorKey: "productName",
|
|
99
103
|
sortable: !0,
|
|
100
|
-
cell: (e) => /* @__PURE__ */
|
|
104
|
+
cell: (e) => /* @__PURE__ */ v("span", {
|
|
101
105
|
className: "font-medium",
|
|
102
106
|
children: e.productName
|
|
103
107
|
})
|
|
104
108
|
},
|
|
105
109
|
{
|
|
106
110
|
id: "sku",
|
|
107
|
-
header:
|
|
111
|
+
header: D("movethewheels.inventory.stock.sku", "SKU"),
|
|
108
112
|
accessorKey: "sku",
|
|
109
113
|
sortable: !0,
|
|
110
|
-
cell: (e) => /* @__PURE__ */
|
|
114
|
+
cell: (e) => /* @__PURE__ */ v("span", {
|
|
111
115
|
className: "text-sm text-text-secondary",
|
|
112
116
|
children: e.sku
|
|
113
117
|
})
|
|
114
118
|
},
|
|
115
119
|
{
|
|
116
120
|
id: "warehouse",
|
|
117
|
-
header:
|
|
121
|
+
header: D("movethewheels.inventory.stock.warehouse", "Warehouse"),
|
|
118
122
|
accessorKey: "warehouseName",
|
|
119
123
|
sortable: !0
|
|
120
124
|
},
|
|
121
125
|
{
|
|
122
126
|
id: "onHand",
|
|
123
|
-
header:
|
|
127
|
+
header: D("movethewheels.inventory.stock.onHand", "On hand"),
|
|
124
128
|
accessorKey: "onHand",
|
|
125
129
|
sortable: !0,
|
|
126
|
-
cell: (e) => /* @__PURE__ */
|
|
130
|
+
cell: (e) => /* @__PURE__ */ v("span", {
|
|
127
131
|
className: "font-medium",
|
|
128
132
|
children: e.onHand.toLocaleString()
|
|
129
133
|
})
|
|
130
134
|
},
|
|
131
135
|
{
|
|
132
136
|
id: "allocated",
|
|
133
|
-
header:
|
|
137
|
+
header: D("movethewheels.inventory.stock.allocated", "Allocated"),
|
|
134
138
|
accessorKey: "allocated",
|
|
135
139
|
sortable: !0,
|
|
136
140
|
cell: (e) => e.allocated.toLocaleString()
|
|
137
141
|
},
|
|
138
142
|
{
|
|
139
143
|
id: "available",
|
|
140
|
-
header:
|
|
144
|
+
header: D("movethewheels.inventory.stock.available", "Available"),
|
|
141
145
|
accessorKey: "available",
|
|
142
146
|
sortable: !0,
|
|
143
|
-
cell: (e) => /* @__PURE__ */
|
|
147
|
+
cell: (e) => /* @__PURE__ */ v("span", {
|
|
144
148
|
className: "font-medium",
|
|
145
149
|
children: e.available.toLocaleString()
|
|
146
150
|
})
|
|
147
151
|
},
|
|
148
152
|
{
|
|
149
153
|
id: "reorderPoint",
|
|
150
|
-
header:
|
|
154
|
+
header: D("movethewheels.inventory.stock.reorderPoint", "Reorder point"),
|
|
151
155
|
accessorKey: "reorderLevel",
|
|
152
156
|
sortable: !0,
|
|
153
157
|
cell: (e) => e.reorderLevel === void 0 ? "—" : e.reorderLevel.toLocaleString()
|
|
154
158
|
},
|
|
155
159
|
{
|
|
156
160
|
id: "state",
|
|
157
|
-
header:
|
|
158
|
-
cell: (e) => /* @__PURE__ */
|
|
159
|
-
status: e.stockState === "out_of_stock" ?
|
|
160
|
-
customColors:
|
|
161
|
+
header: D("movethewheels.inventory.stock.status", "Status"),
|
|
162
|
+
cell: (e) => /* @__PURE__ */ v(_e, {
|
|
163
|
+
status: e.stockState === "out_of_stock" ? D("movethewheels.inventory.stock.outOfStock", "Out of stock") : e.stockState === "low" ? D("movethewheels.inventory.stock.low", "Low") : D("movethewheels.inventory.stock.inStock", "In stock"),
|
|
164
|
+
customColors: S[e.stockState],
|
|
161
165
|
size: "sm"
|
|
162
166
|
})
|
|
163
167
|
},
|
|
164
168
|
{
|
|
165
169
|
id: "actions",
|
|
166
|
-
header:
|
|
167
|
-
cell: (e) => /* @__PURE__ */
|
|
170
|
+
header: D("movethewheels.inventory.stock.actions", "Actions"),
|
|
171
|
+
cell: (e) => /* @__PURE__ */ y("div", {
|
|
168
172
|
className: "flex flex-wrap gap-2",
|
|
169
173
|
onClick: (e) => e.stopPropagation(),
|
|
170
174
|
onKeyDown: (e) => e.stopPropagation(),
|
|
171
|
-
children: [/* @__PURE__ */
|
|
175
|
+
children: [/* @__PURE__ */ y(u, {
|
|
172
176
|
type: "button",
|
|
173
177
|
variant: "outline",
|
|
174
178
|
size: "sm",
|
|
175
179
|
onClick: () => K(Y(e)),
|
|
176
180
|
children: [
|
|
177
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ v(ie, { size: 14 }),
|
|
178
182
|
" ",
|
|
179
|
-
|
|
183
|
+
D("movethewheels.inventory.stock.adjust", "Adjust")
|
|
180
184
|
]
|
|
181
|
-
}), /* @__PURE__ */
|
|
185
|
+
}), /* @__PURE__ */ y(u, {
|
|
182
186
|
type: "button",
|
|
183
187
|
variant: "outline",
|
|
184
188
|
size: "sm",
|
|
185
189
|
onClick: () => J(Y(e)),
|
|
186
190
|
disabled: e.available <= 0,
|
|
187
191
|
children: [
|
|
188
|
-
/* @__PURE__ */
|
|
192
|
+
/* @__PURE__ */ v(t, { size: 14 }),
|
|
189
193
|
" ",
|
|
190
|
-
|
|
194
|
+
D("movethewheels.inventory.stock.transfer", "Transfer")
|
|
191
195
|
]
|
|
192
196
|
})]
|
|
193
197
|
})
|
|
194
198
|
}
|
|
195
199
|
];
|
|
196
|
-
return /* @__PURE__ */
|
|
197
|
-
title:
|
|
198
|
-
subtitle:
|
|
199
|
-
icon: /* @__PURE__ */
|
|
200
|
-
headerActions: /* @__PURE__ */
|
|
200
|
+
return /* @__PURE__ */ y(he, {
|
|
201
|
+
title: D("movethewheels.inventory.title", "Inventory"),
|
|
202
|
+
subtitle: D("movethewheels.inventory.subtitle", "Manage your products and warehouses"),
|
|
203
|
+
icon: /* @__PURE__ */ v(o, { size: 24 }),
|
|
204
|
+
headerActions: /* @__PURE__ */ v(De, {
|
|
201
205
|
primary: {
|
|
202
|
-
label:
|
|
203
|
-
icon: /* @__PURE__ */
|
|
206
|
+
label: D("movethewheels.inventory.actions.addProduct", "Add Product"),
|
|
207
|
+
icon: /* @__PURE__ */ v(re, { size: 16 }),
|
|
204
208
|
onSelect: () => Z("inventory/products/new")
|
|
205
209
|
},
|
|
206
210
|
actions: [
|
|
207
211
|
{
|
|
208
|
-
label:
|
|
209
|
-
icon: /* @__PURE__ */
|
|
212
|
+
label: D("movethewheels.inventory.actions.receiveStock", "Receive stock"),
|
|
213
|
+
icon: /* @__PURE__ */ v(ne, { size: 16 }),
|
|
210
214
|
onSelect: () => W(!0)
|
|
211
215
|
},
|
|
212
216
|
{
|
|
213
|
-
label:
|
|
217
|
+
label: D("movethewheels.inventory.actions.products", "Products"),
|
|
214
218
|
onSelect: () => Z("inventory/products")
|
|
215
219
|
},
|
|
216
220
|
{
|
|
217
|
-
label:
|
|
221
|
+
label: D("movethewheels.inventory.actions.warehouses", "Warehouses"),
|
|
218
222
|
onSelect: () => Z("inventory/warehouses")
|
|
219
223
|
}
|
|
220
224
|
]
|
|
221
225
|
}),
|
|
222
226
|
children: [
|
|
223
|
-
/* @__PURE__ */
|
|
224
|
-
icon: /* @__PURE__ */
|
|
225
|
-
children:
|
|
227
|
+
/* @__PURE__ */ v(x, {
|
|
228
|
+
icon: /* @__PURE__ */ v(o, { size: 18 }),
|
|
229
|
+
children: D("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.")
|
|
226
230
|
}),
|
|
227
|
-
|
|
231
|
+
H && /* @__PURE__ */ v("div", {
|
|
228
232
|
className: "mb-2",
|
|
229
|
-
children: /* @__PURE__ */
|
|
233
|
+
children: /* @__PURE__ */ v(ye, { message: H })
|
|
230
234
|
}),
|
|
231
|
-
|
|
235
|
+
L && !I ? /* @__PURE__ */ v(d, {
|
|
232
236
|
className: "border-status-error-border",
|
|
233
|
-
children: /* @__PURE__ */
|
|
237
|
+
children: /* @__PURE__ */ y(f, {
|
|
234
238
|
className: "p-6 text-center space-y-3",
|
|
235
239
|
children: [
|
|
236
|
-
/* @__PURE__ */
|
|
240
|
+
/* @__PURE__ */ v("p", {
|
|
237
241
|
className: "text-status-error-text font-medium",
|
|
238
|
-
children:
|
|
242
|
+
children: D("movethewheels.inventory.error.title", "Couldn't load inventory")
|
|
239
243
|
}),
|
|
240
|
-
/* @__PURE__ */
|
|
244
|
+
/* @__PURE__ */ v("p", {
|
|
241
245
|
className: "text-sm text-text-secondary",
|
|
242
|
-
children:
|
|
246
|
+
children: L.message
|
|
243
247
|
}),
|
|
244
|
-
/* @__PURE__ */
|
|
248
|
+
/* @__PURE__ */ v(u, {
|
|
245
249
|
variant: "outline",
|
|
246
|
-
onClick:
|
|
247
|
-
children:
|
|
250
|
+
onClick: R,
|
|
251
|
+
children: D("movethewheels.inventory.error.retry", "Retry")
|
|
248
252
|
})
|
|
249
253
|
]
|
|
250
254
|
})
|
|
251
|
-
}) :
|
|
255
|
+
}) : I ? /* @__PURE__ */ v(h, {
|
|
252
256
|
columns: 6,
|
|
253
|
-
children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */
|
|
254
|
-
}) : /* @__PURE__ */
|
|
257
|
+
children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */ v(ge, {}, t))
|
|
258
|
+
}) : /* @__PURE__ */ y(h, {
|
|
255
259
|
columns: 6,
|
|
256
260
|
children: [
|
|
257
|
-
/* @__PURE__ */
|
|
258
|
-
label:
|
|
259
|
-
value:
|
|
260
|
-
icon: /* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ v(m, {
|
|
262
|
+
label: D("movethewheels.inventory.metrics.totalOnHand", "Total on-hand"),
|
|
263
|
+
value: z.totalOnHand.toLocaleString(),
|
|
264
|
+
icon: /* @__PURE__ */ v(r, { size: 20 }),
|
|
261
265
|
accent: "brand",
|
|
262
|
-
subtitle:
|
|
266
|
+
subtitle: D("movethewheels.inventory.metrics.onHandHint", "Units in the network")
|
|
263
267
|
}),
|
|
264
|
-
/* @__PURE__ */
|
|
265
|
-
label:
|
|
266
|
-
value:
|
|
267
|
-
icon: /* @__PURE__ */
|
|
268
|
+
/* @__PURE__ */ v(m, {
|
|
269
|
+
label: D("movethewheels.inventory.metrics.available", "Available"),
|
|
270
|
+
value: z.totalAvailable.toLocaleString(),
|
|
271
|
+
icon: /* @__PURE__ */ v(a, { size: 20 }),
|
|
268
272
|
accent: "success",
|
|
269
|
-
subtitle:
|
|
273
|
+
subtitle: D("movethewheels.inventory.metrics.availableHint", "Free to promise")
|
|
270
274
|
}),
|
|
271
|
-
/* @__PURE__ */
|
|
272
|
-
label:
|
|
273
|
-
value:
|
|
274
|
-
icon: /* @__PURE__ */
|
|
275
|
+
/* @__PURE__ */ v(m, {
|
|
276
|
+
label: D("movethewheels.inventory.metrics.allocated", "Allocated"),
|
|
277
|
+
value: z.totalAllocated.toLocaleString(),
|
|
278
|
+
icon: /* @__PURE__ */ v(te, { size: 20 }),
|
|
275
279
|
accent: "blue",
|
|
276
|
-
subtitle:
|
|
280
|
+
subtitle: D("movethewheels.inventory.metrics.allocatedHint", "Committed to orders")
|
|
277
281
|
}),
|
|
278
|
-
/* @__PURE__ */
|
|
279
|
-
label:
|
|
280
|
-
value:
|
|
281
|
-
icon: /* @__PURE__ */
|
|
282
|
+
/* @__PURE__ */ v(m, {
|
|
283
|
+
label: D("movethewheels.inventory.metrics.lowStock", "Low-stock items"),
|
|
284
|
+
value: z.lowStockCount.toLocaleString(),
|
|
285
|
+
icon: /* @__PURE__ */ v(s, { size: 20 }),
|
|
282
286
|
accent: "warning",
|
|
283
|
-
subtitle:
|
|
287
|
+
subtitle: D("movethewheels.inventory.metrics.lowStockHint", "At or under reorder point")
|
|
284
288
|
}),
|
|
285
|
-
/* @__PURE__ */
|
|
286
|
-
label:
|
|
287
|
-
value:
|
|
288
|
-
icon: /* @__PURE__ */
|
|
289
|
+
/* @__PURE__ */ v(m, {
|
|
290
|
+
label: D("movethewheels.inventory.metrics.totalProducts", "Catalog items"),
|
|
291
|
+
value: z.totalProducts.toLocaleString(),
|
|
292
|
+
icon: /* @__PURE__ */ v(o, { size: 20 }),
|
|
289
293
|
accent: "neutral",
|
|
290
294
|
onClick: () => Z("inventory/products")
|
|
291
295
|
}),
|
|
292
|
-
/* @__PURE__ */
|
|
293
|
-
label:
|
|
294
|
-
value:
|
|
295
|
-
icon: /* @__PURE__ */
|
|
296
|
+
/* @__PURE__ */ v(m, {
|
|
297
|
+
label: D("movethewheels.inventory.metrics.warehouses", "Warehouses"),
|
|
298
|
+
value: z.totalWarehouses.toLocaleString(),
|
|
299
|
+
icon: /* @__PURE__ */ v(ae, { size: 20 }),
|
|
296
300
|
accent: "neutral",
|
|
297
301
|
onClick: () => Z("inventory/warehouses")
|
|
298
302
|
})
|
|
299
303
|
]
|
|
300
304
|
}),
|
|
301
|
-
|
|
305
|
+
N.length > 0 && /* @__PURE__ */ y(b, {
|
|
302
306
|
className: "space-y-4",
|
|
303
|
-
children: [/* @__PURE__ */
|
|
307
|
+
children: [/* @__PURE__ */ y("h2", {
|
|
304
308
|
className: "flex items-center gap-2 text-base font-semibold text-status-warning-text",
|
|
305
309
|
children: [
|
|
306
|
-
/* @__PURE__ */
|
|
307
|
-
|
|
310
|
+
/* @__PURE__ */ v(s, { size: 18 }),
|
|
311
|
+
D("movethewheels.inventory.lowStock.title", "Low Stock Alert"),
|
|
308
312
|
" (",
|
|
309
|
-
|
|
313
|
+
z.lowStockCount,
|
|
310
314
|
" ",
|
|
311
|
-
|
|
315
|
+
D("movethewheels.inventory.lowStock.items", "items"),
|
|
312
316
|
")"
|
|
313
317
|
]
|
|
314
|
-
}), /* @__PURE__ */
|
|
318
|
+
}), /* @__PURE__ */ v("div", { children: /* @__PURE__ */ v("div", {
|
|
315
319
|
className: "space-y-3",
|
|
316
|
-
children:
|
|
320
|
+
children: N.map((e) => /* @__PURE__ */ y("div", {
|
|
317
321
|
className: "flex items-center justify-between p-3 bg-status-warning-bg/10 rounded-lg",
|
|
318
|
-
children: [/* @__PURE__ */
|
|
322
|
+
children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
|
|
319
323
|
className: "font-medium",
|
|
320
|
-
children: e.productName ??
|
|
321
|
-
}), /* @__PURE__ */
|
|
324
|
+
children: e.productName ?? D("movethewheels.inventory.lowStock.unknownProduct", "Unknown Product")
|
|
325
|
+
}), /* @__PURE__ */ y("p", {
|
|
322
326
|
className: "text-sm text-text-secondary",
|
|
323
327
|
children: [
|
|
324
|
-
|
|
328
|
+
D("movethewheels.inventory.lowStock.sku", "SKU:"),
|
|
325
329
|
" ",
|
|
326
330
|
e.productSku ?? "—"
|
|
327
331
|
]
|
|
328
|
-
})] }), /* @__PURE__ */
|
|
332
|
+
})] }), /* @__PURE__ */ y("div", {
|
|
329
333
|
className: "text-right",
|
|
330
|
-
children: [/* @__PURE__ */
|
|
334
|
+
children: [/* @__PURE__ */ y("p", {
|
|
331
335
|
className: "font-medium text-status-warning-text",
|
|
332
336
|
children: [
|
|
333
337
|
e.availableQuantity,
|
|
334
338
|
" ",
|
|
335
|
-
|
|
339
|
+
D("movethewheels.inventory.lowStock.left", "left")
|
|
336
340
|
]
|
|
337
|
-
}), /* @__PURE__ */
|
|
341
|
+
}), /* @__PURE__ */ y("p", {
|
|
338
342
|
className: "text-sm text-text-secondary",
|
|
339
343
|
children: [
|
|
340
|
-
|
|
344
|
+
D("movethewheels.inventory.lowStock.reorderAt", "Reorder at:"),
|
|
341
345
|
" ",
|
|
342
346
|
e.reorderLevel
|
|
343
347
|
]
|
|
@@ -346,94 +350,95 @@ function O() {
|
|
|
346
350
|
}, e.id))
|
|
347
351
|
}) })]
|
|
348
352
|
}),
|
|
349
|
-
/* @__PURE__ */
|
|
353
|
+
/* @__PURE__ */ v(Se, { warehouses: Pe }),
|
|
354
|
+
/* @__PURE__ */ y("div", {
|
|
350
355
|
className: "grid grid-cols-1 xl:grid-cols-3 gap-6",
|
|
351
|
-
children: [/* @__PURE__ */
|
|
356
|
+
children: [/* @__PURE__ */ v("div", {
|
|
352
357
|
className: "xl:col-span-2",
|
|
353
|
-
children: /* @__PURE__ */
|
|
354
|
-
title:
|
|
355
|
-
children: /* @__PURE__ */
|
|
356
|
-
columns:
|
|
357
|
-
data:
|
|
358
|
-
isLoading:
|
|
359
|
-
error:
|
|
360
|
-
onRetry:
|
|
358
|
+
children: /* @__PURE__ */ v(p, {
|
|
359
|
+
title: D("movethewheels.inventory.stock.title", "Stock position"),
|
|
360
|
+
children: /* @__PURE__ */ v(ve, {
|
|
361
|
+
columns: Be,
|
|
362
|
+
data: ze,
|
|
363
|
+
isLoading: I,
|
|
364
|
+
error: L,
|
|
365
|
+
onRetry: R,
|
|
361
366
|
searchable: !0,
|
|
362
|
-
searchPlaceholder:
|
|
367
|
+
searchPlaceholder: D("movethewheels.inventory.stock.search", "Search product, SKU or warehouse..."),
|
|
363
368
|
searchFields: [
|
|
364
369
|
"productName",
|
|
365
370
|
"sku",
|
|
366
371
|
"warehouseName"
|
|
367
372
|
],
|
|
368
|
-
searchQuery:
|
|
373
|
+
searchQuery: O,
|
|
369
374
|
onSearchQueryChange: (e) => {
|
|
370
|
-
|
|
375
|
+
Ae(e), A(0);
|
|
371
376
|
},
|
|
372
|
-
pageIndex:
|
|
373
|
-
pageSize:
|
|
374
|
-
onPageChange:
|
|
377
|
+
pageIndex: k,
|
|
378
|
+
pageSize: j,
|
|
379
|
+
onPageChange: A,
|
|
375
380
|
onPageSizeChange: (e) => {
|
|
376
|
-
|
|
381
|
+
je(e), A(0);
|
|
377
382
|
},
|
|
378
|
-
totalItems:
|
|
379
|
-
hasNextPage:
|
|
383
|
+
totalItems: Me,
|
|
384
|
+
hasNextPage: Ne,
|
|
380
385
|
onRowClick: (e) => Z(`inventory/products/${e.productId}`),
|
|
381
386
|
getRowId: (e) => e.id,
|
|
382
387
|
emptyIllustration: "empty-data",
|
|
383
|
-
emptyTitle:
|
|
384
|
-
emptyDescription:
|
|
388
|
+
emptyTitle: D("movethewheels.inventory.stock.emptyTitle", "No stock recorded yet"),
|
|
389
|
+
emptyDescription: D("movethewheels.inventory.stock.emptyDescription", "Stock lines appear here once a product is received into a warehouse.")
|
|
385
390
|
})
|
|
386
391
|
})
|
|
387
|
-
}), /* @__PURE__ */
|
|
392
|
+
}), /* @__PURE__ */ y(d, {
|
|
388
393
|
className: "h-fit",
|
|
389
|
-
children: [/* @__PURE__ */
|
|
394
|
+
children: [/* @__PURE__ */ v(fe, { children: /* @__PURE__ */ y(pe, {
|
|
390
395
|
className: "flex items-center gap-2",
|
|
391
|
-
children: [/* @__PURE__ */
|
|
392
|
-
}) }), /* @__PURE__ */
|
|
396
|
+
children: [/* @__PURE__ */ v(ee, { size: 18 }), D("movethewheels.inventory.transactions.title", "Recent transactions")]
|
|
397
|
+
}) }), /* @__PURE__ */ v(f, {
|
|
393
398
|
className: "p-0",
|
|
394
|
-
children:
|
|
399
|
+
children: V ? /* @__PURE__ */ v("p", {
|
|
395
400
|
className: "p-6 text-sm text-status-error-text",
|
|
396
|
-
children:
|
|
397
|
-
}) :
|
|
401
|
+
children: V.message
|
|
402
|
+
}) : Ie ? /* @__PURE__ */ v("p", {
|
|
398
403
|
className: "p-6 text-sm text-text-secondary",
|
|
399
|
-
children:
|
|
400
|
-
}) :
|
|
404
|
+
children: D("movethewheels.inventory.transactions.loading", "Loading movements…")
|
|
405
|
+
}) : B.length === 0 ? /* @__PURE__ */ v("p", {
|
|
401
406
|
className: "p-6 text-sm text-text-secondary",
|
|
402
|
-
children:
|
|
403
|
-
}) : /* @__PURE__ */
|
|
407
|
+
children: D("movethewheels.inventory.transactions.empty", "No stock movements recorded yet. Receipts, issues and adjustments show up here as they happen.")
|
|
408
|
+
}) : /* @__PURE__ */ v("ul", {
|
|
404
409
|
className: "divide-y",
|
|
405
|
-
children:
|
|
406
|
-
let i =
|
|
407
|
-
return /* @__PURE__ */
|
|
410
|
+
children: B.map((r) => {
|
|
411
|
+
let i = C[r.type], a = P.find((e) => e.id === r.productId)?.name ?? r.transactionNumber;
|
|
412
|
+
return /* @__PURE__ */ y("li", {
|
|
408
413
|
className: "flex items-start justify-between gap-3 p-4",
|
|
409
|
-
children: [/* @__PURE__ */
|
|
414
|
+
children: [/* @__PURE__ */ y("div", {
|
|
410
415
|
className: "min-w-0",
|
|
411
416
|
children: [
|
|
412
|
-
/* @__PURE__ */
|
|
417
|
+
/* @__PURE__ */ y("p", {
|
|
413
418
|
className: "flex items-center gap-1.5 font-medium",
|
|
414
|
-
children: [i === "in" ? /* @__PURE__ */
|
|
419
|
+
children: [i === "in" ? /* @__PURE__ */ v(e, {
|
|
415
420
|
size: 14,
|
|
416
421
|
className: "text-status-success-text"
|
|
417
|
-
}) : i === "out" ? /* @__PURE__ */
|
|
422
|
+
}) : i === "out" ? /* @__PURE__ */ v(n, {
|
|
418
423
|
size: 14,
|
|
419
424
|
className: "text-status-warning-text"
|
|
420
|
-
}) : /* @__PURE__ */
|
|
425
|
+
}) : /* @__PURE__ */ v(t, {
|
|
421
426
|
size: 14,
|
|
422
427
|
className: "text-text-secondary"
|
|
423
|
-
}),
|
|
428
|
+
}), w[r.type]]
|
|
424
429
|
}),
|
|
425
|
-
/* @__PURE__ */
|
|
430
|
+
/* @__PURE__ */ v("p", {
|
|
426
431
|
className: "truncate text-sm text-text-secondary",
|
|
427
432
|
children: a
|
|
428
433
|
}),
|
|
429
|
-
/* @__PURE__ */
|
|
434
|
+
/* @__PURE__ */ v("p", {
|
|
430
435
|
className: "text-xs text-text-secondary",
|
|
431
|
-
children:
|
|
436
|
+
children: le(r.createdAt, "short")
|
|
432
437
|
})
|
|
433
438
|
]
|
|
434
|
-
}), /* @__PURE__ */
|
|
439
|
+
}), /* @__PURE__ */ v("span", {
|
|
435
440
|
className: i === "in" ? "font-medium text-status-success-text" : i === "out" ? "font-medium text-status-warning-text" : "font-medium text-text-primary",
|
|
436
|
-
children:
|
|
441
|
+
children: T(i, r.quantity)
|
|
437
442
|
})]
|
|
438
443
|
}, r.id);
|
|
439
444
|
})
|
|
@@ -441,53 +446,53 @@ function O() {
|
|
|
441
446
|
})]
|
|
442
447
|
})]
|
|
443
448
|
}),
|
|
444
|
-
/* @__PURE__ */
|
|
449
|
+
/* @__PURE__ */ y("div", {
|
|
445
450
|
className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
|
|
446
|
-
children: [/* @__PURE__ */
|
|
447
|
-
title:
|
|
448
|
-
actions: /* @__PURE__ */
|
|
451
|
+
children: [/* @__PURE__ */ v(p, {
|
|
452
|
+
title: D("movethewheels.inventory.warehouses.title", "Warehouses"),
|
|
453
|
+
actions: /* @__PURE__ */ y(u, {
|
|
449
454
|
variant: "ghost",
|
|
450
455
|
size: "sm",
|
|
451
456
|
onClick: () => Z("inventory/warehouses"),
|
|
452
457
|
children: [
|
|
453
|
-
|
|
458
|
+
D("movethewheels.inventory.common.viewAll", "View all"),
|
|
454
459
|
" ",
|
|
455
|
-
/* @__PURE__ */
|
|
460
|
+
/* @__PURE__ */ v(i, { size: 16 })
|
|
456
461
|
]
|
|
457
462
|
}),
|
|
458
|
-
children: /* @__PURE__ */
|
|
463
|
+
children: /* @__PURE__ */ v(d, { children: /* @__PURE__ */ v(f, {
|
|
459
464
|
className: "p-0",
|
|
460
|
-
children: /* @__PURE__ */
|
|
465
|
+
children: /* @__PURE__ */ v("div", {
|
|
461
466
|
className: "divide-y",
|
|
462
|
-
children:
|
|
467
|
+
children: F.map((e) => /* @__PURE__ */ v("div", {
|
|
463
468
|
role: "button",
|
|
464
469
|
tabIndex: 0,
|
|
465
470
|
"aria-label": `View warehouse ${e.name}`,
|
|
466
471
|
className: "p-4 hover:bg-bg-sunken/50 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-bg",
|
|
467
472
|
onClick: () => Z(`inventory/warehouses/${e.id}`),
|
|
468
473
|
onKeyDown: (t) => Q(t, () => Z(`inventory/warehouses/${e.id}`)),
|
|
469
|
-
children: /* @__PURE__ */
|
|
474
|
+
children: /* @__PURE__ */ y("div", {
|
|
470
475
|
className: "flex items-center justify-between",
|
|
471
|
-
children: [/* @__PURE__ */
|
|
476
|
+
children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
|
|
472
477
|
className: "font-medium",
|
|
473
478
|
children: e.name
|
|
474
|
-
}), /* @__PURE__ */
|
|
479
|
+
}), /* @__PURE__ */ v("p", {
|
|
475
480
|
className: "text-sm text-text-secondary",
|
|
476
481
|
children: [e.address.city, e.address.state].filter(Boolean).join(", ") || "Not provided"
|
|
477
|
-
})] }), /* @__PURE__ */
|
|
482
|
+
})] }), /* @__PURE__ */ y("div", {
|
|
478
483
|
className: "text-right",
|
|
479
|
-
children: [/* @__PURE__ */
|
|
484
|
+
children: [/* @__PURE__ */ v(l, {
|
|
480
485
|
variant: e.status?.toUpperCase() === "ACTIVE" ? "default" : "secondary",
|
|
481
|
-
children: e.status ? e.status.toUpperCase() === "ACTIVE" ?
|
|
482
|
-
}), /* @__PURE__ */
|
|
486
|
+
children: e.status ? e.status.toUpperCase() === "ACTIVE" ? D("movethewheels.inventory.warehouses.active", "Active") : D("movethewheels.inventory.warehouses.inactive", "Inactive") : "Not provided"
|
|
487
|
+
}), /* @__PURE__ */ y("div", {
|
|
483
488
|
className: "mt-2",
|
|
484
|
-
children: [/* @__PURE__ */
|
|
489
|
+
children: [/* @__PURE__ */ v("p", {
|
|
485
490
|
className: "text-xs text-text-secondary",
|
|
486
|
-
children:
|
|
487
|
-
}), e.utilization === void 0 ? /* @__PURE__ */
|
|
491
|
+
children: D("movethewheels.inventory.warehouses.utilization", "Utilization")
|
|
492
|
+
}), e.utilization === void 0 ? /* @__PURE__ */ v("p", {
|
|
488
493
|
className: "text-xs text-text-tertiary",
|
|
489
494
|
children: "Not provided"
|
|
490
|
-
}) : /* @__PURE__ */
|
|
495
|
+
}) : /* @__PURE__ */ v(me, {
|
|
491
496
|
value: e.utilization,
|
|
492
497
|
className: "w-24 h-2"
|
|
493
498
|
})]
|
|
@@ -497,43 +502,43 @@ function O() {
|
|
|
497
502
|
}, e.id))
|
|
498
503
|
})
|
|
499
504
|
}) })
|
|
500
|
-
}), /* @__PURE__ */
|
|
501
|
-
title:
|
|
502
|
-
actions: /* @__PURE__ */
|
|
505
|
+
}), /* @__PURE__ */ v(p, {
|
|
506
|
+
title: D("movethewheels.inventory.products.title", "Recent Products"),
|
|
507
|
+
actions: /* @__PURE__ */ y(u, {
|
|
503
508
|
variant: "ghost",
|
|
504
509
|
size: "sm",
|
|
505
510
|
onClick: () => Z("inventory/products"),
|
|
506
511
|
children: [
|
|
507
|
-
|
|
512
|
+
D("movethewheels.inventory.common.viewAll", "View all"),
|
|
508
513
|
" ",
|
|
509
|
-
/* @__PURE__ */
|
|
514
|
+
/* @__PURE__ */ v(i, { size: 16 })
|
|
510
515
|
]
|
|
511
516
|
}),
|
|
512
|
-
children: /* @__PURE__ */
|
|
517
|
+
children: /* @__PURE__ */ v(d, { children: /* @__PURE__ */ v(f, {
|
|
513
518
|
className: "p-0",
|
|
514
|
-
children: /* @__PURE__ */
|
|
519
|
+
children: /* @__PURE__ */ v("div", {
|
|
515
520
|
className: "divide-y",
|
|
516
|
-
children:
|
|
521
|
+
children: P.slice(0, 5).map((e) => /* @__PURE__ */ v("div", {
|
|
517
522
|
role: "button",
|
|
518
523
|
tabIndex: 0,
|
|
519
524
|
"aria-label": `View product ${e.name}`,
|
|
520
525
|
className: "p-4 hover:bg-bg-sunken/50 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-bg",
|
|
521
526
|
onClick: () => Z(`inventory/products/${e.id}`),
|
|
522
527
|
onKeyDown: (t) => Q(t, () => Z(`inventory/products/${e.id}`)),
|
|
523
|
-
children: /* @__PURE__ */
|
|
528
|
+
children: /* @__PURE__ */ y("div", {
|
|
524
529
|
className: "flex items-center justify-between",
|
|
525
|
-
children: [/* @__PURE__ */
|
|
530
|
+
children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
|
|
526
531
|
className: "font-medium",
|
|
527
532
|
children: e.name
|
|
528
|
-
}), /* @__PURE__ */
|
|
533
|
+
}), /* @__PURE__ */ v("p", {
|
|
529
534
|
className: "text-sm text-text-secondary",
|
|
530
535
|
children: e.sku
|
|
531
|
-
})] }), /* @__PURE__ */
|
|
536
|
+
})] }), /* @__PURE__ */ y("div", {
|
|
532
537
|
className: "text-right",
|
|
533
|
-
children: [/* @__PURE__ */
|
|
538
|
+
children: [/* @__PURE__ */ v("p", {
|
|
534
539
|
className: "font-medium",
|
|
535
|
-
children: e.value === void 0 ? "Not provided" :
|
|
536
|
-
}), /* @__PURE__ */
|
|
540
|
+
children: e.value === void 0 ? "Not provided" : ce(e.value)
|
|
541
|
+
}), /* @__PURE__ */ v(l, {
|
|
537
542
|
variant: "outline",
|
|
538
543
|
children: e.category ?? "Not provided"
|
|
539
544
|
})]
|
|
@@ -544,12 +549,12 @@ function O() {
|
|
|
544
549
|
}) })
|
|
545
550
|
})]
|
|
546
551
|
}),
|
|
547
|
-
/* @__PURE__ */
|
|
548
|
-
open:
|
|
552
|
+
/* @__PURE__ */ v(we, {
|
|
553
|
+
open: Re,
|
|
549
554
|
onOpenChange: W,
|
|
550
555
|
onDone: X
|
|
551
556
|
}),
|
|
552
|
-
/* @__PURE__ */
|
|
557
|
+
/* @__PURE__ */ v(Ce, {
|
|
553
558
|
line: G,
|
|
554
559
|
open: G !== null,
|
|
555
560
|
onOpenChange: (e) => {
|
|
@@ -557,7 +562,7 @@ function O() {
|
|
|
557
562
|
},
|
|
558
563
|
onDone: X
|
|
559
564
|
}),
|
|
560
|
-
/* @__PURE__ */
|
|
565
|
+
/* @__PURE__ */ v(Te, {
|
|
561
566
|
line: q,
|
|
562
567
|
open: q !== null,
|
|
563
568
|
onOpenChange: (e) => {
|
|
@@ -569,4 +574,4 @@ function O() {
|
|
|
569
574
|
});
|
|
570
575
|
}
|
|
571
576
|
//#endregion
|
|
572
|
-
export {
|
|
577
|
+
export { E as default };
|