@pdtf/schemas 3.6.0-dev.7 → 3.6.0-dev.8
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.
- package/busy-spence-79c6bf/CLAUDE.md +101 -0
- package/busy-spence-79c6bf/LICENSE +21 -0
- package/busy-spence-79c6bf/README.md +435 -0
- package/busy-spence-79c6bf/docs/branch-release-workflow.md +138 -0
- package/busy-spence-79c6bf/docs/sef25-extensions-ui-spec.md +355 -0
- package/busy-spence-79c6bf/index.js +654 -0
- package/busy-spence-79c6bf/package-lock.json +7299 -0
- package/busy-spence-79c6bf/package.json +44 -0
- package/busy-spence-79c6bf/scripts/ta6ed6-titles.js +403 -0
- package/busy-spence-79c6bf/scripts/ta7ed5-titles.js +183 -0
- package/busy-spence-79c6bf/src/examples/v1/exampleAddParticipantVouch.json +32 -0
- package/busy-spence-79c6bf/src/examples/v1/exampleDocumentedVouch.json +40 -0
- package/busy-spence-79c6bf/src/examples/v1/exampleElectronicRecord.json +30 -0
- package/busy-spence-79c6bf/src/examples/v1/exampleTransaction.json +878 -0
- package/busy-spence-79c6bf/src/examples/v1/exampleVouch.json +25 -0
- package/busy-spence-79c6bf/src/examples/v2/exampleTransaction.json +901 -0
- package/busy-spence-79c6bf/src/examples/v3/exampleAddParticipantVouch.json +38 -0
- package/busy-spence-79c6bf/src/examples/v3/exampleCustomOverlay.json +55 -0
- package/busy-spence-79c6bf/src/examples/v3/exampleCustomOverlay2.json +93 -0
- package/busy-spence-79c6bf/src/examples/v3/exampleDocumentedVouch.json +47 -0
- package/busy-spence-79c6bf/src/examples/v3/exampleElectronicRecord.json +36 -0
- package/busy-spence-79c6bf/src/examples/v3/exampleTransaction.json +1038 -0
- package/busy-spence-79c6bf/src/examples/v3/exampleVouch.json +32 -0
- package/busy-spence-79c6bf/src/mappings/SendPropertyDetailsRequestSchema.json +1588 -0
- package/busy-spence-79c6bf/src/mappings/adf.js +198 -0
- package/busy-spence-79c6bf/src/schemas/v1/GeoJSON.json +1279 -0
- package/busy-spence-79c6bf/src/schemas/v1/baspiNotes.html +102 -0
- package/busy-spence-79c6bf/src/schemas/v1/energy-performance-certificate.json +124 -0
- package/busy-spence-79c6bf/src/schemas/v1/freehold-information.json +2051 -0
- package/busy-spence-79c6bf/src/schemas/v1/leasehold-information.json +2064 -0
- package/busy-spence-79c6bf/src/schemas/v1/legal-information.json +1045 -0
- package/busy-spence-79c6bf/src/schemas/v1/material-facts.json +2109 -0
- package/busy-spence-79c6bf/src/schemas/v1/pdtf-transaction-search-results.json +40 -0
- package/busy-spence-79c6bf/src/schemas/v1/pdtf-transaction.json +191 -0
- package/busy-spence-79c6bf/src/schemas/v1/searches/drainage-and-water.json +261 -0
- package/busy-spence-79c6bf/src/schemas/v1/searches/local-land-charges.json +69 -0
- package/busy-spence-79c6bf/src/schemas/v1/searches/local-searches-required.json +857 -0
- package/busy-spence-79c6bf/src/schemas/v1/searches.json +237 -0
- package/busy-spence-79c6bf/src/schemas/v1/title-deed.json +841 -0
- package/busy-spence-79c6bf/src/schemas/v2/baspiNotes.html +102 -0
- package/busy-spence-79c6bf/src/schemas/v2/combined.json +37731 -0
- package/busy-spence-79c6bf/src/schemas/v2/overlays/baspi.json +8132 -0
- package/busy-spence-79c6bf/src/schemas/v2/overlays/con29DW.json +705 -0
- package/busy-spence-79c6bf/src/schemas/v2/overlays/con29R.json +2956 -0
- package/busy-spence-79c6bf/src/schemas/v2/overlays/fme1.json +1259 -0
- package/busy-spence-79c6bf/src/schemas/v2/overlays/llc1.json +25 -0
- package/busy-spence-79c6bf/src/schemas/v2/overlays/lpe1.json +2171 -0
- package/busy-spence-79c6bf/src/schemas/v2/overlays/nts.json +326 -0
- package/busy-spence-79c6bf/src/schemas/v2/overlays/oc1.json +2799 -0
- package/busy-spence-79c6bf/src/schemas/v2/overlays/piq.json +3419 -0
- package/busy-spence-79c6bf/src/schemas/v2/overlays/rds.json +3736 -0
- package/busy-spence-79c6bf/src/schemas/v2/overlays/ta10.json +5306 -0
- package/busy-spence-79c6bf/src/schemas/v2/overlays/ta6.json +4533 -0
- package/busy-spence-79c6bf/src/schemas/v2/overlays/ta7.json +1045 -0
- package/busy-spence-79c6bf/src/schemas/v2/pdtf-transaction.json +34351 -0
- package/busy-spence-79c6bf/src/schemas/v2/skeleton.json +3973 -0
- package/busy-spence-79c6bf/src/schemas/v3/combined.json +48643 -0
- package/busy-spence-79c6bf/src/schemas/v3/compactSkeleton.txt +4519 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/README.md +299 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/baspi4.json +8030 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/baspi5.json +8180 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/con29DW.json +716 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/con29R.json +2981 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/extensions/ac.json +334 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/extensions/as.json +74 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/extensions/dk.json +33 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/extensions/dr.json +73 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/extensions/er.json +85 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/extensions/fd.json +75 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/extensions/hi.json +51 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/extensions/hs.json +73 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/extensions/ic.json +94 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/extensions/jk.json +96 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/extensions/la.json +85 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/extensions/lc.json +76 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/extensions/ma.json +90 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/extensions/mc.json +38 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/extensions/mi.json +70 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/extensions/nd.json +44 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/extensions/oa.json +24 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/extensions/oc.json +57 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/extensions/pc.json +38 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/extensions/ph.json +195 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/extensions/rw.json +69 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/extensions/sb.json +73 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/extensions/sc.json +133 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/extensions/sd.json +64 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/extensions/sf.json +74 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/extensions/sl.json +68 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/extensions/ta.json +204 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/extensions/tf.json +103 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/extensions/tr.json +74 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/extensions/wg.json +351 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/fme1.json +1266 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/llc1.json +25 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/lpe1.json +2199 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/nts.json +2159 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/nts2.json +2744 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/ntsl.json +1815 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/ntsl2.json +2219 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/oc1.json +2817 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/piq.json +3324 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/rds.json +3668 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/sef25.json +1653 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/sr24.json +38 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/ta10.json +4645 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/ta6.json +4572 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/ta6ed6.json +6665 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/ta7.json +1537 -0
- package/busy-spence-79c6bf/src/schemas/v3/overlays/ta7ed5.json +1585 -0
- package/busy-spence-79c6bf/src/schemas/v3/pdtf-transaction.json +41570 -0
- package/busy-spence-79c6bf/src/schemas/v3/skeleton.json +5767 -0
- package/busy-spence-79c6bf/src/schemas/verifiedClaims/README.md +21 -0
- package/busy-spence-79c6bf/src/schemas/verifiedClaims/pdtf-verified-claims.json +447 -0
- package/busy-spence-79c6bf/src/utils/compactSkeleton.js +84 -0
- package/busy-spence-79c6bf/src/utils/countTokens.js +67 -0
- package/busy-spence-79c6bf/src/utils/extractExtensionOverlays.js +633 -0
- package/busy-spence-79c6bf/src/utils/extractOverlay.js +381 -0
- package/busy-spence-79c6bf/src/utils/extractProperties.js +44 -0
- package/busy-spence-79c6bf/src/utils/listPathTitles.js +36 -0
- package/busy-spence-79c6bf/src/utils/minimalSkeleton.js +85 -0
- package/busy-spence-79c6bf/src/utils/pathList.csv +903 -0
- package/busy-spence-79c6bf/src/utils/pathSkeleton.js +181 -0
- package/busy-spence-79c6bf/ta6ed6-titles-plan.md +118 -0
- package/busy-spence-79c6bf/ta7ed5-titles-spec.md +89 -0
- package/package.json +1 -1
- package/src/schemas/v3/combined.json +225 -47
- package/src/schemas/v3/overlays/llc1.json +1 -2
- package/src/schemas/v3/overlays/ta6ed6.json +204 -75
- package/src/schemas/v3/overlays/ta7ed5.json +54 -20
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
# PDTF Schema Overlays
|
|
2
|
+
|
|
3
|
+
This directory contains overlay schemas that extend the base PDTF transaction schema with form-specific properties and requirements. Overlays use a merging system that allows flexible composition of schema features.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
The PDTF schema system uses a base transaction schema (`pdtf-transaction.json`) combined with overlays to create form-specific schemas. Each overlay contains:
|
|
8
|
+
|
|
9
|
+
- Form-specific references (e.g., `ntsRef`, `baspiRef`)
|
|
10
|
+
- Additional required fields
|
|
11
|
+
- Form-specific titles and descriptions
|
|
12
|
+
- Enhanced validation rules
|
|
13
|
+
|
|
14
|
+
## Main Form Overlays
|
|
15
|
+
|
|
16
|
+
### Property Information Forms
|
|
17
|
+
|
|
18
|
+
| Overlay | Description | Form Version | Key Features |
|
|
19
|
+
|---------|-------------|--------------|--------------|
|
|
20
|
+
| `baspi4.json` | Buyers and Sellers Property Information | v4.0 | Core property transaction data |
|
|
21
|
+
| `baspi5.json` | Buyers and Sellers Property Information | v5.0 | Enhanced BASPI with additional fields |
|
|
22
|
+
| `nts.json` | National Trading Standards | 2023 | Consumer protection requirements |
|
|
23
|
+
| `nts2.json` | National Trading Standards | 2025 | Extended NTS with specialist issues |
|
|
24
|
+
| `ntsl.json` | National Trading Standards (Leasehold) | 2023 | Leasehold-specific NTS requirements |
|
|
25
|
+
| `ntsl2.json` | National Trading Standards (Leasehold) | 2025 | Enhanced leasehold NTS |
|
|
26
|
+
| `piq.json` | Property Information Questionnaire | v3 | Estate agent property information |
|
|
27
|
+
|
|
28
|
+
### Legal Forms
|
|
29
|
+
|
|
30
|
+
| Overlay | Description | Form Version | Key Features |
|
|
31
|
+
|---------|-------------|--------------|--------------|
|
|
32
|
+
| `ta6.json` | Property Information Form | Edition 4 | Law Society standard form |
|
|
33
|
+
| `ta7.json` | Leasehold Information Form | Edition 3 | Leasehold-specific legal requirements |
|
|
34
|
+
| `ta10.json` | Fittings and Contents Form | Edition 3 | Fixtures and fittings information |
|
|
35
|
+
|
|
36
|
+
### Search and Survey Forms
|
|
37
|
+
|
|
38
|
+
| Overlay | Description | Form Version | Key Features |
|
|
39
|
+
|---------|-------------|--------------|--------------|
|
|
40
|
+
| `con29R.json` | Local Authority Search | 2019 | Standard local authority enquiries |
|
|
41
|
+
| `con29DW.json` | Drainage and Water Search | Current | Water authority enquiries |
|
|
42
|
+
| `lpe1.json` | Leasehold Property Enquiries | Edition 4 | Additional leasehold enquiries |
|
|
43
|
+
| `fme1.json` | Freehold Management Enquiries | Edition 2 | Managed freehold enquiries |
|
|
44
|
+
| `llc1.json` | Local Land Charges Search | v2 | Local land charges register |
|
|
45
|
+
| `oc1.json` | Optional Enquiries of Local Authority | v21 | Additional local authority enquiries |
|
|
46
|
+
|
|
47
|
+
### Specialist Forms
|
|
48
|
+
|
|
49
|
+
| Overlay | Description | Key Features |
|
|
50
|
+
|---------|-------------|--------------|
|
|
51
|
+
| `rds.json` | Residential Development Survey | Property development information |
|
|
52
|
+
| `sr24.json` | Sustainability Report | Environmental sustainability data |
|
|
53
|
+
|
|
54
|
+
## Extension Overlays
|
|
55
|
+
|
|
56
|
+
The `extensions/` directory contains modular overlays that add specific NTS2 features to the NTS base. These allow selective adoption of NTS2 enhancements without requiring the full NTS2 overlay.
|
|
57
|
+
|
|
58
|
+
### Specialist Issues Extensions
|
|
59
|
+
|
|
60
|
+
| Extension | String Key | Description | Reference | Usage |
|
|
61
|
+
|-----------|------------|-------------|-----------|-------|
|
|
62
|
+
| `as.json` | `"as"` | Asbestos | A5.2 | Asbestos presence and management |
|
|
63
|
+
| `dr.json` | `"dr"` | Dry Rot Treatment | A5.1 | Dry rot and timber treatment |
|
|
64
|
+
| `jk.json` | `"jk"` | Japanese Knotweed | A5.3 | Japanese knotweed presence and management |
|
|
65
|
+
| `sb.json` | `"sb"` | Subsidence | A5.4 | Subsidence or structural faults |
|
|
66
|
+
| `hs.json` | `"hs"` | Health & Safety | A5.5 | Ongoing health or safety issues |
|
|
67
|
+
|
|
68
|
+
### Property Features Extensions
|
|
69
|
+
|
|
70
|
+
| Extension | String Key | Description | Reference | Usage |
|
|
71
|
+
|-----------|------------|-------------|-----------|-------|
|
|
72
|
+
| `oa.json` | `"oa"` | Outside Areas | - | Garden, balcony, communal areas |
|
|
73
|
+
| `la.json` | `"la"` | Loft Access | A4.1 | Loft access, boarding, insulation |
|
|
74
|
+
| `sf.json` | `"sf"` | Spray Foam Insulation | A4.2 | Spray foam insulation details |
|
|
75
|
+
| `mc.json` | `"mc"` | Main Construction | - | Standard construction type |
|
|
76
|
+
|
|
77
|
+
### Ownership & Financial Extensions
|
|
78
|
+
|
|
79
|
+
| Extension | String Key | Description | Reference | Usage |
|
|
80
|
+
|-----------|------------|-------------|-----------|-------|
|
|
81
|
+
| `er.json` | `"er"` | Estate Rentcharges | A3.2 | Freehold estate rentcharges |
|
|
82
|
+
| `ma.json` | `"ma"` | Managing Agent | A1.5.4 | Leasehold managing agent details |
|
|
83
|
+
| `tf.json` | `"tf"` | Transfer Fees | A3.5.1.1 | Additional leasehold fees |
|
|
84
|
+
|
|
85
|
+
### Utilities & Services Extensions
|
|
86
|
+
|
|
87
|
+
| Extension | String Key | Description | Reference | Usage |
|
|
88
|
+
|-----------|------------|-------------|-----------|-------|
|
|
89
|
+
| `sl.json` | `"sl"` | Solar Panels Ownership | B3.7.1 | Solar panel ownership details |
|
|
90
|
+
| `hi.json` | `"hi"` | Heating Installation | B3.4.3.2 | Central heating installation date |
|
|
91
|
+
| `fd.json` | `"fd"` | Flood Defences | - | Flood defence information |
|
|
92
|
+
|
|
93
|
+
### Transaction Extensions
|
|
94
|
+
|
|
95
|
+
| Extension | String Key | Description | Reference | Usage |
|
|
96
|
+
|-----------|------------|-------------|-----------|-------|
|
|
97
|
+
| `oc.json` | `"oc"` | Other Property Chain | - | Chain dependency information |
|
|
98
|
+
|
|
99
|
+
## Usage Examples
|
|
100
|
+
|
|
101
|
+
### Basic Form Overlay
|
|
102
|
+
|
|
103
|
+
```javascript
|
|
104
|
+
const { getTransactionSchema } = require('@pdtf/schemas');
|
|
105
|
+
|
|
106
|
+
// Get schema with single overlay
|
|
107
|
+
const schema = getTransactionSchema(
|
|
108
|
+
"https://trust.propdata.org.uk/schemas/v3/pdtf-transaction.json",
|
|
109
|
+
["nts"]
|
|
110
|
+
);
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Multiple Overlays
|
|
114
|
+
|
|
115
|
+
```javascript
|
|
116
|
+
// Combine multiple form overlays
|
|
117
|
+
const schema = getTransactionSchema(
|
|
118
|
+
"https://trust.propdata.org.uk/schemas/v3/pdtf-transaction.json",
|
|
119
|
+
["baspi5", "ta6", "con29R"]
|
|
120
|
+
);
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Extension Overlays
|
|
124
|
+
|
|
125
|
+
```javascript
|
|
126
|
+
// Using string keys (recommended)
|
|
127
|
+
const schema = getTransactionSchema(
|
|
128
|
+
"https://trust.propdata.org.uk/schemas/v3/pdtf-transaction.json",
|
|
129
|
+
["nts2023", "jk", "tf"]
|
|
130
|
+
);
|
|
131
|
+
|
|
132
|
+
// Or load extension overlays directly
|
|
133
|
+
const jkExtension = require('./overlays/extensions/jk.json');
|
|
134
|
+
const tfExtension = require('./overlays/extensions/tf.json');
|
|
135
|
+
|
|
136
|
+
const schema = getTransactionSchema(
|
|
137
|
+
"https://trust.propdata.org.uk/schemas/v3/pdtf-transaction.json",
|
|
138
|
+
["nts2023", jkExtension, tfExtension]
|
|
139
|
+
);
|
|
140
|
+
|
|
141
|
+
// Or access via extensionOverlays object
|
|
142
|
+
const { extensionOverlays } = require('@pdtf/schemas');
|
|
143
|
+
const schema = getTransactionSchema(
|
|
144
|
+
"https://trust.propdata.org.uk/schemas/v3/pdtf-transaction.json",
|
|
145
|
+
["nts2023", extensionOverlays.jk, extensionOverlays.tf]
|
|
146
|
+
);
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Custom Overlay Objects
|
|
150
|
+
|
|
151
|
+
```javascript
|
|
152
|
+
// Define custom overlay inline
|
|
153
|
+
const customOverlay = {
|
|
154
|
+
properties: {
|
|
155
|
+
propertyPack: {
|
|
156
|
+
properties: {
|
|
157
|
+
customField: {
|
|
158
|
+
ntsRef: "CUSTOM.1",
|
|
159
|
+
type: "string",
|
|
160
|
+
title: "Custom Field"
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
const schema = getTransactionSchema(
|
|
168
|
+
"https://trust.propdata.org.uk/schemas/v3/pdtf-transaction.json",
|
|
169
|
+
["nts", customOverlay]
|
|
170
|
+
);
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## Overlay Structure
|
|
174
|
+
|
|
175
|
+
All overlays follow this structure:
|
|
176
|
+
|
|
177
|
+
```json
|
|
178
|
+
{
|
|
179
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
180
|
+
"$id": "https://trust.propdata.org.uk/schemas/v3/overlays/{overlay-name}.json",
|
|
181
|
+
"properties": {
|
|
182
|
+
"propertyPack": {
|
|
183
|
+
"{formRef}": "reference-code",
|
|
184
|
+
"required": ["field1", "field2"],
|
|
185
|
+
"properties": {
|
|
186
|
+
"field1": {
|
|
187
|
+
"{formRef}": "reference-code.1",
|
|
188
|
+
"type": "string",
|
|
189
|
+
"title": "Field Title"
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Reference Attributes
|
|
198
|
+
|
|
199
|
+
Each overlay uses form-specific reference attributes:
|
|
200
|
+
|
|
201
|
+
- `ntsRef` / `nts2Ref` - National Trading Standards references
|
|
202
|
+
- `baspi4Ref` / `baspi5Ref` - BASPI form references
|
|
203
|
+
- `ta6Ref` / `ta7Ref` / `ta10Ref` - Law Society form references
|
|
204
|
+
- `lpe1Ref` / `fme1Ref` - Property enquiry references
|
|
205
|
+
- `con29RRef` / `con29DWRef` - Search form references
|
|
206
|
+
- `rdsRef` - Residential Development Survey references
|
|
207
|
+
- `piqRef` - Property Information Questionnaire references
|
|
208
|
+
|
|
209
|
+
### Discriminator Support
|
|
210
|
+
|
|
211
|
+
Overlays support conditional schemas using discriminators:
|
|
212
|
+
|
|
213
|
+
```json
|
|
214
|
+
{
|
|
215
|
+
"yesNoField": {
|
|
216
|
+
"discriminator": {
|
|
217
|
+
"propertyName": "yesNo"
|
|
218
|
+
},
|
|
219
|
+
"oneOf": [
|
|
220
|
+
{
|
|
221
|
+
"properties": {
|
|
222
|
+
"yesNo": { "enum": ["Yes"] },
|
|
223
|
+
"details": { "type": "string" }
|
|
224
|
+
},
|
|
225
|
+
"required": ["details"]
|
|
226
|
+
}
|
|
227
|
+
]
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
## Validation
|
|
233
|
+
|
|
234
|
+
Use the validation functions to check data against overlay schemas:
|
|
235
|
+
|
|
236
|
+
```javascript
|
|
237
|
+
const { getValidator, validateVerifiedClaims } = require('@pdtf/schemas');
|
|
238
|
+
|
|
239
|
+
// Get validator for specific overlay combination
|
|
240
|
+
const validator = getValidator(
|
|
241
|
+
"https://trust.propdata.org.uk/schemas/v3/pdtf-transaction.json",
|
|
242
|
+
["nts", "baspi5"]
|
|
243
|
+
);
|
|
244
|
+
|
|
245
|
+
// Validate data
|
|
246
|
+
const isValid = validator(data);
|
|
247
|
+
if (!isValid) {
|
|
248
|
+
console.log(validator.errors);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// Validate verified claims
|
|
252
|
+
const errors = validateVerifiedClaims(
|
|
253
|
+
verifiedClaimsData,
|
|
254
|
+
"https://trust.propdata.org.uk/schemas/v3/pdtf-transaction.json",
|
|
255
|
+
["nts"]
|
|
256
|
+
);
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
## Best Practices
|
|
260
|
+
|
|
261
|
+
1. **Choose appropriate overlays** for your use case - don't include unnecessary forms
|
|
262
|
+
2. **Test overlay combinations** thoroughly as some may conflict
|
|
263
|
+
3. **Use extension overlays** for selective NTS2 adoption
|
|
264
|
+
4. **Validate your data** against the merged schema
|
|
265
|
+
5. **Keep overlay order consistent** for predictable results
|
|
266
|
+
6. **Cache merged schemas** in production for performance
|
|
267
|
+
|
|
268
|
+
## Schema Evolution
|
|
269
|
+
|
|
270
|
+
When overlays are updated:
|
|
271
|
+
|
|
272
|
+
- **Patch versions** (3.4.x) - Bug fixes, no breaking changes
|
|
273
|
+
- **Minor versions** (3.x.0) - New fields, backward compatible
|
|
274
|
+
- **Major versions** (x.0.0) - Breaking changes, migration required
|
|
275
|
+
|
|
276
|
+
Always test your integration when updating overlay versions.
|
|
277
|
+
|
|
278
|
+
## Testing
|
|
279
|
+
|
|
280
|
+
Extension overlays are thoroughly tested to ensure:
|
|
281
|
+
|
|
282
|
+
- **String key compatibility** - All extensions work with simple string keys
|
|
283
|
+
- **Merging behavior** - Overlays merge correctly with base schemas
|
|
284
|
+
- **NTS2 equivalence** - Combined extensions produce equivalent results to NTS2
|
|
285
|
+
- **Individual functionality** - Each extension adds the expected properties
|
|
286
|
+
- **Schema validation** - All generated schemas are valid and functional
|
|
287
|
+
|
|
288
|
+
Run tests with:
|
|
289
|
+
```bash
|
|
290
|
+
npm test -- --testPathPattern=extensionOverlays
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
## Support
|
|
294
|
+
|
|
295
|
+
For questions about overlays:
|
|
296
|
+
|
|
297
|
+
- Check the [main repository documentation](../../../README.md)
|
|
298
|
+
- Review [example files](../../examples/) for usage patterns
|
|
299
|
+
- Submit issues to the [GitHub repository](https://github.com/Property-Data-Trust-Framework/schemas)
|