@pdtf/schemas 3.6.0-dev.4 → 3.6.0-dev.6

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 (131) hide show
  1. package/compassionate-easley-bafb14/CLAUDE.md +101 -0
  2. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/README.md +166 -65
  3. package/compassionate-easley-bafb14/docs/branch-release-workflow.md +138 -0
  4. package/compassionate-easley-bafb14/docs/sef25-extensions-ui-spec.md +355 -0
  5. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/index.js +160 -63
  6. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/package-lock.json +13 -10
  7. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/package.json +7 -2
  8. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/examples/v3/exampleAddParticipantVouch.json +3 -0
  9. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/examples/v3/exampleDocumentedVouch.json +3 -0
  10. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/examples/v3/exampleElectronicRecord.json +3 -0
  11. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/examples/v3/exampleTransaction.json +7 -3
  12. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/examples/v3/exampleVouch.json +3 -0
  13. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/combined.json +8190 -1446
  14. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/compactSkeleton.txt +1208 -14
  15. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/overlays/baspi4.json +186 -28
  16. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/overlays/baspi5.json +191 -30
  17. package/compassionate-easley-bafb14/src/schemas/v3/overlays/extensions/ac.json +334 -0
  18. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/overlays/extensions/as.json +4 -2
  19. package/compassionate-easley-bafb14/src/schemas/v3/overlays/extensions/dk.json +33 -0
  20. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/overlays/extensions/dr.json +9 -9
  21. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/overlays/extensions/er.json +4 -2
  22. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/overlays/extensions/fd.json +6 -3
  23. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/overlays/extensions/hi.json +6 -3
  24. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/overlays/extensions/hs.json +4 -2
  25. package/compassionate-easley-bafb14/src/schemas/v3/overlays/extensions/ic.json +94 -0
  26. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/overlays/extensions/jk.json +28 -8
  27. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/overlays/extensions/la.json +4 -2
  28. package/compassionate-easley-bafb14/src/schemas/v3/overlays/extensions/lc.json +76 -0
  29. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/overlays/extensions/ma.json +6 -3
  30. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/overlays/extensions/mc.json +4 -2
  31. package/compassionate-easley-bafb14/src/schemas/v3/overlays/extensions/mi.json +70 -0
  32. package/compassionate-easley-bafb14/src/schemas/v3/overlays/extensions/nd.json +44 -0
  33. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/overlays/extensions/oa.json +4 -2
  34. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/overlays/extensions/oc.json +4 -2
  35. package/compassionate-easley-bafb14/src/schemas/v3/overlays/extensions/pc.json +38 -0
  36. package/compassionate-easley-bafb14/src/schemas/v3/overlays/extensions/ph.json +195 -0
  37. package/compassionate-easley-bafb14/src/schemas/v3/overlays/extensions/rw.json +69 -0
  38. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/overlays/extensions/sb.json +4 -2
  39. package/compassionate-easley-bafb14/src/schemas/v3/overlays/extensions/sc.json +133 -0
  40. package/compassionate-easley-bafb14/src/schemas/v3/overlays/extensions/sd.json +64 -0
  41. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/overlays/extensions/sf.json +4 -2
  42. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/overlays/extensions/sl.json +4 -2
  43. package/compassionate-easley-bafb14/src/schemas/v3/overlays/extensions/ta.json +204 -0
  44. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/overlays/extensions/tf.json +6 -3
  45. package/compassionate-easley-bafb14/src/schemas/v3/overlays/extensions/tr.json +74 -0
  46. package/compassionate-easley-bafb14/src/schemas/v3/overlays/extensions/wg.json +351 -0
  47. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/overlays/fme1.json +16 -14
  48. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/overlays/lpe1.json +61 -88
  49. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/overlays/nts.json +71 -2
  50. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/overlays/nts2.json +71 -5
  51. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/overlays/ntsl.json +71 -2
  52. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/overlays/ntsl2.json +71 -5
  53. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/overlays/piq.json +56 -8
  54. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/overlays/rds.json +128 -12
  55. package/compassionate-easley-bafb14/src/schemas/v3/overlays/sef25.json +1653 -0
  56. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/overlays/ta10.json +12 -9
  57. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/overlays/ta6.json +103 -32
  58. package/compassionate-easley-bafb14/src/schemas/v3/overlays/ta6ed6.json +6536 -0
  59. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/overlays/ta7.json +134 -32
  60. package/compassionate-easley-bafb14/src/schemas/v3/overlays/ta7ed5.json +1551 -0
  61. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/pdtf-transaction.json +4835 -490
  62. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/skeleton.json +1481 -37
  63. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/verifiedClaims/README.md +12 -3
  64. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/verifiedClaims/pdtf-verified-claims.json +16 -0
  65. package/compassionate-easley-bafb14/src/utils/extractExtensionOverlays.js +633 -0
  66. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/utils/extractOverlay.js +129 -38
  67. package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/utils/pathSkeleton.js +1 -1
  68. package/package.json +1 -1
  69. package/src/schemas/v3/combined.json +5 -1
  70. package/src/schemas/v3/overlays/extensions/ic.json +42 -8
  71. package/src/schemas/v3/overlays/sef25.json +16 -2
  72. package/src/utils/extractExtensionOverlays.js +1 -1
  73. package/keen-dewdney-6ae15b/src/tests/v3/caching.test.js +0 -591
  74. package/keen-dewdney-6ae15b/src/tests/v3/extensionOverlays.test.js +0 -525
  75. package/keen-dewdney-6ae15b/src/tests/v3/transactionSchema.test.js +0 -574
  76. package/keen-dewdney-6ae15b/src/tests/v3/verifiedClaimsValidator.test.js +0 -128
  77. package/keen-dewdney-6ae15b/src/utils/extractExtensionOverlays.js +0 -362
  78. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/LICENSE +0 -0
  79. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/examples/v1/exampleAddParticipantVouch.json +0 -0
  80. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/examples/v1/exampleDocumentedVouch.json +0 -0
  81. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/examples/v1/exampleElectronicRecord.json +0 -0
  82. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/examples/v1/exampleTransaction.json +0 -0
  83. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/examples/v1/exampleVouch.json +0 -0
  84. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/examples/v2/exampleTransaction.json +0 -0
  85. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/examples/v3/exampleCustomOverlay.json +0 -0
  86. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/examples/v3/exampleCustomOverlay2.json +0 -0
  87. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/mappings/SendPropertyDetailsRequestSchema.json +0 -0
  88. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/mappings/adf.js +0 -0
  89. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v1/GeoJSON.json +0 -0
  90. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v1/baspiNotes.html +0 -0
  91. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v1/energy-performance-certificate.json +0 -0
  92. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v1/freehold-information.json +0 -0
  93. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v1/leasehold-information.json +0 -0
  94. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v1/legal-information.json +0 -0
  95. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v1/material-facts.json +0 -0
  96. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v1/pdtf-transaction-search-results.json +0 -0
  97. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v1/pdtf-transaction.json +0 -0
  98. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v1/searches/drainage-and-water.json +0 -0
  99. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v1/searches/local-land-charges.json +0 -0
  100. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v1/searches/local-searches-required.json +0 -0
  101. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v1/searches.json +0 -0
  102. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v1/title-deed.json +0 -0
  103. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v2/baspiNotes.html +0 -0
  104. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v2/combined.json +0 -0
  105. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v2/overlays/baspi.json +0 -0
  106. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v2/overlays/con29DW.json +0 -0
  107. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v2/overlays/con29R.json +0 -0
  108. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v2/overlays/fme1.json +0 -0
  109. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v2/overlays/llc1.json +0 -0
  110. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v2/overlays/lpe1.json +0 -0
  111. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v2/overlays/nts.json +0 -0
  112. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v2/overlays/oc1.json +0 -0
  113. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v2/overlays/piq.json +0 -0
  114. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v2/overlays/rds.json +0 -0
  115. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v2/overlays/ta10.json +0 -0
  116. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v2/overlays/ta6.json +0 -0
  117. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v2/overlays/ta7.json +0 -0
  118. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v2/pdtf-transaction.json +0 -0
  119. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v2/skeleton.json +0 -0
  120. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/overlays/README.md +0 -0
  121. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/overlays/con29DW.json +0 -0
  122. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/overlays/con29R.json +0 -0
  123. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/overlays/llc1.json +0 -0
  124. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/overlays/oc1.json +0 -0
  125. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/schemas/v3/overlays/sr24.json +0 -0
  126. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/utils/compactSkeleton.js +0 -0
  127. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/utils/countTokens.js +0 -0
  128. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/utils/extractProperties.js +0 -0
  129. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/utils/listPathTitles.js +0 -0
  130. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/utils/minimalSkeleton.js +0 -0
  131. /package/{keen-dewdney-6ae15b → compassionate-easley-bafb14}/src/utils/pathList.csv +0 -0
