@pdtf/schemas 3.6.0-2 → 3.6.0-21

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 (35) hide show
  1. package/.claude/settings.local.json +17 -2
  2. package/docs/sef25-extensions-ui-spec.md +146 -0
  3. package/index.js +97 -58
  4. package/package.json +4 -2
  5. package/src/schemas/v3/combined.json +7013 -1313
  6. package/src/schemas/v3/compactSkeleton.txt +353 -11
  7. package/src/schemas/v3/overlays/baspi4.json +161 -17
  8. package/src/schemas/v3/overlays/baspi5.json +166 -19
  9. package/src/schemas/v3/overlays/extensions/jk.json +24 -6
  10. package/src/schemas/v3/overlays/extensions/pc.json +36 -0
  11. package/src/schemas/v3/overlays/extensions/ph.json +197 -0
  12. package/src/schemas/v3/overlays/extensions/sc.json +83 -0
  13. package/src/schemas/v3/overlays/fme1.json +16 -14
  14. package/src/schemas/v3/overlays/lpe1.json +60 -30
  15. package/src/schemas/v3/overlays/nts.json +68 -1
  16. package/src/schemas/v3/overlays/nts2.json +68 -1
  17. package/src/schemas/v3/overlays/ntsl.json +68 -1
  18. package/src/schemas/v3/overlays/ntsl2.json +68 -1
  19. package/src/schemas/v3/overlays/piq.json +38 -1
  20. package/src/schemas/v3/overlays/rds.json +118 -6
  21. package/src/schemas/v3/overlays/ta6.json +40 -14
  22. package/src/schemas/v3/overlays/ta6ed6.json +6436 -0
  23. package/src/schemas/v3/overlays/ta7.json +70 -6
  24. package/src/schemas/v3/overlays/ta7ed5.json +1539 -0
  25. package/src/schemas/v3/pdtf-transaction.json +4098 -615
  26. package/src/schemas/v3/skeleton.json +491 -34
  27. package/src/tests/v3/buyerCircumstances.test.js +543 -0
  28. package/src/tests/v3/extensionOverlays.test.js +436 -0
  29. package/src/tests/v3/offers.test.js +37 -40
  30. package/src/tests/v3/patternProperties.test.js +149 -30
  31. package/src/tests/v3/ta6ed6.test.js +2356 -0
  32. package/src/tests/v3/ta7ed5.test.js +567 -0
  33. package/src/utils/extractExtensionOverlays.js +104 -31
  34. package/src/utils/extractOverlay.js +87 -23
  35. 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
  ],
@@ -2221,7 +2244,25 @@
2221
2244
  }
2222
2245
  },
2223
2246
  "otherHeatingFeatures": {
2224
- "nts2Ref": "B3.4.2"
2247
+ "nts2Ref": "B3.4.2",
2248
+ "items": {
2249
+ "enum": [
2250
+ "None",
2251
+ "Air conditioning",
2252
+ "Double glazing",
2253
+ "Triple glazing",
2254
+ "Night storage",
2255
+ "Solar water",
2256
+ "Underfloor heating",
2257
+ "Wood burner",
2258
+ "Aga/Rayburn",
2259
+ "Open fire",
2260
+ "Ground source heat pump",
2261
+ "Air source heat pump",
2262
+ "Solar thermal",
2263
+ "Passive House design"
2264
+ ]
2265
+ }
2225
2266
  }
2226
2267
  }
2227
2268
  },
@@ -2253,6 +2294,32 @@
2253
2294
  },
2254
2295
  "broadband": {
2255
2296
  "nts2Ref": "B3.5",
2297
+ "discriminator": {
2298
+ "propertyName": "typeOfConnection"
2299
+ },
2300
+ "oneOf": [
2301
+ {
2302
+ "properties": {
2303
+ "typeOfConnection": {
2304
+ "enum": [
2305
+ "None"
2306
+ ]
2307
+ }
2308
+ }
2309
+ },
2310
+ {
2311
+ "properties": {
2312
+ "typeOfConnection": {
2313
+ "enum": [
2314
+ "ADSL copper wire",
2315
+ "Cable",
2316
+ "FTTC (Fibre to the Cabinet)",
2317
+ "FTTP (Fibre to the Premises)"
2318
+ ]
2319
+ }
2320
+ }
2321
+ }
2322
+ ],
2256
2323
  "required": [
2257
2324
  "typeOfConnection"
2258
2325
  ],