@pdtf/schemas 3.4.0-8 → 3.4.1-1

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 (32) hide show
  1. package/.claude/settings.local.json +15 -0
  2. package/README.md +326 -6
  3. package/index.js +32 -0
  4. package/package.json +1 -1
  5. package/src/examples/v3/exampleTransaction.json +1 -1
  6. package/src/schemas/v3/combined.json +9 -22
  7. package/src/schemas/v3/overlays/README.md +299 -0
  8. package/src/schemas/v3/overlays/baspi5.json +2 -1
  9. package/src/schemas/v3/overlays/extensions/as.json +57 -0
  10. package/src/schemas/v3/overlays/extensions/dr.json +60 -0
  11. package/src/schemas/v3/overlays/extensions/er.json +71 -0
  12. package/src/schemas/v3/overlays/extensions/fd.json +63 -0
  13. package/src/schemas/v3/overlays/extensions/hi.json +44 -0
  14. package/src/schemas/v3/overlays/extensions/hs.json +56 -0
  15. package/src/schemas/v3/overlays/extensions/jk.json +55 -0
  16. package/src/schemas/v3/overlays/extensions/la.json +66 -0
  17. package/src/schemas/v3/overlays/extensions/ma.json +87 -0
  18. package/src/schemas/v3/overlays/extensions/mc.json +36 -0
  19. package/src/schemas/v3/overlays/extensions/oa.json +22 -0
  20. package/src/schemas/v3/overlays/extensions/oc.json +35 -0
  21. package/src/schemas/v3/overlays/extensions/sb.json +56 -0
  22. package/src/schemas/v3/overlays/extensions/sf.json +57 -0
  23. package/src/schemas/v3/overlays/extensions/sl.json +46 -0
  24. package/src/schemas/v3/overlays/extensions/tf.json +91 -0
  25. package/src/schemas/v3/overlays/nts.json +2 -1
  26. package/src/schemas/v3/overlays/nts2.json +8 -19
  27. package/src/schemas/v3/overlays/ntsl.json +2 -1
  28. package/src/schemas/v3/overlays/ntsl2.json +4 -9
  29. package/src/schemas/v3/overlays/ta6.json +1 -0
  30. package/src/schemas/v3/pdtf-transaction.json +2 -1
  31. package/src/tests/v3/extensionOverlays.test.js +253 -0
  32. package/src/utils/extractExtensionOverlays.js +271 -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
+ }
@@ -75,7 +75,8 @@
75
75
  "propertyType": {
76
76
  "enum": [
77
77
  "House",
78
- "Bungalow"
78
+ "Bungalow",
79
+ "Park home"
79
80
  ]
80
81
  }
81
82
  }
@@ -76,7 +76,8 @@
76
76
  "propertyType": {
77
77
  "enum": [
78
78
  "House",
79
- "Bungalow"
79
+ "Bungalow",
80
+ "Park home"
80
81
  ]
81
82
  }
82
83
  }
@@ -230,11 +231,6 @@
230
231
  "residentialPropertyFeatures": {
231
232
  "nts2Ref": "B5",
232
233
  "required": [
233
- "bedrooms",
234
- "bathrooms",
235
- "receptions",
236
- "kitchens",
237
- "diningAreas",
238
234
  "outsideAreas"
239
235
  ],
240
236
  "properties": {
@@ -254,7 +250,7 @@
254
250
  "nts2Ref": "B5.5"
255
251
  },
256
252
  "outsideAreas": {
257
- "nts2Ref": "B5.6"
253
+ "nts2Ref": "B5.1"
258
254
  }
259
255
  }
260
256
  },
@@ -676,19 +672,13 @@
676
672
  "nts2Ref": "A3.6.1"
677
673
  }
678
674
  }
679
- },
680
- "buildingsInsurance": {
681
- "properties": {
682
- "premiumIncludedInServiceCharge": {
683
- "required": [
684
- "yesNo"
685
- ]
686
- }
687
- }
688
675
  }
689
676
  }
690
677
  }
691
- }
678
+ },
679
+ "required": [
680
+ "leaseholdInformation"
681
+ ]
692
682
  },
693
683
  {
694
684
  "properties": {
@@ -1391,8 +1381,7 @@
1391
1381
  }
1392
1382
  },
1393
1383
  "required": [
1394
- "details",
1395
- "attachments"
1384
+ "details"
1396
1385
  ]
1397
1386
  }
1398
1387
  ],
@@ -77,7 +77,8 @@
77
77
  "propertyType": {
78
78
  "enum": [
79
79
  "House",
80
- "Bungalow"
80
+ "Bungalow",
81
+ "Park home"
81
82
  ]
82
83
  }
83
84
  }
@@ -78,7 +78,8 @@
78
78
  "propertyType": {
79
79
  "enum": [
80
80
  "House",
81
- "Bungalow"
81
+ "Bungalow",
82
+ "Park home"
82
83
  ]
83
84
  }
84
85
  }
@@ -226,11 +227,6 @@
226
227
  "residentialPropertyFeatures": {
227
228
  "ntsl2Ref": "B5",
228
229
  "required": [
229
- "bedrooms",
230
- "bathrooms",
231
- "receptions",
232
- "kitchens",
233
- "diningAreas",
234
230
  "outsideAreas"
235
231
  ],
236
232
  "properties": {
@@ -250,7 +246,7 @@
250
246
  "ntsl2Ref": "B5.5"
251
247
  },
252
248
  "outsideAreas": {
253
- "ntsl2Ref": "B5.6"
249
+ "ntsl2Ref": "B5.1"
254
250
  }
255
251
  }
256
252
  },
@@ -896,8 +892,7 @@
896
892
  }
897
893
  },
898
894
  "required": [
899
- "details",
900
- "attachments"
895
+ "details"
901
896
  ]
902
897
  }
903
898
  ],