fix(est): block missing quantity markers

This commit is contained in:
2026-11-07 08:14:32 +09:00
parent ab5a07ff34
commit 1d02b0205a
3 changed files with 30 additions and 1 deletions
+7 -1
View File
@@ -56,6 +56,12 @@ const EstQuantity = (() => {
return { Code: code, Name: name, rows, items, options };
}
function calculate(sheet) {
const markerErrors = sheet.rows.flatMap((row, index) => {
const count = [...String(row.LineData || "").matchAll(/\x12([-\d.,]+)\x12/g)].length;
return count === (row.markers || []).length
? []
: [`${index + 1}행: 결과 표지 수가 다릅니다.`];
});
const input = [
{ Index: 1, Code: sheet.Code, LineData: "" },
...sheet.rows.map((row) => {
@@ -110,7 +116,7 @@ const EstQuantity = (() => {
rows: result.rows.slice(1),
items: sheet.items.map((item) => ({ ...item, GN: values.get(item.Code) ?? item.GN })),
checks,
errors: result.errors,
errors: [...result.errors, ...markerErrors],
};
}
function manual(items) {