@pdtf/schemas 3.6.0-dev.1 → 3.6.0-dev.11

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 (53) hide show
  1. package/package.json +9 -1
  2. package/src/schemas/v3/combined.json +677 -182
  3. package/src/schemas/v3/compactSkeleton.txt +63 -0
  4. package/src/schemas/v3/overlays/baspi4.json +43 -73
  5. package/src/schemas/v3/overlays/baspi5.json +43 -73
  6. package/src/schemas/v3/overlays/extensions/ac.json +2 -1
  7. package/src/schemas/v3/overlays/extensions/dk.json +3 -2
  8. package/src/schemas/v3/overlays/extensions/ic.json +44 -9
  9. package/src/schemas/v3/overlays/extensions/lc.json +3 -2
  10. package/src/schemas/v3/overlays/extensions/mi.json +2 -1
  11. package/src/schemas/v3/overlays/extensions/nd.json +3 -2
  12. package/src/schemas/v3/overlays/extensions/pc.json +3 -2
  13. package/src/schemas/v3/overlays/extensions/ph.json +2 -1
  14. package/src/schemas/v3/overlays/extensions/rw.json +4 -3
  15. package/src/schemas/v3/overlays/extensions/sc.json +8 -4
  16. package/src/schemas/v3/overlays/extensions/sd.json +3 -2
  17. package/src/schemas/v3/overlays/extensions/ta.json +0 -48
  18. package/src/schemas/v3/overlays/extensions/tr.json +3 -2
  19. package/src/schemas/v3/overlays/extensions/wg.json +2 -1
  20. package/src/schemas/v3/overlays/llc1.json +1 -2
  21. package/src/schemas/v3/overlays/lpe1.json +1 -1
  22. package/src/schemas/v3/overlays/nts.json +3 -1
  23. package/src/schemas/v3/overlays/nts2.json +3 -1
  24. package/src/schemas/v3/overlays/ntsl.json +3 -1
  25. package/src/schemas/v3/overlays/ntsl2.json +3 -1
  26. package/src/schemas/v3/overlays/piq.json +23 -24
  27. package/src/schemas/v3/overlays/rds.json +22 -49
  28. package/src/schemas/v3/overlays/sef25.json +16 -2
  29. package/src/schemas/v3/overlays/ta10.json +0 -9
  30. package/src/schemas/v3/overlays/ta6.json +37 -69
  31. package/src/schemas/v3/overlays/ta6ed6.json +319 -180
  32. package/src/schemas/v3/overlays/ta7ed5.json +66 -20
  33. package/src/schemas/v3/pdtf-transaction.json +397 -95
  34. package/src/schemas/v3/skeleton.json +70 -5
  35. package/src/utils/extractExtensionOverlays.js +11 -2
  36. package/src/utils/extractOverlay.js +20 -0
  37. package/CLAUDE.md +0 -101
  38. package/docs/backend-lms-profile-filtering-spec.md +0 -180
  39. package/src/examples/v1/exampleAddParticipantVouch.json +0 -32
  40. package/src/examples/v1/exampleDocumentedVouch.json +0 -40
  41. package/src/examples/v1/exampleElectronicRecord.json +0 -30
  42. package/src/examples/v1/exampleTransaction.json +0 -878
  43. package/src/examples/v1/exampleVouch.json +0 -25
  44. package/src/examples/v2/exampleTransaction.json +0 -901
  45. package/src/examples/v3/exampleAddParticipantVouch.json +0 -38
  46. package/src/examples/v3/exampleCustomOverlay.json +0 -55
  47. package/src/examples/v3/exampleCustomOverlay2.json +0 -93
  48. package/src/examples/v3/exampleDocumentedVouch.json +0 -47
  49. package/src/examples/v3/exampleElectronicRecord.json +0 -36
  50. package/src/examples/v3/exampleTransaction.json +0 -1038
  51. package/src/examples/v3/exampleVouch.json +0 -32
  52. package/src/mappings/SendPropertyDetailsRequestSchema.json +0 -1588
  53. package/src/mappings/adf.js +0 -198
