@pdtf/schemas 3.6.0-4 → 3.6.0-41

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 (64) hide show
  1. package/.claude/plans/not-seeing-associated-costs.md +99 -0
  2. package/.claude/settings.local.json +22 -3
  3. package/README.md +52 -33
  4. package/docs/sef25-extensions-ui-spec.md +355 -0
  5. package/index.js +130 -66
  6. package/package.json +4 -2
  7. package/src/examples/v3/exampleTransaction.json +3 -3
  8. package/src/schemas/v3/combined.json +7651 -1672
  9. package/src/schemas/v3/compactSkeleton.txt +365 -14
  10. package/src/schemas/v3/overlays/baspi4.json +163 -18
  11. package/src/schemas/v3/overlays/baspi5.json +168 -20
  12. package/src/schemas/v3/overlays/extensions/as.json +4 -2
  13. package/src/schemas/v3/overlays/extensions/dk.json +32 -0
  14. package/src/schemas/v3/overlays/extensions/dr.json +9 -9
  15. package/src/schemas/v3/overlays/extensions/er.json +4 -2
  16. package/src/schemas/v3/overlays/extensions/fd.json +6 -3
  17. package/src/schemas/v3/overlays/extensions/hi.json +6 -3
  18. package/src/schemas/v3/overlays/extensions/hs.json +4 -2
  19. package/src/schemas/v3/overlays/extensions/ic.json +59 -0
  20. package/src/schemas/v3/overlays/extensions/jk.json +28 -8
  21. package/src/schemas/v3/overlays/extensions/la.json +4 -2
  22. package/src/schemas/v3/overlays/extensions/lc.json +75 -0
  23. package/src/schemas/v3/overlays/extensions/ma.json +6 -3
  24. package/src/schemas/v3/overlays/extensions/mc.json +4 -2
  25. package/src/schemas/v3/overlays/extensions/mi.json +69 -0
  26. package/src/schemas/v3/overlays/extensions/nd.json +43 -0
  27. package/src/schemas/v3/overlays/extensions/oa.json +4 -2
  28. package/src/schemas/v3/overlays/extensions/oc.json +4 -2
  29. package/src/schemas/v3/overlays/extensions/pc.json +37 -0
  30. package/src/schemas/v3/overlays/extensions/ph.json +194 -0
  31. package/src/schemas/v3/overlays/extensions/rw.json +68 -0
  32. package/src/schemas/v3/overlays/extensions/sb.json +4 -2
  33. package/src/schemas/v3/overlays/extensions/sc.json +129 -0
  34. package/src/schemas/v3/overlays/extensions/sd.json +63 -0
  35. package/src/schemas/v3/overlays/extensions/sf.json +4 -2
  36. package/src/schemas/v3/overlays/extensions/sl.json +4 -2
  37. package/src/schemas/v3/overlays/extensions/tf.json +6 -3
  38. package/src/schemas/v3/overlays/extensions/tr.json +73 -0
  39. package/src/schemas/v3/overlays/extensions/wg.json +350 -0
  40. package/src/schemas/v3/overlays/fme1.json +16 -14
  41. package/src/schemas/v3/overlays/lpe1.json +60 -30
  42. package/src/schemas/v3/overlays/nts.json +68 -1
  43. package/src/schemas/v3/overlays/nts2.json +68 -4
  44. package/src/schemas/v3/overlays/ntsl.json +68 -1
  45. package/src/schemas/v3/overlays/ntsl2.json +68 -4
  46. package/src/schemas/v3/overlays/piq.json +38 -1
  47. package/src/schemas/v3/overlays/rds.json +118 -6
  48. package/src/schemas/v3/overlays/sef25.json +1067 -0
  49. package/src/schemas/v3/overlays/ta6.json +46 -16
  50. package/src/schemas/v3/overlays/ta6ed6.json +6498 -0
  51. package/src/schemas/v3/overlays/ta7.json +70 -6
  52. package/src/schemas/v3/overlays/ta7ed5.json +1539 -0
  53. package/src/schemas/v3/pdtf-transaction.json +4361 -676
  54. package/src/schemas/v3/skeleton.json +505 -36
  55. package/src/tests/v3/buyerCircumstances.test.js +543 -0
  56. package/src/tests/v3/extensionOverlays.test.js +911 -0
  57. package/src/tests/v3/offers.test.js +37 -40
  58. package/src/tests/v3/patternProperties.test.js +149 -30
  59. package/src/tests/v3/ta6ed6.test.js +2317 -0
  60. package/src/tests/v3/ta7ed5.test.js +567 -0
  61. package/src/tests/v3/transactionSchema.test.js +31 -0
  62. package/src/utils/extractExtensionOverlays.js +216 -31
  63. package/src/utils/extractOverlay.js +88 -23
  64. package/src/utils/pathSkeleton.js +1 -1
