@pdtf/schemas 3.6.0-13 → 3.6.0-14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pdtf/schemas",
3
- "version": "3.6.0-13",
3
+ "version": "3.6.0-14",
4
4
  "description": "Property Data Trust Framework Schemas and Utilities",
5
5
  "main": "index.js",
6
6
  "directories": {
@@ -10481,7 +10481,7 @@
10481
10481
  },
10482
10482
  "details": {
10483
10483
  "ta6ed6Ref": "10.3b2",
10484
- "description": "Specify any relevant local authority licence or terms and conditions",
10484
+ "title": "Specify any relevant local authority licence or terms and conditions",
10485
10485
  "type": "string",
10486
10486
  "minLength": 1
10487
10487
  }
@@ -10490,7 +10490,8 @@
10490
10490
  }
10491
10491
  ]
10492
10492
  }
10493
- }
10493
+ },
10494
+ "ta6ed6Required": ["chargerDetails", "cableCrossesPavement"]
10494
10495
  }
10495
10496
  ]
10496
10497
  },
@@ -21156,7 +21157,7 @@
21156
21157
  "title": "Meter Point Administration Number (MPAN)",
21157
21158
  "description": "Your MPAN is on your electricity or dual fuel bill, usually in a box marked 'Supply Number'. It's 21 digits long and begins with 'S'. You'll only need the last 12 or 13 digits.",
21158
21159
  "ta6ed6Description": "Your MPAN is on your electricity or dual fuel bill, usually in a box marked 'Supply Number'. It's 21 digits long and begins with 'S'. You'll only need the last 12 or 13 digits.",
21159
- "type": "integer"
21160
+ "type": "string"
21160
21161
  }
21161
21162
  }
21162
21163
  }
@@ -23809,7 +23810,7 @@
23809
23810
  "ta6ed6Ref": "12.2.4",
23810
23811
  "title": "Meter Point Reference Number (MPRN)",
23811
23812
  "description": "You can find your property's MPRN on your gas or dual fuel bill. It's usually marked 'Meter Point Reference Number' and is between six and 10 digits long.",
23812
- "type": "integer"
23813
+ "type": "string"
23813
23814
  }
23814
23815
  },
23815
23816
  "baspi4Required": ["location"],
@@ -25232,6 +25233,7 @@
25232
25233
  "enum": ["Yes"]
25233
25234
  },
25234
25235
  "details": {
25236
+ "title": "Provide details",
25235
25237
  "ta6ed6Ref": "9.3.2",
25236
25238
  "type": "string",
25237
25239
  "minLength": 1
@@ -29220,7 +29222,7 @@
29220
29222
  },
29221
29223
  "suppliedCertificate": {
29222
29224
  "title": "Please supply one of the following:",
29223
- "ta6ed6Title": "Please supply any certificates for electrical installtion work",
29225
+ "ta6ed6Title": "Please supply any certificates for electrical installation work",
29224
29226
  "type": "object",
29225
29227
  "baspi4Ref": "B4.2.4.1",
29226
29228
  "baspi5Ref": "B4.2.4.1",
@@ -30908,10 +30910,6 @@
30908
30910
  "type": "string",
30909
30911
  "title": "",
30910
30912
  "enum": ["Yes", "No"]
30911
- },
30912
- "details": {
30913
- "ta6ed6Ref": "13.2.2",
30914
- "type": "string"
30915
30913
  }
30916
30914
  },
30917
30915
  "baspi4Required": ["yesNo"],
@@ -30935,9 +30933,11 @@
30935
30933
  "enum": ["Yes"]
30936
30934
  },
30937
30935
  "details": {
30936
+ "title": "Please provide details",
30938
30937
  "baspi4Ref": "B7.3.2",
30939
30938
  "baspi5Ref": "B7.3.2",
30940
30939
  "ta6Ref": "14.2.2",
30940
+ "ta6ed6Ref": "13.2.2",
30941
30941
  "type": "string"
30942
30942
  }
30943
30943
  },
@@ -827,6 +827,9 @@
827
827
  riskAssessments
828
828
  assessmentsCarriedOut
829
829
  urgentWorksRecommended
830
+ urgentWorksCarriedOut
831
+ outstandingEnforcementAction
832
+ dateRemedialActionRequired
830
833
  standardTermsAvailable
831
834
  yesNo
832
835
  details
@@ -1378,6 +1381,7 @@
1378
1381
  attachments
1379
1382
  yesNo
1380
1383
  managementPlanInPlace
1384
+ attachments
1381
1385
  subsidenceOrStructuralFault
