@pdtf/schemas 3.6.0-dev.14 → 3.6.0-dev.16

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.
@@ -5,6 +5,11 @@
5
5
  "*": {}
6
6
  }
7
7
  },
8
+ "metadata": {
9
+ "*": {
10
+ "*": {}
11
+ }
12
+ },
8
13
  "status": "string",
9
14
  "participants": [
10
15
  {
@@ -82,6 +87,7 @@
82
87
  "attachments": "string",
83
88
  "companyName": "string",
84
89
  "companyNumber": "string",
90
+ "directorOrAuthorisedPerson": "string",
85
91
  "countryOfIncorporation": "string"
86
92
  },
87
93
  "dateBecameOwnerOrAuthority": "string"
@@ -162,7 +168,6 @@
162
168
  "hasLift": "string",
163
169
  "overCommercialPremises": {
164
170
  "isLocatedOverCommercialPremises": "variant",
165
- "detailsAnalysis": {},
166
171
  "details": "string"
167
172
  }
168
173
  },
@@ -981,7 +986,6 @@
981
986
  },
982
987
  "excessPaymentAnticipated": {
983
988
  "yesNo": "variant",
984
- "detailsAnalysis": {},
985
989
  "details": "string"
986
990
  },
987
991
  "lastDemandPeriod": {
@@ -994,7 +998,6 @@
994
998
  },
995
999
  "reserveFund": {
996
1000
  "yesNo": "variant",
997
- "detailsAnalysis": {},
998
1001
  "details": "string",
999
1002
  "contributionIncludedInServiceCharge": "string",
1000
1003
  "sufficentToCoverSection20Expenditure": {
@@ -1004,24 +1007,22 @@
1004
1007
  },
1005
1008
  "lastDecoratedPeriod": {
1006
1009
  "externally": {
1007
- "year": "integer",
1010
+ "year": {},
1008
1011
  "from": "string",
1009
1012
  "to": "string"
1010
1013
  },
1011
1014
  "internally": {
1012
- "year": "integer",
1015
+ "year": {},
1013
1016
  "from": "string",
1014
1017
  "to": "string"
1015
1018
  }
1016
1019
  },
1017
1020
  "section20WorksProposed": {
1018
1021
  "yesNo": "variant",
1019
- "detailsAnalysis": {},
1020
1022
  "details": "string"
1021
1023
  },
1022
1024
  "increaseInServiceChargeAnticipated": {
1023
1025
  "yesNo": "variant",
1024
- "detailsAnalysis": {},
1025
1026
  "details": "string"
1026
1027
  },
1027
1028
  "outstandingServiceChargeConsultation": {
@@ -1105,12 +1106,10 @@
1105
1106
  },
1106
1107
  "unresolvedDisputes": {
1107
1108
  "yesNo": "variant",
1108
- "detailsAnalysis": {},
1109
1109
  "details": "string"
1110
1110
  },
1111
1111
  "breachOfTermsOfLease": {
1112
1112
  "yesNo": "variant",
1113
- "detailsAnalysis": {},
1114
1113
  "details": "string"
1115
1114
  }
1116
1115
  },