@@ -0,0 +1,194 @@
1
+ {
2
+ "properties": {
3
+ "propertyPack": {
4
+ "properties": {
5
+ "specialistIssues": {
6
+ "required": [
7
+ "wellsDitchesShaft",
8
+ "damagedOrExposedElectrics",
9
+ "damageToFlooringOrStaircases",
10
+ "knownAreasInPoorCondition"
11
+ ],
12
+ "properties": {
13
+ "wellsDitchesShaft": {
14
+ "ntsRef": "H1.1",
15
+ "required": [
16
+ "yesNo"
17
+ ],
18
+ "discriminator": {
19
+ "propertyName": "yesNo"
20
+ },
21
+ "properties": {
22
+ "yesNo": {
23
+ "ntsRef": "H1.1.1",
24
+ "type": "string"
25
+ }
26
+ },
27
+ "oneOf": [
28
+ {
29
+ "properties": {
30
+ "yesNo": {
31
+ "enum": [
32
+ "No"
33
+ ]
34
+ }
35
+ }
36
+ },
37
+ {
38
+ "required": [
39
+ "details"
40
+ ],
41
+ "properties": {
42
+ "details": {
43
+ "ntsRef": "H1.1.2",
44
+ "type": "string",
45
+ "minLength": 1
46
+ },
47
+ "yesNo": {
48
+ "enum": [
49
+ "Yes"
50
+ ]
51
+ }
52
+ }
53
+ }
54
+ ]
55
+ },
56
+ "damagedOrExposedElectrics": {
57
+ "ntsRef": "H1.2",
58
+ "required": [
59
+ "yesNo"
60
+ ],
61
+ "discriminator": {
62
+ "propertyName": "yesNo"
63
+ },
64
+ "properties": {
65
+ "yesNo": {
66
+ "ntsRef": "H1.2.1",
67
+ "type": "string"
68
+ }
69
+ },
70
+ "oneOf": [
71
+ {
72
+ "properties": {
73
+ "yesNo": {
74
+ "enum": [
75
+ "No"
76
+ ]
77
+ }
78
+ }
79
+ },
80
+ {
81
+ "required": [
82
+ "details"
83
+ ],
84
+ "properties": {
85
+ "details": {
86
+ "ntsRef": "H1.2.2",
87
+ "type": "string",
88
+ "minLength": 1
89
+ },
90
+ "yesNo": {
91
+ "enum": [
92
+ "Yes"
93
+ ]
94
+ }
95
+ }
96
+ }
97
+ ]
98
+ },
99
+ "damageToFlooringOrStaircases": {
100
+ "ntsRef": "H1.3",
101
+ "required": [
102
+ "yesNo"
103
+ ],
104
+ "discriminator": {
105
+ "propertyName": "yesNo"
106
+ },
107
+ "properties": {
108
+ "yesNo": {
109
+ "ntsRef": "H1.3.1",
110
+ "type": "string"
111
+ }
112
+ },
113
+ "oneOf": [
114
+ {
115
+ "properties": {
116
+ "yesNo": {
117
+ "enum": [
118
+ "No"
119
+ ]
120
+ }
121
+ }
122
+ },
123
+ {
124
+ "required": [
125
+ "details"
126
+ ],
127
+ "properties": {
128
+ "details": {
129
+ "ntsRef": "H1.3.2",
130
+ "type": "string",
131
+ "minLength": 1
132
+ },
133
+ "yesNo": {
134
+ "enum": [
135
+ "Yes"
136
+ ]
137
+ }
138
+ }
139
+ }
140
+ ]
141
+ },
142
+ "knownAreasInPoorCondition": {
143
+ "ntsRef": "H1.4",
144
+ "required": [
145
+ "yesNo"
146
+ ],
147
+ "discriminator": {
148
+ "propertyName": "yesNo"
149
+ },
150
+ "properties": {
151
+ "yesNo": {
152
+ "ntsRef": "H1.4.1",
153
+ "type": "string"
154
+ }
155
+ },
156
+ "oneOf": [
157
+ {
158
+ "properties": {
159
+ "yesNo": {
160
+ "enum": [
161
+ "No"
162
+ ]
163
+ }
164
+ }
165
+ },
166
+ {
167
+ "required": [
168
+ "details"
169
+ ],
170
+ "properties": {
171
+ "details": {
172
+ "ntsRef": "H1.4.2",
173
+ "type": "string",
174
+ "minLength": 1
175
+ },
176
+ "yesNo": {
177
+ "enum": [
178
+ "Yes"
179
+ ]
180
+ }
181
+ }
182
+ }
183
+ ]
184
+ }
185
+ },
186
+ "type": "object"
187
+ }
188
+ }
189
+ }
190
+ },
191
+ "$schema": "http://json-schema.org/draft-07/schema#",
192
+ "$id": "https://trust.propdata.org.uk/schemas/v3/overlays/extensions/ph.json",
193
+ "$comment": "Property hazards and known issues"
194
+ }
@@ -0,0 +1,68 @@
1
+ {
2
+ "properties": {
3
+ "propertyPack": {
4
+ "properties": {
5
+ "rightsAndInformalArrangements": {
6
+ "properties": {
7
+ "rightsOrArrangements": {
8
+ "properties": {
9
+ "privateRightOfWay": {
10
+ "ntsRef": "R1.1",
11
+ "required": [
12
+ "yesNo"
13
+ ],
14
+ "discriminator": {
15
+ "propertyName": "yesNo"
16
+ },
17
+ "properties": {
18
+ "yesNo": {
19
+ "ntsRef": "R1.1.1",
20
+ "type": "string"
21
+ }
22
+ },
23
+ "oneOf": [
24
+ {
25
+ "properties": {
26
+ "yesNo": {
27
+ "enum": [
28
+ "No"
29
+ ]
30
+ }
31
+ }
32
+ },
33
+ {
34
+ "required": [
35
+ "details"
36
+ ],
37
+ "properties": {
38
+ "details": {
39
+ "ntsRef": "R1.1.2",
40
+ "type": "string",
41
+ "minLength": 1
42
+ },
43
+ "yesNo": {
44
+ "enum": [
45
+ "Yes"
46
+ ]
47
+ }
48
+ }
49
+ }
50
+ ],
51
+ "type": "object"
52
+ }
53
+ },
54
+ "required": [
55
+ "privateRightOfWay"
56
+ ],
57
+ "ntsRef": "R1"
58
+ }
59
+ },
60
+ "ntsRef": "R1"
61
+ }
62
+ }
63
+ }
64
+ },
65
+ "$schema": "http://json-schema.org/draft-07/schema#",
66
+ "$id": "https://trust.propdata.org.uk/schemas/v3/overlays/extensions/rw.json",
67
+ "$comment": "Private right of way"
68
+ }
@@ -57,12 +57,14 @@
57
57
  },
