@pdtf/schemas 3.6.0-3 → 3.6.0-30

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.
Files changed (37) hide show
  1. package/.claude/settings.local.json +22 -3
  2. package/docs/sef25-extensions-ui-spec.md +146 -0
  3. package/index.js +121 -66
  4. package/package.json +4 -2
  5. package/src/schemas/v3/combined.json +7021 -1316
  6. package/src/schemas/v3/compactSkeleton.txt +353 -11
  7. package/src/schemas/v3/overlays/baspi4.json +163 -18
  8. package/src/schemas/v3/overlays/baspi5.json +168 -20
  9. package/src/schemas/v3/overlays/extensions/dr.json +5 -7
  10. package/src/schemas/v3/overlays/extensions/jk.json +24 -6
  11. package/src/schemas/v3/overlays/extensions/pc.json +36 -0
  12. package/src/schemas/v3/overlays/extensions/ph.json +197 -0
  13. package/src/schemas/v3/overlays/extensions/sc.json +83 -0
  14. package/src/schemas/v3/overlays/fme1.json +16 -14
  15. package/src/schemas/v3/overlays/lpe1.json +60 -30
  16. package/src/schemas/v3/overlays/nts.json +68 -1
  17. package/src/schemas/v3/overlays/nts2.json +68 -4
  18. package/src/schemas/v3/overlays/ntsl.json +68 -1
  19. package/src/schemas/v3/overlays/ntsl2.json +68 -4
  20. package/src/schemas/v3/overlays/piq.json +38 -1
  21. package/src/schemas/v3/overlays/rds.json +118 -6
  22. package/src/schemas/v3/overlays/ta6.json +46 -16
  23. package/src/schemas/v3/overlays/ta6ed6.json +6479 -0
  24. package/src/schemas/v3/overlays/ta7.json +70 -6
  25. package/src/schemas/v3/overlays/ta7ed5.json +1539 -0
  26. package/src/schemas/v3/pdtf-transaction.json +4114 -621
  27. package/src/schemas/v3/skeleton.json +491 -34
  28. package/src/tests/v3/buyerCircumstances.test.js +543 -0
  29. package/src/tests/v3/extensionOverlays.test.js +436 -0
  30. package/src/tests/v3/offers.test.js +37 -40
  31. package/src/tests/v3/patternProperties.test.js +149 -30
  32. package/src/tests/v3/ta6ed6.test.js +2364 -0
  33. package/src/tests/v3/ta7ed5.test.js +567 -0
  34. package/src/tests/v3/transactionSchema.test.js +31 -0
  35. package/src/utils/extractExtensionOverlays.js +104 -31
  36. package/src/utils/extractOverlay.js +87 -23
  37. package/src/utils/pathSkeleton.js +1 -1
