@operato/ops-contract 0.9.44 → 0.9.46
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/README.md +26 -26
- package/dist/actuation.d.ts +1 -1
- package/dist/actuation.js +11 -11
- package/dist/canonical-record.d.ts +3 -3
- package/dist/capability.d.ts +1 -1
- package/dist/capability.js +8 -8
- package/dist/contract.d.ts +1 -1
- package/dist/contract.js +4 -4
- package/dist/dock-facts.d.ts +22 -1
- package/dist/dock-facts.js +34 -1
- package/dist/domain-definition.d.ts +1 -1
- package/dist/domain-definition.js +11 -11
- package/dist/energy-ingest.js +1 -1
- package/dist/epcis.d.ts +3 -3
- package/dist/epcis.js +25 -25
- package/dist/erp.d.ts +1 -1
- package/dist/erp.js +16 -16
- package/dist/face2-adapter.js +5 -5
- package/dist/gs1.js +1 -1
- package/dist/master-data.js +2 -2
- package/dist/operational-ingest.js +15 -15
- package/dist/scenario-validate.js +1 -1
- package/dist/webhook.d.ts +1 -1
- package/dist/yield.d.ts +1 -1
- package/dist/yield.js +1 -1
- package/dist-cjs/index.cjs +112 -88
- package/package.json +1 -1
package/dist-cjs/index.cjs
CHANGED
|
@@ -347,7 +347,7 @@ var CAPABILITIES = {
|
|
|
347
347
|
operable: {
|
|
348
348
|
key: "operable",
|
|
349
349
|
label: "twin.capability.operable",
|
|
350
|
-
semantics: "\uB2A5\uB3D9 \uC790\uC6D0\uC758 \uC6B4\uC601 \uC0C1\uD0DC(\uC720\uD734/\uAC00\uB3D9/\uACE0\uC7A5).
|
|
350
|
+
semantics: "\uB2A5\uB3D9 \uC790\uC6D0\uC758 \uC6B4\uC601 \uC0C1\uD0DC(\uC720\uD734/\uAC00\uB3D9/\uACE0\uC7A5). \uACF5\uD1B5 \uC6B4\uC601 \uC0C1\uD0DC\uB97C \uAD00\uB9AC\uD569\uB2C8\uB2E4.",
|
|
351
351
|
commands: ["resource.hold", "resource.resume", "resource.down", "resource.repair", "resource.reset-metrics"],
|
|
352
352
|
stateFields: ["status"],
|
|
353
353
|
results: ["statusChanged"]
|
|
@@ -364,7 +364,7 @@ var CAPABILITIES = {
|
|
|
364
364
|
mobile: {
|
|
365
365
|
key: "mobile",
|
|
366
366
|
label: "twin.capability.mobile",
|
|
367
|
-
semantics: "\uC790\uC6D0 \
|
|
367
|
+
semantics: "\uC790\uC6D0\uC774 \uD55C \uC704\uCE58\uC5D0\uC11C \uB2E4\uB978 \uC704\uCE58\uB85C \uC774\uB3D9\uD558\uB294 \uAE30\uB2A5\uC785\uB2C8\uB2E4. Transferable\uC740 \uC544\uC774\uD15C\uC758 \uC774\uB3D9\uC744 \uB098\uD0C0\uB0C5\uB2C8\uB2E4. (\uC52C \uAE30\uC81C: CarrierLine)",
|
|
368
368
|
commands: [],
|
|
369
369
|
stateFields: ["location", "motion"],
|
|
370
370
|
models: ["Motion"],
|
|
@@ -373,7 +373,7 @@ var CAPABILITIES = {
|
|
|
373
373
|
processable: {
|
|
374
374
|
key: "processable",
|
|
375
375
|
label: "twin.capability.processable",
|
|
376
|
-
semantics: "\uBCC0\uD658/\uAC00\uACF5 \uC218\uD589 \u2014 \uC0B0\uCD9C(\uC591\uD488/\uBD88\uB7C9). \uC6B4\uC601 status \uB294 Operable \uC870\uD569.
|
|
376
|
+
semantics: "\uBCC0\uD658/\uAC00\uACF5 \uC218\uD589 \u2014 \uC0B0\uCD9C(\uC591\uD488/\uBD88\uB7C9). \uC6B4\uC601 status \uB294 Operable \uC870\uD569. \uC9C4\uD589\uB960 \uC774\uBCA4\uD2B8\uB294 \uD6C4\uC18D \uAD6C\uD604 \uB300\uC0C1\uC785\uB2C8\uB2E4.",
|
|
377
377
|
commands: [],
|
|
378
378
|
stateFields: ["output"],
|
|
379
379
|
results: ["completed"]
|
|
@@ -402,7 +402,7 @@ var CAPABILITIES = {
|
|
|
402
402
|
trackable: {
|
|
403
403
|
key: "trackable",
|
|
404
404
|
label: "twin.capability.trackable",
|
|
405
|
-
semantics: "\uC624\uB354/\uC544\uC774\uD15C \uC0DD\uC560 \uCD94\uC801 \u2014 \
|
|
405
|
+
semantics: "\uC624\uB354/\uC544\uC774\uD15C \uC0DD\uC560 \uCD94\uC801 \u2014 \uC218\uBA85\uC8FC\uAE30 \uB2E8\uACC4(\uB3C4\uBA54\uC778 \uACF5\uD1B5 \uB77C\uBCA8)\xB7\uC9C4\uD589\xB7\uBCF4\uB958.",
|
|
406
406
|
commands: ["order.hold", "order.resume", "order.release"],
|
|
407
407
|
stateFields: ["lifecycle", "progress", "held"],
|
|
408
408
|
results: ["lifecycleChanged"]
|
|
@@ -416,7 +416,7 @@ var CAPABILITIES = {
|
|
|
416
416
|
metered: {
|
|
417
417
|
key: "metered",
|
|
418
418
|
label: "twin.capability.metered",
|
|
419
|
-
semantics: "\uC790\
|
|
419
|
+
semantics: "\uC790\uC6D0\uC758 \uC5D0\uB108\uC9C0 \uC18C\uBE44\uB97C \uACC4\uCE21\uD569\uB2C8\uB2E4. \u2014 \uC720\uD6A8\uC804\uB825\xB7\uB204\uC801\uB7C9\xB7\uC5ED\uB960. \uAC12\uC774 \uC5C6\uC73C\uBA74 \uBAA8\uB974\uB294 \uAC83\uC774\uB2E4(0 \uC774 \uC544\uB2C8\uB2E4).",
|
|
420
420
|
commands: [],
|
|
421
421
|
stateFields: ["kW", "kWh", "powerFactor"],
|
|
422
422
|
models: ["MeteredState"],
|
|
@@ -425,7 +425,7 @@ var CAPABILITIES = {
|
|
|
425
425
|
curtailable: {
|
|
426
426
|
key: "curtailable",
|
|
427
427
|
label: "twin.capability.curtailable",
|
|
428
|
-
semantics: "\uC904\uC77C \uC218 \uC788\uB2E4 \
|
|
428
|
+
semantics: "\uBD80\uD558\uB97C \uC904\uC77C \uC218 \uC788\uC2B5\uB2C8\uB2E4. \uCD5C\uC18C \uC720\uC9C0 \uBD80\uD558\uB294 \uC9C0\uCF1C\uC57C \uD569\uB2C8\uB2E4. \uD310\uC815\uB9CC \uD558\uACE0 \uC9D1\uD589\uC740 \uC0AC\uB78C\uACFC \uADF8 \uC2DC\uC2A4\uD15C\uC758 \uBAAB\uC774\uB2E4.",
|
|
429
429
|
commands: [],
|
|
430
430
|
stateFields: ["curtailable", "minKW"],
|
|
431
431
|
models: ["CurtailableState"],
|
|
@@ -435,7 +435,7 @@ var CAPABILITIES = {
|
|
|
435
435
|
energyGenerating: {
|
|
436
436
|
key: "energyGenerating",
|
|
437
437
|
label: "twin.capability.energyGenerating",
|
|
438
|
-
semantics: "\uC804\
|
|
438
|
+
semantics: "\uC804\uB825\uC744 \uC0DD\uC0B0\uD569\uB2C8\uB2E4. \u2014 \uC5ED\uC1A1\uC740 \uC18C\uBE44\uC758 \uC74C\uC218\uAC00 \uC544\uB2C8\uB77C \uBCC4\uAC1C \uC0AC\uC2E4\uC774\uB2E4.",
|
|
439
439
|
commands: [],
|
|
440
440
|
/*
|
|
441
441
|
* ── 적산을 더한다 (2026-08-26) ─────────────────────────────────────────────
|
|
@@ -461,7 +461,7 @@ var CAPABILITIES = {
|
|
|
461
461
|
energyStoring: {
|
|
462
462
|
key: "energyStoring",
|
|
463
463
|
label: "twin.capability.energyStoring",
|
|
464
|
-
semantics: "\
|
|
464
|
+
semantics: "\uC804\uB825\uC744 \uC800\uC7A5\uD558\uACE0 \uACF5\uAE09\uD569\uB2C8\uB2E4. \uCDA9\uC804\uACFC \uBC29\uC804\uC744 \uAD6C\uBD84\uD569\uB2C8\uB2E4.(\uC190\uC2E4\xB7\uC218\uBA85 \uD310\uB2E8\uC774 \uB458\uC744 \uAD6C\uBCC4\uD574\uC57C \uD55C\uB2E4).",
|
|
465
465
|
commands: [],
|
|
466
466
|
stateFields: ["soc", "chargeKW", "dischargeKW"],
|
|
467
467
|
models: ["StoringState"],
|
|
@@ -1736,16 +1736,16 @@ function gs1KeyDigitViolation(uri) {
|
|
|
1736
1736
|
}
|
|
1737
1737
|
const got = prefix.length + ref.length;
|
|
1738
1738
|
if (got === want) return void 0;
|
|
1739
|
-
return `${m[1]} \uC790\uB9AC \uC218 \uC624\uB958: ${uri} \u2014 \uD68C\uC0AC \uD504\uB9AC\uD53D\uC2A4(${prefix.length}) + \uCC38\uC870(${ref.length}) = ${got} \uC774\uC9C0\uB9CC ${want} \uC5EC\uC57C \uD55C\uB2E4(GS1 TDS). \uD504\uB9AC\uD53D\uC2A4\uB97C \uBC14\uAFB8\uBA74 \uCC38\uC870 \uC790\
|
|
1739
|
+
return `${m[1]} \uC790\uB9AC \uC218 \uC624\uB958: ${uri} \u2014 \uD68C\uC0AC \uD504\uB9AC\uD53D\uC2A4(${prefix.length}) + \uCC38\uC870(${ref.length}) = ${got} \uC774\uC9C0\uB9CC ${want} \uC5EC\uC57C \uD55C\uB2E4(GS1 TDS). \uD504\uB9AC\uD53D\uC2A4\uB97C \uBC14\uAFB8\uBA74 \uCC38\uC870 \uC790\uB9BF\uC218\uB97C \uD568\uAED8 \uB9DE\uCDB0\uC57C \uD55C\uB2E4.`;
|
|
1740
1740
|
}
|
|
1741
1741
|
function classIdentifierViolation(epcClass) {
|
|
1742
|
-
if (!epcClass) return `quantity epcClass \
|
|
1742
|
+
if (!epcClass) return `quantity\uC758 epcClass \uC624\uB958: ${epcClass}`;
|
|
1743
1743
|
const digits = gs1KeyDigitViolation(epcClass);
|
|
1744
|
-
if (digits) return `quantity epcClass \
|
|
1744
|
+
if (digits) return `quantity\uC758 epcClass \uC624\uB958: ${digits}`;
|
|
1745
1745
|
if (EPC_CLASS_PREFIXES.some((p) => epcClass.startsWith(p))) return void 0;
|
|
1746
1746
|
if (epcClass.startsWith(DL_CANONICAL)) return void 0;
|
|
1747
1747
|
if (CBV_URL_CLASS.test(epcClass) || CBV_URN_CLASS.test(epcClass)) return void 0;
|
|
1748
|
-
return `quantity epcClass \
|
|
1748
|
+
return `quantity\uC758 epcClass \uC624\uB958: ${epcClass} \u2014 \uD074\uB798\uC2A4 \uC2DD\uBCC4\uC790\uB294 \uBC1C\uAE09 \uAD8C\uD55C\uC744 \uC2DD\uBCC4\uD560 \uC218 \uC788\uB294 \uD615\uC2DD\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. (EPC \uD074\uB798\uC2A4 urn:epc:idpat:/urn:epc:class: \xB7 CBV \xA78.3.4 http(s)://<\uB3C4\uBA54\uC778>/**/class/<id> \xB7 CBV \xA78.3.3 urn:<\uC774\uB984\uACF5\uAC04>:**:class:<id>)`;
|
|
1749
1749
|
}
|
|
1750
1750
|
function validateEpcisEvent(e) {
|
|
1751
1751
|
const v = [];
|
|
@@ -1763,12 +1763,12 @@ function validateEpcisEvent(e) {
|
|
|
1763
1763
|
}
|
|
1764
1764
|
if (e["@context"] !== EPCIS_CONTEXT) v.push("@context \uB204\uB77D/\uBD88\uC77C\uCE58");
|
|
1765
1765
|
if (!["ObjectEvent", "AggregationEvent", "TransactionEvent", "TransformationEvent"].includes(e.type)) v.push(`\uC54C \uC218 \uC5C6\uB294 type: ${e.type}`);
|
|
1766
|
-
if (typeof e.eventTime !== "string" || !ISO_RE.test(e.eventTime)) v.push("eventTime
|
|
1766
|
+
if (typeof e.eventTime !== "string" || !ISO_RE.test(e.eventTime)) v.push("eventTime\uC740 ISO 8601 \uD615\uC2DD\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.");
|
|
1767
1767
|
if (typeof e.eventTimeZoneOffset !== "string" || !TZ_RE.test(e.eventTimeZoneOffset)) v.push("eventTimeZoneOffset \uD615\uC2DD \uC624\uB958");
|
|
1768
1768
|
if (typeof e.bizStep !== "string" || !e.bizStep) v.push("bizStep \uB204\uB77D");
|
|
1769
1769
|
if (e.eventID !== void 0 && (typeof e.eventID !== "string" || !e.eventID)) v.push("eventID \uAC00 \uBE48 \uBB38\uC790\uC5F4");
|
|
1770
1770
|
if (e.recordTime !== void 0 && (typeof e.recordTime !== "string" || !ISO_RE.test(e.recordTime))) {
|
|
1771
|
-
v.push("recordTime
|
|
1771
|
+
v.push("recordTime\uC740 ISO 8601 \uD615\uC2DD\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.");
|
|
1772
1772
|
}
|
|
1773
1773
|
if (e.ilmd !== void 0) {
|
|
1774
1774
|
const allowed = e.type === "ObjectEvent" && e.action === "ADD" || e.type === "TransformationEvent";
|
|
@@ -1783,7 +1783,7 @@ function validateEpcisEvent(e) {
|
|
|
1783
1783
|
if (e.persistentDisposition !== void 0) {
|
|
1784
1784
|
const set = e.persistentDisposition.set ?? [];
|
|
1785
1785
|
const unset = e.persistentDisposition.unset ?? [];
|
|
1786
|
-
if (!set.length && !unset.length) v.push("persistentDisposition \uC774 set\xB7unset \uB458 \uB2E4 \uBE44\uC5B4\uC788\uC74C");
|
|
1786
|
+
if (!set.length && !unset.length) v.push("persistentDisposition \uC774 set\xB7unset \uB458 \uB2E4 \uBE44\uC5B4 \uC788\uC74C");
|
|
1787
1787
|
const both = set.filter((x) => unset.includes(x));
|
|
1788
1788
|
if (both.length) v.push(`persistentDisposition \uC774 \uAC19\uC740 \uAC12\uC744 set\xB7unset \uB3D9\uC2DC \uC9C0\uC815: ${both.join(", ")}`);
|
|
1789
1789
|
}
|
|
@@ -1795,7 +1795,7 @@ function validateEpcisEvent(e) {
|
|
|
1795
1795
|
if (e.errorDeclaration !== void 0) {
|
|
1796
1796
|
const d = e.errorDeclaration;
|
|
1797
1797
|
if (typeof d?.declarationTime !== "string" || !ISO_RE.test(d.declarationTime)) {
|
|
1798
|
-
v.push("errorDeclaration.declarationTime
|
|
1798
|
+
v.push("errorDeclaration.declarationTime\uC5D0 ISO 8601 \uD615\uC2DD\uC758 \uC2DC\uAC01\uC744 \uC9C0\uC815\uD558\uC138\uC694.");
|
|
1799
1799
|
}
|
|
1800
1800
|
if (d?.correctiveEventIDs !== void 0) {
|
|
1801
1801
|
if (!Array.isArray(d.correctiveEventIDs)) v.push("errorDeclaration.correctiveEventIDs \uBC30\uC5F4 \uC544\uB2D8");
|
|
@@ -1805,19 +1805,19 @@ function validateEpcisEvent(e) {
|
|
|
1805
1805
|
}
|
|
1806
1806
|
}
|
|
1807
1807
|
if (e.type === "ObjectEvent") {
|
|
1808
|
-
if (!ACTIONS.includes(e.action)) v.push(
|
|
1808
|
+
if (!ACTIONS.includes(e.action)) v.push(`\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 action \uAC12: ${e.action}`);
|
|
1809
1809
|
if (!Array.isArray(e.epcList)) v.push("ObjectEvent.epcList \uB204\uB77D");
|
|
1810
|
-
else if (e.epcList.length === 0 && !e.quantityList?.length) v.push("ObjectEvent: epcList/quantityList \uB458 \uB2E4 \uBE44\uC5B4\uC788\uC74C");
|
|
1810
|
+
else if (e.epcList.length === 0 && !e.quantityList?.length) v.push("ObjectEvent: epcList/quantityList \uB458 \uB2E4 \uBE44\uC5B4 \uC788\uC74C");
|
|
1811
1811
|
} else if (e.type === "AggregationEvent") {
|
|
1812
|
-
if (!ACTIONS.includes(e.action)) v.push(
|
|
1812
|
+
if (!ACTIONS.includes(e.action)) v.push(`\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 action \uAC12: ${e.action}`);
|
|
1813
1813
|
if (!e.parentID) v.push("AggregationEvent.parentID \uB204\uB77D");
|
|
1814
|
-
if (!e.childEPCs?.length && !e.childQuantityList?.length) v.push("AggregationEvent: childEPCs/childQuantityList \uB458 \uB2E4 \uBE44\uC5B4\uC788\uC74C");
|
|
1814
|
+
if (!e.childEPCs?.length && !e.childQuantityList?.length) v.push("AggregationEvent: childEPCs/childQuantityList \uB458 \uB2E4 \uBE44\uC5B4 \uC788\uC74C");
|
|
1815
1815
|
} else if (e.type === "TransactionEvent") {
|
|
1816
|
-
if (!ACTIONS.includes(e.action)) v.push(
|
|
1816
|
+
if (!ACTIONS.includes(e.action)) v.push(`\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 action \uAC12: ${e.action}`);
|
|
1817
1817
|
if (!Array.isArray(e.bizTransactionList) || e.bizTransactionList.length === 0) v.push("TransactionEvent.bizTransactionList \uB204\uB77D");
|
|
1818
1818
|
} else if (e.type === "TransformationEvent") {
|
|
1819
|
-
if (!e.inputEPCList?.length && !e.inputQuantityList?.length) v.push("TransformationEvent:
|
|
1820
|
-
if (!e.outputEPCList?.length && !e.outputQuantityList?.length) v.push("TransformationEvent:
|
|
1819
|
+
if (!e.inputEPCList?.length && !e.inputQuantityList?.length) v.push("TransformationEvent: \uC785\uB825 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
1820
|
+
if (!e.outputEPCList?.length && !e.outputQuantityList?.length) v.push("TransformationEvent: \uCD9C\uB825 \uD56D\uBAA9\uC774 \uC5C6\uC2B5\uB2C8\uB2E4");
|
|
1821
1821
|
}
|
|
1822
1822
|
const qtyLists = [
|
|
1823
1823
|
"quantityList" in e ? e.quantityList : void 0,
|
|
@@ -1830,15 +1830,15 @@ function validateEpcisEvent(e) {
|
|
|
1830
1830
|
if (bad2) v.push(bad2);
|
|
1831
1831
|
const hasQty = q.quantity !== void 0 && q.quantity !== null;
|
|
1832
1832
|
if (!hasQty) {
|
|
1833
|
-
if (q.uom !== void 0) v.push("quantity \
|
|
1833
|
+
if (q.uom !== void 0) v.push("quantity\uB97C \uC9C0\uC815\uD558\uC9C0 \uC54A\uC740 \uACBD\uC6B0 uom\uB3C4 \uC0DD\uB7B5\uD574\uC57C \uD569\uB2C8\uB2E4.");
|
|
1834
1834
|
continue;
|
|
1835
1835
|
}
|
|
1836
1836
|
if (typeof q.quantity !== "number" || !Number.isFinite(q.quantity) || q.quantity <= 0) {
|
|
1837
|
-
v.push("quantity
|
|
1837
|
+
v.push("quantity\uB294 \uC591\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4. \uC218\uB7C9\uC744 \uC54C \uC218 \uC5C6\uC73C\uBA74 \uC0DD\uB7B5\uD558\uC138\uC694.");
|
|
1838
1838
|
continue;
|
|
1839
1839
|
}
|
|
1840
|
-
if (q.uom === void 0 && !Number.isInteger(q.quantity)) v.push("uom \
|
|
1841
|
-
if (q.uom !== void 0 && !/^[A-Z0-9]{2,3}$/.test(q.uom)) v.push(`uom \uD615\uC2DD \
|
|
1840
|
+
if (q.uom === void 0 && !Number.isInteger(q.quantity)) v.push("uom\uC744 \uC0DD\uB7B5\uD55C \uACBD\uC6B0 quantity\uB294 \uAC1C\uC218\uB97C \uB098\uD0C0\uB0B4\uB294 \uC815\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4.");
|
|
1841
|
+
if (q.uom !== void 0 && !/^[A-Z0-9]{2,3}$/.test(q.uom)) v.push(`uom \uD615\uC2DD \uC624\uB958(UN/CEFACT \uAD8C\uACE0 20 \uC758 2~3\uC790 \uCF54\uB4DC): ${q.uom}`);
|
|
1842
1842
|
}
|
|
1843
1843
|
return v;
|
|
1844
1844
|
}
|
|
@@ -2873,10 +2873,10 @@ function procedureViolations(route) {
|
|
|
2873
2873
|
for (const n of elements) {
|
|
2874
2874
|
if (n.parent && !byKey.has(n.parent)) errors.push(`${n.key}: \uC0C1\uC704 '${n.parent}' \uAC00 \uC774 \uC808\uCC28\uC5D0 \uC5C6\uB2E4`);
|
|
2875
2875
|
if (n.step === void 0) continue;
|
|
2876
|
-
if (hasChild.has(n.key)) errors.push(`${n.key}: \
|
|
2877
|
-
if (!stepSet.has(n.step)) errors.push(`${n.key}: \
|
|
2876
|
+
if (hasChild.has(n.key)) errors.push(`${n.key}: \uD558\uC704 \uC694\uC18C\uAC00 \uC788\uB294 \uB178\uB4DC\uC5D0 \uC2E4\uD589 \uB2E8\uACC4\uAC00 \uC9C0\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uC2E4\uD589 \uB2E8\uACC4\uB294 \uB9D0\uB2E8 \uB178\uB4DC\uC5D0\uB9CC \uC9C0\uC815\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.`);
|
|
2877
|
+
if (!stepSet.has(n.step)) errors.push(`${n.key}: \uC815\uC758\uB418\uC9C0 \uC54A\uC740 \uB2E8\uACC4 '${n.step}' \u2014 steps \uC5D0 \uC5C6\uB2E4`);
|
|
2878
2878
|
const already = seenStep.get(n.step);
|
|
2879
|
-
if (already) errors.push(`\uB2E8\uACC4 '${n.step}' \uAC00 '${already}' \uC640 '${n.key}' \
|
|
2879
|
+
if (already) errors.push(`\uB2E8\uACC4 '${n.step}' \uAC00 '${already}' \uC640 '${n.key}' \uB450 \uACF3\uC5D0 \uC911\uBCF5 \uC9C0\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4. \uD55C \uC704\uCE58\uC5D0\uB9CC \uC9C0\uC815\uD558\uC138\uC694.`);
|
|
2880
2880
|
else seenStep.set(n.step, n.key);
|
|
2881
2881
|
}
|
|
2882
2882
|
return errors;
|
|
@@ -2893,11 +2893,11 @@ function dupes(keys) {
|
|
|
2893
2893
|
}
|
|
2894
2894
|
function validateDomainDefinition(def) {
|
|
2895
2895
|
const v = [];
|
|
2896
|
-
if (!def || typeof def !== "object") return ["
|
|
2896
|
+
if (!def || typeof def !== "object") return ["\uB3C4\uBA54\uC778 \uC815\uC758\uB294 \uAC1D\uCCB4\uC5EC\uC57C \uD569\uB2C8\uB2E4."];
|
|
2897
2897
|
if (typeof def.id !== "string" || !def.id) v.push("id \uB204\uB77D");
|
|
2898
2898
|
if (typeof def.label !== "string" || !def.label) v.push("label \uB204\uB77D");
|
|
2899
|
-
if (!Array.isArray(def.locationTypes) || def.locationTypes.length === 0) v.push("locationTypes \
|
|
2900
|
-
if (!Array.isArray(def.resourceTypes)) v.push("resourceTypes \uBC30\uC5F4 \
|
|
2899
|
+
if (!Array.isArray(def.locationTypes) || def.locationTypes.length === 0) v.push("locationTypes\uC5D0 \uC704\uCE58 \uC720\uD615\uC744 \uD558\uB098 \uC774\uC0C1 \uC9C0\uC815\uD574\uC57C \uD569\uB2C8\uB2E4.");
|
|
2900
|
+
if (!Array.isArray(def.resourceTypes)) v.push("resourceTypes\uB294 \uBC30\uC5F4\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4.");
|
|
2901
2901
|
const locationKeys2 = new Set((def.locationTypes || []).map((n) => n.key));
|
|
2902
2902
|
const resKeys = new Set((def.resourceTypes || []).map((r) => r.key));
|
|
2903
2903
|
const matKeys = new Set((def.materials || []).map((m) => m.key));
|
|
@@ -2908,21 +2908,21 @@ function validateDomainDefinition(def) {
|
|
|
2908
2908
|
for (const d of dupes((arr || []).map((x) => x.key))) v.push(`${name} \uD0A4 \uC911\uBCF5: ${d}`);
|
|
2909
2909
|
}
|
|
2910
2910
|
for (const o of def.operations || []) {
|
|
2911
|
-
if (!INTENTS.includes(o.intent)) v.push(`operation '${o.key}' intent \
|
|
2911
|
+
if (!INTENTS.includes(o.intent)) v.push(`operation '${o.key}' intent \uAC12 \uC624\uB958: ${o.intent}`);
|
|
2912
2912
|
if (o.locationType && !locationKeys2.has(o.locationType)) v.push(`operation '${o.key}' locationType '${o.locationType}' \uBBF8\uC815\uC758`);
|
|
2913
2913
|
if (o.resourceType && !resKeys.has(o.resourceType)) v.push(`operation '${o.key}' resourceType '${o.resourceType}' \uBBF8\uC815\uC758`);
|
|
2914
2914
|
if (o.intent === "dwell" && o.resourceType) v.push(`operation '${o.key}' dwell \uC778\uB370 resourceType \uC9C0\uC815\uB428(\uBB34\uC790\uC6D0\uC774\uC5B4\uC57C)`);
|
|
2915
2915
|
}
|
|
2916
2916
|
for (const r of def.routes || []) {
|
|
2917
|
-
if (!Array.isArray(r.steps) || r.steps.length === 0) v.push(`route '${r.key}' steps \uBE44\uC5B4\uC788\uC74C`);
|
|
2917
|
+
if (!Array.isArray(r.steps) || r.steps.length === 0) v.push(`route '${r.key}' steps \uBE44\uC5B4 \uC788\uC74C`);
|
|
2918
2918
|
for (const s of r.steps || []) if (!opKeys.has(s)) v.push(`route '${r.key}' step '${s}' \uBBF8\uC815\uC758 operation`);
|
|
2919
2919
|
}
|
|
2920
2920
|
for (const rc of def.recipes || []) {
|
|
2921
2921
|
if (rc.route && !routeKeys.has(rc.route)) v.push(`recipe '${rc.key}' route '${rc.route}' \uBBF8\uC815\uC758`);
|
|
2922
|
-
if (!rc.outputs?.length) v.push(`recipe '${rc.key}' outputs \uBE44\uC5B4\uC788\uC74C`);
|
|
2922
|
+
if (!rc.outputs?.length) v.push(`recipe '${rc.key}' outputs \uBE44\uC5B4 \uC788\uC74C`);
|
|
2923
2923
|
for (const p of [...rc.inputs || [], ...rc.outputs || []]) {
|
|
2924
2924
|
if (!matKeys.has(p.material)) v.push(`recipe '${rc.key}' material '${p.material}' \uBBF8\uC815\uC758`);
|
|
2925
|
-
if (typeof p.qty !== "number" || p.qty <= 0) v.push(`recipe '${rc.key}' material '${p.material}' qty \
|
|
2925
|
+
if (typeof p.qty !== "number" || p.qty <= 0) v.push(`recipe '${rc.key}' material '${p.material}' qty\uB294 \uC591\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4.`);
|
|
2926
2926
|
const mat = matByKey.get(p.material);
|
|
2927
2927
|
if (mat?.locationType && !locationKeys2.has(mat.locationType)) v.push(`recipe '${rc.key}' material '${p.material}' locationType '${mat.locationType}' \uBBF8\uC815\uC758`);
|
|
2928
2928
|
}
|
|
@@ -3133,7 +3133,7 @@ function ingestEnergyGenerationRecords(records, opts) {
|
|
|
3133
3133
|
const alsoState = STATE_FIELDS.filter((f) => r?.[f] !== void 0);
|
|
3134
3134
|
if (alsoState.length) {
|
|
3135
3135
|
errors.push(
|
|
3136
|
-
`\uC801\uC0B0\uACFC \uC124\uBE44 \uC0C1\uD0DC\
|
|
3136
|
+
`\uD55C \uB808\uCF54\uB4DC\uC5D0 \uC801\uC0B0\uAC12\uACFC \uC124\uBE44 \uC0C1\uD0DC\uAC00 \uD568\uAED8 \uB4E4\uC5B4 \uC788\uC2B5\uB2C8\uB2E4(${alsoState.join("\xB7")}) \u2014 \uC774 \uACBD\uB85C\uC5D0\uC11C\uB294 \uC801\uC0B0\uAC12\uB9CC \uCC98\uB9AC\uD569\uB2C8\uB2E4. \uC124\uBE44 \uC0C1\uD0DC\uB294 \uBCC4\uB3C4 \uB808\uCF54\uB4DC\uB85C \uBCF4\uB0B4\uC138\uC694.`
|
|
3137
3137
|
);
|
|
3138
3138
|
}
|
|
3139
3139
|
const raw = r?.kWh;
|
|
@@ -3508,7 +3508,7 @@ var FIXED_LENGTH = {
|
|
|
3508
3508
|
"13": 6,
|
|
3509
3509
|
// 포장일
|
|
3510
3510
|
"15": 6,
|
|
3511
|
-
//
|
|
3511
|
+
// 품질 유지 기한
|
|
3512
3512
|
"16": 6,
|
|
3513
3513
|
// 판매기한
|
|
3514
3514
|
"17": 6,
|
|
@@ -3864,7 +3864,7 @@ function resolveErrorDeclaration(spec, record, errors) {
|
|
|
3864
3864
|
const correctiveEventIDs = resolveList(spec.correctiveEventIDs, record, "errorDeclaration.correctiveEventIDs", errors);
|
|
3865
3865
|
if (!declarationTime) {
|
|
3866
3866
|
if (reason || correctiveEventIDs.length) {
|
|
3867
|
-
errors.push("errorDeclaration
|
|
3867
|
+
errors.push("errorDeclaration\uC5D0 \uC815\uC815 \uC0AC\uC720 \uB610\uB294 \uB300\uC0C1\uC774 \uC788\uC9C0\uB9CC \uC815\uC815 \uC2DC\uAC01(declarationTime)\uC774 \uC5C6\uC2B5\uB2C8\uB2E4.");
|
|
3868
3868
|
}
|
|
3869
3869
|
return void 0;
|
|
3870
3870
|
}
|
|
@@ -3889,10 +3889,10 @@ function mapRecordChecked(record, mapping, eventTime) {
|
|
|
3889
3889
|
const outputQuantityList = resolveQuantityList(mapping.outputQuantityList, record, "outputQuantityList", errors);
|
|
3890
3890
|
const transformationID = resolve(mapping.transformationID, record, "transformationID", errors);
|
|
3891
3891
|
if (!inputEPCList.length && !inputQuantityList.length) {
|
|
3892
|
-
errors.push("\
|
|
3892
|
+
errors.push("\uBCC0\uD658 \uC774\uBCA4\uD2B8\uC5D0 \uC785\uB825 \uD56D\uBAA9\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.(EPCIS 2.0 \xA77.4.5)");
|
|
3893
3893
|
}
|
|
3894
3894
|
if (!outputEPCList.length && !outputQuantityList.length) {
|
|
3895
|
-
errors.push("\
|
|
3895
|
+
errors.push("\uBCC0\uD658 \uC774\uBCA4\uD2B8\uC5D0 \uCD9C\uB825 \uD56D\uBAA9\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.(EPCIS 2.0 \xA77.4.5)");
|
|
3896
3896
|
}
|
|
3897
3897
|
return {
|
|
3898
3898
|
event: transformationEvent({
|
|
@@ -3941,7 +3941,7 @@ function mapRecordChecked(record, mapping, eventTime) {
|
|
|
3941
3941
|
const epc = resolve(mapping.epc, record, "epc", errors);
|
|
3942
3942
|
const quantityList = resolveQuantityList(mapping.quantityList, record, "quantityList", errors);
|
|
3943
3943
|
if (!epc && !quantityList.length) {
|
|
3944
|
-
errors.push("epc \
|
|
3944
|
+
errors.push("epc \uB610\uB294 quantityList\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4. \uAC1C\uCCB4 \uC2DD\uBCC4\uC790\uB098 \uD074\uB798\uC2A4\xB7\uC218\uB7C9\uC744 \uC9C0\uC815\uD558\uC138\uC694.");
|
|
3945
3945
|
}
|
|
3946
3946
|
const ilmd = resolveObject(mapping.ilmd, record, "ilmd", errors);
|
|
3947
3947
|
return {
|
|
@@ -3972,7 +3972,7 @@ function ingest(records, rules, opts) {
|
|
|
3972
3972
|
for (const record of records) {
|
|
3973
3973
|
const rule = ruleByType.get(String(record["sourceType"]));
|
|
3974
3974
|
if (!rule) {
|
|
3975
|
-
rejected.push({ record, errors: [`\uB9E4\
|
|
3975
|
+
rejected.push({ record, errors: [`\uC77C\uCE58\uD558\uB294 \uB9E4\uD551 \uADDC\uCE59 \uC5C6\uC74C: sourceType=${record["sourceType"]}`] });
|
|
3976
3976
|
continue;
|
|
3977
3977
|
}
|
|
3978
3978
|
const timeErrors = [];
|
|
@@ -4038,8 +4038,8 @@ function ingestMasterData(records) {
|
|
|
4038
4038
|
const rejected = [];
|
|
4039
4039
|
for (const r of arr) {
|
|
4040
4040
|
const errors = [];
|
|
4041
|
-
if (!isMasterDataRecord(r)) errors.push("vocabularyType
|
|
4042
|
-
else if (!Object.keys(r.attributes).length) errors.push("attributes
|
|
4041
|
+
if (!isMasterDataRecord(r)) errors.push("vocabularyType, id, attributes\uB97C \uC9C0\uC815\uD574\uC57C \uD569\uB2C8\uB2E4.");
|
|
4042
|
+
else if (!Object.keys(r.attributes).length) errors.push("attributes\uC5D0 \uC18D\uC131\uC744 \uD558\uB098 \uC774\uC0C1 \uC9C0\uC815\uD574\uC57C \uD569\uB2C8\uB2E4.");
|
|
4043
4043
|
if (errors.length) rejected.push({ record: r, errors });
|
|
4044
4044
|
else accepted.push({ vocabularyType: r.vocabularyType, id: r.id, attributes: { ...r.attributes } });
|
|
4045
4045
|
}
|
|
@@ -4105,13 +4105,13 @@ function shapeErrors(where, row, shape) {
|
|
|
4105
4105
|
for (const f of shape.required ?? []) {
|
|
4106
4106
|
const v = row[f];
|
|
4107
4107
|
const empty = v === void 0 || v === null || typeof v === "string" && !v.trim();
|
|
4108
|
-
if (empty) errors.push(`${where}.${f} \
|
|
4108
|
+
if (empty) errors.push(`${where}.${f}: \uD544\uC218 \uD544\uB4DC \uB204\uB77D`);
|
|
4109
4109
|
}
|
|
4110
4110
|
for (const [f, t] of Object.entries(shape.fields ?? {})) {
|
|
4111
4111
|
const v = row[f];
|
|
4112
4112
|
if (v === void 0 || v === null) continue;
|
|
4113
4113
|
if (t === "number" && (typeof v !== "number" || !Number.isFinite(v))) {
|
|
4114
|
-
errors.push(`${where}.${f} \
|
|
4114
|
+
errors.push(`${where}.${f} \uAC12\uC740 \uC720\uD55C\uD55C \uC22B\uC790\uC5EC\uC57C \uD569\uB2C8\uB2E4: ${JSON.stringify(v)}`);
|
|
4115
4115
|
} else if (t !== "number" && typeof v !== t) {
|
|
4116
4116
|
errors.push(`${where}.${f} \uAC00 ${t} \uAC00 \uC544\uB2C8\uB2E4: ${JSON.stringify(v)}`);
|
|
4117
4117
|
}
|
|
@@ -4120,14 +4120,14 @@ function shapeErrors(where, row, shape) {
|
|
|
4120
4120
|
const v = row[f];
|
|
4121
4121
|
if (v === void 0 || v === null) continue;
|
|
4122
4122
|
if (!allowed.includes(String(v))) {
|
|
4123
|
-
errors.push(`${where}.${f}
|
|
4123
|
+
errors.push(`${where}.${f}\uC5D0 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uB294 \uAC12\uC774 \uC9C0\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4: ${JSON.stringify(v)} (${allowed.join(" \xB7 ")})`);
|
|
4124
4124
|
}
|
|
4125
4125
|
}
|
|
4126
4126
|
for (const f of shape.positive ?? []) {
|
|
4127
4127
|
const v = row[f];
|
|
4128
4128
|
if (v === void 0 || v === null) continue;
|
|
4129
4129
|
if (typeof v !== "number" || !(v > 0)) {
|
|
4130
|
-
errors.push(`${where}.${f} \uAC00 0 \uC774\uD558\uB2E4: ${JSON.stringify(v)} \u2014 \
|
|
4130
|
+
errors.push(`${where}.${f} \uAC00 0 \uC774\uD558\uB2E4: ${JSON.stringify(v)} \u2014 \uC218\uB7C9\uC744 \uC54C \uC218 \uC5C6\uC73C\uBA74 \uAC12\uC744 \uC0DD\uB7B5\uD558\uC138\uC694.`);
|
|
4131
4131
|
}
|
|
4132
4132
|
}
|
|
4133
4133
|
return errors;
|
|
@@ -4579,7 +4579,7 @@ function unknownKindReason() {
|
|
|
4579
4579
|
const fields = spec.match ?? [spec.identity];
|
|
4580
4580
|
return `${kind}: ${fields.join("+")}`;
|
|
4581
4581
|
});
|
|
4582
|
-
return `\
|
|
4582
|
+
return `\uC6B4\uC601 \uB808\uCF54\uB4DC\uC758 \uC720\uD615\uC744 \uD310\uBCC4\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uC720\uD615\uC744 \uC2DD\uBCC4\uD560 \uD544\uB4DC\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4(${shapes.join(" \xB7 ")}). epc\uAC00 \uD3EC\uD568\uB41C \uB808\uCF54\uB4DC\uB294 EPCIS \uCC98\uB9AC \uACBD\uB85C\uC5D0 \uC81C\uCD9C\uD558\uC138\uC694.`;
|
|
4583
4583
|
}
|
|
4584
4584
|
var MATCH_ORDER = Object.keys(SPECS).sort(
|
|
4585
4585
|
(a, b) => (SPECS[a].matchOrder ?? 1e3) - (SPECS[b].matchOrder ?? 1e3)
|
|
@@ -4609,7 +4609,7 @@ function ingestOperationalRecords(records, opts) {
|
|
|
4609
4609
|
if (unknown.length) errors.push(`${kind}: \uACC4\uC57D\uC5D0 \uC5C6\uB294 \uD544\uB4DC \u2014 ${unknown.join(", ")}`);
|
|
4610
4610
|
for (const name of spec.required) {
|
|
4611
4611
|
const v = r[name];
|
|
4612
|
-
if (v === void 0 || v === null || v === "") errors.push(`${kind}: ${name} \
|
|
4612
|
+
if (v === void 0 || v === null || v === "") errors.push(`${kind}: ${name}: \uD544\uC218 \uAC12 \uB204\uB77D`);
|
|
4613
4613
|
}
|
|
4614
4614
|
const data = {};
|
|
4615
4615
|
for (const [name, type] of Object.entries(spec.fields)) {
|
|
@@ -4618,12 +4618,12 @@ function ingestOperationalRecords(records, opts) {
|
|
|
4618
4618
|
switch (type) {
|
|
4619
4619
|
case "string": {
|
|
4620
4620
|
if (typeof v !== "string") {
|
|
4621
|
-
errors.push(`${kind}.${name} \
|
|
4621
|
+
errors.push(`${kind}.${name} \uAC12\uC740 \uBB38\uC790\uC5F4\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4: ${JSON.stringify(v)}`);
|
|
4622
4622
|
break;
|
|
4623
4623
|
}
|
|
4624
4624
|
const allowed = spec.enums?.[name];
|
|
4625
4625
|
if (allowed && !allowed.includes(v)) {
|
|
4626
|
-
errors.push(`${kind}.${name}
|
|
4626
|
+
errors.push(`${kind}.${name}\uC5D0 \uD5C8\uC6A9\uB418\uC9C0 \uC54A\uB294 \uAC12\uC774 \uC9C0\uC815\uB418\uC5C8\uC2B5\uB2C8\uB2E4: ${JSON.stringify(v)} \u2014 \uD5C8\uC6A9 \uAC12: ${allowed.join(" \xB7 ")}`);
|
|
4627
4627
|
break;
|
|
4628
4628
|
}
|
|
4629
4629
|
data[name] = v;
|
|
@@ -4632,7 +4632,7 @@ function ingestOperationalRecords(records, opts) {
|
|
|
4632
4632
|
case "number": {
|
|
4633
4633
|
const n = Number(v);
|
|
4634
4634
|
if (typeof v === "boolean" || !Number.isFinite(n)) {
|
|
4635
|
-
errors.push(`${kind}.${name} \
|
|
4635
|
+
errors.push(`${kind}.${name} \uAC12\uC740 \uC720\uD55C\uD55C \uC22B\uC790\uC5EC\uC57C \uD569\uB2C8\uB2E4: ${JSON.stringify(v)}`);
|
|
4636
4636
|
break;
|
|
4637
4637
|
}
|
|
4638
4638
|
if (name === "progress" && (n < 0 || n > 1)) {
|
|
@@ -4648,7 +4648,7 @@ function ingestOperationalRecords(records, opts) {
|
|
|
4648
4648
|
}
|
|
4649
4649
|
case "boolean": {
|
|
4650
4650
|
if (typeof v !== "boolean") {
|
|
4651
|
-
errors.push(`${kind}.${name} \
|
|
4651
|
+
errors.push(`${kind}.${name} \uAC12\uC740 \uBD88\uB9AC\uC5B8\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4: ${JSON.stringify(v)}`);
|
|
4652
4652
|
break;
|
|
4653
4653
|
}
|
|
4654
4654
|
data[name] = v;
|
|
@@ -4656,7 +4656,7 @@ function ingestOperationalRecords(records, opts) {
|
|
|
4656
4656
|
}
|
|
4657
4657
|
case "string[]": {
|
|
4658
4658
|
if (!Array.isArray(v) || v.some((x) => typeof x !== "string")) {
|
|
4659
|
-
errors.push(`${kind}.${name} \
|
|
4659
|
+
errors.push(`${kind}.${name} \uAC12\uC740 \uBB38\uC790\uC5F4 \uBC30\uC5F4\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4: ${JSON.stringify(v)}`);
|
|
4660
4660
|
break;
|
|
4661
4661
|
}
|
|
4662
4662
|
data[name] = v.slice();
|
|
@@ -4664,7 +4664,7 @@ function ingestOperationalRecords(records, opts) {
|
|
|
4664
4664
|
}
|
|
4665
4665
|
case "object": {
|
|
4666
4666
|
if (Array.isArray(v) || typeof v !== "object") {
|
|
4667
|
-
errors.push(`${kind}.${name} \
|
|
4667
|
+
errors.push(`${kind}.${name} \uAC12\uC740 \uAC1D\uCCB4\uC5EC\uC57C \uD569\uB2C8\uB2E4: ${JSON.stringify(v)}`);
|
|
4668
4668
|
break;
|
|
4669
4669
|
}
|
|
4670
4670
|
errors.push(...shapeErrors(`${kind}.${name}`, v, spec.shapes?.[name]));
|
|
@@ -4673,7 +4673,7 @@ function ingestOperationalRecords(records, opts) {
|
|
|
4673
4673
|
}
|
|
4674
4674
|
case "object[]": {
|
|
4675
4675
|
if (!Array.isArray(v) || v.some((x) => !x || typeof x !== "object")) {
|
|
4676
|
-
errors.push(`${kind}.${name} \
|
|
4676
|
+
errors.push(`${kind}.${name} \uAC12\uC740 \uAC1D\uCCB4 \uBC30\uC5F4\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4: ${JSON.stringify(v)}`);
|
|
4677
4677
|
break;
|
|
4678
4678
|
}
|
|
4679
4679
|
v.forEach(
|
|
@@ -4704,12 +4704,12 @@ function ingestOperationalRecords(records, opts) {
|
|
|
4704
4704
|
const at2 = closedPeriodEnd || String(r.at ?? "").trim() || opts.defaultEventTime;
|
|
4705
4705
|
const atMs = at2 ? Date.parse(at2) : Number.NaN;
|
|
4706
4706
|
if (!Number.isFinite(atMs)) {
|
|
4707
|
-
errors.push(`${kind}: at \uC5C6\uC74C/\uD615\uC2DD \uC624\uB958 \u2014 \
|
|
4707
|
+
errors.push(`${kind}: at \uC5C6\uC74C/\uD615\uC2DD \uC624\uB958 \u2014 \uC774\uC804 \uC774\uBCA4\uD2B8\uAC00 \uB4A4\uB2A6\uAC8C \uB3C4\uCC29\uD588\uB294\uC9C0 \uD310\uB2E8\uD558\uB824\uBA74 \uC2DC\uAC01\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.`);
|
|
4708
4708
|
}
|
|
4709
4709
|
if (closedPeriodEnd && opts.defaultEventTime) {
|
|
4710
4710
|
const nowMs = Date.parse(opts.defaultEventTime);
|
|
4711
4711
|
if (Number.isFinite(nowMs) && Number.isFinite(atMs) && atMs > nowMs) {
|
|
4712
|
-
errors.push(`${kind}: \uC544\uC9C1 \uC624\uC9C0 \uC54A\uC740 \uC2DC\uAC01\uC758 \uC0AC\uC2E4\uC774\uB2E4(${closedPeriodEnd}) \u2014 \
|
|
4712
|
+
errors.push(`${kind}: \uC544\uC9C1 \uC624\uC9C0 \uC54A\uC740 \uC2DC\uAC01\uC758 \uC0AC\uC2E4\uC774\uB2E4(${closedPeriodEnd}) \u2014 \uC885\uB8CC\uB41C \uAD6C\uAC04\uB9CC \uB9C8\uAC10\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.`);
|
|
4713
4713
|
}
|
|
4714
4714
|
}
|
|
4715
4715
|
if (errors.length) {
|
|
@@ -5074,7 +5074,7 @@ function computeOee(c, nowMs) {
|
|
|
5074
5074
|
}
|
|
5075
5075
|
|
|
5076
5076
|
// src/yield.ts
|
|
5077
|
-
var FIRST_PASS_RULE = "\uC7AC\uC791\uC5C5\xB7\uC218\uB9AC\
|
|
5077
|
+
var FIRST_PASS_RULE = "\uC7AC\uC791\uC5C5\xB7\uC218\uB9AC \uD6C4 \uD569\uACA9\uD55C \uC218\uB7C9\uC740 \uCD5C\uCD08 \uACF5\uC815\uC758 \uC591\uD488 \uC218\uB7C9\uC5D0 \uD569\uC0B0\uD558\uC9C0 \uC54A\uB294\uB2E4. \uD569\uC0B0\uD558\uBA74 \uCD5C\uCD08 \uD569\uACA9\uB960\uC774 \uC544\uB2CC \uD488\uC9C8\uB960\uC744 \uACC4\uC0B0\uD558\uAC8C \uB41C\uB2E4.";
|
|
5078
5078
|
var finite = (n) => typeof n === "number" && Number.isFinite(n);
|
|
5079
5079
|
function computeFirstPassYield(input) {
|
|
5080
5080
|
const missing = [];
|
|
@@ -5204,37 +5204,37 @@ function materialMovementKey(e) {
|
|
|
5204
5204
|
}
|
|
5205
5205
|
function validatePerformance(e, nowMs) {
|
|
5206
5206
|
const errors = [];
|
|
5207
|
-
if (!String(e?.orderId ?? "").trim()) errors.push("orderId \
|
|
5208
|
-
if (!String(e?.uom ?? "").trim()) errors.push("uom \
|
|
5207
|
+
if (!String(e?.orderId ?? "").trim()) errors.push("orderId \uB204\uB77D. \uC2E4\uC801\uC758 \uC791\uC5C5\uC9C0\uC2DC ID\uB97C \uC9C0\uC815\uD558\uC138\uC694.");
|
|
5208
|
+
if (!String(e?.uom ?? "").trim()) errors.push("uom \uB204\uB77D. \uC815\uC0B0\uD560 \uC218\uB7C9\uC758 \uB2E8\uC704\uB97C \uC9C0\uC815\uD558\uC138\uC694.");
|
|
5209
5209
|
for (const [name, v] of [
|
|
5210
5210
|
["goodQuantity", e?.goodQuantity],
|
|
5211
5211
|
["scrapQuantity", e?.scrapQuantity]
|
|
5212
5212
|
]) {
|
|
5213
|
-
if (typeof v !== "number" || !Number.isFinite(v)) errors.push(`${name} \
|
|
5214
|
-
else if (v < 0) errors.push(`${name} \
|
|
5213
|
+
if (typeof v !== "number" || !Number.isFinite(v)) errors.push(`${name} \uAC12\uC740 \uC720\uD55C\uD55C \uC22B\uC790\uC5EC\uC57C \uD569\uB2C8\uB2E4`);
|
|
5214
|
+
else if (v < 0) errors.push(`${name} \uAC12\uC740 0 \uC774\uC0C1\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4. \uC2E4\uC801\uC744 \uCDE8\uC18C\uD560 \uB54C\uB294 \uC5ED\uBD84\uAC1C\uB97C \uC0AC\uC6A9\uD558\uC138\uC694.`);
|
|
5215
5215
|
}
|
|
5216
5216
|
if (typeof e?.goodQuantity === "number" && typeof e?.scrapQuantity === "number" && e.goodQuantity + e.scrapQuantity <= 0) {
|
|
5217
|
-
errors.push("\
|
|
5217
|
+
errors.push("\uC591\uD488 \uB610\uB294 \uBD88\uB7C9 \uC218\uB7C9\uC774 \uC788\uC5B4\uC57C \uC2E4\uC801\uC744 \uB4F1\uB85D\uD560 \uC218 \uC788\uC2B5\uB2C8\uB2E4.");
|
|
5218
5218
|
}
|
|
5219
5219
|
const from = Date.parse(String(e?.from ?? ""));
|
|
5220
5220
|
const to = Date.parse(String(e?.to ?? ""));
|
|
5221
|
-
if (!Number.isFinite(from) || !Number.isFinite(to)) errors.push("\uAD6C\uAC04\
|
|
5221
|
+
if (!Number.isFinite(from) || !Number.isFinite(to)) errors.push("\uC2E4\uC801 \uAD6C\uAC04\uC758 \uC2DC\uC791 \uC2DC\uAC01(from)\uACFC \uC885\uB8CC \uC2DC\uAC01(to)\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.");
|
|
5222
5222
|
else {
|
|
5223
|
-
if (to < from) errors.push("\
|
|
5224
|
-
if (to > nowMs) errors.push("\
|
|
5223
|
+
if (to < from) errors.push("\uC2E4\uC801\uC758 \uC885\uB8CC \uC2DC\uAC01\uC774 \uC2DC\uC791 \uC2DC\uAC01\uBCF4\uB2E4 \uBE60\uB985\uB2C8\uB2E4.");
|
|
5224
|
+
if (to > nowMs) errors.push("\uC2E4\uC801\uC758 \uC885\uB8CC \uC2DC\uAC01\uC774 \uD604\uC7AC\uBCF4\uB2E4 \uB2A6\uC2B5\uB2C8\uB2E4.");
|
|
5225
5225
|
}
|
|
5226
5226
|
for (const m of e?.materialActual ?? []) {
|
|
5227
|
-
if (!String(m?.definitionId ?? "").trim()) errors.push("\uC790\uC7AC \
|
|
5228
|
-
if (!String(m?.uom ?? "").trim()) errors.push(`${m?.definitionId}: uom \
|
|
5227
|
+
if (!String(m?.definitionId ?? "").trim()) errors.push("\uC790\uC7AC \uD56D\uBAA9\uC5D0 definitionId\uAC00 \uC5C6\uC2B5\uB2C8\uB2E4.");
|
|
5228
|
+
if (!String(m?.uom ?? "").trim()) errors.push(`${m?.definitionId}: uom \uB204\uB77D. ERP\uC5D0 \uB4F1\uB85D\uB41C \uC790\uC7AC \uB2E8\uC704\uB97C \uC9C0\uC815\uD558\uC138\uC694.`);
|
|
5229
5229
|
if (typeof m?.quantity !== "number" || !(m.quantity > 0)) errors.push(`${m?.definitionId}: \uC218\uB7C9\uC774 0 \uC774\uD558\uB2E4`);
|
|
5230
5230
|
if (m?.use !== "consumed" && m?.use !== "produced") {
|
|
5231
|
-
errors.push(`${m?.definitionId}: use \
|
|
5231
|
+
errors.push(`${m?.definitionId}: use \uAC12\uC740 consumed \uB610\uB294 produced\uC5EC\uC57C \uD569\uB2C8\uB2E4.`);
|
|
5232
5232
|
}
|
|
5233
5233
|
}
|
|
5234
5234
|
return errors;
|
|
5235
5235
|
}
|
|
5236
5236
|
function reversalKey(performanceKey2) {
|
|
5237
|
-
if (!String(performanceKey2 ?? "").trim()) throw new Error("reversalKey: \
|
|
5237
|
+
if (!String(performanceKey2 ?? "").trim()) throw new Error("reversalKey: \uCDE8\uC18C\uD560 \uC2E4\uC801\uC758 \uD0A4\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.");
|
|
5238
5238
|
return `${performanceKey2}|reversal`;
|
|
5239
5239
|
}
|
|
5240
5240
|
var ERP_CAPABILITY = [
|
|
@@ -5271,11 +5271,11 @@ function erpCapabilityGaps(adapter) {
|
|
|
5271
5271
|
gaps.push("reversal \uB2A5\uB825\uC744 \uC120\uC5B8\uD588\uB294\uB370 traits.reversal \uC774 api \uAC00 \uC544\uB2C8\uB2E4 \u2014 \uB458 \uC911 \uD558\uB098\uAC00 \uD2C0\uB838\uB2E4");
|
|
5272
5272
|
}
|
|
5273
5273
|
if (adapter.traits?.materialWithPerformance && typeof adapter.postMaterialMovement === "function") {
|
|
5274
|
-
gaps.push("traits.materialWithPerformance \uAC00 \uCC38\uC778\uB370 postMaterialMovement \uAC00 \uB530\uB85C \uC788\uB2E4 \u2014 \uC18C\uBE44\uAC00 \
|
|
5274
|
+
gaps.push("traits.materialWithPerformance \uAC00 \uCC38\uC778\uB370 postMaterialMovement \uAC00 \uB530\uB85C \uC788\uB2E4 \u2014 \uC790\uC7AC \uC18C\uBE44\uAC00 \uC911\uBCF5 \uBC18\uC601\uB420 \uC218 \uC788\uC2B5\uB2C8\uB2E4.");
|
|
5275
5275
|
}
|
|
5276
5276
|
if (manual) {
|
|
5277
5277
|
if (typeof adapter.postPerformance === "function") {
|
|
5278
|
-
gaps.push("traits.posting \uC774 manual-export \uC778\uB370 postPerformance \uAC00 \uC788\uB2E4 \u2014 \
|
|
5278
|
+
gaps.push("traits.posting \uC774 manual-export \uC778\uB370 postPerformance \uAC00 \uC788\uB2E4 \u2014 \uC218\uB3D9 \uBC18\uC601 \uBC29\uC2DD\uC5D0\uC11C\uB294 API\uB85C \uC2E4\uC801\uC744 \uB4F1\uB85D\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4.");
|
|
5279
5279
|
}
|
|
5280
5280
|
if (typeof adapter.postMaterialMovement === "function") {
|
|
5281
5281
|
gaps.push("traits.posting \uC774 manual-export \uC778\uB370 postMaterialMovement \uAC00 \uC788\uB2E4");
|
|
@@ -5285,7 +5285,7 @@ function erpCapabilityGaps(adapter) {
|
|
|
5285
5285
|
}
|
|
5286
5286
|
}
|
|
5287
5287
|
if (adapter.traits?.posting !== "api" && adapter.traits?.posting !== "manual-export") {
|
|
5288
|
-
gaps.push("traits.posting
|
|
5288
|
+
gaps.push("traits.posting\uC5D0 api \uB610\uB294 manual-export\uB97C \uC9C0\uC815\uD558\uC138\uC694. \uC218\uB3D9 \uBC18\uC601\uC6A9 \uB0B4\uBCF4\uB0B4\uAE30\uB97C ERP \uB4F1\uB85D \uC644\uB8CC\uB85C \uCC98\uB9AC\uD558\uC9C0 \uC54A\uAE30 \uC704\uD574 \uD544\uC694\uD55C \uC124\uC815\uC785\uB2C8\uB2E4.");
|
|
5289
5289
|
}
|
|
5290
5290
|
return gaps;
|
|
5291
5291
|
}
|
|
@@ -5313,26 +5313,26 @@ function isCommandTerminal(state) {
|
|
|
5313
5313
|
return Object.keys(ALLOWED[state] ?? {}).length === 0;
|
|
5314
5314
|
}
|
|
5315
5315
|
function approveCommand(command, approval) {
|
|
5316
|
-
if (!approval?.by?.trim()) throw new Error("\uC2B9\uC778\
|
|
5317
|
-
if (!approval?.at?.trim()) throw new Error("\uC2B9\uC778
|
|
5316
|
+
if (!approval?.by?.trim()) throw new Error("\uC2B9\uC778\uC790 \uC815\uBCF4\uAC00 \uD544\uC694\uD569\uB2C8\uB2E4.");
|
|
5317
|
+
if (!approval?.at?.trim()) throw new Error("\uC2B9\uC778 \uC2DC\uAC01\uC774 \uD544\uC694\uD569\uB2C8\uB2E4.");
|
|
5318
5318
|
const to = nextCommandState(command.state, "approve");
|
|
5319
|
-
if (!to) throw new Error(`${command.state} \uC0C1\uD0DC\
|
|
5319
|
+
if (!to) throw new Error(`${command.state} \uC0C1\uD0DC\uC5D0\uC11C\uB294 \uBA85\uB839\uC744 \uC2B9\uC778\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4 (${command.id})`);
|
|
5320
5320
|
return { ...command, state: to, approval };
|
|
5321
5321
|
}
|
|
5322
5322
|
function passThroughReversible(command) {
|
|
5323
5323
|
if (requiresApproval(command)) {
|
|
5324
|
-
throw new Error(`\uB418\uB3CC\uB9B4 \uC218 \uC5C6\uB294 \
|
|
5324
|
+
throw new Error(`\uB418\uB3CC\uB9B4 \uC218 \uC5C6\uB294 \uBA85\uB839\uC740 \uC0AC\uB78C\uC758 \uC2B9\uC778\uC774 \uD544\uC694\uD569\uB2C8\uB2E4 (${command.id} \xB7 ${command.type})`);
|
|
5325
5325
|
}
|
|
5326
5326
|
const to = nextCommandState(command.state, "approve");
|
|
5327
|
-
if (!to) throw new Error(`${command.state} \uC0C1\uD0DC\
|
|
5327
|
+
if (!to) throw new Error(`${command.state} \uC0C1\uD0DC\uC5D0\uC11C\uB294 \uBA85\uB839\uC744 \uC804\uC1A1\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4 (${command.id})`);
|
|
5328
5328
|
return { ...command, state: to };
|
|
5329
5329
|
}
|
|
5330
5330
|
function asApproved(command) {
|
|
5331
5331
|
if (command.state !== "approved" && command.state !== "failed") {
|
|
5332
|
-
throw new Error(`\uC2B9\uC778\uB418\uC9C0 \uC54A\uC740 \
|
|
5332
|
+
throw new Error(`\uC2B9\uC778\uB418\uC9C0 \uC54A\uC740 \uBA85\uB839\uC740 \uC2E4\uD589\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4 (${command.id} \xB7 ${command.state})`);
|
|
5333
5333
|
}
|
|
5334
5334
|
if (requiresApproval(command) && !command.approval?.by) {
|
|
5335
|
-
throw new Error(`\uC2B9\uC778 \uAE30\uB85D\uC774 \uC5C6\uB294 \
|
|
5335
|
+
throw new Error(`\uC2B9\uC778 \uAE30\uB85D\uC774 \uC5C6\uB294 \uBA85\uB839\uC740 \uC2E4\uD589\uD560 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4 (${command.id})`);
|
|
5336
5336
|
}
|
|
5337
5337
|
return command;
|
|
5338
5338
|
}
|
|
@@ -5342,7 +5342,7 @@ function commandTypeOf(specs, type) {
|
|
|
5342
5342
|
function commandFromSpec(spec, seed) {
|
|
5343
5343
|
const missing = missingCommandPayload(spec, seed.payload);
|
|
5344
5344
|
if (missing.length) {
|
|
5345
|
-
throw new Error(`${spec.type}: \
|
|
5345
|
+
throw new Error(`${spec.type}: \uD544\uC218 \uD544\uB4DC \uB204\uB77D \u2014 ${missing.join(", ")}`);
|
|
5346
5346
|
}
|
|
5347
5347
|
return {
|
|
5348
5348
|
id: seed.id,
|
|
@@ -5365,10 +5365,10 @@ function missingCommandPayload(spec, payload) {
|
|
|
5365
5365
|
}
|
|
5366
5366
|
function commandSpecGaps(specs, command) {
|
|
5367
5367
|
const spec = commandTypeOf(specs, command.type);
|
|
5368
|
-
if (!spec) return [`\
|
|
5369
|
-
const gaps = missingCommandPayload(spec, command.payload).map((k) => `\
|
|
5368
|
+
if (!spec) return [`\uC9C0\uC6D0\uD558\uC9C0 \uC54A\uB294 \uC870\uCE58 \uC720\uD615 \u2014 ${command.type}`];
|
|
5369
|
+
const gaps = missingCommandPayload(spec, command.payload).map((k) => `\uD544\uC218 \uD544\uB4DC \uB204\uB77D \u2014 ${k}`);
|
|
5370
5370
|
if (command.reversible === true && spec.reversible === false) {
|
|
5371
|
-
gaps.push(`${command.type} \uC740 \uB418\uB3CC\uB9B4 \uC218 \uC5C6\
|
|
5371
|
+
gaps.push(`${command.type} \uC720\uD615\uC740 \uB418\uB3CC\uB9B4 \uC218 \uC5C6\uC2B5\uB2C8\uB2E4. \uC774 \uBA85\uB839\uC744 \uB418\uB3CC\uB9AC\uAE30 \uAC00\uB2A5\uC73C\uB85C \uC9C0\uC815\uD558\uBA74 \uC2B9\uC778 \uC808\uCC28\uB97C \uC6B0\uD68C\uD558\uBBC0\uB85C \uC124\uC815\uC744 \uBCC0\uACBD\uD558\uC138\uC694.`);
|
|
5372
5372
|
}
|
|
5373
5373
|
return gaps;
|
|
5374
5374
|
}
|
|
@@ -5732,6 +5732,11 @@ var DOCK_FACT_KIND = {
|
|
|
5732
5732
|
slotRequest: "slot-request",
|
|
5733
5733
|
/** warehouse → yard: the order no longer needs it. */
|
|
5734
5734
|
slotWithdrawn: "slot-withdrawn",
|
|
5735
|
+
/**
|
|
5736
|
+
* warehouse → yard: these logistic units (SSCC) came off or went onto the trailer at the door, as the warehouse received or
|
|
5737
|
+
* shipped them (ADR-0210 decision 2, 2026-11-20) - the yard records the unloading or loading against the appointment's trailer.
|
|
5738
|
+
*/
|
|
5739
|
+
cargo: "cargo",
|
|
5735
5740
|
/** yard → warehouse: the appointment for a request, as it stands now - booked, moved, cancelled, at the door, done. */
|
|
5736
5741
|
appointment: "appointment",
|
|
5737
5742
|
/** yard → warehouse: the yard will not book this request, and why. */
|
|
@@ -5780,6 +5785,25 @@ function dockFactOf(record, takes) {
|
|
|
5780
5785
|
if (errors.length) return { errors };
|
|
5781
5786
|
return { fact: { factId: s("factId"), kind, request: s("request"), ...text("reason") ? { reason: s("reason") } : {} } };
|
|
5782
5787
|
}
|
|
5788
|
+
case DOCK_FACT_KIND.cargo: {
|
|
5789
|
+
if (!text("order")) errors.push("order is missing: cargo names the warehouse order");
|
|
5790
|
+
if (!Object.values(YMS_ORDER_KIND).includes(r.direction)) errors.push(`direction must be ${Object.values(YMS_ORDER_KIND).join(" or ")}`);
|
|
5791
|
+
if (!isInstant(r.eventTime)) errors.push("eventTime is not an instant");
|
|
5792
|
+
const units = r.units;
|
|
5793
|
+
if (!Array.isArray(units) || !units.length) errors.push("units is empty: cargo names the logistic units that crossed the door");
|
|
5794
|
+
else for (const unit of units) if (typeof unit !== "string" || !ssccDigitsOf(unit.trim())) errors.push(`${String(unit)} is not an SSCC`);
|
|
5795
|
+
if (errors.length) return { errors };
|
|
5796
|
+
return {
|
|
5797
|
+
fact: {
|
|
5798
|
+
factId: s("factId"),
|
|
5799
|
+
kind,
|
|
5800
|
+
order: s("order"),
|
|
5801
|
+
direction: r.direction,
|
|
5802
|
+
units: [...new Set(units.map((unit) => unit.trim()))],
|
|
5803
|
+
eventTime: r.eventTime
|
|
5804
|
+
}
|
|
5805
|
+
};
|
|
5806
|
+
}
|
|
5783
5807
|
case DOCK_FACT_KIND.appointment: {
|
|
5784
5808
|
for (const key of ["request", "order", "appointment", "dockDoor"]) if (!text(key)) errors.push(`${key} is missing`);
|
|
5785
5809
|
if (!isYmsAppointmentStatus(r.status)) errors.push(`status ${String(r.status)} is not an appointment status`);
|