58
58
  "required": [
59
59
  "subsidenceOrStructuralFault"
60
- ]
60
+ ],
61
+ "ntsRef": "A5"
61
62
  }
62
63
  },
63
64
  "required": [
64
65
  "specialistIssues"
65
- ]
66
+ ],
67
+ "ntsRef": "0"
66
68
  }
67
69
  },
68
70
  "$schema": "http://json-schema.org/draft-07/schema#",
@@ -0,0 +1,129 @@
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
+ "frequency"
17
+ ],
18
+ "discriminator": {
19
+ "propertyName": "frequency"
20
+ },
21
+ "properties": {
22
+ "frequency": {
23
+ "ntsRef": "U1.1.2",
24
+ "type": "string"
25
+ }
26
+ },
27
+ "oneOf": [
28
+ {
29
+ "properties": {
30
+ "frequency": {
31
+ "enum": [
32
+ "Not applicable"
33
+ ]
34
+ }
35
+ }
36
+ },
37
+ {
38
+ "properties": {
39
+ "amount": {
40
+ "ntsRef": "U1.1.1",
41
+ "type": "number"
42
+ },
43
+ "frequency": {
44
+ "enum": [
45
+ "Per month",
46
+ "Per year"
47
+ ]
48
+ }
49
+ }
50
+ }
51
+ ],
52
+ "type": "object"
53
+ }
54
+ },
55
+ "required": [
56
+ "associatedCost"
57
+ ]
58
+ }
59
+ ]
60
+ }
61
+ }
62
+ },
63
+ "drainage": {
64
+ "properties": {
65
+ "mainsFoulDrainage": {
66
+ "oneOf": [
67
+ null,
68
+ null,
69
+ {
70
+ "properties": {
71
+ "associatedCost": {
72
+ "ntsRef": "U1.2",
73
+ "required": [
74
+ "frequency"
75
+ ],
76
+ "discriminator": {
77
+ "propertyName": "frequency"
78
+ },
79
+ "properties": {
80
+ "frequency": {
81
+ "ntsRef": "U1.2.2",
82
+ "type": "string"
83
+ }
84
+ },
85
+ "oneOf": [
86
+ {
87
+ "properties": {
88
+ "frequency": {
89
+ "enum": [
90
+ "Not applicable"
91
+ ]
92
+ }
93
+ }
94
+ },
95
+ {
96
+ "properties": {
97
+ "amount": {
98
+ "ntsRef": "U1.2.1",
99
+ "type": "number"
100
+ },
101
+ "frequency": {
102
+ "enum": [
103
+ "Per month",
104
+ "Per year"
105
+ ]
106
+ }
107
+ }
108
+ }
109
+ ],
110
+ "type": "object"
111
+ }
112
+ },
113
+ "required": [
114
+ "associatedCost"
115
+ ]
116
+ }
117
+ ]
118
+ }
119
+ }
120
+ }
121
+ }
122
+ }
123
+ }
124
+ }
125
+ },
126
+ "$schema": "http://json-schema.org/draft-07/schema#",
127
+ "$id": "https://trust.propdata.org.uk/schemas/v3/overlays/extensions/sc.json",
128
+ "$comment": "Associated costs for private water and sewerage supply"
129
+ }
@@ -0,0 +1,63 @@
1
+ {
2
+ "properties": {
3
+ "propertyPack": {
4
+ "properties": {
5
+ "environmentalIssues": {
6
+ "properties": {
7
+ "stormFireFloodDamage": {
8
+ "ntsRef": "E1.1",
9
+ "required": [
10
+ "yesNo"
11
+ ],
12
+ "discriminator": {
13
+ "propertyName": "yesNo"
14
+ },
15
+ "properties": {
16
+ "yesNo": {
17
+ "ntsRef": "E1.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": "E1.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
+ },
52
+ "required": [
53
+ "stormFireFloodDamage"
54
+ ],
55
+ "ntsRef": "E1"
56
+ }
57
+ }
58
+ }
59
+ },
60
+ "$schema": "http://json-schema.org/draft-07/schema#",
61
+ "$id": "https://trust.propdata.org.uk/schemas/v3/overlays/extensions/sd.json",
62
+ "$comment": "Storm, fire or flood damage"
63
+ }
@@ -58,12 +58,14 @@
58
58
  },
59
59
  "required": [
60
60
  "sprayFoamInsulation"
61
- ]
61
+ ],
62
+ "ntsRef": "A1.2"
62
63
  }