@@ -0,0 +1,197 @@
1
+ {
2
+ "properties": {
3
+ "propertyPack": {
4
+ "properties": {
5
+ "specialistIssues": {
6
+ "properties": {
7
+ "wellsDitchesShaft": {
8
+ "ntsRef": "H1.1",
9
+ "required": [
10
+ "yesNo"
11
+ ],
12
+ "discriminator": {
13
+ "propertyName": "yesNo"
14
+ },
15
+ "properties": {
16
+ "yesNo": {
17
+ "ntsRef": "H1.1.1",
18
+ "type": "string"
19
+ }
20
+ },
21
+ "oneOf": [
22
+ {
23
+ "properties": {
24
+ "yesNo": {
25
+ "enum": [
26
+ "No"
27
+ ]
28
+ }
29
+ }
30
+ },
31
+ {
32
+ "required": [
33
+ "details"
34
+ ],
35
+ "properties": {
36
+ "details": {
37
+ "ntsRef": "H1.1.2",
38
+ "type": "string",
39
+ "minLength": 1
40
+ },
41
+ "yesNo": {
42
+ "enum": [
43
+ "Yes"
44
+ ]
45
+ }
46
+ }
47
+ }
48
+ ],
49
+ "type": "object"
50
+ },
51
+ "damagedOrExposedElectrics": {
52
+ "ntsRef": "H1.2",
53
+ "required": [
54
+ "yesNo"
55
+ ],
56
+ "discriminator": {
57
+ "propertyName": "yesNo"
58
+ },
59
+ "properties": {
60
+ "yesNo": {
61
+ "ntsRef": "H1.2.1",
62
+ "type": "string"
63
+ }
64
+ },
65
+ "oneOf": [
66
+ {
67
+ "properties": {
68
+ "yesNo": {
69
+ "enum": [
70
+ "No"
71
+ ]
72
+ }
73
+ }
74
+ },
75
+ {
76
+ "required": [
77
+ "details"
78
+ ],
79
+ "properties": {
80
+ "details": {
81
+ "ntsRef": "H1.2.2",
82
+ "type": "string",
83
+ "minLength": 1
84
+ },
85
+ "yesNo": {
86
+ "enum": [
87
+ "Yes"
88
+ ]
89
+ }
90
+ }
91
+ }
92
+ ],
93
+ "type": "object"
94
+ },
95
+ "damageToFlooringOrStaircases": {
96
+ "ntsRef": "H1.3",
97
+ "required": [
98
+ "yesNo"
99
+ ],
100
+ "discriminator": {
101
+ "propertyName": "yesNo"
102
+ },
103
+ "properties": {
104
+ "yesNo": {
105
+ "ntsRef": "H1.3.1",
106
+ "type": "string"
107
+ }
108
+ },
109
+ "oneOf": [
110
+ {
111
+ "properties": {
112
+ "yesNo": {
113
+ "enum": [
114
+ "No"
115
+ ]
116
+ }
117
+ }
118
+ },
119
+ {
120
+ "required": [
121
+ "details"
122
+ ],
123
+ "properties": {
124
+ "details": {
125
+ "ntsRef": "H1.3.2",
126
+ "type": "string",
127
+ "minLength": 1
128
+ },
129
+ "yesNo": {
130
+ "enum": [
131
+ "Yes"
132
+ ]
133
+ }
134
+ }
135
+ }
136
+ ],
137
+ "type": "object"
138
+ },
139
+ "knownAreasInPoorCondition": {
140
+ "ntsRef": "H1.4",
141
+ "required": [
142
+ "yesNo"
143
+ ],
144
+ "discriminator": {
145
+ "propertyName": "yesNo"
146
+ },
147
+ "properties": {
148
+ "yesNo": {
149
+ "ntsRef": "H1.4.1",
150
+ "type": "string"
151
+ }
152
+ },
153
+ "oneOf": [
154
+ {
155
+ "properties": {
156
+ "yesNo": {
157
+ "enum": [
158
+ "No"
159
+ ]
160
+ }
161
+ }
162
+ },
163
+ {
164
+ "required": [
165
+ "details"
166
+ ],
167
+ "properties": {
168
+ "details": {
169
+ "ntsRef": "H1.4.2",
170
+ "type": "string",
171
+ "minLength": 1
172
+ },
173
+ "yesNo": {
174
+ "enum": [
175
+ "Yes"
176
+ ]
177
+ }
178
+ }
179
+ }
180
+ ],
181
+ "type": "object"
182
+ }
183
+ },
184
+ "required": [
185
+ "wellsDitchesShaft",
186
+ "damagedOrExposedElectrics",
187
+ "damageToFlooringOrStaircases",
188
+ "knownAreasInPoorCondition"
189
+ ]
190
+ }
191
+ }
192
+ }
193
+ },
194
+ "$schema": "http://json-schema.org/draft-07/schema#",
195
+ "$id": "https://trust.propdata.org.uk/schemas/v3/overlays/extensions/ph.json",
196
+ "$comment": "Property hazards and known issues"
197
+ }
@@ -0,0 +1,83 @@
1
+ {
2
+ "properties": {
3
+ "propertyPack": {
4
+ "properties": {
5
+ "waterAndDrainage": {
6
+ "properties": {
7
+ "water": {
8
+ "properties": {
9
+ "mainsWater": {
10
+ "oneOf": [
11
+ {
12
+ "properties": {
13
+ "associatedCost": {
14
+ "ntsRef": "U1.1",
15
+ "required": [
16
+ "amount",
17
+ "frequency"
18
+ ],
19
+ "properties": {
20
+ "amount": {
21
+ "ntsRef": "U1.1.1",
22
+ "type": "number"
23
+ },
24
+ "frequency": {
25
+ "ntsRef": "U1.1.2",
26
+ "type": "string"
27
+ }
28
+ },
29
+ "type": "object"
30
+ }
31
+ },
32
+ "required": [
33
+ "associatedCost"
34
+ ]
35
+ }
36
+ ]
37
+ }
38
+ }
39
+ },
40
+ "drainage": {
41
+ "properties": {
42
+ "mainsFoulDrainage": {
43
+ "oneOf": [
44
+ null,
45
+ null,
46
+ {
47
+ "properties": {
48
+ "associatedCost": {
49
+ "ntsRef": "U1.2",
50
+ "required": [
51
+ "amount",
52
+ "frequency"
53
+ ],
54
+ "properties": {
55
+ "amount": {
56
+ "ntsRef": "U1.2.1",
57
+ "type": "number"
58
+ },
59
+ "frequency": {
60
+ "ntsRef": "U1.2.2",
61
+ "type": "string"
62
+ }
63
+ },
64
+ "type": "object"
65
+ }
66
+ },
67
+ "required": [
68
+ "associatedCost"
69
+ ]
70
+ }
71
+ ]
72
+ }
73
+ }
74
+ }
75
+ }
76
+ }
77
+ }
78
+ }
79
+ },
80
+ "$schema": "http://json-schema.org/draft-07/schema#",
81
+ "$id": "https://trust.propdata.org.uk/schemas/v3/overlays/extensions/sc.json",
82
+ "$comment": "Associated costs for private water and sewerage supply"
83
+ }
@@ -203,20 +203,22 @@
203
203
  "contact",
