@pdtf/schemas 3.4.0-9 → 3.4.1-2

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 (29) hide show
  1. package/.claude/settings.local.json +15 -0
  2. package/README.md +326 -6
  3. package/index.js +131 -0
  4. package/package.json +1 -1
  5. package/src/examples/v3/exampleTransaction.json +5 -1
  6. package/src/schemas/v3/combined.json +8 -21
  7. package/src/schemas/v3/overlays/README.md +299 -0
  8. package/src/schemas/v3/overlays/extensions/as.json +57 -0
  9. package/src/schemas/v3/overlays/extensions/dr.json +60 -0
  10. package/src/schemas/v3/overlays/extensions/er.json +71 -0
  11. package/src/schemas/v3/overlays/extensions/fd.json +63 -0
  12. package/src/schemas/v3/overlays/extensions/hi.json +44 -0
  13. package/src/schemas/v3/overlays/extensions/hs.json +56 -0
  14. package/src/schemas/v3/overlays/extensions/jk.json +55 -0
  15. package/src/schemas/v3/overlays/extensions/la.json +66 -0
  16. package/src/schemas/v3/overlays/extensions/ma.json +87 -0
  17. package/src/schemas/v3/overlays/extensions/mc.json +36 -0
  18. package/src/schemas/v3/overlays/extensions/oa.json +22 -0
  19. package/src/schemas/v3/overlays/extensions/oc.json +35 -0
  20. package/src/schemas/v3/overlays/extensions/sb.json +56 -0
  21. package/src/schemas/v3/overlays/extensions/sf.json +57 -0
  22. package/src/schemas/v3/overlays/extensions/sl.json +46 -0
  23. package/src/schemas/v3/overlays/extensions/tf.json +91 -0
  24. package/src/schemas/v3/overlays/nts2.json +6 -18
  25. package/src/schemas/v3/overlays/ntsl2.json +2 -8
  26. package/src/schemas/v3/overlays/ta6.json +1 -0
  27. package/src/schemas/v3/property-transaction-milestones.json +91 -0
  28. package/src/tests/v3/extensionOverlays.test.js +397 -0
  29. package/src/utils/extractExtensionOverlays.js +318 -0