@@ -0,0 +1,101 @@
1
+ # CLAUDE.md
2
+
3
+ This file provides guidance for AI coding agents when working with code in this repository.
4
+
5
+ ## Overview
6
+
7
+ This repository contains the Property Data Trust Framework (PDTF) schemas - JSON Schema-based definitions for digital residential property data exchange in England and Wales. The framework enables frictionless exchange of property data between software products and services.
8
+
9
+ ## Commands
10
+
11
+ ### Testing
12
+ ```bash
13
+ npm test # Run all tests
14
+ npm run test:watch # Run tests in watch mode
15
+ ```
16
+
17
+ ### Development
18
+ ```bash
19
+ npm install # Install dependencies
20
+ npm run extract-overlays # Regenerate v3 schemas and overlays from combined.json
21
+ npm run extract-extension-overlays # Regenerate v3 extension overlays from combined.json
22
+ npm run publish:dev # Publish the dev branch package to npm tag dev
23
+ npm run publish:next # Publish the next branch package to npm tag next
24
+ npm run publish:latest # Publish the main branch package to npm tag latest
25
+ ```
26
+
27
+ **Important**: `src/schemas/v3/combined.json` is the source of truth for v3 schema changes. Never edit generated schema artifacts directly; there are no exceptions. Utility/source files may be edited normally. After changing `combined.json`, always run both overlay extraction commands so derived files stay in sync.
28
+
29
+ ## Architecture
30
+
31
+ ### Schema System
32
+ The PDTF uses a flexible overlay system where a base transaction schema can be extended with form-specific overlays:
33
+
34
+ - **Base Schema**: Core transaction schema at `/src/schemas/v3/pdtf-transaction.json`
35
+ - **Overlays**: Form-specific extensions in `/src/schemas/v3/overlays/` (e.g., baspi5.json, ta6.json)
36
+ - **Merging**: Overlays are merged with the base schema using deepmerge with custom merge strategies
37
+ - **Generated Files**: `pdtf-transaction.json`, `skeleton.json`, `compactSkeleton.txt`, `src/schemas/v3/overlays/*.json`, and `src/schemas/v3/overlays/extensions/*.json` are generated from `combined.json`
38
+
39
+ ### Key Components
40
+
41
+ 1. **index.js**: Main module exposing schema utilities
42
+ - `getTransactionSchema(schemaId, overlays)`: Merges base schema with overlays
43
+ - `getValidator(schemaId, overlays)`: Returns AJV validator for schema
44
+ - `validateVerifiedClaims()`: Validates verified claims structure
45
+
46
+ 2. **Schema Versions**: Currently on v3, with v2 still supported
47
+ - Use `https://trust.propdata.org.uk/schemas/v3/pdtf-transaction.json` for v3
48
+
49
+ 3. **Overlay System**: Supports multiple UK property forms
50
+ - BASPI (v4 and v5)
51
+ - Law Society TA forms (TA6, TA7, TA10)
52
+ - NTS forms (2023 and 2025 versions)
53
+ - CON29R, PIQ, RDS, and others
54
+
55
+ ### Testing Approach
56
+ Tests in `/src/tests/` validate:
57
+ - Schema structure with different overlay combinations
58
+ - Path validation for nested properties
59
+ - Custom overlay merging
60
+ - Verified claims validation
61
+
62
+ Use existing test patterns when adding new tests.
63
+
64
+ ## Branch And Release Workflow
65
+
66
+ This repository publishes `@pdtf/schemas` through three branches and npm
67
+ dist-tags:
68
+
69
+ - `main` -> npm `latest`: stable PDTF releases for broad industry use.
70
+ - `next` -> npm `next`: tested capabilities proposed for the next managed PDTF
71
+ point release.
72
+ - `dev` -> npm `dev`: the unstable coal face for faster-moving integration work
73
+ and early adopters.
74
+
75
+ PRs may be merged into `dev` to prove out work before it is ready for the managed
76
+ release path. Once a `dev` PR has been tested and is suitable for standards
77
+ review, promote the same change into `next` via a focused PR. Do not treat `dev`
78
+ as the standard, and do not publish `dev` or `next` builds to npm `latest`.
79
+
80
+ Promotion is automatic by default: after a PR is merged into `dev`,
81
+ `.github/workflows/promote-dev-to-next.yml` creates a matching PR into `next` by
82
+ cherry-picking the merged dev PR. Add the `no-promote-next` label before merging
83
+ a dev PR only when it should stay out of the `next` review queue. Reviewers
84
+ should still inspect the promotion PR, resolve conflicts, and adjust
85
+ release/version metadata if needed before merging to `next`.
86
+
87
+ Each npm publish needs a unique semver version. Use `-dev.N` versions on `dev`,
88
+ prerelease versions on `next`, and normal release versions on `main`.
89
+
90
+ Consumer-specific compatibility profiles belong in the consuming application or
91
+ service unless the capability becomes generic PDTF package functionality.
92
+ Consumers should pin/hash supplied schemas and use their own target-profile
93
+ configuration for API calls and webhooks.
94
+
95
+ See `docs/branch-release-workflow.md` for the full workflow.
96
+
97
+ ## Important Notes
98
+
99
+ - All schemas use JSON Schema Draft 07
100
+ - The repository publishes to npm as `@pdtf/schemas`
101
+ - Overlays may contain fields from licensed forms (BASPI, PIQ, Law Society) - ensure compliance when rendering data
@@ -7,18 +7,25 @@ The Property Data Trust Framework (PDTF) Schemas provide standardized JSON Schem
7
7
 
