@pdtf/schemas 3.6.0-30 → 3.6.0-32

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 (38) hide show
  1. package/docs/sef25-extensions-ui-spec.md +274 -5
  2. package/index.js +9 -0
  3. package/package.json +1 -1
  4. package/src/schemas/v3/combined.json +419 -69
  5. package/src/schemas/v3/compactSkeleton.txt +24 -5
  6. package/src/schemas/v3/overlays/extensions/as.json +4 -2
  7. package/src/schemas/v3/overlays/extensions/dk.json +32 -0
  8. package/src/schemas/v3/overlays/extensions/dr.json +4 -2
  9. package/src/schemas/v3/overlays/extensions/er.json +4 -2
  10. package/src/schemas/v3/overlays/extensions/fd.json +6 -3
  11. package/src/schemas/v3/overlays/extensions/hi.json +6 -3
  12. package/src/schemas/v3/overlays/extensions/hs.json +4 -2
  13. package/src/schemas/v3/overlays/extensions/ic.json +56 -0
  14. package/src/schemas/v3/overlays/extensions/jk.json +4 -2
  15. package/src/schemas/v3/overlays/extensions/la.json +4 -2
  16. package/src/schemas/v3/overlays/extensions/lc.json +86 -0
  17. package/src/schemas/v3/overlays/extensions/ma.json +6 -3
  18. package/src/schemas/v3/overlays/extensions/mc.json +4 -2
  19. package/src/schemas/v3/overlays/extensions/mi.json +52 -0
  20. package/src/schemas/v3/overlays/extensions/nd.json +43 -0
  21. package/src/schemas/v3/overlays/extensions/oa.json +4 -2
  22. package/src/schemas/v3/overlays/extensions/oc.json +4 -2
  23. package/src/schemas/v3/overlays/extensions/pc.json +2 -1
  24. package/src/schemas/v3/overlays/extensions/rw.json +68 -0
  25. package/src/schemas/v3/overlays/extensions/sb.json +4 -2
  26. package/src/schemas/v3/overlays/extensions/sc.json +82 -14
  27. package/src/schemas/v3/overlays/extensions/sd.json +63 -0
  28. package/src/schemas/v3/overlays/extensions/sf.json +4 -2
  29. package/src/schemas/v3/overlays/extensions/sl.json +4 -2
  30. package/src/schemas/v3/overlays/extensions/tf.json +6 -3
  31. package/src/schemas/v3/overlays/extensions/tr.json +73 -0
  32. package/src/schemas/v3/overlays/extensions/wg.json +209 -0
  33. package/src/schemas/v3/overlays/ta6ed6.json +37 -18
  34. package/src/schemas/v3/pdtf-transaction.json +477 -51
  35. package/src/schemas/v3/skeleton.json +33 -10
  36. package/src/tests/v3/extensionOverlays.test.js +410 -4
  37. package/src/tests/v3/ta6ed6.test.js +1 -48
  38. package/src/utils/extractExtensionOverlays.js +121 -0
@@ -2,13 +2,24 @@
2
2
 
3
3
  ## Overview
4
4
 
5
- Three new extension overlays add follow-up questions to existing form sections. Each overlay is loaded by passing its key to `getTransactionSchema(schemaId, overlays)`.
5
+ Extension overlays add follow-up questions to existing form sections. Each overlay is loaded by passing its key to `getTransactionSchema(schemaId, overlays)`.
6
6
 
7
7
  | Overlay Key | Name | Section | Fields Added |
8
8
  |-------------|------|---------|-------------|
9
9
  | `sc` | Supply Costs | Water & Drainage | 2 cost fields (private water, private sewerage) |
10
10
  | `pc` | Parking Permit Cost | Parking | 1 frequency field |
11
11
  | `ph` | Property Hazards | Specialist Issues | 4 Yes/No + details fields |