1382
1386
  yesNo
1383
1387
  details
@@ -258,7 +258,11 @@
258
258
  }
259
259
  }
260
260
  }
261
- }
261
+ },
262
+ "required": [
263
+ "chargerDetails",
264
+ "cableCrossesPavement"
265
+ ]
262
266
  }
263
267
  ],
264
268
  "required": [
@@ -5553,7 +5557,7 @@
5553
5557
  "required": [
5554
5558
  "attachments"
5555
5559
  ],
5556
- "title": "Please supply any certificates for electrical installtion work",
5560
+ "title": "Please supply any certificates for electrical installation work",
5557
5561
  "properties": {
5558
5562
  "attachments": {
5559
5563
  "ta6ed6Ref": "11.2"
@@ -6334,6 +6338,9 @@
6334
6338
  "enum": [
6335
6339
  "Yes"
6336
6340
  ]
6341
+ },
6342
+ "details": {
6343
+ "ta6ed6Ref": "13.2.2"
6337
6344
  }
6338
6345
  },
6339
6346
  "required": [
@@ -6347,9 +6354,6 @@
6347
6354
  "properties": {
6348
6355
  "yesNo": {
6349
6356
  "ta6ed6Ref": "13.2.1"
6350
- },
6351
- "details": {
6352
- "ta6ed6Ref": "13.2.2"
6353
6357
  }
6354
6358
  }
6355
6359
  },
@@ -8460,7 +8460,7 @@
8460
8460
  ]
8461
8461
  },
8462
8462
  "details": {
8463
- "description": "Specify any relevant local authority licence or terms and conditions",
8463
+ "title": "Specify any relevant local authority licence or terms and conditions",
8464
8464
  "type": "string",
8465
8465
  "minLength": 1
8466
8466
  }
@@ -17694,7 +17694,7 @@
17694
17694
  "mpan": {
17695
17695
  "title": "Meter Point Administration Number (MPAN)",
17696
17696
  "description": "Your MPAN is on your electricity or dual fuel bill, usually in a box marked 'Supply Number'. It's 21 digits long and begins with 'S'. You'll only need the last 12 or 13 digits.",
17697
- "type": "integer"
17697
+ "type": "string"
17698
17698
  }
17699
17699
  }
17700
17700
  }
@@ -19504,7 +19504,7 @@
19504
19504
  "mprn": {
19505
19505
  "title": "Meter Point Reference Number (MPRN)",
19506
19506
  "description": "You can find your property's MPRN on your gas or dual fuel bill. It's usually marked 'Meter Point Reference Number' and is between six and 10 digits long.",
19507
- "type": "integer"
19507
+ "type": "string"
19508
19508
  }
19509
19509
  }
19510
19510
  }
@@ -20462,6 +20462,7 @@
20462
20462
  ]
20463
20463
  },
20464
20464
  "details": {
20465
+ "title": "Provide details",
20465
20466
  "type": "string",
20466
20467
  "minLength": 1
20467
20468
  }
@@ -24745,9 +24746,6 @@
24745
24746
  "Yes",
24746
24747
  "No"
24747
24748
  ]
24748
- },
24749
- "details": {
24750
- "type": "string"
24751
24749
  }
24752
24750
  },
24753
24751
  "oneOf": [
@@ -24768,6 +24766,7 @@
24768
24766
  ]
24769
24767
  },
24770
24768
  "details": {
24769
+ "title": "Please provide details",
24771
24770
  "type": "string"
24772
24771
  }
24773
24772
  }