8
8
  ## Project Goals & Status
9
9
 
10
- **Current Version:** 3.4.0 (Schema v3 - Stable)
10
+ **Current Version:** 3.5.0 on `main` / npm `latest`.
11
+
12
+ Additional release channels are available for earlier adoption:
13
+
14
+ - `next` branch / npm `next`: tested capabilities proposed for the next PDTF release.
15
+ - `dev` branch / npm `dev`: fast-moving integration work for Moverly and other early adopters. This channel may include changes that are not yet accepted as PDTF standard capability.
11
16
 
12
17
  This schema framework aims to support the [Home Buying and Selling Group](https://homebuyingandsellinggroup.co.uk) 'Property Pack' initiative, encompassing all requirements starting with the Buyers and Sellers Property Information set ([BASPI v4.0](https://homebuyingandsellinggroup.co.uk/baspi/)).
13
18
 
14
19
  **Key Objectives:**
20
+
15
21
  - 🏠 **Standardize** residential property data exchange across England and Wales
16
- - 🔗 **Enable** frictionless data sharing between software products and services
22
+ - 🔗 **Enable** frictionless data sharing between software products and services
17
23
  - 🛡️ **Maintain** trusted information about data provenance and verification
18
24
  - 📋 **Support** industry-standard forms (BASPI, NTS, Law Society TA forms)
19
25
  - 🧩 **Provide** modular components for flexible implementation
20
26
 
21
27
  **Related Projects:**
28
+
22
29
  - [API Specifications](https://github.com/Property-Data-Trust-Framework/api) - OpenAPI specs for data exchange protocols
23
30
  - [PDTF Website](https://trust.propdata.org.uk) - Official framework documentation
24
31
 
@@ -35,7 +42,7 @@ npm install @pdtf/schemas
35
42
  ### Basic Usage
36
43
 
37
44
  ```javascript
38
- const { getTransactionSchema, getValidator } = require('@pdtf/schemas');
45
+ const { getTransactionSchema, getValidator } = require("@pdtf/schemas");
39
46
 
40
47
  // Get a schema with BASPI v5 overlay
41
48
  const schema = getTransactionSchema(
@@ -45,14 +52,14 @@ const schema = getTransactionSchema(
45
52
 
46
53
  // Create a validator
47
54
  const validator = getValidator(
48
- "https://trust.propdata.org.uk/schemas/v3/pdtf-transaction.json",
55
+ "https://trust.propdata.org.uk/schemas/v3/pdtf-transaction.json",
49
56
  ["baspiV5"]
50
57
  );
51
58
 
52
59
  // Validate data
53
60
  const isValid = validator(propertyData);
54
61
  if (!isValid) {
55
- console.log('Validation errors:', validator.errors);
62
+ console.log("Validation errors:", validator.errors);
56
63
  }
57
64
  ```
58
65
 
@@ -60,7 +67,7 @@ if (!isValid) {
60
67
 
61
68
  - **🏗️ Modular Schema System** - Base schemas with flexible overlay composition
62
69
  - **📋 Multiple Form Support** - BASPI, NTS, Law Society TA forms, and more
63
- - **🧩 Extension Overlays** - Granular NTS2 features as individual modules
70
+ - **🧩 Extension Overlays** - Granular NTS2 and SEF25 features as individual modules
64
71
  - **✅ JSON Schema Validation** - Full JSON Schema Draft 07 support with AJV
65
72
  - **🔗 Verified Claims** - Support for verified data provenance tracking
66
73
  - **📚 Comprehensive Documentation** - Detailed usage guides and examples
@@ -80,7 +87,7 @@ if (!isValid) {
80
87
  │ │ │ │ └── extensions/ # Modular NTS2 extensions
81
88
  │ │ │ │ ├── jk.json # Japanese Knotweed
82
89
  │ │ │ │ ├── tf.json # Transfer Fees
83
- │ │ │ │ └── ... # 16 total extensions
90
+ │ │ │ │ └── ... # NTS2 + SEF25 extensions
84
91
  │ │ │ └── combined.json # Master schema for generation
85
92
  │ │ ├── v2/ # Legacy schema version
86
93
  │ │ ├── verifiedClaims/ # Verified claims schemas
@@ -122,6 +129,7 @@ const schema = getTransactionSchema(
122
129
  ```
123
130
 
124
131
  **Parameters:**
132
+
125
133
  - `schemaId` (string): Schema version URL
126
134
  - `overlays` (array): Array of overlay names or objects
127
135
 
@@ -146,39 +154,70 @@ const errors = validateVerifiedClaims(verifiedClaims, schemaId, ["nts2023"]);
146
154
 
147
155
  #### Main Form Overlays
148
156
 
149
- | Overlay | Description | Version |
150
- |---------|-------------|---------|
151
- | `baspiV4` | Buyers and Sellers Property Information | v4.0 |
152
- | `baspiV5` | Buyers and Sellers Property Information | v5.0 |
153
- | `nts2023` | National Trading Standards | 2023 |
154
- | `nts2025` | National Trading Standards | 2025 |
155
- | `ta6ed4` | Law Society Property Information Form | Edition 4 |
156
- | `ta7ed3` | Law Society Leasehold Information Form | Edition 3 |
157
- | `ta10ed3` | Law Society Fittings and Contents Form | Edition 3 |
157
+ | Overlay | Description | Version |
158
+ | --------- | --------------------------------------- | --------- |
159
+ | `baspiV4` | Buyers and Sellers Property Information | v4.0 |
160
+ | `baspiV5` | Buyers and Sellers Property Information | v5.0 |
161
+ | `nts2023` | National Trading Standards | 2023 |
162
+ | `nts2025` | National Trading Standards | 2025 |
163
+ | `ta6ed4` | Law Society Property Information Form | Edition 4 |
164
+ | `ta7ed3` | Law Society Leasehold Information Form | Edition 3 |
165
+ | `ta10ed3` | Law Society Fittings and Contents Form | Edition 3 |
158
166
 
159
167
  [View all overlays →](src/schemas/v3/overlays/README.md)
160
168
 
161
169
  #### Extension Overlays
162
170
 
163
- Modular NTS2 features for selective adoption:
171
+ Modular features for selective adoption. Extensions are merged on top of an NTS base overlay.
164
172
 
165
173
  ```javascript
166
- // Individual extensions
167
- const schema = getTransactionSchema(schemaId, ["nts2023", "jk", "tf"]);
174
+ // NTS2 extensions
175
+ const schema = getTransactionSchema(schemaId, ["nts2023", "jk", "tf", "ma"]);
168
176
 
169
- // Multiple specialist issues
170
- const schema = getTransactionSchema(schemaId, ["nts2023", "as", "dr", "jk", "sb"]);
177
+ // SEF25 extensions (Seller Enquiry Form)
178
+ const sef25 = ["sc", "pc", "ph", "dk", "rw", "sd", "lc", "wg", "ic", "nd", "mi", "tr"];
179
+ const schema = getTransactionSchema(schemaId, ["nts2023", ...sef25]);
171
180
  ```
172
181
 
182
+ **NTS2 Extensions:**
183
+
173
184
  | Extension | Code | Description |
174
- |-----------|------|-------------|
185
+ | --- | --- | --- |
175
186
  | Japanese Knotweed | `jk` | Knotweed presence and management |
176
- | Transfer Fees | `tf` | Additional leasehold fees |
177
- | Managing Agent | `ma` | Leasehold managing agent details |
178
- | Solar Panels | `sl` | Solar panel ownership details |
179
187
  | Asbestos | `as` | Asbestos presence and management |
188
+ | Dry Rot | `dr` | Dry rot treatment |
189
+ | Subsidence | `sb` | Subsidence or structural fault |
190
+ | Health & Safety | `hs` | Ongoing health or safety issues |
191
+ | Outside Areas | `oa` | Outside areas details |
192
+ | Main Construction | `mc` | Construction type if standard form |
193
+ | Loft Access | `la` | Loft access and details |
194
+ | Spray Foam | `sf` | Spray foam insulation |
195
+ | Solar Panels | `sl` | Solar panel ownership details |
196
+ | Heating Installed | `hi` | Central heating installation date |
197
+ | Flood Defences | `fd` | Flood defence information |
198
+ | Estate Rentcharges | `er` | Estate rentcharges for freehold |
199
+ | Managing Agent | `ma` | Leasehold managing agent details |
200
+ | Transfer Fees | `tf` | Additional leasehold fees |
201
+ | Onward Chain | `oc` | Other property in chain |
180
202
 
181
- [View all extensions →](src/schemas/v3/overlays/README.md#extension-overlays)
203
+ **SEF25 Extensions (Seller Enquiry Form):**
204
+
205
+ | Extension | Code | Description |
206
+ | --- | --- | --- |
207
+ | Supply Costs | `sc` | Private water/sewerage costs |
208
+ | Parking Permit Cost | `pc` | Parking permit frequency |
209
+ | Property Hazards | `ph` | 4 hazard Yes/No questions |
210
+ | Dropped Kerb | `dk` | Dropped kerb access to parking |
211
+ | Private Right of Way | `rw` | Private right of way |
212
+ | Storm/Fire/Flood Damage | `sd` | Storm, fire or flood damage |
213
+ | Solar Lease Costs | `lc` | Solar panel lease costs |
214
+ | Warranties & Guarantees | `wg` | 7 warranty categories upfront |
215
+ | Insurance Claims | `ic` | Insurance claims upfront |
216
+ | Neighbour Development | `nd` | Neighbour development |
217
+ | Material Issue | `mi` | Other material issue upfront |
218
+ | Title Restrictions | `tr` | Title restrictions for freehold |
219
+
220
+ [View full SEF25 UI spec →](docs/sef25-extensions-ui-spec.md) | [View all extensions →](src/schemas/v3/overlays/README.md#extension-overlays)
182
221
 
183
222
  ## Usage Examples
184
223
 
@@ -195,27 +234,26 @@ const legalSchema = getTransactionSchema(schemaId, ["ta6ed4", "ta7ed3"]);
195
234
  const ntsSchema = getTransactionSchema(schemaId, ["nts2023"]);
196
235
  ```
197
236
 
198
- ### Modular NTS2 Features
237
+ ### Modular Extension Features
199
238
 
200
239
  ```javascript
201
240
  // Selective NTS2 adoption
202
241
  const partialNts2 = getTransactionSchema(schemaId, [
203
- "nts2023", // Base NTS
204
- "jk", // Japanese Knotweed
205
- "tf", // Transfer Fees
206
- "ma" // Managing Agent
242
+ "nts2023", // Base NTS
243
+ "jk", // Japanese Knotweed
244
+ "tf", // Transfer Fees
245
+ "ma", // Managing Agent
207
246
  ]);
208
247
 
209
- // Full specialist issues
210
- const specialistIssues = getTransactionSchema(schemaId, [
211
- "nts2023", "as", "dr", "jk", "sb", "hs"
212
- ]);
248
+ // SEF25 Seller Enquiry Form extensions
249
+ const sef25 = ["sc", "pc", "ph", "dk", "rw", "sd", "lc", "wg", "ic", "nd", "mi", "tr"];
250
+ const sellerEnquiry = getTransactionSchema(schemaId, ["nts2023", ...sef25]);
213
251
  ```
214
252
 
215
253
  ### Data Validation
216
254
 
217
255
  ```javascript
218
- const { getValidator } = require('@pdtf/schemas');
256
+ const { getValidator } = require("@pdtf/schemas");
219
257
 
220
258
  const validator = getValidator(schemaId, ["baspiV5"]);
221
259
 
@@ -223,16 +261,16 @@ const propertyData = {
223
261
  propertyPack: {
224
262
  priceInformation: {
225
263
  price: 350000,
226
- priceQualifier: "Freehold"
264
+ priceQualifier: "Freehold",
227
265
  },
228
266
  // ... more property data
229
- }
267
+ },
230
268
  };
231
269
 
232
270
  if (validator(propertyData)) {
233
- console.log('✅ Data is valid');
271
+ console.log("✅ Data is valid");
234
272
  } else {
235
- console.log('❌ Validation errors:', validator.errors);
273
+ console.log("❌ Validation errors:", validator.errors);
236
274
  }
237
275
  ```
238
276
 
@@ -241,46 +279,110 @@ if (validator(propertyData)) {
241
279
  PDTF supports verified claims to maintain data provenance and trust throughout property transactions. Claims package specific property data with verification evidence, enabling traceability back to authoritative sources.
242
280
 
243
281
  ```javascript
244
- const { validateVerifiedClaims } = require('@pdtf/schemas');
282
+ const { validateVerifiedClaims } = require("@pdtf/schemas");
245
283
 
246
284
  // Current verified claims format
247
- const verifiedClaims = [{
248
- id: "claim-12345",
249
- transactionId: "txn-67890",
250
- schemaVersion: "3.4.0",
251
- verification: {
252
- trust_framework: "uk_pdtf",
253
- time: "2024-07-01T10:30:00Z",
254
- evidence: [{
255
- type: "vouch",
256
- attestation: {
257
- type: "digital_attestation",
258
- voucher: { name: "Estate Agent Ltd" }
259
- },
260
- verification_method: { type: "auth" }
261
- }]
285
+ const verifiedClaims = [
286
+ {
287
+ id: "claim-12345",
288
+ transactionId: "txn-67890",
289
+ schemaVersion: "3.4.0",
290
+ verification: {
291
+ trust_framework: "uk_pdtf",
292
+ time: "2024-07-01T10:30:00Z",
293
+ evidence: [
294
+ {
295
+ type: "vouch",
296
+ attestation: {
297
+ type: "digital_attestation",
298
+ voucher: { name: "Estate Agent Ltd" },
299
+ },
300
+ verification_method: { type: "auth" },
301
+ },
302
+ ],
303
+ },
304
+ terms_of_use: {
305
+ confidentiality_level: "public",
306
+ },
307
+ claims: {
308
+ "/propertyPack/priceInformation/price": 350000,
309
+ "/propertyPack/energyEfficiency/epcRating": "C",
310
+ },
262
311
  },
263
- claims: {
264
- "/propertyPack/priceInformation/price": 350000,
265
- "/propertyPack/energyEfficiency/epcRating": "C"
266
- }
267
- }];
312
+ ];
268
313
 
269
314
  // Validate claims against schema
270
315
  const errors = validateVerifiedClaims(verifiedClaims, schemaId, ["baspiV5"]);
271
316
  if (errors.length === 0) {
272
- console.log('✅ Verified claims are valid');
317
+ console.log("✅ Verified claims are valid");
273
318
  }
274
319
  ```
275
320
 
276
321
  **Key Features:**
322
+
277
323
  - **Schema Path Validation** - Claims reference specific schema paths (e.g., `/propertyPack/priceInformation/price`)
278
324
  - **Provenance Tracking** - Each claim includes verification evidence and source attribution
279
325
  - **Trust Framework Integration** - Claims operate within the UK PDTF trust framework
280
326
  - **Attachment Support** - Supporting documents can be cryptographically linked to claims
327
+ - **Confidentiality Controls** - Terms of use define access levels and permitted recipients
328
+
329
+ #### Confidentiality Levels
330
+
331
+ Verified claims support three confidentiality levels through a pdtf-specific extension: a `terms_of_use` field, enabling fine-grained access control:
332
+
333
+ **Public Data** - Freely accessible data from official sources or public listing information:
334
+
335
+ ```javascript
336
+ {
337
+ terms_of_use: {
338
+ confidentiality_level: "public";
339
+ }
340
+ }
341
+ ```
342
+
343
+ Examples: Land Registry data, Energy Performance Certificates, planning records, council tax information
344
+
345
+ **Restricted Data** - Limited to transaction participants:
346
+
347
+ ```javascript
348
+ {
349
+ terms_of_use: {
350
+ confidentiality_level: "restricted";
351
+ }
352
+ }
353
+ ```
354
+
355
+ Examples: Commercial property reports, contents of legal forms
356
+
357
+ **Confidential Data** - Role-based access with explicit authorization:
358
+
359
+ ```javascript
360
+ {
361
+ terms_of_use: {
362
+ confidentiality_level: "confidential",
363
+ allowed_roles: [
364
+ "Estate Agent",
365
+ "Seller's Conveyancer",
366
+ "Buyer's Conveyancer",
367
+ "Mortgage Broker",
368
+ "Lender"
369
+ ]
370
+ }
371
+ }
372
+ ```
373
+
374
+ Examples: Identity verification reports, anti-money laundering checks, sensitive personal information
375
+
376
+ **Guidelines:**
377
+
378
+ - Use **public** for government/official data sources
379
+ - Use **restricted** for commercial data providers and processed information
380
+ - Use **confidential** for sensitive personal data requiring explicit role authorization
381
+ - Always consider data source and sensitivity when assigning levels
281
382
 
282
383
  **Roadmap - W3C Verifiable Credentials:**
283
384
  The next version of the PDTF framework will migrate to [W3C Verifiable Credentials](https://www.w3.org/TR/vc-data-model/) to provide:
385
+
284
386
  - **Enhanced Security** - Cryptographically signed claims with tamper detection
285
387
  - **Granular Permissions** - Fine-grained access control over claim data
286
388
  - **Interoperability** - Standards-based approach for broader ecosystem compatibility
@@ -311,17 +413,17 @@ npm test -- --testPathPattern=extensionOverlays
311
413
  npm test -- --testPathPattern=transactionSchema
312
414
  ```
313
415
 
314
-
315
416
  ## Versioning
316
417
 
317
418
  The schema follows semantic versioning:
419
+
318
420
  - **Patch** (3.4.x): Bug fixes, no breaking changes
319
421
  - **Minor** (3.x.0): New fields, backward compatible
320
422
  - **Major** (x.0.0): Breaking changes, migration required
321
423
 
322
424
  ## Licensing
323
425
 
324
- Licensed under the [MIT License](https://opensource.org/licenses/MIT).
426
+ Licensed under the [MIT License](https://opensource.org/licenses/MIT).
325
427
 
326
428
  **Important:** Overlays contain fields from licensed forms ([BASPI](https://homebuyingsellingcouncil.co.uk/wp-content/uploads/2021/03/Terms-of-Licence-mandatory-download-for-use-of-BASPI.pdf), [PIQ](https://www.propertymark.co.uk/static/14e7c154-98de-4230-957f09bd8d5ddeec/f542b10a-7710-4c37-b3958ccaeec25d4b/property-information-questionnaire-residential-sales.pdf), [Law Society TA](https://www.lawsociety.org.uk/topics/property/transaction-forms)). When rendering data into these forms, ensure compliance with their respective license terms.
327
429
 
@@ -331,4 +433,3 @@ Licensed under the [MIT License](https://opensource.org/licenses/MIT).
331
433
  - 📁 [Example Files](src/examples/)
332
434
  - 🐛 [Issue Tracker](https://github.com/Property-Data-Trust-Framework/schemas/issues)
333
435
  - 🌐 [PDTF Website](https://trust.propdata.org.uk)
334
-
@@ -0,0 +1,138 @@
1
+ # Branch And Release Workflow
2
+
3
+ This repository uses three long-lived release channels for `@pdtf/schemas`.
4
+
5
+ ## Branches And npm Tags
6
+
7
+ | Branch | npm dist-tag | Purpose |
8
+ | --- | --- | --- |
9
+ | `main` | `latest` | Stable PDTF releases for broad industry use. |
10
+ | `next` | `next` | Tested capabilities intended for the next managed PDTF point release. |
11
+ | `dev` | `dev` | Unstable coal face for faster-moving integration work and early adopters. |
12
+
13
+ `dev` is not the standard. It is a proving ground for changes that may later be
14
+ promoted to `next` through focused PRs. Consumers who need the stable standard
15
+ should use `@pdtf/schemas` from `latest`/`main`.
16
+
17
+ ## Versioning
18
+
19
+ Every npm publish must have a unique semver version.
20
+
21
+ - `main` publishes normal release versions, for example `3.5.0`, on `latest`.
22
+ - `next` publishes prerelease versions on the `next` tag.
23
+ - `dev` publishes prerelease versions on the `dev` tag, using a `-dev.N`
24
+ suffix, for example `3.6.0-dev.0`.
25
+
26
+ Do not publish `dev` or `next` builds to `latest`.
27
+
28
+ ## Dev Fast-Path Workflow
29
+
30
+ Use this workflow when work needs to move faster than the managed PDTF release
31
+ cycle, or when a change needs practical integration testing before it is proposed
32
+ for the standards-track path.
33
+
34
+ 1. Open a PR against `dev`.
35
+ 2. Treat `dev` as the unstable coal face. Keep the change reviewable and, where
36
+ possible, structured so that accepted parts can later be promoted to `next`.
37
+ 3. Change `src/schemas/v3/combined.json` for schema changes, then run both
38
+ extraction scripts:
39
+
40
+ ```bash
41
+ npm run extract-overlays
42
+ npm run extract-extension-overlays
43
+ ```
44
+
45
+ 4. Add or update tests for schema, overlay, path-validation, and utility
46
+ behaviour.
47
+ 5. Bump the package version to the next unique `-dev.N` version if the PR will
48
+ be published from `dev`.
49
+ 6. If the change should not enter the `next` review queue after it has landed in
50
+ `dev`, add the `no-promote-next` label before merging.
51
+ 7. Merge to `dev`.
52
+ 8. If publishing the dev channel, publish from `dev`:
53
+
54
+ ```bash
55
+ npm run publish:dev
56
+ ```
57
+
58
+ 9. Consumers can use `@pdtf/schemas@dev`, or pin the exact dev version in
59
+ lockfiles when deterministic rollout is required.
60
+
61
+ ## Automated Promotion To next
62
+
63
+ The `.github/workflows/promote-dev-to-next.yml` workflow can open the matching
64
+ `next` PR automatically.
65
+
66
+ Trigger:
67
+
68
+ - A PR is merged into `dev`.
69
+ - The merged PR does not have the `no-promote-next` label.
70
+
71
+ Behaviour:
72
+
73
+ 1. Check out `next`.
74
+ 2. Create a branch named `promote/dev-pr-<number>-to-next`.
75
+ 3. Cherry-pick the merged dev PR's effective diff onto that branch.
76
+ 4. Open a PR into `next` with a title and body referencing the original dev PR.
77
+
78
+ If the cherry-pick conflicts, the workflow creates an issue instead of a PR so a
79
+ maintainer can promote the change manually.
80
+
81
+ The promotion PR is intentionally still reviewed. Before merging to `next`,
82
+ maintainers should:
83
+
84
+ - confirm the change is appropriate for the managed release path;
85
+ - remove any dev-only scaffolding;
86
+ - adjust package version metadata from `-dev.N` to the correct `next`
87
+ prerelease version where needed;
88
+ - run tests and schema extraction checks.
89
+
90
+ ## Manual Promotion To next
91
+
92
+ If automation is not used, or if the automated cherry-pick conflicts:
93
+
94
+ 1. Branch from `next`.
95
+ 2. Cherry-pick the merged dev PR commit or recreate the focused diff.
96
+ 3. Remove dev-only changes.
97
+ 4. Bump to the next unique `next` prerelease version if the PR will be published
98
+ from `next`.
99
+ 5. Open a PR into `next` that links back to the original dev PR.
100
+ 6. Merge to `next` after review.
101
+ 7. Publish from `next`:
102
+
103
+ ```bash
104
+ npm run publish:next
105
+ ```
106
+
107
+ The `next` channel should remain tested and coherent. It can be ahead of
108
+ `main`, but it should not contain unrelated experimental work merely because it
109
+ exists on `dev`.
110
+
111
+ ## Promotion To main
112
+
113
+ When the PDTF point-release cycle is ready:
114
+
115
+ 1. Select accepted `next` changes for the point release.
116
+ 2. Merge or cherry-pick the accepted changes into `main`.
117
+ 3. Bump to the release version, for example `3.6.0`.
118
+ 4. Publish from `main`:
119
+
120
+ ```bash
121
+ npm run publish:latest
122
+ ```
123
+
124
+ Long-running `dev` work should not be merged wholesale into `main` unless the
125
+ full contents have been reviewed and accepted for the PDTF release.
126
+
127
+ ## Consumer Compatibility Profiles
128
+
129
+ Consumer-specific compatibility profiles are owned by the consuming application
130
+ or service unless and until they become a reusable PDTF capability.
131
+
132
+ Consumers may pin exact supplied schemas, hash them, and filter outbound API
133
+ calls or webhooks accordingly. That code should not be added to this schema
134
+ package unless the capability is generic and appropriate for PDTF consumers.
135
+
136
+ If a consumer later supports an official PDTF release, its target profile should
137
+ move from the consumer-specific schema to the relevant published
138
+ `@pdtf/schemas` release or prerelease.