12
+ | `dk` | Dropped Kerb | Parking | 1 Yes/No field |
13
+ | `rw` | Private Right of Way | Rights & Informal Arrangements | 1 Yes/No + details field |
14
+ | `sd` | Storm/Fire/Flood Damage | Environmental Issues | 1 Yes/No + details field |
15
+ | `lc` | Solar Lease Costs | Utilities (Solar Panels) | 1 cost field (amount + frequency) |
16
+ | `wg` | Warranties & Guarantees | Guarantees & Warranties | Marks 7 warranty categories as required |
17
+ | `dc` | Disputes & Complaints | Disputes & Complaints | Marks hasDisputesAndComplaints required |
18
+ | `ic` | Insurance Claims | Insurance | Marks insuranceClaims required (isInsured=Yes branch) |
19
+ | `hf` | Historical Flooding | Environmental Issues | Marks hasBeenFlooded required |
20
+ | `nd` | Neighbour Development | Notices | Marks neighbourDevelopment required |
21
+ | `mi` | Material Issue | Additional Information | Marks otherMaterialIssue required |
22
+ | `tr` | Title Restrictions | Ownership (Freehold) | Adds titleRestrictions field to freehold branch |
12
23
 
13
24
  All fields use `sef25Ref` for reference codes.
14
25
 