@@ -0,0 +1,55 @@
1
+ {
2
+ "properties": {
3
+ "propertyPack": {
4
+ "properties": {
5
+ "specialistIssues": {
6
+ "properties": {
7
+ "japaneseKnotweed": {
8
+ "ntsRef": "A5.3",
9
+ "required": [
10
+ "yesNo"
11
+ ],
12
+ "discriminator": {
13
+ "propertyName": "yesNo"
14
+ },
15
+ "properties": {
16
+ "yesNo": {
17
+ "ntsRef": "A5.3.1",
18
+ "type": "string"
19
+ }
20
+ },
21
+ "oneOf": [
22
+ {
23
+ "required": [
24
+ "managementPlanInPlace"
25
+ ],
26
+ "properties": {
27
+ "managementPlanInPlace": {
28
+ "ntsRef": "A5.3.2",
29
+ "type": "string"
30
+ },
31
+ "yesNo": {
32
+ "enum": [
33
+ "Yes"
34
+ ]
35
+ }
36
+ }
37
+ }
38
+ ],
39
+ "type": "object"
40
+ }
41
+ },
42
+ "required": [
43
+ "japaneseKnotweed"
44
+ ]
45
+ }
46
+ },
47
+ "required": [
48
+ "specialistIssues"
49
+ ]
50
+ }
51
+ },
52
+ "$schema": "http://json-schema.org/draft-07/schema#",
53
+ "$id": "https://trust.propdata.org.uk/schemas/v3/overlays/extensions/jk.json",
54
+ "$comment": "Japanese knotweed specialist issue"
55
+ }
@@ -0,0 +1,66 @@
1
+ {
2
+ "properties": {
3
+ "propertyPack": {
4
+ "properties": {
5
+ "typeOfConstruction": {
6
+ "properties": {
7
+ "loft": {
8
+ "ntsRef": "A1.2.4",
9
+ "required": [
10
+ "loftAccess"
11
+ ],
12
+ "discriminator": {
13
+ "propertyName": "loftAccess"
14
+ },
15
+ "properties": {
16
+ "loftAccess": {
17
+ "ntsRef": "A1.2.4.1",
18
+ "type": "string"
19
+ }
20
+ },
21
+ "oneOf": [
22
+ {
23
+ "required": [
24
+ "details",
25
+ "loftBoarded",
26
+ "loftInsulated"
27
+ ],
28
+ "properties": {
29
+ "details": {
30
+ "ntsRef": "A1.2.4.2",
31
+ "type": "string",
32
+ "minLength": 1
33
+ },
34
+ "loftBoarded": {
35
+ "ntsRef": "A1.2.4.3",
36
+ "type": "string"
37
+ },
38
+ "loftInsulated": {
39
+ "ntsRef": "A1.2.4.4",
40
+ "type": "string"
41
+ },
42
+ "loftAccess": {
43
+ "enum": [
44
+ "Yes"
45
+ ]
46
+ }
47
+ }
48
+ }
49
+ ],
50
+ "type": "object"
51
+ }
52
+ },
53
+ "required": [
54
+ "loft"
55
+ ]
56
+ }
57
+ },
58
+ "required": [
59
+ "typeOfConstruction"
60
+ ]
61
+ }
62
+ },
63
+ "$schema": "http://json-schema.org/draft-07/schema#",
64
+ "$id": "https://trust.propdata.org.uk/schemas/v3/overlays/extensions/la.json",
65
+ "$comment": "Loft access and details"
66
+ }
@@ -0,0 +1,87 @@
1
+ {
2
+ "properties": {
3
+ "propertyPack": {
4
+ "properties": {
5
+ "ownership": {
6
+ "properties": {
7
+ "ownershipsToBeTransferred": {
8
+ "items": {
9
+ "oneOf": [
10
+ null,
11
+ null,
12
+ {
13
+ "properties": {
14
+ "leaseholdInformation": {
15
+ "properties": {
16
+ "contactDetails": {
17
+ "ntsRef": "A1.5.4",
18
+ "required": [
19
+ "contacts"
20
+ ],
21
+ "properties": {
22
+ "contacts": {
23
+ "ntsRef": "A1.5.4",
24
+ "required": [
25
+ "managingAgent"
26
+ ],
27
+ "properties": {
28
+ "managingAgent": {
29
+ "ntsRef": "A1.5.6",
30
+ "properties": {
31
+ "contact": {
32
+ "ntsRef": "A1.5.6.1",
33
+ "required": [
34
+ "nameOrOrganisation",
35
+ "emailAddress"
36
+ ],
37
+ "properties": {
38
+ "nameOrOrganisation": {
39
+ "ntsRef": "A1.5.6.1.1",
40
+ "type": "string",
41
+ "minLength": 1
42
+ },
43
+ "emailAddress": {
44
+ "ntsRef": "A1.5.6.1.2",
45
+ "type": "string",
46
+ "format": "email"
47
+ }
48
+ },
49
+ "type": "object"
50
+ }
51
+ },
52
+ "type": "object"
53
+ }
54
+ },
55
+ "type": "object"
56
+ }
57
+ },
58
+ "type": "object"
59
+ }
60
+ },
61
+ "required": [
62
+ "contactDetails"
63
+ ]
64
+ }
65
+ },
66
+ "required": [
67
+ "leaseholdInformation"
68
+ ]
69
+ }
70
+ ]
71
+ }
72
+ }
73
+ },
74
+ "required": [
75
+ "ownershipsToBeTransferred"
76
+ ]
77
+ }
78
+ },
79
+ "required": [
80
+ "ownership"
81
+ ]
82
+ }
83
+ },
84
+ "$schema": "http://json-schema.org/draft-07/schema#",
85
+ "$id": "https://trust.propdata.org.uk/schemas/v3/overlays/extensions/ma.json",
86
+ "$comment": "Managing agent contact details for leasehold"
87
+ }
@@ -0,0 +1,36 @@
1
+ {
2
+ "properties": {
3
+ "propertyPack": {
4
+ "properties": {
5
+ "typeOfConstruction": {
6
+ "properties": {
7
+ "isStandardForm": {
8
+ "oneOf": [
9
+ {
10
+ "properties": {
11
+ "constructionType": {
12
+ "ntsRef": "A1.2.1.3",
13
+ "type": "string"
14
+ }
15
+ },
16
+ "required": [
17
+ "constructionType"
18
+ ]
19
+ }
20
+ ]
21
+ }
22
+ },
23
+ "required": [
24
+ "isStandardForm"
25
+ ]
26
+ }
27
+ },
28
+ "required": [
29
+ "typeOfConstruction"
30
+ ]
31
+ }
32
+ },
33
+ "$schema": "http://json-schema.org/draft-07/schema#",
34
+ "$id": "https://trust.propdata.org.uk/schemas/v3/overlays/extensions/mc.json",
35
+ "$comment": "Main construction type if standard form"
36
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "properties": {
3
+ "propertyPack": {
4
+ "properties": {
5
+ "residentialPropertyFeatures": {
6
+ "properties": {
7
+ "outsideAreas": {
8
+ "ntsRef": "B5.1",
9
+ "type": "array"
10
+ }
11
+ },
12
+ "required": [
13
+ "outsideAreas"
14
+ ]
15
+ }
16
+ }
17
+ }
18
+ },
19
+ "$schema": "http://json-schema.org/draft-07/schema#",
20
+ "$id": "https://trust.propdata.org.uk/schemas/v3/overlays/extensions/oa.json",
21
+ "$comment": "Outside areas extension for NTS"
22
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "properties": {
3
+ "propertyPack": {
4
+ "properties": {
5
+ "completionAndMoving": {
6
+ "properties": {
7
+ "otherPropertyInChain": {
8
+ "ntsRef": "A1.5.7.1",
9
+ "required": [
10
+ "yesNo"
11
+ ],
12
+ "title": "Is this sale dependent on completion of the purchase of another property on the same day?",
13
+ "discriminator": {
14
+ "propertyName": "yesNo"
15
+ },
16
+ "properties": {
17
+ "yesNo": {
18
+ "ntsRef": "A1.5.7.1.1",
19
+ "type": "string"
20
+ }
21
+ },
22
+ "type": "object"
23
+ }
24
+ },
25
+ "required": [
26
+ "otherPropertyInChain"
27
+ ]
28
+ }
29
+ }
30
+ }
31
+ },
32
+ "$schema": "http://json-schema.org/draft-07/schema#",
33
+ "$id": "https://trust.propdata.org.uk/schemas/v3/overlays/extensions/oc.json",
34
+ "$comment": "Other property in chain dependency"
35
+ }
@@ -0,0 +1,56 @@
1
+ {
2
+ "properties": {
3
+ "propertyPack": {
4
+ "properties": {
5
+ "specialistIssues": {
6
+ "properties": {
7
+ "subsidenceOrStructuralFault": {
8
+ "ntsRef": "A5.4",
9
+ "required": [
10
+ "yesNo"
11
+ ],
12
+ "discriminator": {
13
+ "propertyName": "yesNo"
14
+ },
15
+ "properties": {
16
+ "yesNo": {
17
+ "ntsRef": "A5.4.1",
18
+ "type": "string"
19
+ }
20
+ },
21
+ "oneOf": [
22
+ {
23
+ "required": [
24
+ "details"
25
+ ],
26
+ "properties": {
27
+ "details": {
28
+ "ntsRef": "A5.4.2",
29
+ "type": "string",
30
+ "minLength": 1
31
+ },
32
+ "yesNo": {
33
+ "enum": [
34
+ "Yes"
35
+ ]
36
+ }
37
+ }
38
+ }
39
+ ],
40
+ "type": "object"
41
+ }
42
+ },
43
+ "required": [
44
+ "subsidenceOrStructuralFault"
45
+ ]
46
+ }
47
+ },
48
+ "required": [
49
+ "specialistIssues"
50
+ ]
51
+ }
52
+ },
53
+ "$schema": "http://json-schema.org/draft-07/schema#",
54
+ "$id": "https://trust.propdata.org.uk/schemas/v3/overlays/extensions/sb.json",
55
+ "$comment": "Subsidence or structural fault specialist issue"
56
+ }
@@ -0,0 +1,57 @@
1
+ {
2
+ "properties": {
3
+ "propertyPack": {
4
+ "properties": {
5
+ "typeOfConstruction": {
6
+ "properties": {
7
+ "sprayFoamInsulation": {
8
+ "ntsRef": "A4.2",
9
+ "required": [
10
+ "hasSprayFoamInstalled"
11
+ ],
12
+ "discriminator": {
13
+ "propertyName": "hasSprayFoamInstalled"
14
+ },
15
+ "properties": {
16
+ "hasSprayFoamInstalled": {
17
+ "ntsRef": "A4.2.1",
18
+ "type": "string"
19
+ }
20
+ },
21
+ "oneOf": [
22
+ {
23
+ "required": [
24
+ "details"
25
+ ],
26
+ "properties": {
27
+ "details": {
28
+ "ntsRef": "A4.2.2",
29
+ "title": "Please give details",
30
+ "type": "string",
31
+ "minLength": 1
32
+ },
33
+ "hasSprayFoamInstalled": {
34
+ "enum": [
35
+ "Yes"
36
+ ]
37
+ }
38
+ }
39
+ }
40
+ ],
41
+ "type": "object"
42
+ }
43
+ },
44
+ "required": [
45
+ "sprayFoamInsulation"
46
+ ]
47
+ }
48
+ },
49
+ "required": [
50
+ "typeOfConstruction"
51
+ ]
52
+ }
53
+ },
54
+ "$schema": "http://json-schema.org/draft-07/schema#",
55
+ "$id": "https://trust.propdata.org.uk/schemas/v3/overlays/extensions/sf.json",
56
+ "$comment": "Spray foam insulation"
57
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "properties": {
3
+ "propertyPack": {
4
+ "properties": {
5
+ "electricity": {
6
+ "properties": {
7
+ "solarPanels": {
8
+ "oneOf": [
9
+ null,
10
+ {
11
+ "properties": {
12
+ "panelsOwnedOutright": {
13
+ "ntsRef": "B3.7.1",
14
+ "required": [
15
+ "yesNo"
16
+ ],
17
+ "discriminator": {
18
+ "propertyName": "yesNo"
19
+ },
20
+ "properties": {
21
+ "yesNo": {
22
+ "ntsRef": "B3.7.1.1",
23
+ "type": "string"
24
+ }
25
+ },
26
+ "type": "object"
27
+ }
28
+ }
29
+ }
30
+ ]
31
+ }
32
+ },
33
+ "required": [
34
+ "solarPanels"
35
+ ]
36
+ }
37
+ },
38
+ "required": [
39
+ "electricity"
40
+ ]
41
+ }
42
+ },
43
+ "$schema": "http://json-schema.org/draft-07/schema#",
44
+ "$id": "https://trust.propdata.org.uk/schemas/v3/overlays/extensions/sl.json",
45
+ "$comment": "Solar panels ownership details"
46
+ }
@@ -0,0 +1,91 @@
1
+ {
2
+ "properties": {
3
+ "propertyPack": {
4
+ "properties": {
5
+ "ownership": {
6
+ "properties": {
7
+ "ownershipsToBeTransferred": {
8
+ "items": {
9
+ "oneOf": [
10
+ null,
11
+ null,
12
+ {
13
+ "properties": {
14
+ "leaseholdInformation": {
15
+ "properties": {
16
+ "serviceCharge": {
17
+ "oneOf": [
18
+ null,
19
+ {
20
+ "properties": {
21
+ "transferFees": {
22
+ "ntsRef": "A3.5.1.1",
23
+ "required": [
24
+ "yesNo"
25
+ ],
26
+ "title": "Are there any additional fees payable on sale or letting?",
27
+ "discriminator": {
28
+ "propertyName": "yesNo"
29
+ },
30
+ "properties": {
31
+ "yesNo": {
32
+ "ntsRef": "A3.5.1.1.1",
33
+ "type": "string"
34
+ }
35
+ },
36
+ "oneOf": [
37
+ {
38
+ "required": [
39
+ "details"
40
+ ],
41
+ "properties": {
42
+ "details": {
43
+ "ntsRef": "A3.5.1.1.2",
44
+ "type": "string",
45
+ "minLength": 1
46
+ },
47
+ "yesNo": {
48
+ "enum": [
49
+ "Yes"
50
+ ]
51
+ }
52
+ }
53
+ }
54
+ ],
55
+ "type": "object"
56
+ }
57
+ },
58
+ "required": [
59
+ "transferFees"
60
+ ]
61
+ }
62
+ ]
63
+ }
64
+ },
65
+ "required": [
66
+ "serviceCharge"
67
+ ]
68
+ }
69
+ },
70
+ "required": [
71
+ "leaseholdInformation"
72
+ ]
73
+ }
74
+ ]
75
+ }
76
+ }
77
+ },
78
+ "required": [
79
+ "ownershipsToBeTransferred"
80
+ ]
81
+ }
82
+ },
83
+ "required": [
84
+ "ownership"
85
+ ]
86
+ }
87
+ },
88
+ "$schema": "http://json-schema.org/draft-07/schema#",
89
+ "$id": "https://trust.propdata.org.uk/schemas/v3/overlays/extensions/tf.json",
90
+ "$comment": "Transfer fees for leasehold"
91
+ }
@@ -231,11 +231,6 @@
231
231
  "residentialPropertyFeatures": {
232
232
  "nts2Ref": "B5",
233
233
  "required": [
234
- "bedrooms",
235
- "bathrooms",
236
- "receptions",
237
- "kitchens",
238
- "diningAreas",
239
234
  "outsideAreas"
240
235
  ],
241
236
  "properties": {
@@ -255,7 +250,7 @@
255
250
  "nts2Ref": "B5.5"
256
251
  },
257
252
  "outsideAreas": {
258
- "nts2Ref": "B5.6"
253
+ "nts2Ref": "B5.1"
259
254
  }
260
255
  }