63
64
  },
64
65
  "required": [
65
66
  "typeOfConstruction"
66
- ]
67
+ ],
68
+ "ntsRef": "0"
67
69
  }
68
70
  },
69
71
  "$schema": "http://json-schema.org/draft-07/schema#",
@@ -52,12 +52,14 @@
52
52
  },
53
53
  "required": [
54
54
  "solarPanels"
55
- ]
55
+ ],
56
+ "ntsRef": "B3.1"
56
57
  }
57
58
  },
58
59
  "required": [
59
60
  "electricity"
60
- ]
61
+ ],
62
+ "ntsRef": "0"
61
63
  }
62
64
  },
63
65
  "$schema": "http://json-schema.org/draft-07/schema#",
@@ -73,7 +73,8 @@
73
73
  },
74
74
  "required": [
75
75
  "serviceCharge"
76
- ]
76
+ ],
77
+ "ntsRef": "A3.2"
77
78
  }
78
79
  },
79
80
  "required": [
@@ -86,12 +87,14 @@
86
87
  },
87
88
  "required": [
88
89
  "ownershipsToBeTransferred"
89
- ]
90
+ ],
91
+ "ntsRef": "A3"
90
92
  }
91
93
  },
92
94
  "required": [
93
95
  "ownership"
94
- ]
96
+ ],
97
+ "ntsRef": "0"
95
98
  }
