@pdtf/schemas 3.6.0-12 → 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 +1 -1
- package/src/schemas/v3/combined.json +103 -47
- package/src/schemas/v3/compactSkeleton.txt +5 -1
- package/src/schemas/v3/overlays/baspi4.json +10 -2
- package/src/schemas/v3/overlays/baspi5.json +10 -2
- package/src/schemas/v3/overlays/ta6.json +12 -4
- package/src/schemas/v3/overlays/ta6ed6.json +292 -44
- package/src/schemas/v3/pdtf-transaction.json +21 -19
- package/src/schemas/v3/skeleton.json +36 -14
- package/src/tests/v3/ta6ed6.test.js +12 -7
- package/src/utils/extractOverlay.js +11 -13
|
@@ -8460,7 +8460,7 @@
|
|
|
8460
8460
|
]
|
|
8461
8461
|
},
|
|
8462
8462
|
"details": {
|
|
8463
|
-
"
|
|
8463
|
+
"title": "Specify any relevant local authority licence or terms and conditions",
|
|
8464
8464
|
"type": "string",
|
|
8465
8465
|
"minLength": 1
|
|
8466
8466
|
}
|
|
@@ -12486,18 +12486,9 @@
|
|
|
12486
12486
|
]
|
|
12487
12487
|
},
|
|
12488
12488
|
"japaneseKnotweed": {
|
|
12489
|
-
"title": "
|
|
12489
|
+
"title": "Japanese Knotweed",
|
|
12490
12490
|
"type": "object",
|
|
12491
12491
|
"properties": {
|
|
12492
|
-
"yesNo": {
|
|
12493
|
-
"type": "string",
|
|
12494
|
-
"title": "",
|
|
12495
|
-
"enum": [
|
|
12496
|
-
"Yes",
|
|
12497
|
-
"No",
|
|
12498
|
-
"Not known"
|
|
12499
|
-
]
|
|
12500
|
-
},
|
|
12501
12492
|
"knotweedSurveyCarriedOut": {
|
|
12502
12493
|
"title": "Has a Japanese knotweed survey been carried out in relation to the property?",
|
|
12503
12494
|
"type": "object",
|
|
@@ -12531,7 +12522,7 @@
|
|
|
12531
12522
|
]
|
|
12532
12523
|
},
|
|
12533
12524
|
"attachments": {
|
|
12534
|
-
"title": "
|
|
12525
|
+
"title": "Provide a copy of the survey.",
|
|
12535
12526
|
"type": "string",
|
|
12536
12527
|
"enum": [
|
|
12537
12528
|
"Attached",
|
|
@@ -12541,6 +12532,15 @@
|
|
|
12541
12532
|
}
|
|
12542
12533
|
}
|
|
12543
12534
|
]
|
|
12535
|
+
},
|
|
12536
|
+
"yesNo": {
|
|
12537
|
+
"type": "string",
|
|
12538
|
+
"title": "To your knowledge, is the property or neighbouring land, affected by Japanese knotweed or other invasive species?",
|
|
12539
|
+
"enum": [
|
|
12540
|
+
"Yes",
|
|
12541
|
+
"No",
|
|
12542
|
+
"Not known"
|
|
12543
|
+
]
|
|
12544
12544
|
}
|
|
12545
12545
|
},
|
|
12546
12546
|
"oneOf": [
|
|
@@ -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": "
|
|
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": "
|
|
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
|
}
|
|
@@ -20954,6 +20955,7 @@
|
|
|
20954
20955
|
]
|
|
20955
20956
|
},
|
|
20956
20957
|
"details": {
|
|
20958
|
+
"title": "Details",
|
|
20957
20959
|
"type": "string",
|
|
20958
20960
|
"minLength": 1
|
|
20959
20961
|
}
|
|
@@ -23540,7 +23542,8 @@
|
|
|
23540
23542
|
"type": "string",
|
|
23541
23543
|
"enum": [
|
|
23542
23544
|
"Attached",
|
|
23543
|
-
"To follow"
|
|
23545
|
+
"To follow",
|
|
23546
|
+
"Not available"
|
|
23544
23547
|
]
|
|
23545
23548
|
}
|
|
23546
23549
|
}
|
|
@@ -23605,7 +23608,8 @@
|
|
|
23605
23608
|
"type": "string",
|
|
23606
23609
|
"enum": [
|
|
23607
23610
|
"Attached",
|
|
23608
|
-
"To follow"
|
|
23611
|
+
"To follow",
|
|
23612
|
+
"Not available"
|
|
23609
23613
|
]
|
|
23610
23614
|
}
|
|
23611
23615
|
}
|
|
@@ -24742,9 +24746,6 @@
|
|
|
24742
24746
|
"Yes",
|
|
24743
24747
|
"No"
|
|
24744
24748
|
]
|
|
24745
|
-
},
|
|
24746
|
-
"details": {
|
|
24747
|
-
"type": "string"
|
|
24748
24749
|
}
|
|
24749
24750
|
},
|
|
24750
24751
|
"oneOf": [
|
|
@@ -24765,6 +24766,7 @@
|
|
|
24765
24766
|
]
|
|
24766
24767
|
},
|
|
24767
24768
|
"details": {
|
|
24769
|
+
"title": "Please provide details",
|
|
24768
24770
|
"type": "string"
|
|
24769
24771
|
}
|
|
24770
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": "
|
|
1060
|
+
"urgentWorksRecommended": "variant",
|
|
1061
|
+
"urgentWorksCarriedOut": "string",
|
|
1062
|
+
"outstandingEnforcementAction": "variant",
|
|
1063
|
+
"dateRemedialActionRequired": "string"
|
|
1057
1064
|
}
|
|
1058
1065
|
},
|
|
1059
1066
|
"standardTermsAvailable": {
|
|
@@ -1735,12 +1742,13 @@
|
|
|
1735
1742
|
"attachments": "string"
|
|
1736
1743
|
},
|
|
1737
1744
|
"japaneseKnotweed": {
|
|
1738
|
-
"yesNo": "variant",
|
|
1739
1745
|
"knotweedSurveyCarriedOut": {
|
|
1740
1746
|
"yesNo": "variant",
|
|
1741
1747
|
"attachments": "string"
|
|
1742
1748
|
},
|
|
1743
|
-
"
|
|
1749
|
+
"yesNo": "variant",
|
|
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": "
|
|
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": "
|
|
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
|
|
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(
|
|
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", () => {
|
|
@@ -834,6 +838,7 @@ describe("TA6 Edition 6 overlay", () => {
|
|
|
834
838
|
neighbouringLandRights: { yesNo: "No" },
|
|
835
839
|
sharedContributions: { yesNo: "No" },
|
|
836
840
|
rightsOrArrangements: {
|
|
841
|
+
publicRightOfWay: { yesNo: "No" },
|
|
837
842
|
rightsOfLight: { yesNo: "No" },
|
|
838
843
|
rightsOfSupport: { yesNo: "No" },
|
|
839
844
|
rightsCreatedThroughCustom: { yesNo: "No" },
|
|
@@ -1625,7 +1630,7 @@ describe("TA6 Edition 6 overlay", () => {
|
|
|
1625
1630
|
mainsElectricity: {
|
|
1626
1631
|
yesNo: "Yes",
|
|
1627
1632
|
supplier: "British Gas",
|
|
1628
|
-
electricityMeter: { location: "Hall cupboard" },
|
|
1633
|
+
electricityMeter: { location: "Hall cupboard", mpan: "1234567890123" },
|
|
1629
1634
|
},
|
|
1630
1635
|
solarPanels: { yesNo: "No" },
|
|
1631
1636
|
};
|
|
@@ -1637,7 +1642,7 @@ describe("TA6 Edition 6 overlay", () => {
|
|
|
1637
1642
|
mainsElectricity: {
|
|
1638
1643
|
yesNo: "Yes",
|
|
1639
1644
|
supplier: "British Gas",
|
|
1640
|
-
electricityMeter: { location: "Hall cupboard" },
|
|
1645
|
+
electricityMeter: { location: "Hall cupboard", mpan: "1234567890123" },
|
|
1641
1646
|
},
|
|
1642
1647
|
solarPanels: { yesNo: "Yes" },
|
|
1643
1648
|
};
|
|
@@ -1654,7 +1659,7 @@ describe("TA6 Edition 6 overlay", () => {
|
|
|
1654
1659
|
mainsElectricity: {
|
|
1655
1660
|
yesNo: "Yes",
|
|
1656
1661
|
supplier: "British Gas",
|
|
1657
|
-
electricityMeter: { location: "Hall cupboard" },
|
|
1662
|
+
electricityMeter: { location: "Hall cupboard", mpan: "1234567890123" },
|
|
1658
1663
|
},
|
|
1659
1664
|
solarPanels: {
|
|
1660
1665
|
yesNo: "Yes",
|
|
@@ -1676,7 +1681,7 @@ describe("TA6 Edition 6 overlay", () => {
|
|
|
1676
1681
|
mainsElectricity: {
|
|
1677
1682
|
yesNo: "Yes",
|
|
1678
1683
|
supplier: "British Gas",
|
|
1679
|
-
electricityMeter: { location: "Hall cupboard" },
|
|
1684
|
+
electricityMeter: { location: "Hall cupboard", mpan: "1234567890123" },
|
|
1680
1685
|
},
|
|
1681
1686
|
solarPanels: {
|
|
1682
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
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
if (returnStructure[key] && JSON.stringify(returnStructure[key]) !== JSON.stringify(
|
|
96
|
-
|
|
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
|
-
|
|
101
|
-
returnStructure[key] = { ...returnStructure[key], ...newValue, _variants: true };
|
|
99
|
+
returnStructure[key] = { ...returnStructure[key], ...value, _variants: true };
|
|
102
100
|
}
|
|
103
101
|
} else {
|
|
104
|
-
returnStructure[key] =
|
|
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
|
}
|