204
204
  "capacity"
205
205
  ],
206
- "contact": {
207
- "required": [
208
- "nameOrOrganisation",
209
- "line1",
210
- "postcode",
211
- "telephone",
212
- "emailAddress"
213
- ],
214
- "properties": {
215
- "address": {
216
- "required": [
217
- "line1",
218
- "postcode"
219
- ]
206
+ "properties": {
207
+ "contact": {
208
+ "required": [
209
+ "nameOrOrganisation",
210
+ "line1",
211
+ "postcode",
212
+ "telephone",
213
+ "emailAddress"
214
+ ],
215
+ "properties": {
216
+ "address": {
217
+ "required": [
218
+ "line1",
219
+ "postcode"
220
+ ]
221
+ }
220
222
  }
221
223
  }
222
224
  }
@@ -282,20 +282,22 @@
282
282
  "contact",
283
283
  "capacity"
284
284
  ],
285
- "contact": {
286
- "required": [
287
- "nameOrOrganisation",
288
- "line1",
289
- "postcode",
290
- "telephone",
291
- "emailAddress"
292
- ],
293
- "properties": {
294
- "address": {
295
- "required": [
296
- "line1",
297
- "postcode"
298
- ]
285
+ "properties": {
286
+ "contact": {
287
+ "required": [
288
+ "nameOrOrganisation",
289
+ "line1",
290
+ "postcode",
291
+ "telephone",
292
+ "emailAddress"
293
+ ],
294
+ "properties": {
295
+ "address": {
296
+ "required": [
297
+ "line1",
298
+ "postcode"
299
+ ]
300
+ }
299
301
  }
300
302
  }
301
303
  }
@@ -381,20 +383,22 @@
381
383
  "contact",
382
384
  "capacity"
383
385
  ],
384
- "contact": {
385
- "required": [
386
- "nameOrOrganisation",
387
- "line1",
388
- "postcode",
389
- "telephone",
390
- "emailAddress"
391
- ],
392
- "properties": {
393
- "address": {
394
- "required": [
395
- "line1",
396
- "postcode"
397
- ]
386
+ "properties": {
387
+ "contact": {
388
+ "required": [
389
+ "nameOrOrganisation",
390
+ "line1",
391
+ "postcode",
392
+ "telephone",
393
+ "emailAddress"
394
+ ],
395
+ "properties": {
396
+ "address": {
397
+ "required": [
398
+ "line1",
399
+ "postcode"
400
+ ]
401
+ }
398
402
  }
399
403
  }
400
404
  }
@@ -436,13 +440,39 @@
436
440
  }
437
441
  },
438
442
  "collectsGroundRent": {
439
- "lpe1Ref": "1.7"
443
+ "required": [
444
+ "collector"
445
+ ],
446
+ "properties": {
447
+ "collector": {
448
+ "lpe1Ref": "1.7",
449
+ "enum": [
450
+ "Landlord",
451
+ "Management Company",
452
+ "Managing Agent",
453
+ "Not applicable"
454
+ ]
455
+ }
456
+ }
440
457
  },
441
458
  "collectsServiceCharges": {
442
459
  "lpe1Ref": "1.8"
443
460
  },
444
461
  "collectsbuildingInsurancePremiums": {
445
- "lpe1Ref": "1.9"
462
+ "required": [
463
+ "collector"
464
+ ],
465
+ "properties": {
466
+ "collector": {
467
+ "lpe1Ref": "1.9",
468
+ "enum": [
469
+ "Landlord",
470
+ "Management Company",
471
+ "Managing Agent",
472
+ "Not applicable"
473
+ ]
474
+ }
475
+ }
446
476
  },
447
477
  "dealsWithDayToDayMaintenanceOfManagedArea": {
448
478
  "lpe1Ref": "1.11"
@@ -631,6 +631,29 @@
631
631
  },
632
632
  "electricVehicleChargingPoint": {
633
633
  "ntsRef": "B4.4",
634
+ "discriminator": {
635
+ "propertyName": "yesNo"
636
+ },
637
+ "oneOf": [
638
+ {
639
+ "properties": {
640
+ "yesNo": {
641
+ "enum": [
642
+ "No"
643
+ ]
644
+ }
645
+ }
646
+ },
647
+ {
648
+ "properties": {
649
+ "yesNo": {
650
+ "enum": [
651
+ "Yes"
652
+ ]
653
+ }
654
+ }
655
+ }
656
+ ],
634
657
  "required": [
635
658
  "yesNo"
636
659
  ],
@@ -1713,7 +1736,25 @@
1713
1736
  }
1714
1737
  },
1715
1738
  "otherHeatingFeatures": {
1716
- "ntsRef": "B3.4.2"
1739
+ "ntsRef": "B3.4.2",
1740
+ "items": {
1741
+ "enum": [
1742
+ "None",
1743
+ "Air conditioning",
1744
+ "Double glazing",
1745
+ "Triple glazing",
1746
+ "Night storage",
1747
+ "Solar water",
1748
+ "Underfloor heating",
1749
+ "Wood burner",
1750
+ "Aga/Rayburn",
1751
+ "Open fire",
1752
+ "Ground source heat pump",
1753
+ "Air source heat pump",
1754
+ "Solar thermal",
1755
+ "Passive House design"
1756
+ ]
1757
+ }
1717
1758
  }
1718
1759
  }
1719
1760
  },
@@ -1745,6 +1786,32 @@
1745
1786
  },
1746
1787
  "broadband": {
1747
1788
  "ntsRef": "B3.5",
1789
+ "discriminator": {
1790
+ "propertyName": "typeOfConnection"
1791
+ },
1792
+ "oneOf": [
1793
+ {
1794
+ "properties": {
1795
+ "typeOfConnection": {
1796
+ "enum": [
1797
+ "None"
1798
+ ]
1799
+ }
1800
+ }
1801
+ },
1802
+ {
1803
+ "properties": {
1804
+ "typeOfConnection": {
1805
+ "enum": [
1806
+ "ADSL copper wire",
1807
+ "Cable",
1808
+ "FTTC (Fibre to the Cabinet)",
1809
+ "FTTP (Fibre to the Premises)"
1810
+ ]
1811
+ }
1812
+ }
1813
+ }
1814
+ ],
1748
1815
  "required": [
1749
1816
  "typeOfConnection"
1750
1817
  ],
@@ -787,6 +787,29 @@
787
787
  },
788
788
  "electricVehicleChargingPoint": {
789
789
  "nts2Ref": "B4.4",
790
+ "discriminator": {
791
+ "propertyName": "yesNo"
792
+ },
793
+ "oneOf": [
794
+ {
795
+ "properties": {
796
+ "yesNo": {
797
+ "enum": [
798
+ "No"
799
+ ]
800
+ }
801
+ }
802
+ },
803
+ {
804
+ "properties": {
805
+ "yesNo": {
806
+ "enum": [
807
+ "Yes"
808
+ ]
809
+ }
810
+ }
811
+ }
812
+ ],
790
813
  "required": [
791
814
  "yesNo"
792
815
  ],
@@ -1378,9 +1401,6 @@
1378
1401
  },
1379
1402
  "details": {
1380
1403
  "nts2Ref": "A5.1.2"
1381
- },
1382
- "attachments": {
1383
- "nts2Ref": "A5.1.3"
1384
1404
  }
1385
1405
  },