96
99
  },
97
100
  "$schema": "http://json-schema.org/draft-07/schema#",
@@ -0,0 +1,73 @@
1
+ {
2
+ "properties": {
3
+ "propertyPack": {
4
+ "properties": {
5
+ "ownership": {
6
+ "properties": {
7
+ "ownershipsToBeTransferred": {
8
+ "items": {
9
+ "oneOf": [
10
+ {
11
+ "properties": {
12
+ "titleRestrictions": {
13
+ "ntsRef": "T1.1",
14
+ "required": [
15
+ "yesNo"
16
+ ],
17
+ "discriminator": {
18
+ "propertyName": "yesNo"
19
+ },
20
+ "properties": {
21
+ "yesNo": {
22
+ "ntsRef": "T1.1.1",
23
+ "type": "string"
24
+ }
25
+ },
26
+ "oneOf": [
27
+ {
28
+ "properties": {
29
+ "yesNo": {
30
+ "enum": [
31
+ "No"
32
+ ]
33
+ }
34
+ }
35
+ },
36
+ {
37
+ "required": [
38
+ "details"
39
+ ],
40
+ "properties": {
41
+ "details": {
42
+ "ntsRef": "T1.1.2",
43
+ "type": "string",
44
+ "minLength": 1
45
+ },
46
+ "yesNo": {
47
+ "enum": [
48
+ "Yes"
49
+ ]
50
+ }
51
+ }
52
+ }
53
+ ],
54
+ "type": "object"
55
+ }
56
+ },
57
+ "required": [
58
+ "titleRestrictions"
59
+ ]
60
+ }
61
+ ]
62
+ }
63
+ }
64
+ },
65
+ "ntsRef": "T1"
66
+ }
67
+ }
68
+ }
69
+ },
70
+ "$schema": "http://json-schema.org/draft-07/schema#",
71
+ "$id": "https://trust.propdata.org.uk/schemas/v3/overlays/extensions/tr.json",
72
+ "$comment": "Title restrictions for freehold properties"
73
+ }