261
256
  },
@@ -677,19 +672,13 @@
677
672
  "nts2Ref": "A3.6.1"
678
673
  }
679
674
  }
680
- },
681
- "buildingsInsurance": {
682
- "properties": {
683
- "premiumIncludedInServiceCharge": {
684
- "required": [
685
- "yesNo"
686
- ]
687
- }
688
- }
689
675
  }
690
676
  }
691
677
  }
692
- }
678
+ },
679
+ "required": [
680
+ "leaseholdInformation"
681
+ ]
693
682
  },
694
683
  {
695
684
  "properties": {
@@ -1392,8 +1381,7 @@
1392
1381
  }
1393
1382
  },
1394
1383
  "required": [
1395
- "details",
1396
- "attachments"
1384
+ "details"
1397
1385
  ]
1398
1386
  }
1399
1387
  ],
@@ -227,11 +227,6 @@
227
227
  "residentialPropertyFeatures": {
228
228
  "ntsl2Ref": "B5",
229
229
  "required": [
230
- "bedrooms",
231
- "bathrooms",
232
- "receptions",
233
- "kitchens",
234
- "diningAreas",
235
230
  "outsideAreas"
236
231
  ],
237
232
  "properties": {
@@ -251,7 +246,7 @@
251
246
  "ntsl2Ref": "B5.5"
252
247
  },
253
248
  "outsideAreas": {
254
- "ntsl2Ref": "B5.6"
249
+ "ntsl2Ref": "B5.1"
255
250
  }
256
251
  }
257
252
  },
@@ -897,8 +892,7 @@
897
892
  }
898
893
  },
899
894
  "required": [
900
- "details",
901
- "attachments"
895
+ "details"
902
896
  ]
903
897
  }
904
898
  ],
@@ -1789,6 +1789,7 @@
1789
1789
  }
1790
1790
  },
1791
1791
  "drainage": {
1792
+ "ta6Ref": "12.4",
1792
1793
  "required": [
1793
1794
  "mainsSurfaceWaterDrainage",
1794
1795
  "mainsFoulDrainage"