@@ -1,180 +0,0 @@
1
- # Backend LMS Profile Filtering Spec
2
-
3
- ## Context
4
-
5
- Moverly will consume `@pdtf/schemas@dev` for early access to schema changes, but
6
- LMS should only receive data shaped to the `pdtf-transaction.json` profile they
7
- currently support.
8
-
9
- This compatibility layer belongs in Moverly backend services because it is an
10
- integration-boundary concern. The PDTF schema package should not carry
11
- LMS-specific profile code unless the capability later becomes generic and useful
12
- to PDTF consumers.
13
-
14
- ## Target Profile
15
-
16
- Initial LMS profile:
17
-
18
- - Source: LMS-supplied `pdtf-transaction.json`
19
- - Profile id: `lms-2026-05-08`
20
- - Schema id: `https://trust.propdata.org.uk/schemas/v3/pdtf-transaction.json`
21
- - Raw SHA-256:
22
- `5135ffd6158bbe48955ae630cf9cae42ba18f6cd522daed771cd3e44136283d7`
23
- - Canonical SHA-256:
24
- `98aeebe4231557c1aa7bc5182cbb5318d28af32cdcbe3b293feb61dca1e8d6f5`
25
-
26
- The LMS profile is not an official PDTF release. It is a pinned recipient
27
- profile supplied by LMS. When LMS can support an official PDTF release, move the
28
- target profile to that release artifact instead.
29
-
30
- ## Configuration
31
-
32
- Add a backend environment variable:
33
-
34
- ```bash
35
- LMS_PDTF_TARGET_PROFILE=lms-2026-05-08
36
- ```
37
-
38
- Behaviour:
39
-
40
- - Non-production may default to `lms-2026-05-08`.
41
- - Production must fail startup or alert loudly if the variable is missing or
42
- unknown.
43
- - Logs and telemetry must include the selected profile id.
44
-
45
- ## Scope
46
-
47
- Apply LMS profile filtering to:
48
-
49
- - backend endpoints that expose PDTF transaction data to LMS;
50
- - webhooks sent to LMS;
51
- - verified claim payloads included in LMS-facing API responses or webhooks.
52
-
53
- Do not apply LMS filtering to:
54
-
55
- - stored/source Moverly verified claims;
56
- - internal Moverly workflows;
57
- - non-LMS partners;
58
- - frontend schema rendering, except where frontend displays backend-provided
59
- compatibility metadata.
60
-
61
- ## Filtering Rules
62
-
63
- Treat the target profile as closed for outbound LMS payloads, even though PDTF
64
- schemas generally do not declare `additionalProperties: false`.
65
-
66
- For transaction payloads:
67
-
68
- 1. Build the normal internal Moverly/PDTF payload.
69
- 2. Filter unknown top-level and nested fields against the selected LMS target
70
- schema.
71
- 3. Validate the filtered payload against the selected LMS target schema.
72
- 4. Send only the filtered payload.
73
-
74
- For verified claims:
75
-
76
- 1. Iterate each verified claim envelope.
77
- 2. Inspect each `claims` path/value pair independently.
78
- 3. Keep the line item only if:
79
- - the path exists in the selected LMS target schema; and
80
- - the value validates against that path's subschema.
81
- 4. Drop unsupported or invalid line items.
82
- 5. Preserve the verified claim envelope if at least one line item remains.
83
- 6. Drop the envelope only if all line items are suppressed.
84
- 7. Preserve envelope metadata such as `id`, `transactionId`, `schemaVersion`,
85
- `verification`, and `terms_of_use`.
86
- 8. Do not mutate the source verified claim.
87
-
88
- Do not map paths or transform values. If a field needs structural mapping, that
89
- is a separate business/product decision and should not happen implicitly in this
90
- filtering layer.
91
-
92
- ## Selective Disclosure Semantics
93
-
94
- Suppression means "not disclosed to LMS under this profile".
95
-
96
- It does not mean "the seller/source did not assert this". Any backend feature
97
- answering questions such as "did the seller make an assertion about flooding?"
98
- must query the source verified claims or explicit suppression metadata, not the
99
- LMS-filtered payload.
100
-
101
- ## Suggested Backend Module
102
-
103
- Create a small backend-owned module, for example:
104
-
105
- ```text
106
- src/integrations/lms/pdtfProfile/
107
- lms-2026-05-08/pdtf-transaction.json
108
- lms-2026-05-08/metadata.json
109
- filterTransactionForProfile.ts
110
- filterVerifiedClaimsForProfile.ts
111
- profileRegistry.ts
112
- ```
113
-
114
- The implementation should:
115
-
116
- - load the selected profile by id;
117
- - verify the pinned file hash in tests;
118
- - use JSON Schema parsing rather than hand-maintained path allowlists;
119
- - compile validators with the same AJV draft/settings used for PDTF validation;
120
- - cache subschema validators by `profileId:path`;
121
- - return suppression metadata without logging claim values.
122
-
123
- ## Observability
124
-
125
- Record:
126
-
127
- - partner: `LMS`;
128
- - target profile id;
129
- - profile raw/canonical hash;
130
- - endpoint or webhook name;
131
- - transaction id;
132
- - claim line items before filtering;
133
- - claim line items after filtering;
134
- - verified claim envelopes before filtering;
135
- - verified claim envelopes after filtering;
136
- - envelopes dropped;
137
- - unsupported path count;
138
- - invalid value count;
139
- - suppressed paths, where safe;
140
- - validation errors, without sensitive values.
141
-
142
- ## Tests
143
-
144
- Backend tests should cover:
145
-
146
- - selected profile id is read from env;
147
- - unknown production profile id fails loudly;
148
- - profile metadata hashes match the bundled LMS schema file;
149
- - transaction filtering removes unknown top-level fields;
150
- - transaction filtering removes unknown nested fields;
151
- - filtered transaction validates against the LMS target profile;
152
- - a field valid in `@pdtf/schemas@dev` but absent from LMS is suppressed;
153
- - verified claim line items are filtered independently;
154
- - verified claim envelope metadata is preserved;
155
- - envelopes are dropped only when all line items are suppressed;
156
- - source verified claims are not mutated;
157
- - suppression metadata is returned and contains no claim values.
158
-
159
- ## Rollout
160
-
161
- 1. Publish and install `@pdtf/schemas@dev` in Moverly backend.
162
- 2. Add the LMS target profile module and tests.
163
- 3. Set `LMS_PDTF_TARGET_PROFILE=lms-2026-05-08` in non-production.
164
- 4. Run LMS endpoint and webhook regression tests.
165
- 5. Deploy on Monday morning behind normal backend release controls.
166
- 6. Monitor suppression and validation telemetry.
167
- 7. Set the production env var and complete go-live.
168
- 8. Keep the previous behaviour available for rollback until LMS confirms the new
169
- payloads are accepted.
170
-
171
- ## Future Profiles
172
-
173
- For a new LMS-supported PDTF release:
174
-
175
- 1. Add the official released `pdtf-transaction.json` artifact or reference.
176
- 2. Give it a clear profile id, for example `pdtf-3.6.0`.
177
- 3. Add metadata and hash tests.
178
- 4. Update `LMS_PDTF_TARGET_PROFILE`.
179
- 5. Deploy backend and monitor telemetry.
180
- 6. Retain the previous profile until rollback is no longer needed.
@@ -1,32 +0,0 @@
1
- {
2
- "verification": {
3
- "trust_framework": "uk_pdtf",
4
- "time": "2022-01-25T13:05:03.108Z",
5
- "evidence": [
6
- {
7
- "type": "vouch",
8
- "attestation": {
9
- "type": "digital_attestation",
10
- "voucher": {
11
- "name": "Martin Abode"
12
- }
13
- },
14
- "verification_method": {
15
- "type": "auth"
16
- }
17
- }
18
- ]
19
- },
20
- "claims": {
21
- "/participants/-": {
22
- "name": {
23
- "firstName": "Martin",
24
- "lastName": "Abode"
25
- },
26
- "email": "martin@abode.co.uk",
27
- "organisation": "Abode and Floggit Estate Agents",
28
- "organisationReference": "MAR/12243/22",
29
- "role": "Estate Agent"
30
- }
31
- }
32
- }
@@ -1,40 +0,0 @@
1
- {
2
- "verification": {
3
- "trust_framework": "uk_pdtf",
4
- "time": "2022-01-25T13:16:44.527Z",
5
- "evidence": [
6
- {
7
- "type": "vouch",
8
- "attachments": [
9
- {
10
- "digest": {
11
- "alg": "md5",
12
- "value": "randomHashValue"
13
- },
14
- "url": "https://fakeFileStore.com/some/kind/of/file",
15
- "desc": "proofOfAddress.pdf",
16
- "pdtfSchemaPath": "/propertyPack/materialFacts/councilTax/councilTaxAffectingAlterations/details"
17
- }
18
- ],
19
- "verification_method": {
20
- "type": "auth"
21
- },
22
- "attestation": {
23
- "voucher": {
24
- "name": "Maria Harris"
25
- },
26
- "type": "digital_attestation"
27
- }
28
- }
29
- ]
30
- },
31
- "claims": {
32
- "/propertyPack/materialFacts/councilTax": {
33
- "councilTaxBand": "D",
34
- "councilTaxAffectingAlterations": {
35
- "yesNo": "Yes",
36
- "details": "Extension added in 2005 to add bedroom with ensuite shower room. Certificate of Compliance issued 17th Feb 2006 and council tax updated"
37
- }
38
- }
39
- }
40
- }
@@ -1,30 +0,0 @@
1
- {
2
- "verification": {
3
- "time": "2022-01-25T07:52:14.318Z",
4
- "trust_framework": "uk_pdtf",
5
- "evidence": [
6
- {
7
- "type": "electronic_record",
8
- "verifier": {
9
- "organization": "Property Pack Assembly Software Ltd"
10
- },
11
- "record": {
12
- "source": {
13
- "name": "Royal Mail Postcode Address File",
14
- "rights": "(c) Royal Mail"
15
- },
16
- "type": "postcode_address_file"
17
- }
18
- }
19
- ]
20
- },
21
- "claims": {
22
- "/propertyPack/materialFacts/address": {
23
- "line1": "3 The Hollys",
24
- "line2": "Birtley",
25
- "town": "CHESTER LE STREET",
26
- "county": "County Durham",
27
- "postcode": "DH3 1QN"
28
- }
29
- }
30
- }