@@ -1130,7 +1129,6 @@
1130
1129
  "alterations": {
1131
1130
  "sellerAwareOfAlterations": {
1132
1131
  "yesNo": "variant",
1133
- "detailsAnalysis": {},
1134
1132
  "details": "string",
1135
1133
  "landlordConsentObtained": {
1136
1134
  "yesNo": "variant",
@@ -1265,7 +1263,6 @@
1265
1263
  "listingAndConservation": {
1266
1264
  "isListed": {
1267
1265
  "yesNo": "variant",
1268
- "detailsAnalysis": {},
1269
1266
  "details": "string",
1270
1267
  "attachments": "string"
1271
1268
  },
@@ -1278,7 +1275,6 @@
1278
1275
  "yesNo": "variant",
1279
1276
  "workCarriedOut": {
1280
1277
  "yesNo": "variant",
1281
- "detailsAnalysis": {},
1282
1278
  "details": "string",
1283
1279
  "consentsObtained": "string",
1284
1280
  "attachments": "string"
@@ -1288,13 +1284,11 @@
1288
1284
  "typeOfConstruction": {
1289
1285
  "isStandardForm": {
1290
1286
  "yesNo": "variant",
1291
- "detailsAnalysis": {},
1292
1287
  "constructionType": "string",
1293
1288
  "details": "string"
1294
1289
  },
1295
1290
  "buildingSafety": {
1296
1291
  "yesNo": "variant",
1297
- "detailsAnalysis": {},
1298
1292
  "details": "string",
1299
1293
  "workAlreadyDone": "string",
1300
1294
  "workToBeDone": "string",
@@ -1304,14 +1298,12 @@
1304
1298
  },
1305
1299
  "loft": {
1306
1300
  "loftAccess": "variant",
1307
- "detailsAnalysis": {},
1308
1301
  "details": "string",
1309
1302
  "loftBoarded": "string",
1310
1303
  "loftInsulated": "string"
1311
1304
  },
1312
1305
  "sprayFoamInsulation": {
1313
1306
  "hasSprayFoamInstalled": "variant",
1314
- "detailsAnalysis": {},
1315
1307
  "details": "string",
1316
1308
  "attachments": "string"
1317
1309
  },
@@ -1447,29 +1439,34 @@
1447
1439
  "disputesAndComplaints": {
1448
1440
  "hasDisputesAndComplaints": {
1449
1441
  "yesNo": "variant",
1450
- "detailsAnalysis": {},
1451
1442
  "details": "string"
1452
1443
  },
1453
1444
  "leadingToDisputesAndComplaints": {
1454
1445
  "yesNo": "variant",
1455
- "detailsAnalysis": {},
1456
1446
  "details": "string"
1457
1447
  }
1458
1448
  },
1459
1449
  "alterationsAndChanges": {
1460
1450
  "hasStructuralAlterations": {
1461
1451
  "yesNo": "variant",
1462
- "detailsAnalysis": {},
1452
+ "alterationTypes": [
1453
+ "string"
1454
+ ],
1463
1455
  "details": "string",
1456
+ "workCompleted": {
1457
+ "yesNo": "variant",
1458
+ "details": "string"
1459
+ },
1460
+ "documents": "string",
1461
+ "approvalsObtained": "string",
1462
+ "approvalsNotRequiredReason": "string",
1464
1463
  "buildingRegApproval": {
1465
1464
  "yesNo": "variant",
1466
- "detailsAnalysis": {},
1467
1465
  "attachments": "string",
1468
1466
  "details": "string"
1469
1467
  },
1470
1468
  "planningPermission": {
1471
1469
  "yesNo": "variant",
1472
- "detailsAnalysis": {},
1473
1470
  "attachments": "string",
1474
1471
  "details": "string"
1475
1472
  },
@@ -1486,12 +1483,10 @@
1486
1483
  },
1487
1484
  "changeOfUse": {
1488
1485
  "yesNo": "variant",
1489
- "detailsAnalysis": {},
1490
1486
  "details": "string",
1491
1487
  "yearCompleted": "integer",
1492
1488
  "buildingRegApproval": {
1493
1489
  "yesNo": "variant",
1494
- "detailsAnalysis": {},
1495
1490
  "attachments": "string",
1496
1491
  "details": "string"
1497
1492
  },
@@ -1518,12 +1513,10 @@
1518
1513
  },
1519
1514
  "windowReplacementsSince2002": {
1520
1515
  "yesNo": "variant",
1521
- "detailsAnalysis": {},
1522
1516
  "details": "string",
1523
1517
  "yearCompleted": "integer",
1524
1518
  "buildingRegApproval": {
1525
1519
  "yesNo": "variant",
1526
- "detailsAnalysis": {},
1527
1520
  "attachments": "string",
1528
1521
  "details": "string"
1529
1522
  },
@@ -1569,12 +1562,10 @@
1569
1562
  },
1570
1563
  "hasAddedConservatory": {
1571
1564
  "yesNo": "variant",
1572
- "detailsAnalysis": {},
1573
1565
  "details": "string",
1574
1566
  "yearCompleted": "integer",
1575
1567
  "buildingRegApproval": {
1576
1568
  "yesNo": "variant",
1577
- "detailsAnalysis": {},
1578
1569
  "attachments": "string",
1579
1570
  "details": "string"
1580
1571
  },
@@ -1715,20 +1706,17 @@
1715
1706
  },
1716
1707
  "worksUnfinished": {
1717
1708
  "yesNo": "variant",
1718
- "detailsAnalysis": {},
1719
1709
  "details": "string",
1720
1710
  "attachments": "string"
1721
1711
  },
1722
1712
  "planningPermissionBreaches": {
1723
1713
  "yesNo": "variant",
1724
- "detailsAnalysis": {},
1725
1714
  "details": "string",
1726
1715
  "willingToInsure": "string",
1727
1716
  "attachments": "string"
1728
1717
  },
1729
1718
  "unresolvedPlanningIssues": {
1730
1719
  "yesNo": "variant",
1731
- "detailsAnalysis": {},
1732
1720
  "details": "string",
1733
1721
  "willingToInsure": "string",
1734
1722
  "attachments": "string"
@@ -1762,7 +1750,6 @@
1762
1750
  },
1763
1751
  "partyWallAct": {
1764
1752
  "yesNo": "variant",
1765
- "detailsAnalysis": {},
1766
1753
  "details": "string",
1767
1754
  "attachments": "string"
1768
1755
  },
@@ -1794,7 +1781,6 @@
1794
1781
  },
1795
1782
  "subsidenceOrStructuralFault": {
1796
1783
  "yesNo": "variant",
1797
- "detailsAnalysis": {},
1798
1784
  "details": "string",
1799
1785
  "attachments": "string"
1800
1786
  },
@@ -2427,7 +2413,6 @@
2427
2413
  "yearInstalled": "integer",
2428
2414
  "panelsOwnedOutright": {
2429
2415
  "yesNo": "variant",
2430
- "detailsAnalysis": {},
2431
2416
  "details": "string",
2432
2417
  "attachments": "string",
2433
2418
  "associatedCost": {
@@ -2437,7 +2422,6 @@
2437
2422
  },
2438
2423
  "panelProviderLease": {
2439
2424
  "yesNo": "variant",
2440
- "detailsAnalysis": {},
2441
2425
  "details": "string",
2442
2426
  "attachments": "string"
2443
2427
  },
@@ -2627,7 +2611,6 @@
2627
2611
  "heating": {
2628
2612
  "heatingSystem": {
2629
2613
  "heatingType": "variant",
2630
- "detailsAnalysis": {},
2631
2614
  "centralHeatingDetails": {
2632
2615
  "centralHeatingFuel": {
2633
2616
  "centralHeatingFuelType": "variant",
@@ -2658,6 +2641,18 @@
2658
2641
  },
2659
2642
  "details": "string"
2660
2643
  },
2644
+ "mainHeatingTypes": [
2645
+ "string"
2646
+ ],
2647
+ "mainHeatingTypesOtherDetails": "string",
2648
+ "heatingInstalledDate": {},
2649
+ "boilerInstalledDate": {},
2650
+ "heatingSystemReplaced": "string",
2651
+ "complianceCertificates": "string",
2652
+ "inspectionReport": "string",
2653
+ "inGoodWorkingOrder": "string",
2654
+ "lastServicedYear": {},
2655
+ "lastServicedReport": "string",
2661
2656
  "otherHeatingFeatures": [
2662
2657
  "string"
2663
2658
  ],
@@ -2734,22 +2729,18 @@
2734
2729
  "difficultiesObtainingInsurance": {
2735
2730
  "abnormalRiseInPremiums": {
2736
2731
  "yesNo": "variant",
2737
- "detailsAnalysis": {},
2738
2732
  "details": "string"
2739
2733
  },
2740
2734
  "subjectToHighExcesses": {
2741
2735
  "yesNo": "variant",
2742
- "detailsAnalysis": {},
2743
2736
  "details": "string"
2744
2737
  },
2745
2738
  "subjectToUnusualConditions": {
2746
2739
  "yesNo": "variant",
2747
- "detailsAnalysis": {},
2748
2740
  "details": "string"
2749
2741
  },
2750
2742
  "refused": {
2751
2743
  "yesNo": "variant",
2752
- "detailsAnalysis": {},
2753
2744
  "details": "string"
2754
2745
  }
2755
2746
  },
@@ -2759,7 +2750,6 @@
2759
2750
  "whoInsures": "string",
2760
2751
  "insuranceClaims": {
2761
2752
  "yesNo": "variant",
2762
- "detailsAnalysis": {},
2763
2753
  "details": "string"
2764
2754
  }
2765
2755
  },
@@ -3184,23 +3174,19 @@
3184
3174
  "legalBoundaries": {
3185
3175
  "partOutsideLegalOwnership": {
3186
3176
  "yesNo": "variant",
3187
- "detailsAnalysis": {},
3188
3177
  "details": "string"
3189
3178
  },
3190
3179
  "partOnSeparateSiteOrDeed": {
3191
3180
  "yesNo": "variant",
3192
- "detailsAnalysis": {},
3193
3181
  "details": "string"
3194
3182
  },
3195
3183
  "boundariesDifferFromTitlePlan": {
3196
3184
  "yesNo": "variant",
3197
- "detailsAnalysis": {},
3198
3185
  "details": "string",
3199
3186
  "attachments": "string"
3200
3187
  },
3201
3188
  "boundaryAlterationProposal": {
3202
3189
  "yesNo": "variant",
3203
- "detailsAnalysis": {},
3204
3190
  "details": "string"
3205
3191
  },
3206
3192
  "ownership": {
@@ -3212,22 +3198,18 @@
3212
3198
  "front": "string"
3213
3199
  },
3214
3200
  "details": "string",
3215
- "attachments": "string",
3216
- "detailsAnalysis": {}
3201
+ "attachments": "string"
3217
3202
  },
3218
3203
  "haveBoundaryFeaturesMoved": {
3219
3204
  "yesNo": "variant",
3220
- "detailsAnalysis": {},
3221
3205
  "details": "string"
3222
3206
  },
3223
3207
  "adjacentLandIncluded": {
3224
3208
  "yesNo": "variant",
3225
- "detailsAnalysis": {},
3226
3209
  "details": "string"
3227
3210
  },
3228
3211
  "flyingFreehold": {
3229
3212
  "yesNo": "variant",
3230
- "detailsAnalysis": {},
3231
3213
  "details": "string"
3232
3214
  }
3233
3215
  },
@@ -3256,7 +3238,6 @@
3256
3238
  },
3257
3239
  "electricalWorkSince2005": {
3258
3240
  "yesNo": "variant",
3259
- "detailsAnalysis": {},
3260
3241
  "yearWorkCarriedOut": "integer",
3261
3242
  "details": "string",
3262
3243
  "suppliedCertificate": {
@@ -3285,7 +3266,6 @@
3285
3266
  "hasValidGuaranteesOrWarranties": "variant",
3286
3267
  "newHomeWarranty": {
3287
3268
  "yesNo": "variant",
3288
- "detailsAnalysis": {},
3289
3269
  "details": "string",
3290
3270
  "attachments": "string"
3291
3271
  },
@@ -3343,7 +3323,6 @@
3343
3323
  },
3344
3324
  "outstandingClaimsOrApplications": {
3345
3325
  "yesNo": "variant",
3346
- "detailsAnalysis": {},
3347
3326
  "details": "string",
3348
3327
  "attachments": "string"
3349
3328
  },
@@ -3353,7 +3332,6 @@
3353
3332
  },
3354
3333
  "titleDefectInsurance": {
3355
3334
  "yesNo": "variant",
3356
- "detailsAnalysis": {},
3357
3335
  "details": "string",
3358
3336
  "attachments": "string"
3359
3337
  }
@@ -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",
@@ -0,0 +1,92 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Sync ta6ed6v2 markers from ta6ed6 across combined.json.
4
+ *
5
+ * ta6ed6v2 is a "full marker set" twin of ta6ed6: every shared field carries its
6
+ * own `ta6ed6v2*` markers so that inclusion is presence and suppression is the
7
+ * ABSENCE of a v2 ref (see src/tests/v3/ta6ed6v2.test.js — the drift-lint).
8
+ *
9
+ * Two subtrees intentionally diverge (their v2 shape is hand-authored) and are
10
+ * excluded from sync: propertyPack.heating and propertyPack.alterationsAndChanges.
11
+ *
12
+ * For every OTHER node, this tool guarantees each `ta6ed6<Suffix>` marker has a
13
+ * matching `ta6ed6v2<Suffix>` marker of equal value — adding missing twins and
14
+ * repairing drifted values. Edits are minimal text splices that preserve the
15
+ * file's existing formatting.
16
+ *
17
+ * node src/utils/syncTa6ed6v2Markers.js # apply (write)
18
+ * node src/utils/syncTa6ed6v2Markers.js --check # exit 1 if out of sync (CI)
19
+ *
20
+ * After running, regenerate overlays: node src/utils/extractOverlay.js
21
+ */
22
+ const fs = require("fs");
23
+ const path = require("path");
24
+
25
+ const FILE = process.env.COMBINED_PATH || path.resolve(__dirname, "../schemas/v3/combined.json");
26
+ const CHECK = process.argv.includes("--check");
27
+
28
+ const MARKER_RE = /^ta6ed6(Ref|Required|Title|Description|Enum|EnumNames)$/;
29
+ const v2Of = (k) => k.replace(/^ta6ed6/, "ta6ed6v2");
30
+ // NOTE: array indices are numbers in the tokenizer path (strict-equal), so use 2 not "2".
31
+ const COMPANY = ["properties", "participants", "items", "oneOf", 2, "properties", "sellersCapacity", "oneOf", 2, "properties"];
32
+ const EXCLUDED_PREFIXES = [
33
+ ["properties", "propertyPack", "properties", "heating"],
34
+ ["properties", "propertyPack", "properties", "alterationsAndChanges"],
35
+ // §1.6 company seller fields: v2 realigns refs to the form (companyNumber→1.6.1,
36
+ // directorOrAuthorisedPerson→1.6.2) while ed6 keeps its existing refs — hand-authored.
37
+ [...COMPANY, "companyName"],
38
+ [...COMPANY, "companyNumber"],
39
+ [...COMPANY, "directorOrAuthorisedPerson"],
40
+ ];
41
+ const isExcluded = (p) => EXCLUDED_PREFIXES.some((pre) => pre.every((seg, i) => p[i] === seg));
42
+
43
+ // minimal position-tracking JSON tokenizer
44
+ function tokenize(text) {
45
+ let i = 0; const n = text.length; const members = [];
46
+ const ws = () => { while (i < n && /\s/.test(text[i])) i++; };
47
+ const str = () => { i++; while (i < n) { const c = text[i]; if (c === "\\") { i += 2; continue; } if (c === '"') { i++; break; } i++; } };
48
+ const val = (p) => { ws(); const c = text[i]; if (c === "{") obj(p); else if (c === "[") arr(p); else if (c === '"') str(); else { while (i < n && !/[,}\]\s]/.test(text[i])) i++; } };
49
+ function obj(p) { i++; ws(); if (text[i] === "}") { i++; return; } while (i < n) { ws(); const ks = i; str(); const key = JSON.parse(text.slice(ks, i)); ws(); i++; ws(); const vs = i; val(p.concat(key)); members.push({ path: p.concat(key), key, keyStart: ks, valueStart: vs, valueEnd: i }); ws(); if (text[i] === ",") { i++; continue; } if (text[i] === "}") { i++; break; } break; } }
50
+ function arr(p) { i++; ws(); if (text[i] === "]") { i++; return; } let k = 0; while (i < n) { ws(); val(p.concat(k)); k++; ws(); if (text[i] === ",") { i++; continue; } if (text[i] === "]") { i++; break; } break; } }
51
+ ws(); val([]); return members;
52
+ }
53
+
54
+ let text = fs.readFileSync(FILE, "utf8");
55
+ const members = tokenize(text);
56
+ const owner = (m) => m.path.slice(0, -1).join("/");
57
+ const keysByOwner = new Map();
58
+ for (const m of members) { const o = owner(m); if (!keysByOwner.has(o)) keysByOwner.set(o, new Map()); keysByOwner.get(o).set(m.key, m); }
59
+ const indentAt = (off) => text.slice(text.lastIndexOf("\n", off - 1) + 1, off);
60
+
61
+ const edits = []; // {at, end, text} (end omitted => pure insert)
62
+ const adds = [], fixes = [];
63
+ for (const m of members) {
64
+ if (!MARKER_RE.test(m.key)) continue;
65
+ if (isExcluded(m.path)) continue;
66
+ const v2 = v2Of(m.key);
67
+ const siblings = keysByOwner.get(owner(m));
68
+ const ed6Val = text.slice(m.valueStart, m.valueEnd);
69
+ if (!siblings.has(v2)) {
70
+ const indent = indentAt(m.keyStart);
71
+ edits.push({ at: m.valueEnd, text: `,\n${indent}"${v2}": ${ed6Val}` });
72
+ adds.push("/" + m.path.join("/"));
73
+ } else {
74
+ const tw = siblings.get(v2);
75
+ const v2Val = text.slice(tw.valueStart, tw.valueEnd);
76
+ if (JSON.stringify(JSON.parse(v2Val)) !== JSON.stringify(JSON.parse(ed6Val))) {
77
+ edits.push({ at: tw.valueStart, end: tw.valueEnd, text: ed6Val });
78
+ fixes.push("/" + tw.path.join("/"));
79
+ }
80
+ }
81
+ }
82
+
83
+ if (!edits.length) { console.log("ta6ed6v2 markers in sync — nothing to do."); process.exit(0); }
84
+ console.log(`Out of sync: ${adds.length} missing twin(s), ${fixes.length} drifted value(s).`);
85
+ [...adds, ...fixes].slice(0, 20).forEach((p) => console.log(" " + p));
86
+ if (CHECK) process.exit(1);
87
+
88
+ edits.sort((a, b) => b.at - a.at);
89
+ for (const e of edits) text = text.slice(0, e.at) + e.text + text.slice(e.end ?? e.at);
90
+ JSON.parse(text); // guard
91
+ fs.writeFileSync(FILE, text);
92
+ console.log(`Applied ${edits.length} edit(s) to ${FILE}. Now run: node src/utils/extractOverlay.js`);