1386
1406
  "required": [
@@ -2221,7 +2241,25 @@
2221
2241
  }
2222
2242
  },
2223
2243
  "otherHeatingFeatures": {
2224
- "nts2Ref": "B3.4.2"
2244
+ "nts2Ref": "B3.4.2",
2245
+ "items": {
2246
+ "enum": [
2247
+ "None",
2248
+ "Air conditioning",
2249
+ "Double glazing",
2250
+ "Triple glazing",
2251
+ "Night storage",
2252
+ "Solar water",
2253
+ "Underfloor heating",
2254
+ "Wood burner",
2255
+ "Aga/Rayburn",
2256
+ "Open fire",
2257
+ "Ground source heat pump",
2258
+ "Air source heat pump",
2259
+ "Solar thermal",
2260
+ "Passive House design"
2261
+ ]
2262
+ }
2225
2263
  }
2226
2264
  }
2227
2265
  },
@@ -2253,6 +2291,32 @@
2253
2291
  },
2254
2292
  "broadband": {
2255
2293
  "nts2Ref": "B3.5",
2294
+ "discriminator": {
2295
+ "propertyName": "typeOfConnection"
2296
+ },
2297
+ "oneOf": [
2298
+ {
2299
+ "properties": {
2300
+ "typeOfConnection": {
2301
+ "enum": [
2302
+ "None"
2303
+ ]
2304
+ }
2305
+ }
2306
+ },
2307
+ {
2308
+ "properties": {
2309
+ "typeOfConnection": {
2310
+ "enum": [
2311
+ "ADSL copper wire",
2312
+ "Cable",
2313
+ "FTTC (Fibre to the Cabinet)",
2314
+ "FTTP (Fibre to the Premises)"
2315
+ ]
2316
+ }
2317
+ }
2318
+ }
2319
+ ],
2256
2320
  "required": [
2257
2321
  "typeOfConnection"
2258
2322
  ],