@dforge-core/metadata 0.0.42 → 0.0.44
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/CHANGELOG.md +39 -1
- package/dist/dsl/index.js +22 -3
- package/dist/dsl/index.js.map +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +19 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/schemas/entity.schema.json +15 -3
- package/schemas/registers.schema.json +60 -3
- package/schemas/reports.schema.json +6 -2
- package/schemas/translations.schema.json +21 -0
- package/src/dsl/builtins.ts +22 -3
- package/src/registers/check-binding.ts +19 -1
- package/src/registers/types.ts +2 -0
- package/src/reports.ts +4 -0
package/dist/index.d.ts
CHANGED
|
@@ -973,7 +973,11 @@ interface ReportQuery {
|
|
|
973
973
|
}
|
|
974
974
|
/** Per-column metadata override on a dataset. */
|
|
975
975
|
interface ColumnDef {
|
|
976
|
+
/** A literal header: wins over the entity's or the procedure's translated one. */
|
|
976
977
|
label?: string;
|
|
978
|
+
fieldTypeCd?: string;
|
|
979
|
+
format?: string;
|
|
980
|
+
/** Accepted, but read by nothing. */
|
|
977
981
|
visible?: boolean;
|
|
978
982
|
width?: number;
|
|
979
983
|
}
|
|
@@ -1722,6 +1726,8 @@ interface RegisterBindingParams {
|
|
|
1722
1726
|
lineEntity?: string;
|
|
1723
1727
|
lineField?: string;
|
|
1724
1728
|
groupLinesBy?: string[];
|
|
1729
|
+
/** On a line posting: the line column dating that line's movement instead of `dateField`. */
|
|
1730
|
+
lineDateField?: string;
|
|
1725
1731
|
/** Register dimension or resource name → column of the row read. */
|
|
1726
1732
|
map?: Record<string, RegisterMapValue>;
|
|
1727
1733
|
/** On a line posting: register name → DOCUMENT column. */
|
package/dist/index.js
CHANGED
|
@@ -926,18 +926,36 @@ function checkPosting(params, ledger, error) {
|
|
|
926
926
|
if (hasKey(params, "groupLinesBy")) {
|
|
927
927
|
error(["groupLinesBy"], "register-group-lines", "'groupLinesBy' needs lines to group \u2014 name the 'lineEntity'.");
|
|
928
928
|
}
|
|
929
|
+
if (hasKey(params, "lineDateField")) {
|
|
930
|
+
error(["lineDateField"], "register-line-date", "'lineDateField' dates the lines a posting is made from \u2014 name the 'lineEntity', or date the document with 'dateField'.");
|
|
931
|
+
}
|
|
929
932
|
}
|
|
930
933
|
if (ledger) {
|
|
931
934
|
if (!lineEntity) {
|
|
932
935
|
error(["lineEntity"], "register-line", "An L column posts lines: 'lineEntity' and 'lineField' are required.");
|
|
933
936
|
}
|
|
934
|
-
for (const key of ["headerMap", "skipPostingWhenEmpty", "dateTrunc", "groupLinesBy"]) {
|
|
937
|
+
for (const key of ["headerMap", "skipPostingWhenEmpty", "dateTrunc", "groupLinesBy", "lineDateField"]) {
|
|
935
938
|
if (hasKey(params, key)) {
|
|
936
939
|
error([key], "register-ledger-only", `'${key}' is read by A columns only.`);
|
|
937
940
|
}
|
|
938
941
|
}
|
|
939
942
|
}
|
|
940
943
|
const dateField = safeTrim(params.dateField);
|
|
944
|
+
const lineDateField = safeTrim(params.lineDateField);
|
|
945
|
+
if (lineEntity && lineDateField && !ledger) {
|
|
946
|
+
if (!dateField) {
|
|
947
|
+
error(["dateField"], "register-line-date", "'lineDateField' falls back to the document's 'dateField' for a line with no date \u2014 name a 'dateField'.");
|
|
948
|
+
}
|
|
949
|
+
if (hasKey(params, "periodDimField")) {
|
|
950
|
+
error(["lineDateField"], "register-line-date", "'lineDateField' and 'periodDimField' cannot be combined: the period dimension is the document's one period, and a line dated in another month would post under it.");
|
|
951
|
+
}
|
|
952
|
+
if (!lockedLines.includes("*") && !lockedLines.includes(lineDateField)) {
|
|
953
|
+
error(["lockedLineFields"], "register-line-date", `'${lineDateField}' must be in 'lockedLineFields': a posted line re-dated would leave its movement under the old date.`);
|
|
954
|
+
}
|
|
955
|
+
if (Array.isArray(params.groupLinesBy) && !stringList(params.groupLinesBy).includes(lineDateField)) {
|
|
956
|
+
error(["groupLinesBy"], "register-line-date", `'${lineDateField}' must be in 'groupLinesBy': a group posts one movement, which has one date only when its lines share it.`);
|
|
957
|
+
}
|
|
958
|
+
}
|
|
941
959
|
if (hasKey(params, "dateTrunc") && !dateField) {
|
|
942
960
|
error(["dateTrunc"], "register-date", "'dateTrunc' needs a 'dateField'.");
|
|
943
961
|
}
|