@@ -1,7 +1,9 @@
1
1
  {
2
2
  "transactionId": "string",
3
3
  "externalIds": {
4
- "*": {}
4
+ "*": {
5
+ "*": {}
6
+ }
5
7
  },
6
8
  "status": "string",
7
9
  "participants": [
@@ -33,7 +35,9 @@
33
35
  "organisationReference": "string",
34
36
  "role": "variant",
35
37
  "externalIds": {
36
- "*": {}
38
+ "*": {
39
+ "*": {}
40
+ }
37
41
  },
38
42
  "participantStatus": "string",
39
43
  "verification": {
@@ -1053,7 +1057,10 @@
1053
1057
  "yesNo": "variant",
1054
1058
  "riskAssessments": {
1055
1059
  "assessmentsCarriedOut": "variant",
1056
- "urgentWorksRecommended": "string"
1060
+ "urgentWorksRecommended": "variant",
1061
+ "urgentWorksCarriedOut": "string",
1062
+ "outstandingEnforcementAction": "variant",
1063
+ "dateRemedialActionRequired": "string"
1057
1064
  }
1058
1065
  },
1059
1066
  "standardTermsAvailable": {
@@ -1740,7 +1747,8 @@
1740
1747
  "attachments": "string"
1741
1748
  },
1742
1749
  "yesNo": "variant",
1743
- "managementPlanInPlace": "string"
1750
+ "managementPlanInPlace": "variant",
1751
+ "attachments": "string"
1744
1752
  },
1745
1753
  "subsidenceOrStructuralFault": {
1746
1754
  "yesNo": "variant",
@@ -2349,7 +2357,7 @@
2349
2357
  "electricityMeter": {
2350
2358
  "location": "string",
2351
2359
  "attachments": "string",
2352
- "mpan": "integer"
2360
+ "mpan": "string"
2353
2361
  },
2354
2362
  "dateToBeConnected": "string"
2355
2363
  },
@@ -2551,7 +2559,7 @@
2551
2559
  "gasMeter": {
2552
2560
  "location": "string",
2553
2561
  "attachments": "string",
2554
- "mprn": "integer"
2562
+ "mprn": "string"
2555
2563
  },
2556
2564
  "otherCentralHeatingFuelType": "string"
2557
2565
  },
@@ -3323,7 +3331,9 @@
3323
3331
  "name": "string",
3324
3332
  "signedOn": "string",
3325
3333
  "externalIds": {
3326
- "*": {}
3334
+ "*": {
3335
+ "*": {}
3336
+ }
3327
3337
  }
3328
3338
  }
3329
3339
  ]
@@ -4632,7 +4642,9 @@
4632
4642
  "mimeType": "string",
4633
4643
  "documentType": "string",
4634
4644
  "externalIds": {
4635
- "*": {}
4645
+ "*": {
4646
+ "*": {}
4647
+ }
4636
4648
  },
4637
4649
  "isDeleted": "boolean",
4638
4650
  "summary": {}
@@ -5494,7 +5506,9 @@
5494
5506
  "name": "string",
5495
5507
  "url": "string",
5496
5508
  "externalIds": {
5497
- "*": {}
5509
+ "*": {
5510
+ "*": {}
5511
+ }
5498
5512
  },
5499
5513
  "requiredSignatories": [
5500
5514
  {
@@ -5510,7 +5524,9 @@
5510
5524
  "name": "string",
5511
5525
  "signedOn": "string",
5512
5526
  "externalIds": {
5513
- "*": {}
5527
+ "*": {
5528
+ "*": {}
5529
+ }
5514
5530
  }
5515
5531
  }
5516
5532
  ]
@@ -5521,7 +5537,9 @@
5521
5537
  {
5522
5538
  "transactionId": "string",
5523
5539
  "externalIds": {
5524
- "*": {}
5540
+ "*": {
5541
+ "*": {}
5542
+ }
5525
5543
  },
5526
5544
  "address": {
5527
5545
  "buildingNumber": "string",
@@ -5586,7 +5604,9 @@
5586
5604
  "string"
5587
5605
  ],
5588
5606
  "externalIds": {
5589
- "*": {}
5607
+ "*": {
5608
+ "*": {}
5609
+ }
5590
5610
  },
5591
5611
  "buyerCircumstances": {
5592
5612
  "intendedUse": "string",
@@ -5633,7 +5653,9 @@
5633
5653
  }
5634
5654
  },
5635
5655
  "externalIds": {
5636
- "*": {}
5656
+ "*": {
5657
+ "*": {}
5658
+ }
5637
5659
  },
5638
5660
  "resolutionCondition": "string"
5639
5661
  }
@@ -203,14 +203,18 @@ describe("TA6 Edition 6 overlay", () => {
203
203
  expect(parkingValidator(data)).toBe(true);
204
204
  });
205
205
 
