@pdtf/schemas 3.6.0-dev.3 → 3.6.0-dev.32
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/docs/ta6-certificate-permit-contract.md +51 -0
- package/docs/v4-mapping-and-recomposition.md +476 -0
- package/index.js +212 -0
- package/package.json +10 -1
- package/src/schemas/v3/combined.json +2267 -658
- package/src/schemas/v3/compactSkeleton.txt +120 -51
- package/src/schemas/v3/overlays/baspi4.json +54 -74
- package/src/schemas/v3/overlays/baspi5.json +54 -74
- package/src/schemas/v3/overlays/extensions/ac.json +2 -1
- package/src/schemas/v3/overlays/extensions/dk.json +3 -2
- package/src/schemas/v3/overlays/extensions/fd.json +2 -1
- package/src/schemas/v3/overlays/extensions/ic.json +44 -9
- package/src/schemas/v3/overlays/extensions/lc.json +3 -2
- package/src/schemas/v3/overlays/extensions/mi.json +2 -1
- package/src/schemas/v3/overlays/extensions/nd.json +3 -2
- package/src/schemas/v3/overlays/extensions/pc.json +3 -2
- package/src/schemas/v3/overlays/extensions/ph.json +2 -1
- package/src/schemas/v3/overlays/extensions/rw.json +4 -3
- package/src/schemas/v3/overlays/extensions/sc.json +8 -4
- package/src/schemas/v3/overlays/extensions/sd.json +3 -2
- package/src/schemas/v3/overlays/extensions/tr.json +3 -2
- package/src/schemas/v3/overlays/extensions/wg.json +2 -1
- package/src/schemas/v3/overlays/llc1.json +1 -2
- package/src/schemas/v3/overlays/lpe1.json +3 -2
- package/src/schemas/v3/overlays/nts.json +7 -3
- package/src/schemas/v3/overlays/nts2.json +9 -4
- package/src/schemas/v3/overlays/ntsl.json +5 -2
- package/src/schemas/v3/overlays/ntsl2.json +7 -3
- package/src/schemas/v3/overlays/piq.json +34 -25
- package/src/schemas/v3/overlays/rds.json +24 -50
- package/src/schemas/v3/overlays/sef25.json +16 -2
- package/src/schemas/v3/overlays/ta10.json +0 -9
- package/src/schemas/v3/overlays/ta6.json +39 -70
- package/src/schemas/v3/overlays/ta6ed6.json +331 -307
- package/{pensive-tesla-d0d355/src/schemas/v3/overlays/ta6.json → src/schemas/v3/overlays/ta6ed6v2.json} +1574 -1464
- package/src/schemas/v3/overlays/ta7.json +2 -1
- package/src/schemas/v3/overlays/ta7ed5.json +77 -21
- package/src/schemas/v3/pdtf-transaction.json +1030 -492
- package/src/schemas/v3/skeleton.json +163 -57
- package/src/schemas/v4/Gift.json +88 -0
- package/src/schemas/v4/Offer.json +425 -0
- package/src/schemas/v4/Organisation.json +167 -0
- package/src/schemas/v4/Person.json +321 -0
- package/src/schemas/v4/Property.json +27813 -0
- package/src/schemas/v4/PropertyTitleLink.json +183 -0
- package/src/schemas/v4/Representation.json +67 -0
- package/src/schemas/v4/SellerCapacity.json +193 -0
- package/src/schemas/v4/Title.json +14675 -0
- package/src/schemas/v4/Transaction.json +1612 -0
- package/src/schemas/v4/TransactionRole.json +59 -0
- package/src/schemas/v4/mapping.json +1188 -0
- package/src/utils/checkTa6OmissionCompatibility.js +146 -0
- package/src/utils/extractExtensionOverlays.js +11 -2
- package/src/utils/extractOverlay.js +21 -0
- package/src/utils/generateV4Schemas.js +1561 -0
- package/src/utils/syncTa6ed6v2Markers.js +92 -0
- package/src/utils/v4.js +956 -0
- package/CLAUDE.md +0 -101
- package/pensive-tesla-d0d355/CLAUDE.md +0 -101
- package/pensive-tesla-d0d355/LICENSE +0 -21
- package/pensive-tesla-d0d355/README.md +0 -435
- package/pensive-tesla-d0d355/docs/branch-release-workflow.md +0 -138
- package/pensive-tesla-d0d355/docs/sef25-extensions-ui-spec.md +0 -355
- package/pensive-tesla-d0d355/index.js +0 -654
- package/pensive-tesla-d0d355/package-lock.json +0 -7297
- package/pensive-tesla-d0d355/package.json +0 -44
- package/pensive-tesla-d0d355/src/examples/v1/exampleAddParticipantVouch.json +0 -32
- package/pensive-tesla-d0d355/src/examples/v1/exampleDocumentedVouch.json +0 -40
- package/pensive-tesla-d0d355/src/examples/v1/exampleElectronicRecord.json +0 -30
- package/pensive-tesla-d0d355/src/examples/v1/exampleTransaction.json +0 -878
- package/pensive-tesla-d0d355/src/examples/v1/exampleVouch.json +0 -25
- package/pensive-tesla-d0d355/src/examples/v2/exampleTransaction.json +0 -901
- package/pensive-tesla-d0d355/src/examples/v3/exampleAddParticipantVouch.json +0 -38
- package/pensive-tesla-d0d355/src/examples/v3/exampleCustomOverlay.json +0 -55
- package/pensive-tesla-d0d355/src/examples/v3/exampleCustomOverlay2.json +0 -93
- package/pensive-tesla-d0d355/src/examples/v3/exampleDocumentedVouch.json +0 -47
- package/pensive-tesla-d0d355/src/examples/v3/exampleElectronicRecord.json +0 -36
- package/pensive-tesla-d0d355/src/examples/v3/exampleTransaction.json +0 -1038
- package/pensive-tesla-d0d355/src/examples/v3/exampleVouch.json +0 -32
- package/pensive-tesla-d0d355/src/mappings/SendPropertyDetailsRequestSchema.json +0 -1588
- package/pensive-tesla-d0d355/src/mappings/adf.js +0 -198
- package/pensive-tesla-d0d355/src/schemas/v1/GeoJSON.json +0 -1279
- package/pensive-tesla-d0d355/src/schemas/v1/baspiNotes.html +0 -102
- package/pensive-tesla-d0d355/src/schemas/v1/energy-performance-certificate.json +0 -124
- package/pensive-tesla-d0d355/src/schemas/v1/freehold-information.json +0 -2051
- package/pensive-tesla-d0d355/src/schemas/v1/leasehold-information.json +0 -2064
- package/pensive-tesla-d0d355/src/schemas/v1/legal-information.json +0 -1045
- package/pensive-tesla-d0d355/src/schemas/v1/material-facts.json +0 -2109
- package/pensive-tesla-d0d355/src/schemas/v1/pdtf-transaction-search-results.json +0 -40
- package/pensive-tesla-d0d355/src/schemas/v1/pdtf-transaction.json +0 -191
- package/pensive-tesla-d0d355/src/schemas/v1/searches/drainage-and-water.json +0 -261
- package/pensive-tesla-d0d355/src/schemas/v1/searches/local-land-charges.json +0 -69
- package/pensive-tesla-d0d355/src/schemas/v1/searches/local-searches-required.json +0 -857
- package/pensive-tesla-d0d355/src/schemas/v1/searches.json +0 -237
- package/pensive-tesla-d0d355/src/schemas/v1/title-deed.json +0 -841
- package/pensive-tesla-d0d355/src/schemas/v2/baspiNotes.html +0 -102
- package/pensive-tesla-d0d355/src/schemas/v2/combined.json +0 -37731
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/baspi.json +0 -8132
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/con29DW.json +0 -705
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/con29R.json +0 -2956
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/fme1.json +0 -1259
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/llc1.json +0 -25
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/lpe1.json +0 -2171
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/nts.json +0 -326
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/oc1.json +0 -2799
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/piq.json +0 -3419
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/rds.json +0 -3736
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/ta10.json +0 -5306
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/ta6.json +0 -4533
- package/pensive-tesla-d0d355/src/schemas/v2/overlays/ta7.json +0 -1045
- package/pensive-tesla-d0d355/src/schemas/v2/pdtf-transaction.json +0 -34351
- package/pensive-tesla-d0d355/src/schemas/v2/skeleton.json +0 -3973
- package/pensive-tesla-d0d355/src/schemas/v3/combined.json +0 -48469
- package/pensive-tesla-d0d355/src/schemas/v3/compactSkeleton.txt +0 -4519
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/README.md +0 -299
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/baspi4.json +0 -8025
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/baspi5.json +0 -8175
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/con29DW.json +0 -716
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/con29R.json +0 -2981
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/ac.json +0 -333
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/as.json +0 -74
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/dk.json +0 -32
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/dr.json +0 -73
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/er.json +0 -85
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/fd.json +0 -75
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/hi.json +0 -51
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/hs.json +0 -73
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/ic.json +0 -59
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/jk.json +0 -96
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/la.json +0 -85
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/lc.json +0 -75
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/ma.json +0 -90
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/mc.json +0 -38
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/mi.json +0 -69
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/nd.json +0 -43
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/oa.json +0 -24
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/oc.json +0 -57
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/pc.json +0 -37
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/ph.json +0 -194
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/rw.json +0 -68
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/sb.json +0 -73
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/sc.json +0 -129
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/sd.json +0 -63
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/sf.json +0 -74
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/sl.json +0 -68
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/ta.json +0 -252
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/tf.json +0 -103
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/tr.json +0 -73
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/extensions/wg.json +0 -350
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/fme1.json +0 -1266
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/llc1.json +0 -25
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/lpe1.json +0 -2199
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/nts.json +0 -2157
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/nts2.json +0 -2742
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/ntsl.json +0 -1813
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/ntsl2.json +0 -2217
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/oc1.json +0 -2817
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/piq.json +0 -3322
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/rds.json +0 -3665
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/sef25.json +0 -1639
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/sr24.json +0 -38
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/ta10.json +0 -4654
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/ta6ed6.json +0 -6534
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/ta7.json +0 -1537
- package/pensive-tesla-d0d355/src/schemas/v3/overlays/ta7ed5.json +0 -1551
- package/pensive-tesla-d0d355/src/schemas/v3/pdtf-transaction.json +0 -41573
- package/pensive-tesla-d0d355/src/schemas/v3/skeleton.json +0 -5767
- package/pensive-tesla-d0d355/src/schemas/verifiedClaims/README.md +0 -21
- package/pensive-tesla-d0d355/src/schemas/verifiedClaims/pdtf-verified-claims.json +0 -447
- package/pensive-tesla-d0d355/src/utils/compactSkeleton.js +0 -84
- package/pensive-tesla-d0d355/src/utils/countTokens.js +0 -67
- package/pensive-tesla-d0d355/src/utils/extractExtensionOverlays.js +0 -624
- package/pensive-tesla-d0d355/src/utils/extractOverlay.js +0 -381
- package/pensive-tesla-d0d355/src/utils/extractProperties.js +0 -44
- package/pensive-tesla-d0d355/src/utils/listPathTitles.js +0 -36
- package/pensive-tesla-d0d355/src/utils/minimalSkeleton.js +0 -85
- package/pensive-tesla-d0d355/src/utils/pathList.csv +0 -903
- package/pensive-tesla-d0d355/src/utils/pathSkeleton.js +0 -181
- package/src/examples/v1/exampleAddParticipantVouch.json +0 -32
- package/src/examples/v1/exampleDocumentedVouch.json +0 -40
- package/src/examples/v1/exampleElectronicRecord.json +0 -30
- package/src/examples/v1/exampleTransaction.json +0 -878
- package/src/examples/v1/exampleVouch.json +0 -25
- package/src/examples/v2/exampleTransaction.json +0 -901
- package/src/examples/v3/exampleAddParticipantVouch.json +0 -38
- package/src/examples/v3/exampleCustomOverlay.json +0 -55
- package/src/examples/v3/exampleCustomOverlay2.json +0 -93
- package/src/examples/v3/exampleDocumentedVouch.json +0 -47
- package/src/examples/v3/exampleElectronicRecord.json +0 -36
- package/src/examples/v3/exampleTransaction.json +0 -1038
- package/src/examples/v3/exampleVouch.json +0 -32
- package/src/mappings/SendPropertyDetailsRequestSchema.json +0 -1588
- package/src/mappings/adf.js +0 -198
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
// Run against an unpacked published npm package, not a git approximation:
|
|
2
|
+
// node src/utils/checkTa6OmissionCompatibility.js /path/to/baseline/package
|
|
3
|
+
const assert = require("assert");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const current = require("../../index.js");
|
|
6
|
+
const baseline = require(path.resolve(process.argv[2]));
|
|
7
|
+
const schemaId =
|
|
8
|
+
"https://trust.propdata.org.uk/schemas/v3/pdtf-transaction.json";
|
|
9
|
+
const electricalPath = "/propertyPack/electricalWorks/electricalWorkSince2005";
|
|
10
|
+
const drainagePath =
|
|
11
|
+
"/propertyPack/waterAndDrainage/drainage/mainsFoulDrainage/offMainsDrainageSystem";
|
|
12
|
+
const jp = require("jsonpointer");
|
|
13
|
+
const clone = (v) => JSON.parse(JSON.stringify(v));
|
|
14
|
+
const results = {
|
|
15
|
+
baseline: require(path.resolve(process.argv[2], "package.json")).version,
|
|
16
|
+
candidate: require("../../package.json").version,
|
|
17
|
+
comparisons: 0,
|
|
18
|
+
legacy: {
|
|
19
|
+
validToValid: 0,
|
|
20
|
+
invalidToValid: 0,
|
|
21
|
+
invalidToInvalid: 0,
|
|
22
|
+
validToInvalid: [],
|
|
23
|
+
},
|
|
24
|
+
newAnswer: {
|
|
25
|
+
validToValid: 0,
|
|
26
|
+
invalidToValid: 0,
|
|
27
|
+
invalidToInvalid: 0,
|
|
28
|
+
validToInvalid: [],
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
for (const overlay of ["ta6ed6", "ta6ed6v2"]) {
|
|
32
|
+
const fixture = require(`../tests/fixtures/ta6/${overlay}.json`);
|
|
33
|
+
assert(
|
|
34
|
+
baseline.getValidator(schemaId, [overlay])(clone(fixture)),
|
|
35
|
+
`${overlay} whole fixture must be baseline-valid`,
|
|
36
|
+
);
|
|
37
|
+
const compare = (target, value, group) => {
|
|
38
|
+
for (const whole of [false, true]) {
|
|
39
|
+
const record = whole ? clone(fixture) : value;
|
|
40
|
+
if (whole) {
|
|
41
|
+
jp.set(record, target, value);
|
|
42
|
+
if (target === drainagePath)
|
|
43
|
+
jp.set(
|
|
44
|
+
record,
|
|
45
|
+
"/propertyPack/waterAndDrainage/drainage/mainsFoulDrainage/yesNo",
|
|
46
|
+
"No",
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
const get = (pkg) =>
|
|
50
|
+
whole
|
|
51
|
+
? pkg.getValidator(schemaId, [overlay])
|
|
52
|
+
: pkg.getSubschemaValidator(target, schemaId, [overlay]);
|
|
53
|
+
const before = get(baseline)(clone(record));
|
|
54
|
+
const after = get(current)(clone(record));
|
|
55
|
+
results.comparisons++;
|
|
56
|
+
if (before && !after)
|
|
57
|
+
results[group].validToInvalid.push({ overlay, whole, target, value });
|
|
58
|
+
else
|
|
59
|
+
results[group][
|
|
60
|
+
before
|
|
61
|
+
? "validToValid"
|
|
62
|
+
: after
|
|
63
|
+
? "invalidToValid"
|
|
64
|
+
: "invalidToInvalid"
|
|
65
|
+
]++;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
for (const answer of [undefined, "Yes", "No", "Maybe", "", null]) {
|
|
69
|
+
for (const attachments of [
|
|
70
|
+
undefined,
|
|
71
|
+
"Attached",
|
|
72
|
+
"To follow",
|
|
73
|
+
"Not available",
|
|
74
|
+
"Invalid",
|
|
75
|
+
]) {
|
|
76
|
+
for (const certificateType of [
|
|
77
|
+
undefined,
|
|
78
|
+
"Electrical Safety Certificate (BS7671)",
|
|
79
|
+
]) {
|
|
80
|
+
const suppliedCertificate = {};
|
|
81
|
+
if (answer !== undefined) suppliedCertificate.yesNo = answer;
|
|
82
|
+
if (attachments !== undefined)
|
|
83
|
+
suppliedCertificate.attachments = attachments;
|
|
84
|
+
if (certificateType !== undefined)
|
|
85
|
+
suppliedCertificate.certificateType = certificateType;
|
|
86
|
+
compare(
|
|
87
|
+
electricalPath,
|
|
88
|
+
{ yesNo: "Yes", details: "Electrical work", suppliedCertificate },
|
|
89
|
+
answer === undefined ? "legacy" : "newAnswer",
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
for (const type of [
|
|
95
|
+
"Septic tank",
|
|
96
|
+
"Cesspit",
|
|
97
|
+
"Sewerage treatment plant",
|
|
98
|
+
"Other",
|
|
99
|
+
]) {
|
|
100
|
+
for (const permitDocuments of [
|
|
101
|
+
undefined,
|
|
102
|
+
"Attached",
|
|
103
|
+
"To follow",
|
|
104
|
+
"Not applicable",
|
|
105
|
+
"Invalid",
|
|
106
|
+
"",
|
|
107
|
+
null,
|
|
108
|
+
]) {
|
|
109
|
+
compare(
|
|
110
|
+
drainagePath,
|
|
111
|
+
{
|
|
112
|
+
offMainsDrainageSystemType: type,
|
|
113
|
+
otherConnectedProperties: { yesNo: "No" },
|
|
114
|
+
plantOnOtherLand: { yesNo: "No" },
|
|
115
|
+
plantDrainsIntoWaterway: { yesNo: "Yes" },
|
|
116
|
+
dateDischargeCommenced: "2020-01-01",
|
|
117
|
+
dateInstalled: "2020-01-01",
|
|
118
|
+
dateLastEmptied: "2025-01-01",
|
|
119
|
+
dateLastServiced: "2025-01-01",
|
|
120
|
+
supplier: "Provider",
|
|
121
|
+
makeModel: "Model",
|
|
122
|
+
serviceProviderName: "Servicer",
|
|
123
|
+
...(permitDocuments === undefined ? {} : { permitDocuments }),
|
|
124
|
+
},
|
|
125
|
+
"legacy",
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
// An unrelated question must remain byte-for-byte identical.
|
|
130
|
+
assert.deepStrictEqual(
|
|
131
|
+
current.getSubschema("/propertyPack/heating", schemaId, [overlay]),
|
|
132
|
+
baseline.getSubschema("/propertyPack/heating", schemaId, [overlay]),
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
assert.strictEqual(
|
|
136
|
+
results.legacy.validToInvalid.length,
|
|
137
|
+
0,
|
|
138
|
+
"Existing answer shapes regressed",
|
|
139
|
+
);
|
|
140
|
+
// Previously unconstrained values at the NEW property are the only expected tightening.
|
|
141
|
+
assert(
|
|
142
|
+
results.newAnswer.validToInvalid.every(
|
|
143
|
+
({ value }) => !["Yes", "No"].includes(value.suppliedCertificate.yesNo),
|
|
144
|
+
),
|
|
145
|
+
);
|
|
146
|
+
console.log(JSON.stringify(results, null, 2));
|
|
@@ -274,7 +274,7 @@ const extensionMappings = {
|
|
|
274
274
|
description: "Insurance claims upfront for SEF25",
|
|
275
275
|
refType: "sef25Ref",
|
|
276
276
|
paths: [
|
|
277
|
-
"/properties/propertyPack/properties/insurance
|
|
277
|
+
"/properties/propertyPack/properties/insurance",
|
|
278
278
|
],
|
|
279
279
|
},
|
|
280
280
|
|
|
@@ -575,7 +575,16 @@ function addIntermediateRefs(overlay, schema, refConfig) {
|
|
|
575
575
|
const schemaPath = "/" + this.path.join("/");
|
|
576
576
|
try {
|
|
577
577
|
const schemaNode = jp.get(schema, schemaPath);
|
|
578
|
-
if (schemaNode
|
|
578
|
+
if (!schemaNode) return;
|
|
579
|
+
// When the output key differs from the source key (e.g. sef25Ref -> ntsRef),
|
|
580
|
+
// prefer the schema's existing outputRef on intermediate parents so we
|
|
581
|
+
// don't clobber legitimate NTS refs when the extension is later merged.
|
|
582
|
+
if (
|
|
583
|
+
refConfig.ref !== refConfig.outputRef &&
|
|
584
|
+
schemaNode[refConfig.outputRef]
|
|
585
|
+
) {
|
|
586
|
+
node[refConfig.outputRef] = schemaNode[refConfig.outputRef];
|
|
587
|
+
} else if (schemaNode[refConfig.ref]) {
|
|
579
588
|
node[refConfig.outputRef] = schemaNode[refConfig.ref];
|
|
580
589
|
}
|
|
581
590
|
} catch (err) {
|
|
@@ -30,6 +30,7 @@ const extractFields = [
|
|
|
30
30
|
"ntsl2",
|
|
31
31
|
"ta6",
|
|
32
32
|
"ta6ed6",
|
|
33
|
+
"ta6ed6v2",
|
|
33
34
|
"ta7",
|
|
34
35
|
"ta7ed5",
|
|
35
36
|
"ta10",
|
|
@@ -220,6 +221,25 @@ const extractOverlay = (sourceSchema, ref) => {
|
|
|
220
221
|
jp.set(returnSchema, `${path}/enum`, element[refEnum]);
|
|
221
222
|
}
|
|
222
223
|
|
|
224
|
+
// Per-overlay display labels for enum values. The underlying enum (the
|
|
225
|
+
// stored value) is left untouched — we only emit positional `enumNames`
|
|
226
|
+
// aligned to the effective enum, so a form-facing overlay can present the
|
|
227
|
+
// form's own wording (e.g. "Ground"/"Surface water") while the data keeps
|
|
228
|
+
// its canonical value. Invisible to the core/base schema (stripped below).
|
|
229
|
+
const refEnumNames = `${ref}EnumNames`;
|
|
230
|
+
if (element[refEnumNames]) {
|
|
231
|
+
const labelMap = element[refEnumNames];
|
|
232
|
+
const effectiveEnum = element[refEnum] || element.enum;
|
|
233
|
+
if (Array.isArray(effectiveEnum)) {
|
|
234
|
+
const enumNames = effectiveEnum.map((value) =>
|
|
235
|
+
Object.prototype.hasOwnProperty.call(labelMap, value)
|
|
236
|
+
? labelMap[value]
|
|
237
|
+
: value
|
|
238
|
+
);
|
|
239
|
+
jp.set(returnSchema, `${path}/enumNames`, enumNames);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
223
243
|
const refConst = `${ref}Const`;
|
|
224
244
|
if (Object.prototype.hasOwnProperty.call(element, refConst)) {
|
|
225
245
|
jp.set(returnSchema, `${path}/const`, element[refConst]);
|
|
@@ -265,6 +285,7 @@ const coreSchema = deleteProperties(combinedSchema, [
|
|
|
265
285
|
...metadataFields.map((item) => `${item}Title`),
|
|
266
286
|
...metadataFields.map((item) => `${item}Description`),
|
|
267
287
|
...metadataFields.map((item) => `${item}Enum`),
|
|
288
|
+
...metadataFields.map((item) => `${item}EnumNames`),
|
|
268
289
|
...metadataFields.map((item) => `${item}Type`),
|
|
269
290
|
...metadataFields.map((item) => `${item}MinLength`),
|
|
270
291
|
...metadataFields.map((item) => `${item}MaxLength`),
|