@naisys/erp 3.0.0-beta.26 → 3.0.0-beta.30
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/client-dist/assets/{index-ey6Ixpe7.js → index-CXmH80Ig.js} +292 -18
- package/client-dist/assets/{vendor-MNFI7PUp.js → vendor-DFaFIeiT.js} +39 -1
- package/client-dist/index.html +2 -2
- package/dist/erpRoutes.js +3 -2
- package/dist/erpServer.js +6 -3
- package/dist/routes/dispatch.js +85 -4
- package/dist/routes/operation-runs.js +10 -0
- package/dist/routes/order-runs.js +2 -0
- package/dist/routes/work-centers.js +1 -1
- package/dist/services/operation-run-service.js +10 -0
- package/dist/services/order-run-service.js +1 -1
- package/npm-shrinkwrap.json +28 -28
- package/package.json +6 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as __toESM } from "./rolldown-runtime-CvHMtSRF.js";
|
|
2
|
-
import { $ as
|
|
2
|
+
import { $ as union, $t as UnstyledButton, A as IconNote, At as Menu, B as IconArrowBackUp, Bt as Button, C as useForm, Ct as Select, D as IconTrash, Dt as Pagination, E as IconUpload, Et as PasswordInput, F as IconInfoCircle, Ft as Divider, G as ZodIssueCode, Gt as Anchor, H as IconAlertTriangle, Ht as Autocomplete, I as IconFile, It as Container, J as boolean, Jt as Accordion, K as _enum, Kt as Text, L as IconEye$1, Lt as Code, M as IconListDetails, Mt as Image, N as IconLayoutSidebarLeftExpand, Nt as FileButton, O as IconRobot, Ot as NumberInput, P as IconLayoutSidebarLeftCollapse, Pt as Drawer, Q as string, Qt as Popover, R as IconChevronDown, Rt as Center, S as IconCopy, St as Stack, T as IconUser, Tt as Tooltip, U as IconAlertCircle, Ut as Checkbox, V as IconApi, Vt as Badge, W as require_semver, Wt as AppShell, X as object, Xt as ActionIcon, Y as number, Yt as Group, Z as record, Zt as Loader, _ as IconRefresh, _t as Title, a as _undefined, an as require_jsx_runtime, at as Route, b as IconEyeOff, bt as Table, c as boolean$1, ct as useNavigate, d as object$1, dt as useSearchParams, en as ScrollArea, et as unknown, f as string$1, ft as Notifications, g as Markdown, gt as DatesProvider, h as remarkGfm, ht as DateInput, i as _null, in as useDebouncedValue, it as Outlet, j as IconLogout, jt as Textarea, k as IconPlus, kt as Modal, l as literal, lt as useOutletContext, m as datetime, mt as DateTimePicker, n as string$2, nn as MantineProvider, nt as Link, o as any, on as require_client, ot as Routes, p as union$1, pt as notifications, q as array, qt as Alert, r as _enum$1, rn as useDisclosure, rt as Navigate, s as array$1, sn as require_react, st as useLocation, t as number$1, tn as Box, tt as BrowserRouter, u as number$2, ut as useParams, v as IconPhoto, vt as TextInput, w as IconX, wt as SegmentedControl, x as IconDownload, xt as Switch, y as IconEye, yt as Tabs, z as IconCheck, zt as Card } from "./vendor-DFaFIeiT.js";
|
|
3
3
|
//#region \0vite/modulepreload-polyfill.js
|
|
4
4
|
(function polyfill() {
|
|
5
5
|
const relList = document.createElement("link").relList;
|
|
@@ -47,7 +47,7 @@ object({
|
|
|
47
47
|
chatEnabled: boolean().optional().describe("Show chat commands to the agent. Chat encourages more concise communication"),
|
|
48
48
|
webEnabled: boolean().optional().describe("Allow agent to browse the web with Lynx, a text based browser"),
|
|
49
49
|
completeSessionEnabled: boolean().optional().describe("Allow the agent to end its session. Once ended, it can only be restarted explicitly or via mail if wakeOnMessage is enabled. Disable on root agents to prevent the system from going unresponsive"),
|
|
50
|
-
debugPauseSeconds: number().int("Must be a whole number").min(0, "Must be non-negative").optional().describe("Seconds to wait at the debug prompt before auto-continuing, only applies when the agent's console is in focus. Unset waits indefinitely for manual input"),
|
|
50
|
+
debugPauseSeconds: number().int("Must be a whole number").min(0, "Must be non-negative").optional().describe("Seconds to wait at the debug prompt before auto-continuing, only applies when the agent's console is in focus. Set to 0 to continue immediately. Unset waits indefinitely for manual input"),
|
|
51
51
|
wakeOnMessage: boolean().optional().describe("When mail or chat is received, start the agent automatically, or wake it from its wait state"),
|
|
52
52
|
commandProtection: _enum([
|
|
53
53
|
"none",
|
|
@@ -379,6 +379,7 @@ var api = {
|
|
|
379
379
|
};
|
|
380
380
|
var apiEndpoints = {
|
|
381
381
|
dispatch: "dispatch",
|
|
382
|
+
dispatchReadyToClose: "dispatch/ready-to-close",
|
|
382
383
|
inventory: "inventory",
|
|
383
384
|
items: "items",
|
|
384
385
|
item: (key) => `items/${key}`,
|
|
@@ -1438,6 +1439,8 @@ var OperationRunSchema = object$1({
|
|
|
1438
1439
|
id: number$2(),
|
|
1439
1440
|
orderRunId: number$2(),
|
|
1440
1441
|
operationId: number$2(),
|
|
1442
|
+
revNo: number$2(),
|
|
1443
|
+
orderDescription: string$1(),
|
|
1441
1444
|
seqNo: number$2(),
|
|
1442
1445
|
title: string$1(),
|
|
1443
1446
|
description: string$1(),
|
|
@@ -1559,6 +1562,7 @@ var OrderRunSchema = object$1({
|
|
|
1559
1562
|
orderId: number$2(),
|
|
1560
1563
|
orderKey: string$1(),
|
|
1561
1564
|
revNo: number$2(),
|
|
1565
|
+
description: string$1(),
|
|
1562
1566
|
itemKey: string$1().nullable(),
|
|
1563
1567
|
instanceId: number$2().nullable(),
|
|
1564
1568
|
instanceKey: string$1().nullable(),
|
|
@@ -1642,6 +1646,30 @@ object$1({
|
|
|
1642
1646
|
_linkTemplates: array$1(HateoasLinkTemplateSchema).optional(),
|
|
1643
1647
|
_actionTemplates: array$1(HateoasActionTemplateSchema).optional()
|
|
1644
1648
|
});
|
|
1649
|
+
object$1({
|
|
1650
|
+
...paginationQuery(),
|
|
1651
|
+
priority: OrderRunPriorityEnum.optional(),
|
|
1652
|
+
search: string$1().optional()
|
|
1653
|
+
});
|
|
1654
|
+
object$1({
|
|
1655
|
+
items: array$1(object$1({
|
|
1656
|
+
id: number$2(),
|
|
1657
|
+
orderKey: string$1(),
|
|
1658
|
+
revNo: number$2(),
|
|
1659
|
+
runNo: number$2(),
|
|
1660
|
+
description: string$1(),
|
|
1661
|
+
status: OrderRunStatusEnum,
|
|
1662
|
+
priority: OrderRunPriorityEnum,
|
|
1663
|
+
dueAt: string$1().nullable(),
|
|
1664
|
+
opCount: number$2(),
|
|
1665
|
+
createdAt: datetime()
|
|
1666
|
+
})),
|
|
1667
|
+
total: number$2(),
|
|
1668
|
+
page: number$2(),
|
|
1669
|
+
pageSize: number$2(),
|
|
1670
|
+
_links: array$1(HateoasLinkSchema),
|
|
1671
|
+
_linkTemplates: array$1(HateoasLinkTemplateSchema).optional()
|
|
1672
|
+
});
|
|
1645
1673
|
/** POST create — server-generated id + self link + actions */
|
|
1646
1674
|
var CreateResponseSchema = object$1({ _actions: array$1(HateoasActionSchema).optional() }).extend({
|
|
1647
1675
|
id: number$2(),
|
|
@@ -2536,7 +2564,7 @@ var STATUS_COLORS$7 = {
|
|
|
2536
2564
|
[OperationRunStatus.skipped]: "gray",
|
|
2537
2565
|
[OperationRunStatus.failed]: "red"
|
|
2538
2566
|
};
|
|
2539
|
-
var PRIORITY_COLORS$
|
|
2567
|
+
var PRIORITY_COLORS$4 = {
|
|
2540
2568
|
low: "gray",
|
|
2541
2569
|
medium: "blue",
|
|
2542
2570
|
high: "orange",
|
|
@@ -2557,6 +2585,7 @@ var STATUS_OPTIONS = [
|
|
|
2557
2585
|
}
|
|
2558
2586
|
];
|
|
2559
2587
|
var DispatchList = () => {
|
|
2588
|
+
const navigate = useNavigate();
|
|
2560
2589
|
const [searchParams, setSearchParams] = useSearchParams();
|
|
2561
2590
|
const page = Number(searchParams.get("page")) || 1;
|
|
2562
2591
|
const status = searchParams.get("status") || void 0;
|
|
@@ -2626,6 +2655,20 @@ var DispatchList = () => {
|
|
|
2626
2655
|
children: "Dispatch"
|
|
2627
2656
|
})
|
|
2628
2657
|
}),
|
|
2658
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tabs, {
|
|
2659
|
+
value: "open",
|
|
2660
|
+
onChange: (v) => {
|
|
2661
|
+
if (v === "ready-to-close") navigate("/dispatch/ready-to-close");
|
|
2662
|
+
},
|
|
2663
|
+
mb: "md",
|
|
2664
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Tabs.List, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tabs.Tab, {
|
|
2665
|
+
value: "open",
|
|
2666
|
+
children: "Open Operations"
|
|
2667
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tabs.Tab, {
|
|
2668
|
+
value: "ready-to-close",
|
|
2669
|
+
children: "Ready to Close"
|
|
2670
|
+
})] })
|
|
2671
|
+
}),
|
|
2629
2672
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Group, {
|
|
2630
2673
|
mb: "md",
|
|
2631
2674
|
children: [
|
|
@@ -2812,7 +2855,7 @@ var DispatchList = () => {
|
|
|
2812
2855
|
to: opRunLink,
|
|
2813
2856
|
style: cellLinkStyle,
|
|
2814
2857
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Badge, {
|
|
2815
|
-
color: PRIORITY_COLORS$
|
|
2858
|
+
color: PRIORITY_COLORS$4[item.priority] ?? "gray",
|
|
2816
2859
|
variant: "light",
|
|
2817
2860
|
children: item.priority
|
|
2818
2861
|
})
|
|
@@ -2858,6 +2901,237 @@ var DispatchList = () => {
|
|
|
2858
2901
|
});
|
|
2859
2902
|
};
|
|
2860
2903
|
//#endregion
|
|
2904
|
+
//#region src/pages/dispatch/DispatchReadyToClose.tsx
|
|
2905
|
+
var PRIORITY_COLORS$3 = {
|
|
2906
|
+
low: "gray",
|
|
2907
|
+
medium: "blue",
|
|
2908
|
+
high: "orange",
|
|
2909
|
+
critical: "red"
|
|
2910
|
+
};
|
|
2911
|
+
var DispatchReadyToClose = () => {
|
|
2912
|
+
const navigate = useNavigate();
|
|
2913
|
+
const [searchParams, setSearchParams] = useSearchParams();
|
|
2914
|
+
const page = Number(searchParams.get("page")) || 1;
|
|
2915
|
+
const priority = searchParams.get("priority") || void 0;
|
|
2916
|
+
const search = searchParams.get("search") || "";
|
|
2917
|
+
const [searchInput, setSearchInput] = (0, import_react.useState)(search);
|
|
2918
|
+
const [debouncedSearch] = useDebouncedValue(searchInput, 300);
|
|
2919
|
+
const isFirstRender = (0, import_react.useRef)(true);
|
|
2920
|
+
(0, import_react.useEffect)(() => {
|
|
2921
|
+
if (isFirstRender.current) {
|
|
2922
|
+
isFirstRender.current = false;
|
|
2923
|
+
return;
|
|
2924
|
+
}
|
|
2925
|
+
setSearchParams((prev) => {
|
|
2926
|
+
if (debouncedSearch) prev.set("search", debouncedSearch);
|
|
2927
|
+
else prev.delete("search");
|
|
2928
|
+
prev.set("page", "1");
|
|
2929
|
+
return prev;
|
|
2930
|
+
});
|
|
2931
|
+
}, [debouncedSearch, setSearchParams]);
|
|
2932
|
+
const [data, setData] = (0, import_react.useState)(null);
|
|
2933
|
+
const [loading, setLoading] = (0, import_react.useState)(true);
|
|
2934
|
+
const fetchData = (0, import_react.useCallback)(async () => {
|
|
2935
|
+
setLoading(true);
|
|
2936
|
+
try {
|
|
2937
|
+
const params = new URLSearchParams();
|
|
2938
|
+
params.set("page", String(page));
|
|
2939
|
+
params.set("pageSize", "20");
|
|
2940
|
+
if (priority) params.set("priority", priority);
|
|
2941
|
+
if (search) params.set("search", search);
|
|
2942
|
+
setData(await api.get(`${apiEndpoints.dispatchReadyToClose}?${params}`));
|
|
2943
|
+
} catch (err) {
|
|
2944
|
+
showErrorNotification(err);
|
|
2945
|
+
} finally {
|
|
2946
|
+
setLoading(false);
|
|
2947
|
+
}
|
|
2948
|
+
}, [
|
|
2949
|
+
page,
|
|
2950
|
+
priority,
|
|
2951
|
+
search
|
|
2952
|
+
]);
|
|
2953
|
+
(0, import_react.useEffect)(() => {
|
|
2954
|
+
fetchData();
|
|
2955
|
+
}, [fetchData]);
|
|
2956
|
+
const totalPages = data ? Math.ceil(data.total / data.pageSize) : 0;
|
|
2957
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Container, {
|
|
2958
|
+
size: "lg",
|
|
2959
|
+
py: "xl",
|
|
2960
|
+
children: [
|
|
2961
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Group, {
|
|
2962
|
+
justify: "space-between",
|
|
2963
|
+
mb: "lg",
|
|
2964
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Title, {
|
|
2965
|
+
order: 2,
|
|
2966
|
+
children: "Dispatch"
|
|
2967
|
+
})
|
|
2968
|
+
}),
|
|
2969
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tabs, {
|
|
2970
|
+
value: "ready-to-close",
|
|
2971
|
+
onChange: (v) => {
|
|
2972
|
+
if (v === "open") navigate("/dispatch");
|
|
2973
|
+
},
|
|
2974
|
+
mb: "md",
|
|
2975
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Tabs.List, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tabs.Tab, {
|
|
2976
|
+
value: "open",
|
|
2977
|
+
children: "Open Operations"
|
|
2978
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tabs.Tab, {
|
|
2979
|
+
value: "ready-to-close",
|
|
2980
|
+
children: "Ready to Close"
|
|
2981
|
+
})] })
|
|
2982
|
+
}),
|
|
2983
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Group, {
|
|
2984
|
+
mb: "md",
|
|
2985
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(TextInput, {
|
|
2986
|
+
placeholder: "Search order key or description...",
|
|
2987
|
+
value: searchInput,
|
|
2988
|
+
onChange: (e) => setSearchInput(e.currentTarget.value),
|
|
2989
|
+
style: { flex: 1 }
|
|
2990
|
+
}), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Select, {
|
|
2991
|
+
placeholder: "All priorities",
|
|
2992
|
+
data: OrderRunPriorityEnum.options.map((v) => ({
|
|
2993
|
+
value: v,
|
|
2994
|
+
label: v.charAt(0).toUpperCase() + v.slice(1)
|
|
2995
|
+
})),
|
|
2996
|
+
value: priority ?? null,
|
|
2997
|
+
onChange: (val) => {
|
|
2998
|
+
setSearchParams((prev) => {
|
|
2999
|
+
if (val) prev.set("priority", val);
|
|
3000
|
+
else prev.delete("priority");
|
|
3001
|
+
prev.set("page", "1");
|
|
3002
|
+
return prev;
|
|
3003
|
+
});
|
|
3004
|
+
},
|
|
3005
|
+
clearable: true
|
|
3006
|
+
})]
|
|
3007
|
+
}),
|
|
3008
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Stack, {
|
|
3009
|
+
align: "center",
|
|
3010
|
+
py: "xl",
|
|
3011
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Loader, {})
|
|
3012
|
+
}) : data && data.items.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Table, {
|
|
3013
|
+
striped: true,
|
|
3014
|
+
highlightOnHover: true,
|
|
3015
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Table.Thead, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Table.Tr, { children: [
|
|
3016
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Table.Th, { children: "Order / Run" }),
|
|
3017
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Table.Th, { children: "Description" }),
|
|
3018
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Table.Th, { children: "Status" }),
|
|
3019
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Table.Th, { children: "Priority" }),
|
|
3020
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Table.Th, { children: "Ops" }),
|
|
3021
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Table.Th, { children: "Due" })
|
|
3022
|
+
] }) }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Table.Tbody, { children: data.items.map((item) => {
|
|
3023
|
+
const runLink = `/orders/${item.orderKey}/runs/${item.runNo}`;
|
|
3024
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Table.Tr, {
|
|
3025
|
+
style: { cursor: "pointer" },
|
|
3026
|
+
children: [
|
|
3027
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Table.Td, {
|
|
3028
|
+
style: { padding: 0 },
|
|
3029
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, {
|
|
3030
|
+
to: runLink,
|
|
3031
|
+
style: cellLinkStyle,
|
|
3032
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Group, {
|
|
3033
|
+
gap: "xs",
|
|
3034
|
+
wrap: "nowrap",
|
|
3035
|
+
children: [
|
|
3036
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
3037
|
+
size: "sm",
|
|
3038
|
+
ff: "monospace",
|
|
3039
|
+
children: item.orderKey
|
|
3040
|
+
}),
|
|
3041
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Badge, {
|
|
3042
|
+
color: "violet",
|
|
3043
|
+
variant: "light",
|
|
3044
|
+
size: "sm",
|
|
3045
|
+
children: ["R", item.revNo]
|
|
3046
|
+
}),
|
|
3047
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, {
|
|
3048
|
+
size: "sm",
|
|
3049
|
+
ff: "monospace",
|
|
3050
|
+
children: ["#", item.runNo]
|
|
3051
|
+
})
|
|
3052
|
+
]
|
|
3053
|
+
})
|
|
3054
|
+
})
|
|
3055
|
+
}),
|
|
3056
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Table.Td, {
|
|
3057
|
+
style: { padding: 0 },
|
|
3058
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, {
|
|
3059
|
+
to: runLink,
|
|
3060
|
+
style: cellLinkStyle,
|
|
3061
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
3062
|
+
size: "sm",
|
|
3063
|
+
lineClamp: 1,
|
|
3064
|
+
children: item.description
|
|
3065
|
+
})
|
|
3066
|
+
})
|
|
3067
|
+
}),
|
|
3068
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Table.Td, {
|
|
3069
|
+
style: { padding: 0 },
|
|
3070
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, {
|
|
3071
|
+
to: runLink,
|
|
3072
|
+
style: cellLinkStyle,
|
|
3073
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Badge, {
|
|
3074
|
+
color: "blue",
|
|
3075
|
+
variant: "light",
|
|
3076
|
+
children: item.status
|
|
3077
|
+
})
|
|
3078
|
+
})
|
|
3079
|
+
}),
|
|
3080
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Table.Td, {
|
|
3081
|
+
style: { padding: 0 },
|
|
3082
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, {
|
|
3083
|
+
to: runLink,
|
|
3084
|
+
style: cellLinkStyle,
|
|
3085
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Badge, {
|
|
3086
|
+
color: PRIORITY_COLORS$3[item.priority] ?? "gray",
|
|
3087
|
+
variant: "light",
|
|
3088
|
+
children: item.priority
|
|
3089
|
+
})
|
|
3090
|
+
})
|
|
3091
|
+
}),
|
|
3092
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Table.Td, {
|
|
3093
|
+
style: { padding: 0 },
|
|
3094
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, {
|
|
3095
|
+
to: runLink,
|
|
3096
|
+
style: cellLinkStyle,
|
|
3097
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
3098
|
+
size: "sm",
|
|
3099
|
+
children: item.opCount
|
|
3100
|
+
})
|
|
3101
|
+
})
|
|
3102
|
+
}),
|
|
3103
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Table.Td, {
|
|
3104
|
+
style: { padding: 0 },
|
|
3105
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, {
|
|
3106
|
+
to: runLink,
|
|
3107
|
+
style: cellLinkStyle,
|
|
3108
|
+
children: item.dueAt ? new Date(item.dueAt).toLocaleDateString() : "—"
|
|
3109
|
+
})
|
|
3110
|
+
})
|
|
3111
|
+
]
|
|
3112
|
+
}, item.id);
|
|
3113
|
+
}) })]
|
|
3114
|
+
}), totalPages > 1 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Group, {
|
|
3115
|
+
justify: "center",
|
|
3116
|
+
mt: "md",
|
|
3117
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Pagination, {
|
|
3118
|
+
total: totalPages,
|
|
3119
|
+
value: page,
|
|
3120
|
+
onChange: (p) => setSearchParams((prev) => {
|
|
3121
|
+
prev.set("page", String(p));
|
|
3122
|
+
return prev;
|
|
3123
|
+
})
|
|
3124
|
+
})
|
|
3125
|
+
})] }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
3126
|
+
c: "dimmed",
|
|
3127
|
+
ta: "center",
|
|
3128
|
+
py: "xl",
|
|
3129
|
+
children: "No order runs ready to close."
|
|
3130
|
+
})
|
|
3131
|
+
]
|
|
3132
|
+
});
|
|
3133
|
+
};
|
|
3134
|
+
//#endregion
|
|
2861
3135
|
//#region src/pages/inventory/InventoryList.tsx
|
|
2862
3136
|
var InventoryList = () => {
|
|
2863
3137
|
const [searchParams, setSearchParams] = useSearchParams();
|
|
@@ -7378,15 +7652,8 @@ var HeaderRunDetail = () => {
|
|
|
7378
7652
|
const { orderKey, runNo } = useParams();
|
|
7379
7653
|
const { orderRun, onOrderRunUpdate } = useOutletContext();
|
|
7380
7654
|
const [editing, setEditing] = (0, import_react.useState)(false);
|
|
7381
|
-
const [revDescription, setRevDescription] = (0, import_react.useState)(null);
|
|
7382
7655
|
const [operations, setOperations] = (0, import_react.useState)(null);
|
|
7383
7656
|
const [opsLoading, setOpsLoading] = (0, import_react.useState)(true);
|
|
7384
|
-
const fetchRevision = (0, import_react.useCallback)(async () => {
|
|
7385
|
-
if (!orderKey) return;
|
|
7386
|
-
try {
|
|
7387
|
-
setRevDescription((await api.get(apiEndpoints.orderRev(orderKey, orderRun.revNo))).description || null);
|
|
7388
|
-
} catch {}
|
|
7389
|
-
}, [orderKey, orderRun.revNo]);
|
|
7390
7657
|
const fetchOperations = (0, import_react.useCallback)(async () => {
|
|
7391
7658
|
if (!orderKey || !runNo) return;
|
|
7392
7659
|
setOpsLoading(true);
|
|
@@ -7399,9 +7666,8 @@ var HeaderRunDetail = () => {
|
|
|
7399
7666
|
}
|
|
7400
7667
|
}, [orderKey, runNo]);
|
|
7401
7668
|
(0, import_react.useEffect)(() => {
|
|
7402
|
-
fetchRevision();
|
|
7403
7669
|
fetchOperations();
|
|
7404
|
-
}, [
|
|
7670
|
+
}, [fetchOperations]);
|
|
7405
7671
|
const handleUpdate = async (data) => {
|
|
7406
7672
|
try {
|
|
7407
7673
|
onOrderRunUpdate(await api.put(apiEndpoints.orderRun(orderKey, runNo), data));
|
|
@@ -7474,7 +7740,7 @@ var HeaderRunDetail = () => {
|
|
|
7474
7740
|
fw: 600,
|
|
7475
7741
|
w: 140,
|
|
7476
7742
|
children: "Description:"
|
|
7477
|
-
}),
|
|
7743
|
+
}), orderRun.description ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompactMarkdown, { children: orderRun.description }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
7478
7744
|
c: "dimmed",
|
|
7479
7745
|
children: "—"
|
|
7480
7746
|
})]
|
|
@@ -9912,10 +10178,14 @@ var UserList = () => {
|
|
|
9912
10178
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, {
|
|
9913
10179
|
to: `/users/${item.username}`,
|
|
9914
10180
|
style: cellLinkStyle,
|
|
9915
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.
|
|
9916
|
-
|
|
9917
|
-
|
|
9918
|
-
children: item.
|
|
10181
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Group, {
|
|
10182
|
+
gap: 6,
|
|
10183
|
+
wrap: "nowrap",
|
|
10184
|
+
children: [item.isAgent ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IconRobot, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(IconUser, { size: 16 }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, {
|
|
10185
|
+
size: "sm",
|
|
10186
|
+
ff: "monospace",
|
|
10187
|
+
children: item.username
|
|
10188
|
+
})]
|
|
9919
10189
|
})
|
|
9920
10190
|
})
|
|
9921
10191
|
}),
|
|
@@ -10588,6 +10858,10 @@ var AppContent = () => {
|
|
|
10588
10858
|
path: "/dispatch",
|
|
10589
10859
|
element: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DispatchList, {})
|
|
10590
10860
|
}),
|
|
10861
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Route, {
|
|
10862
|
+
path: "/dispatch/ready-to-close",
|
|
10863
|
+
element: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DispatchReadyToClose, {})
|
|
10864
|
+
}),
|
|
10591
10865
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Route, {
|
|
10592
10866
|
path: "/inventory",
|
|
10593
10867
|
element: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(InventoryList, {})
|
|
@@ -39965,6 +39965,44 @@ var IconPlus = createReactComponent$1("outline", "plus", "Plus", [["path", {
|
|
|
39965
39965
|
"d": "M5 12l14 0",
|
|
39966
39966
|
"key": "svg-1"
|
|
39967
39967
|
}]]);
|
|
39968
|
+
var IconRobot = createReactComponent$1("outline", "robot", "Robot", [
|
|
39969
|
+
["path", {
|
|
39970
|
+
"d": "M6 6a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2l0 -4",
|
|
39971
|
+
"key": "svg-0"
|
|
39972
|
+
}],
|
|
39973
|
+
["path", {
|
|
39974
|
+
"d": "M12 2v2",
|
|
39975
|
+
"key": "svg-1"
|
|
39976
|
+
}],
|
|
39977
|
+
["path", {
|
|
39978
|
+
"d": "M9 12v9",
|
|
39979
|
+
"key": "svg-2"
|
|
39980
|
+
}],
|
|
39981
|
+
["path", {
|
|
39982
|
+
"d": "M15 12v9",
|
|
39983
|
+
"key": "svg-3"
|
|
39984
|
+
}],
|
|
39985
|
+
["path", {
|
|
39986
|
+
"d": "M5 16l4 -2",
|
|
39987
|
+
"key": "svg-4"
|
|
39988
|
+
}],
|
|
39989
|
+
["path", {
|
|
39990
|
+
"d": "M15 14l4 2",
|
|
39991
|
+
"key": "svg-5"
|
|
39992
|
+
}],
|
|
39993
|
+
["path", {
|
|
39994
|
+
"d": "M9 18h6",
|
|
39995
|
+
"key": "svg-6"
|
|
39996
|
+
}],
|
|
39997
|
+
["path", {
|
|
39998
|
+
"d": "M10 8v.01",
|
|
39999
|
+
"key": "svg-7"
|
|
40000
|
+
}],
|
|
40001
|
+
["path", {
|
|
40002
|
+
"d": "M14 8v.01",
|
|
40003
|
+
"key": "svg-8"
|
|
40004
|
+
}]
|
|
40005
|
+
]);
|
|
39968
40006
|
var IconTrash = createReactComponent$1("outline", "trash", "Trash", [
|
|
39969
40007
|
["path", {
|
|
39970
40008
|
"d": "M4 7l16 0",
|
|
@@ -66138,4 +66176,4 @@ function number(params) {
|
|
|
66138
66176
|
return /* @__PURE__ */ _coercedNumber(ZodNumber, params);
|
|
66139
66177
|
}
|
|
66140
66178
|
//#endregion
|
|
66141
|
-
export {
|
|
66179
|
+
export { union$1 as $, UnstyledButton as $t, IconNote as A, Menu as At, IconArrowBackUp as B, Button as Bt, useForm as C, Select as Ct, IconTrash as D, Pagination as Dt, IconUpload as E, PasswordInput as Et, IconInfoCircle as F, Divider as Ft, ZodIssueCode as G, Anchor as Gt, IconAlertTriangle as H, Autocomplete as Ht, IconFile as I, Container as It, boolean$3 as J, Accordion as Jt, _enum$1 as K, Text as Kt, IconEye$1 as L, Code as Lt, IconListDetails as M, Image as Mt, IconLayoutSidebarLeftExpand as N, FileButton as Nt, IconRobot as O, NumberInput as Ot, IconLayoutSidebarLeftCollapse as P, Drawer as Pt, string$5 as Q, Popover as Qt, IconChevronDown as R, Center as Rt, IconCopy as S, Stack as St, IconUser as T, Tooltip as Tt, IconAlertCircle as U, Checkbox as Ut, IconApi as V, Badge as Vt, require_semver as W, AppShell as Wt, object$1 as X, ActionIcon as Xt, number$4 as Y, Group as Yt, record as Z, Loader as Zt, IconRefresh as _, Title as _t, _undefined as a, require_jsx_runtime as an, Route as at, IconEyeOff as b, Table as bt, boolean as c, useNavigate as ct, object as d, useSearchParams as dt, ScrollArea as en, unknown$1 as et, string$1 as f, Notifications as ft, Markdown as g, DatesProvider as gt, remarkGfm as h, DateInput as ht, _null as i, useDebouncedValue as in, Outlet as it, IconLogout as j, Textarea as jt, IconPlus as k, Modal as kt, literal as l, useOutletContext as lt, datetime as m, DateTimePicker as mt, string as n, MantineProvider as nn, Link as nt, any as o, require_client as on, Routes as ot, union as p, notifications as pt, array$1 as q, Alert as qt, _enum as r, useDisclosure as rn, Navigate as rt, array as s, require_react as sn, useLocation as st, number as t, Box as tn, BrowserRouter as tt, number$1 as u, useParams as ut, IconPhoto as v, TextInput as vt, IconX as w, SegmentedControl as wt, IconDownload as x, Switch as xt, IconEye as y, Tabs as yt, IconCheck as z, Card as zt };
|
package/client-dist/index.html
CHANGED
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
<meta name="format-detection" content="telephone=no" />
|
|
34
34
|
|
|
35
35
|
<title>NAISYS ERP</title>
|
|
36
|
-
<script type="module" crossorigin src="/erp/assets/index-
|
|
36
|
+
<script type="module" crossorigin src="/erp/assets/index-CXmH80Ig.js"></script>
|
|
37
37
|
<link rel="modulepreload" crossorigin href="/erp/assets/rolldown-runtime-CvHMtSRF.js">
|
|
38
|
-
<link rel="modulepreload" crossorigin href="/erp/assets/vendor-
|
|
38
|
+
<link rel="modulepreload" crossorigin href="/erp/assets/vendor-DFaFIeiT.js">
|
|
39
39
|
<link rel="stylesheet" crossorigin href="/erp/assets/vendor-CLUPjUnv.css">
|
|
40
40
|
<link rel="stylesheet" crossorigin href="/erp/assets/index-CSiMTJfw.css">
|
|
41
41
|
</head>
|
package/dist/erpRoutes.js
CHANGED
|
@@ -26,11 +26,11 @@ import stepRunFieldRoutes from "./routes/step-run-fields.js";
|
|
|
26
26
|
import stepRunTransitionRoutes from "./routes/step-run-transitions.js";
|
|
27
27
|
import stepRunRoutes from "./routes/step-runs.js";
|
|
28
28
|
import stepRoutes from "./routes/steps.js";
|
|
29
|
-
import { isSupervisorAuth } from "./supervisorAuth.js";
|
|
30
29
|
import userPermissionRoutes from "./routes/user-permissions.js";
|
|
31
30
|
import userRoutes from "./routes/users.js";
|
|
32
31
|
import workCenterRoutes from "./routes/work-centers.js";
|
|
33
|
-
|
|
32
|
+
import { isSupervisorAuth } from "./supervisorAuth.js";
|
|
33
|
+
export const erpRoutes = (fastify) => {
|
|
34
34
|
fastify.register(adminRoutes, { prefix: "/erp/api/admin" });
|
|
35
35
|
fastify.register(auditRoutes, { prefix: "/erp/api/audit" });
|
|
36
36
|
fastify.register(authRoutes, { prefix: "/erp/api/auth" });
|
|
@@ -110,5 +110,6 @@ export const erpRoutes = async (fastify) => {
|
|
|
110
110
|
publicRead: process.env.PUBLIC_READ === "true",
|
|
111
111
|
supervisorAuth: isSupervisorAuth(),
|
|
112
112
|
}));
|
|
113
|
+
return Promise.resolve();
|
|
113
114
|
};
|
|
114
115
|
//# sourceMappingURL=erpRoutes.js.map
|
package/dist/erpServer.js
CHANGED
|
@@ -188,7 +188,11 @@ if (process.argv[1] === fileURLToPath(import.meta.url)) {
|
|
|
188
188
|
type: "fields",
|
|
189
189
|
comment: "ERP configuration",
|
|
190
190
|
fields: [
|
|
191
|
-
{
|
|
191
|
+
{
|
|
192
|
+
key: "NAISYS_FOLDER",
|
|
193
|
+
label: "NAISYS Data Folder",
|
|
194
|
+
defaultValue: cwdWithTilde(),
|
|
195
|
+
},
|
|
192
196
|
{ key: "SERVER_PORT", label: "Server Port" },
|
|
193
197
|
{ key: "SUPERVISOR_AUTH", label: "Use Supervisor for Auth" },
|
|
194
198
|
{ key: "PUBLIC_READ", label: "Public Read Access" },
|
|
@@ -202,8 +206,7 @@ if (process.argv[1] === fileURLToPath(import.meta.url)) {
|
|
|
202
206
|
wizardRan = await runSetupWizard(path.resolve(".env"), erpExampleUrl, erpWizardConfig);
|
|
203
207
|
expandNaisysFolder();
|
|
204
208
|
}
|
|
205
|
-
wizardRan =
|
|
206
|
-
(await ensureDotEnv(erpExampleUrl, erpWizardConfig)) || wizardRan;
|
|
209
|
+
wizardRan = (await ensureDotEnv(erpExampleUrl, erpWizardConfig)) || wizardRan;
|
|
207
210
|
void startServer(wizardRan);
|
|
208
211
|
}
|
|
209
212
|
//# sourceMappingURL=erpServer.js.map
|
package/dist/routes/dispatch.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DispatchListQuerySchema, DispatchListResponseSchema, OperationRunStatus, OrderRunStatus, } from "@naisys/erp-shared";
|
|
1
|
+
import { DispatchListQuerySchema, DispatchListResponseSchema, OperationRunStatus, OrderRunStatus, ReadyToCloseListQuerySchema, ReadyToCloseListResponseSchema, } from "@naisys/erp-shared";
|
|
2
2
|
import erpDb from "../erpDb.js";
|
|
3
3
|
import { API_PREFIX, paginationLinks } from "../hateoas.js";
|
|
4
4
|
import { getUserWorkCenterIds } from "../services/work-center-service.js";
|
|
@@ -64,9 +64,7 @@ export default function dispatchRoutes(fastify) {
|
|
|
64
64
|
// Intersect with the requested status filter
|
|
65
65
|
const currentStatuses = status ? [status] : DEFAULT_OP_STATUSES;
|
|
66
66
|
const filteredStatuses = currentStatuses.filter((s) => workableStatuses.includes(s));
|
|
67
|
-
where.status = {
|
|
68
|
-
in: filteredStatuses.length > 0 ? filteredStatuses : ["__none__"],
|
|
69
|
-
};
|
|
67
|
+
where.status = { in: filteredStatuses };
|
|
70
68
|
// Work center access
|
|
71
69
|
if (userWcIds.length > 0) {
|
|
72
70
|
where.operation = {
|
|
@@ -147,6 +145,11 @@ export default function dispatchRoutes(fastify) {
|
|
|
147
145
|
canWork: canWork ? "true" : undefined,
|
|
148
146
|
clockedIn: clockedIn ? "true" : undefined,
|
|
149
147
|
}),
|
|
148
|
+
{
|
|
149
|
+
rel: "ready-to-close",
|
|
150
|
+
href: `${API_PREFIX}/dispatch/ready-to-close`,
|
|
151
|
+
title: "Ready to Close",
|
|
152
|
+
},
|
|
150
153
|
{
|
|
151
154
|
rel: "work-centers",
|
|
152
155
|
href: `${API_PREFIX}/work-centers`,
|
|
@@ -170,5 +173,83 @@ export default function dispatchRoutes(fastify) {
|
|
|
170
173
|
};
|
|
171
174
|
},
|
|
172
175
|
});
|
|
176
|
+
app.get("/ready-to-close", {
|
|
177
|
+
schema: {
|
|
178
|
+
description: "List open order runs whose operations are all completed or skipped (ready to close)",
|
|
179
|
+
tags: ["Dispatch"],
|
|
180
|
+
querystring: ReadyToCloseListQuerySchema,
|
|
181
|
+
response: {
|
|
182
|
+
200: ReadyToCloseListResponseSchema,
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
handler: async (request) => {
|
|
186
|
+
const { page, pageSize, priority, search } = request.query;
|
|
187
|
+
const where = {
|
|
188
|
+
status: { in: OPEN_ORDER_STATUSES },
|
|
189
|
+
operationRuns: {
|
|
190
|
+
none: {
|
|
191
|
+
status: {
|
|
192
|
+
notIn: [OperationRunStatus.completed, OperationRunStatus.skipped],
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
...(priority ? { priority } : {}),
|
|
197
|
+
};
|
|
198
|
+
if (search) {
|
|
199
|
+
where.OR = [
|
|
200
|
+
{ order: { key: { contains: search } } },
|
|
201
|
+
{ orderRev: { description: { contains: search } } },
|
|
202
|
+
];
|
|
203
|
+
}
|
|
204
|
+
const [items, total] = await Promise.all([
|
|
205
|
+
erpDb.orderRun.findMany({
|
|
206
|
+
where,
|
|
207
|
+
include: {
|
|
208
|
+
order: { select: { key: true } },
|
|
209
|
+
orderRev: { select: { revNo: true, description: true } },
|
|
210
|
+
_count: { select: { operationRuns: true } },
|
|
211
|
+
},
|
|
212
|
+
skip: (page - 1) * pageSize,
|
|
213
|
+
take: pageSize,
|
|
214
|
+
orderBy: { dueAt: "asc" },
|
|
215
|
+
}),
|
|
216
|
+
erpDb.orderRun.count({ where }),
|
|
217
|
+
]);
|
|
218
|
+
return {
|
|
219
|
+
items: items.map((run) => ({
|
|
220
|
+
id: run.id,
|
|
221
|
+
orderKey: run.order.key,
|
|
222
|
+
revNo: run.orderRev.revNo,
|
|
223
|
+
runNo: run.runNo,
|
|
224
|
+
description: run.orderRev.description,
|
|
225
|
+
status: run.status,
|
|
226
|
+
priority: run.priority,
|
|
227
|
+
dueAt: run.dueAt,
|
|
228
|
+
opCount: run._count.operationRuns,
|
|
229
|
+
createdAt: run.createdAt.toISOString(),
|
|
230
|
+
})),
|
|
231
|
+
total,
|
|
232
|
+
page,
|
|
233
|
+
pageSize,
|
|
234
|
+
_links: [
|
|
235
|
+
...paginationLinks("dispatch/ready-to-close", page, pageSize, total, {
|
|
236
|
+
priority,
|
|
237
|
+
search,
|
|
238
|
+
}),
|
|
239
|
+
{
|
|
240
|
+
rel: "dispatch",
|
|
241
|
+
href: `${API_PREFIX}/dispatch`,
|
|
242
|
+
title: "Open Operations",
|
|
243
|
+
},
|
|
244
|
+
],
|
|
245
|
+
_linkTemplates: [
|
|
246
|
+
{
|
|
247
|
+
rel: "item",
|
|
248
|
+
hrefTemplate: `${API_PREFIX}/orders/{orderKey}/runs/{runNo}`,
|
|
249
|
+
},
|
|
250
|
+
],
|
|
251
|
+
};
|
|
252
|
+
},
|
|
253
|
+
});
|
|
173
254
|
}
|
|
174
255
|
//# sourceMappingURL=dispatch.js.map
|
|
@@ -122,10 +122,13 @@ export async function formatOpRun(orderKey, runNo, user, opRun) {
|
|
|
122
122
|
getOpRunStepSummary(opRun.id),
|
|
123
123
|
getOpRunFieldRefSummary(opRun.operationId, opRun.orderRunId, orderKey, runNo),
|
|
124
124
|
]);
|
|
125
|
+
const revNo = opRun.orderRun.orderRev.revNo;
|
|
125
126
|
return {
|
|
126
127
|
id: opRun.id,
|
|
127
128
|
orderRunId: opRun.orderRunId,
|
|
128
129
|
operationId: opRun.operationId,
|
|
130
|
+
revNo,
|
|
131
|
+
orderDescription: opRun.orderRun.orderRev.description,
|
|
129
132
|
seqNo,
|
|
130
133
|
title: opRun.operation.title,
|
|
131
134
|
description: opRun.operation.description,
|
|
@@ -148,6 +151,11 @@ export async function formatOpRun(orderKey, runNo, user, opRun) {
|
|
|
148
151
|
...formatAuditFields(opRun),
|
|
149
152
|
_links: [
|
|
150
153
|
...childItemLinks("/" + opRunResource(orderKey, runNo), seqNo, "Operation Runs", "/orders/" + orderKey + "/runs/" + runNo, "Order Run", "OperationRun", "run"),
|
|
154
|
+
{
|
|
155
|
+
rel: "order-revision",
|
|
156
|
+
href: `${API_PREFIX}/orders/${orderKey}/revs/${revNo}`,
|
|
157
|
+
title: "Order Revision",
|
|
158
|
+
},
|
|
151
159
|
{
|
|
152
160
|
rel: "steps",
|
|
153
161
|
href: `${API_PREFIX}/${opRunResource(orderKey, runNo)}/${seqNo}/steps`,
|
|
@@ -186,6 +194,8 @@ function formatListOpRun(opRun) {
|
|
|
186
194
|
id: opRun.id,
|
|
187
195
|
orderRunId: opRun.orderRunId,
|
|
188
196
|
operationId: opRun.operationId,
|
|
197
|
+
revNo: opRun.orderRun.orderRev.revNo,
|
|
198
|
+
orderDescription: opRun.orderRun.orderRev.description,
|
|
189
199
|
seqNo,
|
|
190
200
|
title: opRun.operation.title,
|
|
191
201
|
description: opRun.operation.description,
|
|
@@ -116,6 +116,7 @@ export async function formatRun(orderKey, user, run) {
|
|
|
116
116
|
orderId: run.orderId,
|
|
117
117
|
orderKey,
|
|
118
118
|
revNo: run.orderRev.revNo,
|
|
119
|
+
description: run.orderRev.description,
|
|
119
120
|
itemKey,
|
|
120
121
|
instanceId: instance?.id ?? null,
|
|
121
122
|
instanceKey: instance?.key ?? null,
|
|
@@ -143,6 +144,7 @@ function formatListRun(orderKey, run) {
|
|
|
143
144
|
orderId: run.orderId,
|
|
144
145
|
orderKey,
|
|
145
146
|
revNo: run.orderRev.revNo,
|
|
147
|
+
description: run.orderRev.description,
|
|
146
148
|
itemKey,
|
|
147
149
|
instanceId: instance?.id ?? null,
|
|
148
150
|
instanceKey: instance?.key ?? null,
|
|
@@ -3,7 +3,7 @@ import { z } from "zod/v4";
|
|
|
3
3
|
import { hasPermission, requirePermission } from "../auth-middleware.js";
|
|
4
4
|
import { notFound } from "../error-handler.js";
|
|
5
5
|
import { API_PREFIX, collectionLink, paginationLinks, schemaLink, selfLink, } from "../hateoas.js";
|
|
6
|
-
import { formatAuditFields, mutationResult, permGate } from "../route-helpers.js";
|
|
6
|
+
import { formatAuditFields, mutationResult, permGate, } from "../route-helpers.js";
|
|
7
7
|
import { assignUser, createWorkCenter, deleteWorkCenter, findExisting, listWorkCenters, removeUser, updateWorkCenter, } from "../services/work-center-service.js";
|
|
8
8
|
const RESOURCE = "work-centers";
|
|
9
9
|
const KeyParamsSchema = z.object({
|
|
@@ -14,6 +14,11 @@ export const includeOp = {
|
|
|
14
14
|
workCenter: { select: { key: true } },
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
|
+
orderRun: {
|
|
18
|
+
select: {
|
|
19
|
+
orderRev: { select: { revNo: true, description: true } },
|
|
20
|
+
},
|
|
21
|
+
},
|
|
17
22
|
assignedTo: { select: { username: true } },
|
|
18
23
|
createdBy: { select: { username: true } },
|
|
19
24
|
updatedBy: { select: { username: true } },
|
|
@@ -35,6 +40,11 @@ export async function listOpRuns(runId) {
|
|
|
35
40
|
},
|
|
36
41
|
},
|
|
37
42
|
},
|
|
43
|
+
orderRun: {
|
|
44
|
+
select: {
|
|
45
|
+
orderRev: { select: { revNo: true, description: true } },
|
|
46
|
+
},
|
|
47
|
+
},
|
|
38
48
|
_count: { select: { stepRuns: true } },
|
|
39
49
|
assignedTo: { select: { username: true } },
|
|
40
50
|
createdBy: { select: { username: true } },
|
|
@@ -4,7 +4,7 @@ import erpDb from "../erpDb.js";
|
|
|
4
4
|
import { deserializeFieldValue, upsertFieldValue, validateFieldSet, } from "./field-value-service.js";
|
|
5
5
|
// --- Prisma include & result type ---
|
|
6
6
|
export const includeRev = {
|
|
7
|
-
orderRev: { select: { revNo: true } },
|
|
7
|
+
orderRev: { select: { revNo: true, description: true } },
|
|
8
8
|
order: { select: { item: { select: { key: true } } } },
|
|
9
9
|
itemInstances: { select: { id: true, key: true }, take: 1 },
|
|
10
10
|
createdBy: { select: { username: true } },
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naisys/erp",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.30",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@naisys/erp",
|
|
9
|
-
"version": "3.0.0-beta.
|
|
9
|
+
"version": "3.0.0-beta.30",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@fastify/cookie": "^11.0.2",
|
|
12
12
|
"@fastify/cors": "^11.2.0",
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
"@fastify/rate-limit": "^10.3.0",
|
|
15
15
|
"@fastify/static": "^9.0.0",
|
|
16
16
|
"@fastify/swagger": "^9.7.0",
|
|
17
|
-
"@naisys/common": "3.0.0-beta.
|
|
18
|
-
"@naisys/common-node": "3.0.0-beta.
|
|
19
|
-
"@naisys/erp-shared": "3.0.0-beta.
|
|
20
|
-
"@naisys/hub-database": "3.0.0-beta.
|
|
21
|
-
"@naisys/supervisor-database": "3.0.0-beta.
|
|
17
|
+
"@naisys/common": "3.0.0-beta.30",
|
|
18
|
+
"@naisys/common-node": "3.0.0-beta.30",
|
|
19
|
+
"@naisys/erp-shared": "3.0.0-beta.30",
|
|
20
|
+
"@naisys/hub-database": "3.0.0-beta.30",
|
|
21
|
+
"@naisys/supervisor-database": "3.0.0-beta.30",
|
|
22
22
|
"@prisma/adapter-better-sqlite3": "^7.5.0",
|
|
23
23
|
"@prisma/client": "^7.5.0",
|
|
24
24
|
"@scalar/fastify-api-reference": "^1.48.7",
|
|
@@ -444,41 +444,41 @@
|
|
|
444
444
|
}
|
|
445
445
|
},
|
|
446
446
|
"node_modules/@naisys/common": {
|
|
447
|
-
"version": "3.0.0-beta.
|
|
448
|
-
"resolved": "https://registry.npmjs.org/@naisys/common/-/common-3.0.0-beta.
|
|
449
|
-
"integrity": "sha512-
|
|
447
|
+
"version": "3.0.0-beta.30",
|
|
448
|
+
"resolved": "https://registry.npmjs.org/@naisys/common/-/common-3.0.0-beta.30.tgz",
|
|
449
|
+
"integrity": "sha512-xccdzzGpPLAi1kxatmQNUF9ojDkGM9L2s5ZiRsDmllZs8Y5tANZmHd9HhFwLHtncxAhRGwOWfBS/5jyz5UYpcw==",
|
|
450
450
|
"dependencies": {
|
|
451
451
|
"semver": "^7.7.4",
|
|
452
452
|
"zod": "^4.3.6"
|
|
453
453
|
}
|
|
454
454
|
},
|
|
455
455
|
"node_modules/@naisys/common-node": {
|
|
456
|
-
"version": "3.0.0-beta.
|
|
457
|
-
"resolved": "https://registry.npmjs.org/@naisys/common-node/-/common-node-3.0.0-beta.
|
|
458
|
-
"integrity": "sha512-
|
|
456
|
+
"version": "3.0.0-beta.30",
|
|
457
|
+
"resolved": "https://registry.npmjs.org/@naisys/common-node/-/common-node-3.0.0-beta.30.tgz",
|
|
458
|
+
"integrity": "sha512-jhF7BMn1rwu4US8AkISH3IrLI9r6Plr3Nl0gvIvbRLUH9DKGTn/U+aZM5uB10rFXD7CV2aMTs4sKfkd/66cTSw==",
|
|
459
459
|
"dependencies": {
|
|
460
|
-
"@naisys/common": "3.0.0-beta.
|
|
460
|
+
"@naisys/common": "3.0.0-beta.30",
|
|
461
461
|
"better-sqlite3": "^12.6.2",
|
|
462
462
|
"js-yaml": "^4.1.1",
|
|
463
463
|
"pino": "^10.3.1"
|
|
464
464
|
}
|
|
465
465
|
},
|
|
466
466
|
"node_modules/@naisys/erp-shared": {
|
|
467
|
-
"version": "3.0.0-beta.
|
|
468
|
-
"resolved": "https://registry.npmjs.org/@naisys/erp-shared/-/erp-shared-3.0.0-beta.
|
|
469
|
-
"integrity": "sha512-
|
|
467
|
+
"version": "3.0.0-beta.30",
|
|
468
|
+
"resolved": "https://registry.npmjs.org/@naisys/erp-shared/-/erp-shared-3.0.0-beta.30.tgz",
|
|
469
|
+
"integrity": "sha512-VYORB+9Qyyc9LKakoaw82yzpkKAPN/1cssWEnbEgWJ/F7XXvwPrxzDfTAtt+FCQTVWsADv/n99o5/DzvrspM0g==",
|
|
470
470
|
"dependencies": {
|
|
471
|
-
"@naisys/common": "3.0.0-beta.
|
|
471
|
+
"@naisys/common": "3.0.0-beta.30",
|
|
472
472
|
"zod": "^4.3.6"
|
|
473
473
|
}
|
|
474
474
|
},
|
|
475
475
|
"node_modules/@naisys/hub-database": {
|
|
476
|
-
"version": "3.0.0-beta.
|
|
477
|
-
"resolved": "https://registry.npmjs.org/@naisys/hub-database/-/hub-database-3.0.0-beta.
|
|
478
|
-
"integrity": "sha512-
|
|
476
|
+
"version": "3.0.0-beta.30",
|
|
477
|
+
"resolved": "https://registry.npmjs.org/@naisys/hub-database/-/hub-database-3.0.0-beta.30.tgz",
|
|
478
|
+
"integrity": "sha512-V8ahfsVdQMZh/+QZw+Ly5SV/xVtFVkEh5g/lfDBcjE7F/3aLaGhissgR2w6iw3A7qj5vWvthS5JsytzSNBjv/Q==",
|
|
479
479
|
"dependencies": {
|
|
480
|
-
"@naisys/common": "3.0.0-beta.
|
|
481
|
-
"@naisys/common-node": "3.0.0-beta.
|
|
480
|
+
"@naisys/common": "3.0.0-beta.30",
|
|
481
|
+
"@naisys/common-node": "3.0.0-beta.30",
|
|
482
482
|
"@prisma/adapter-better-sqlite3": "^7.5.0",
|
|
483
483
|
"@prisma/client": "^7.5.0",
|
|
484
484
|
"better-sqlite3": "^12.6.2",
|
|
@@ -486,12 +486,12 @@
|
|
|
486
486
|
}
|
|
487
487
|
},
|
|
488
488
|
"node_modules/@naisys/supervisor-database": {
|
|
489
|
-
"version": "3.0.0-beta.
|
|
490
|
-
"resolved": "https://registry.npmjs.org/@naisys/supervisor-database/-/supervisor-database-3.0.0-beta.
|
|
491
|
-
"integrity": "sha512-
|
|
489
|
+
"version": "3.0.0-beta.30",
|
|
490
|
+
"resolved": "https://registry.npmjs.org/@naisys/supervisor-database/-/supervisor-database-3.0.0-beta.30.tgz",
|
|
491
|
+
"integrity": "sha512-g1Nytu8o0Ok7rL0eZUGcLmWwXGkGvTiMJrq+LQKdzk0uP78rTppGmQKwzXWmxckmxdcQdz8t1kZmjtqlqBq3aw==",
|
|
492
492
|
"dependencies": {
|
|
493
|
-
"@naisys/common": "3.0.0-beta.
|
|
494
|
-
"@naisys/common-node": "3.0.0-beta.
|
|
493
|
+
"@naisys/common": "3.0.0-beta.30",
|
|
494
|
+
"@naisys/common-node": "3.0.0-beta.30",
|
|
495
495
|
"@prisma/adapter-better-sqlite3": "^7.5.0",
|
|
496
496
|
"@prisma/client": "^7.5.0",
|
|
497
497
|
"bcryptjs": "^3.0.2",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naisys/erp",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.30",
|
|
4
4
|
"description": "NAISYS ERP - Web UI for AI-driven order and work management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/erpServer.js",
|
|
@@ -46,11 +46,11 @@
|
|
|
46
46
|
"@fastify/rate-limit": "^10.3.0",
|
|
47
47
|
"@fastify/static": "^9.0.0",
|
|
48
48
|
"@fastify/swagger": "^9.7.0",
|
|
49
|
-
"@naisys/erp-shared": "3.0.0-beta.
|
|
50
|
-
"@naisys/common": "3.0.0-beta.
|
|
51
|
-
"@naisys/common-node": "3.0.0-beta.
|
|
52
|
-
"@naisys/hub-database": "3.0.0-beta.
|
|
53
|
-
"@naisys/supervisor-database": "3.0.0-beta.
|
|
49
|
+
"@naisys/erp-shared": "3.0.0-beta.30",
|
|
50
|
+
"@naisys/common": "3.0.0-beta.30",
|
|
51
|
+
"@naisys/common-node": "3.0.0-beta.30",
|
|
52
|
+
"@naisys/hub-database": "3.0.0-beta.30",
|
|
53
|
+
"@naisys/supervisor-database": "3.0.0-beta.30",
|
|
54
54
|
"@prisma/adapter-better-sqlite3": "^7.5.0",
|
|
55
55
|
"@prisma/client": "^7.5.0",
|
|
56
56
|
"@scalar/fastify-api-reference": "^1.48.7",
|