206
- test("electricVehicleChargingPoint Yes without additional details is valid", () => {
207
- // The ta6ed6 overlay does not require chargerDetails etc. in the Yes branch
206
+ test("electricVehicleChargingPoint Yes without additional details is invalid", () => {
208
207
  const data = {
209
208
  parkingArrangements: ["Driveway"],
210
209
  controlledParking: { yesNo: "No" },
211
210
  electricVehicleChargingPoint: { yesNo: "Yes" },
212
211
  };
213
- expect(parkingValidator(data)).toBe(true);
212
+ expect(parkingValidator(data)).toBe(false);
213
+ expect(
214
+ parkingValidator.errors.some((e) =>
215
+ e.message.includes("'chargerDetails'")
216
+ )
217
+ ).toBe(true);
214
218
  });
215
219
 
216
220
  test("electricVehicleChargingPoint Yes with all required details is valid", () => {
@@ -1626,7 +1630,7 @@ describe("TA6 Edition 6 overlay", () => {
1626
1630
  mainsElectricity: {
1627
1631
  yesNo: "Yes",
1628
1632
  supplier: "British Gas",
1629
- electricityMeter: { location: "Hall cupboard", mpan: 1234567890123 },
1633
+ electricityMeter: { location: "Hall cupboard", mpan: "1234567890123" },
1630
1634
  },
1631
1635
  solarPanels: { yesNo: "No" },
1632
1636
  };
@@ -1638,7 +1642,7 @@ describe("TA6 Edition 6 overlay", () => {
1638
1642
  mainsElectricity: {
1639
1643
  yesNo: "Yes",
1640
1644
  supplier: "British Gas",
1641
- electricityMeter: { location: "Hall cupboard", mpan: 1234567890123 },
1645
+ electricityMeter: { location: "Hall cupboard", mpan: "1234567890123" },
1642
1646
  },
1643
1647
  solarPanels: { yesNo: "Yes" },
1644
1648
  };
@@ -1655,7 +1659,7 @@ describe("TA6 Edition 6 overlay", () => {
1655
1659
  mainsElectricity: {
1656
1660
  yesNo: "Yes",
1657
1661
  supplier: "British Gas",
1658
- electricityMeter: { location: "Hall cupboard", mpan: 1234567890123 },
1662
+ electricityMeter: { location: "Hall cupboard", mpan: "1234567890123" },
1659
1663
  },
1660
1664
  solarPanels: {
1661
1665
  yesNo: "Yes",
@@ -1677,7 +1681,7 @@ describe("TA6 Edition 6 overlay", () => {
1677
1681
  mainsElectricity: {
1678
1682
  yesNo: "Yes",
1679
1683
  supplier: "British Gas",
1680
- electricityMeter: { location: "Hall cupboard", mpan: 1234567890123 },
1684
+ electricityMeter: { location: "Hall cupboard", mpan: "1234567890123" },
1681
1685
  },
1682
1686
  solarPanels: {
1683
1687
  yesNo: "Yes",
@@ -85,23 +85,21 @@ const flattenSkeleton = (schema) => {
85
85
  });
86
86
  }
87
87
 
88
- // Handle oneOf - merge all possible properties
88
+ // Handle oneOf - merge all possible properties (recursively handles nested oneOf)
89
89
  if (schema.oneOf) {
90
90
  schema.oneOf.forEach((aOneOf) => {
91
- if (aOneOf.properties) {
92
- Object.entries(aOneOf.properties).forEach(([key, value]) => {
93
- // If property already exists and differs, mark as variant
94
- const newValue = flattenSkeleton(value);
95
- if (returnStructure[key] && JSON.stringify(returnStructure[key]) !== JSON.stringify(newValue)) {
96
- // For primitive types, just mark as variant type
97
- if (typeof returnStructure[key] === "string" || typeof newValue === "string") {
91
+ const variantResult = flattenSkeleton(aOneOf);
92
+ if (variantResult && typeof variantResult === "object" && !Array.isArray(variantResult)) {
93
+ Object.entries(variantResult).forEach(([key, value]) => {
94
+ if (key === "_variants") return;
95
+ if (returnStructure[key] && JSON.stringify(returnStructure[key]) !== JSON.stringify(value)) {
96
+ if (typeof returnStructure[key] === "string" || typeof value === "string") {
98
97
  returnStructure[key] = "variant";
99
98
  } else {
100
- // For complex types, merge properties
101
- returnStructure[key] = { ...returnStructure[key], ...newValue, _variants: true };
99
+ returnStructure[key] = { ...returnStructure[key], ...value, _variants: true };
102
100
  }
103
101
  } else {
104
- returnStructure[key] = newValue;
102
+ returnStructure[key] = value;
105
103
  }
106
104
  });
107
105
  }
@@ -333,8 +331,8 @@ const toCompact = (obj, indent = "") => {
333
331
  // Check if this is a keyed object (has "*" key)
334
332
  if (keys.length === 1 && keys[0] === "*") {
335
333
  const inner = toCompact(obj["*"], indent);
336
- if (inner === "") {
337
- return "{*}"; // Keyed object of primitives
334
+ if (inner === "" || inner === "{*}") {
335
+ return "{*}"; // Keyed object of primitives (or nested keyed objects with no structure)
338
336
  }
339
337
  return `{*}\n${inner}`;
340
338
  }