@@ -114,6 +125,172 @@ These follow the identical pattern to existing specialist issues (dry rot, asbes
114
125
 
115
126
  ---
116
127
 
128
+ ## 4. Dropped Kerb (`dk`)
129
+
130
+ **Trigger:** Always shown within Parking section.
131
+
132
+ **Path:** `propertyPack.parking.droppedKerbAccess`
133
+
134
+ | Field | Path (relative) | Type | Validation | UI Element |
135
+ |-------|-----------------|------|------------|------------|
136
+ | Dropped kerb? | `droppedKerbAccess.yesNo` | `string` | Required, enum | Yes/No radio |
137
+
138
+ **Ref:** `K1.1` (yesNo: `K1.1.1`)
139
+
140
+ ---
141
+
142
+ ## 5. Private Right of Way (`rw`)
143
+
144
+ **Trigger:** Always shown within Rights & Informal Arrangements, alongside the existing public right of way question.
145
+
146
+ **Path:** `propertyPack.rightsAndInformalArrangements.rightsOrArrangements.privateRightOfWay`
147
+
148
+ **UI:** Same pattern as `publicRightOfWay` — Yes/No, if Yes show details.
149
+
150
+ | Field | Path (relative) | Type | Validation | UI Element |
151
+ |-------|-----------------|------|------------|------------|
152
+ | Private ROW? | `privateRightOfWay.yesNo` | `string` | Required, enum | Yes/No radio |
153
+ | Details | `privateRightOfWay.details` | `string` | Required when Yes, minLength 1 | Text input |
154
+
155
+ **Ref:** `R1.1` (yesNo: `R1.1.1`, details: `R1.1.2`)
156
+
157
+ ### Data shape
158
+
159
+ ```json
160
+ // When "No":
161
+ { "yesNo": "No" }
162
+
163
+ // When "Yes":
164
+ { "yesNo": "Yes", "details": "Description of private right of way..." }
165
+ ```
166
+
167
+ ---
168
+
169
+ ## 6. Storm, Fire or Flood Damage (`sd`)
170
+
171
+ **Trigger:** Always shown within Environmental Issues section.
172
+
173
+ **Path:** `propertyPack.environmentalIssues.stormFireFloodDamage`
174
+
175
+ **UI:** Yes/No, if Yes show details. Render under "Environmental & Structural Information" or "Specialist Issues".
176
+
177
+ | Field | Path (relative) | Type | Validation | UI Element |
178
+ |-------|-----------------|------|------------|------------|
179
+ | Damage? | `stormFireFloodDamage.yesNo` | `string` | Required, enum | Yes/No radio |
180
+ | Details | `stormFireFloodDamage.details` | `string` | Required when Yes, minLength 1 | Text area |
181
+
182
+ **Ref:** `E1.1` (yesNo: `E1.1.1`, details: `E1.1.2`)
183
+
184
+ ### Data shape
185
+
186
+ ```json
187
+ // When "No":
188
+ { "yesNo": "No" }
189
+
190
+ // When "Yes":
191
+ { "yesNo": "Yes", "details": "Details of storm/fire/flood damage..." }
192
+ ```
193
+
194
+ ---
195
+
196
+ ## 7. Solar Panel Lease Costs (`lc`)
197
+
198
+ **Trigger:** Show when `propertyPack.utilities.solarPanels.panelsOwnedOutright.yesNo` = `"No"` (panels are leased).
199
+
200
+ **Path:** `propertyPack.utilities.solarPanels.panelsOwnedOutright.associatedCost`
201
+
202
+ **UI:** Render alongside existing lease details. First ask if there are costs, then show amount and frequency if Yes.
203
+
204
+ | Field | Path (relative) | Type | Validation | UI Element |
205
+ |-------|-----------------|------|------------|------------|
206
+ | Has costs? | `associatedCost.hasCost` | `string` | Required, enum | Yes/No radio |
207
+ | Amount (£) | `associatedCost.amount` | `number` | Required when Yes | Numeric input |
208
+ | Frequency | `associatedCost.frequency` | `string` | Required when Yes, enum | Dropdown |
209
+
210
+ **Frequency enum values:** `"Per month"`, `"Per year"`
211
+
212
+ **Ref:** `S1.1` (hasCost: `S1.1.1`, amount: `S1.1.2`, frequency: `S1.1.3`)
213
+
214
+ ### Data shape
215
+
216
+ ```json
217
+ // When no costs:
218
+ { "hasCost": "No" }
219
+
220
+ // When costs exist:
221
+ { "hasCost": "Yes", "amount": 50, "frequency": "Per month" }
222
+ ```
223
+
224
+ ---
225
+
226
+ ## 8. Warranties & Guarantees Upfront (`wg`)
227
+
228
+ **Trigger:** Always shown when overlay is loaded. Displayed upfront regardless of `hasValidGuaranteesOrWarranties` value.
229
+
230
+ **Path prefix:** `propertyPack.guaranteesWarrantiesAndIndemnityInsurances`
231
+
232
+ **UI:** For SEF25 upfront, show all 7 warranty categories as simple Yes/No questions. No details or "Years Remaining" needed at this stage — the law firm picks up details later.
233
+
234
+ ### Fields (all Yes/No only)
235
+
236
+ | Property | Title | sef25Ref |
237
+ |----------|-------|----------|
238
+ | `newHomeWarranty` | New Home Warranty (NHBC or similar) | W1.1 |
239
+ | `roofingWork` | Roofing work | W1.2 |
240
+ | `dampProofingTreatment` | Damp proofing treatment | W1.3 |
241
+ | `centralHeatingAndorPlumbing` | Central heating and/or plumbing | W1.4 |
242
+ | `electricalRepairOrInstallation` | Electrical repair or installation | W1.5 |
243
+ | `subsidenceWork` | Underpinning or other preventative work / remedial action relating to subsidence | W1.6 |
244
+ | `otherGuarantees` | Other Guarantees or warranties | W1.7 |
245
+
246
+ **Note:** These fields already exist in the base schema under the `hasValidGuaranteesOrWarranties = "Yes"` branch. The `wg` overlay marks them as required within that branch. The Moverly app shows them upfront for SEF25 users without requiring the parent gate question first.
247
+
248
+ ---
249
+
250
+ ## 9. Upfront Existing Fields
251
+
252
+ The following existing fields have extension overlays that add `sef25Ref` and `required` arrays, making them selectively available for SEF25 upfront forms.
253
+
254
+ ### Disputes & Complaints (`dc`)
255
+
256
+ **Path:** `propertyPack.disputesAndComplaints.hasDisputesAndComplaints`
257
+
258
+ **Ref:** `D1.1` — "Have any disputes or complaints occurred, regarding this property, a property nearby, or their use?"
259
+
260
+ ### Insurance Claims (`ic`)
261
+
262
+ **Path:** `propertyPack.insurance.insuranceClaims` (inside `isInsured = "Yes"` branch)
263
+
264
+ **Ref:** `I1.1` — "Have you made any buildings insurance claims?"
265
+
266
+ **Note:** The field is inside the `isInsured = "Yes"` oneOf branch. The overlay marks it required within that branch.
267
+
268
+ ### Historical Flooding (`hf`)
269
+
270
+ **Path:** `propertyPack.environmentalIssues.flooding.historicalFlooding.hasBeenFlooded`
271
+
272
+ **Ref:** `E1.2` — "Has the property been flooded in the last 5 years?"
273
+
274
+ ### Neighbour Development (`nd`)
275
+
276
+ **Path:** `propertyPack.notices.neighbourDevelopment`
277
+
278
+ **Ref:** `N1.1` — "Is the seller aware of any proposals to develop property or land nearby?"
279
+
280
+ ### Material Issue (`mi`)
281
+
282
+ **Path:** `propertyPack.additionalInformation.otherMaterialIssue`
283
+
284
+ **Ref:** `M1.1` — "Are you aware of any other material issue or information which may affect the average person's decision to proceed?"
285
+
286
+ ### Title Restrictions (`tr`)
287
+
288
+ **Path:** `propertyPack.ownership.ownershipsToBeTransferred[Freehold].titleRestrictions`
289
+
290
+ **Ref:** `T1.1` — "Are there any known restrictions on the title?" (Yes/No + details if Yes, modelled on `leaseRestrictions` for leasehold)
291
+
292
+ ---
293
+
117
294
  ## Loading the Extensions
118
295
 
119
296
  ```js
@@ -121,14 +298,15 @@ import { getTransactionSchema, getValidator } from "@pdtf/schemas";
121
298
 
122
299
  const schemaId = "https://trust.propdata.org.uk/schemas/v3/pdtf-transaction.json";
123
300
 
124
- // Load with one or more SEF25 extensions
125
- const schema = getTransactionSchema(schemaId, ["sc", "pc", "ph"]);
301
+ // Load all SEF25 extensions
302
+ const sef25Extensions = ["sc", "pc", "ph", "dk", "rw", "sd", "lc", "wg", "ic", "nd", "mi", "tr"];
303
+ const schema = getTransactionSchema(schemaId, sef25Extensions);
126
304
 
127
305
  // Or combine with other overlays
128
- const schema = getTransactionSchema(schemaId, ["baspiV5", "sc", "pc", "ph"]);
306
+ const schema = getTransactionSchema(schemaId, ["baspiV5", ...sef25Extensions]);
129
307
 
130
308
  // Validate data against the merged schema
131
- const validator = getValidator(schemaId, ["sc", "pc", "ph"]);
309
+ const validator = getValidator(schemaId, sef25Extensions);
132
310
  ```
133
311
 
134
312
  ---
@@ -144,3 +322,94 @@ const validator = getValidator(schemaId, ["sc", "pc", "ph"]);
144
322
  | Damaged electrics | Always (within Specialist Issues) |
145
323
  | Flooring/staircase damage | Always (within Specialist Issues) |
146
324
  | Areas in poor condition | Always (within Specialist Issues) |
325
+ | Dropped kerb access | Always (within Parking) |
326
+ | Private right of way | Always (within Rights & Informal Arrangements) |
327
+ | Storm/fire/flood damage | Always (within Environmental Issues) |
328
+ | Solar panel lease costs | `panelsOwnedOutright.yesNo` = `"No"` |
329
+ | Warranty categories (7) | Always when `wg` overlay loaded (within Guarantees & Warranties) |
330
+ | Insurance claims | `isInsured.yesNo` = `"Yes"` (via `ic` overlay) |
331
+ | Neighbour development | Always (via `nd` overlay) |
332
+ | Other material issue | Always (via `mi` overlay) |
333
+ | Title restrictions | Always (via `tr` overlay) |
334
+
335
+ ---
336
+
337
+ ## Moverly propertyPackTasks Changes
338
+
339
+ The following changes are needed in the Moverly app's `propertyPackTasks` configuration to surface the new SEF25 fields in the listing journey.
340
+
341
+ ### Existing tasks to deprecate
342
+
343
+ The flooding and planning tasks should be stepped up to their parent section level to cover the new sibling fields (`stormFireFloodDamage` and `neighbourDevelopment`).
344
+
345
+ ```js
346
+ // Replace existing flooding task with deprecated version
347
+ {
348
+ name: "Flooding",
349
+ path: "/propertyPack/environmentalIssues/flooding",
350
+ category: "listing",
351
+ overlay: "nts2023",
352
+ deprecated: true, // replaced by environmental issues check
353
+ },
354
+
355
+ // Replace existing planning task with deprecated version
356
+ {
357
+ name: "Planning and development",
358
+ path: "/propertyPack/notices/planningApplication",
359
+ category: "listing",
360
+ overlay: "nts2023",
361
+ deprecated: true, // replaced by notices check
362
+ },
363
+ ```
364
+
365
+ ### New listing tasks to add
366
+
367
+ ```js
368
+ {
369
+ name: "Environmental issues",
370
+ checkName: "sef25-environmentalIssues",
371
+ path: "/propertyPack/environmentalIssues",
372
+ category: "listing",
373
+ overlay: "sd",
374
+ },
375
+ {
376
+ name: "Notices",
377
+ checkName: "sef25-notices",
378
+ path: "/propertyPack/notices",
379
+ category: "listing",
380
+ overlay: "nd",
381
+ },
382
+ {
383
+ name: "Guarantees & warranties",
384
+ checkName: "sef25-warranties",
385
+ path: "/propertyPack/guaranteesWarrantiesAndIndemnityInsurances",
386
+ category: "listing",
387
+ overlay: "wg",
388
+ },
389
+ {
390
+ name: "Insurance claims",
391
+ checkName: "sef25-insurance",
392
+ path: "/propertyPack/insurance",
393
+ category: "listing",
394
+ overlay: "ic",
395
+ },
396
+ {
397
+ name: "Material information",
398
+ checkName: "sef25-additionalInformation",
399
+ path: "/propertyPack/additionalInformation",
400
+ category: "listing",
401
+ overlay: "mi",
402
+ },
403
+ ```
404
+
405
+ ### Fields covered by existing listing tasks (no new task needed)
406
+
407
+ | Extension | Covered by |
408
+ |-----------|------------|
409
+ | `dk` (dropped kerb) | Parking |
410
+ | `rw` (private right of way) | Rights and easements |
411
+ | `lc` (solar lease costs) | Electricity |
412
+ | `sc` (supply costs) | Water and drainage |
413
+ | `pc` (parking permit cost) | Parking |
414
+ | `ph` (property hazards) | Specialist issues |
415
+ | `tr` (title restrictions) | Ownership |
package/index.js CHANGED
@@ -57,6 +57,15 @@ const extensionOverlays = {
57
57
  sc: require("./src/schemas/v3/overlays/extensions/sc.json"),
58
58
  pc: require("./src/schemas/v3/overlays/extensions/pc.json"),
59
59
  ph: require("./src/schemas/v3/overlays/extensions/ph.json"),
60
+ dk: require("./src/schemas/v3/overlays/extensions/dk.json"),
61
+ rw: require("./src/schemas/v3/overlays/extensions/rw.json"),
62
+ sd: require("./src/schemas/v3/overlays/extensions/sd.json"),
63
+ lc: require("./src/schemas/v3/overlays/extensions/lc.json"),
64
+ wg: require("./src/schemas/v3/overlays/extensions/wg.json"),
65
+ ic: require("./src/schemas/v3/overlays/extensions/ic.json"),
66
+ nd: require("./src/schemas/v3/overlays/extensions/nd.json"),
67
+ mi: require("./src/schemas/v3/overlays/extensions/mi.json"),
68
+ tr: require("./src/schemas/v3/overlays/extensions/tr.json"),
60
69
  };
61
70
 
62
71
  const overlaysMap = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pdtf/schemas",
3
- "version": "3.6.0-30",
3
+ "version": "3.6.0-32",
4
4
  "description": "Property Data Trust Framework Schemas and Utilities",
5
5
  "main": "index.js",
6
6
  "directories": {