@pdtf/schemas 3.6.0-dev.29 → 3.6.0-dev.30
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/docs/ta6-certificate-permit-contract.md +51 -0
- package/package.json +1 -1
- package/src/schemas/v3/combined.json +13 -8
- package/src/schemas/v3/compactSkeleton.txt +1 -0
- package/src/schemas/v3/overlays/ta6ed6.json +4 -4
- package/src/schemas/v3/overlays/ta6ed6v2.json +4 -4
- package/src/schemas/v3/pdtf-transaction.json +16 -4
- package/src/schemas/v3/skeleton.json +1 -0
- package/src/schemas/v4/Gift.json +2 -2
- package/src/schemas/v4/Offer.json +2 -2
- package/src/schemas/v4/Organisation.json +2 -2
- package/src/schemas/v4/Person.json +2 -2
- package/src/schemas/v4/Property.json +18 -6
- package/src/schemas/v4/Representation.json +2 -2
- package/src/schemas/v4/SellerCapacity.json +2 -2
- package/src/schemas/v4/Title.json +2 -2
- package/src/schemas/v4/Transaction.json +2 -2
- package/src/schemas/v4/TransactionRole.json +2 -2
- package/src/schemas/v4/mapping.json +2 -2
- package/src/utils/checkTa6OmissionCompatibility.js +146 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# TA6 certificate and permit document contract
|
|
2
|
+
|
|
3
|
+
Candidate: `@pdtf/schemas@3.6.0-dev.30`, targeting `dev`. Published baseline checked on 27 October 2026: `3.6.0-dev.29`. Publication requires release approval; this document does not assert publication.
|
|
4
|
+
|
|
5
|
+
## Paths and refs
|
|
6
|
+
|
|
7
|
+
Both `ta6ed6` and `ta6ed6v2` use the same stored paths and values.
|
|
8
|
+
|
|
9
|
+
| Path | Values | TA6 ref in both overlays |
|
|
10
|
+
| --- | --- | --- |
|
|
11
|
+
| `/propertyPack/electricalWorks/electricalWorkSince2005/suppliedCertificate/yesNo` | `Yes`, `No` | `11.2.1` |
|
|
12
|
+
| `/propertyPack/electricalWorks/electricalWorkSince2005/suppliedCertificate/attachments` | `Attached`, `To follow` | `11.2.2` (formerly `11.2`) |
|
|
13
|
+
| `/propertyPack/waterAndDrainage/drainage/mainsFoulDrainage/offMainsDrainageSystem/permitDocuments` | `Attached`, `To follow`, `Not applicable` | `11.7j` (unchanged) |
|
|
14
|
+
|
|
15
|
+
The certificate object retains ref `11.2` and the existing `certificateType` and `attachments` paths. `certificateType` remains defined in the base and BASPI/TA6 fourth-edition overlays; it is not newly displayed in sixth-edition forms.
|
|
16
|
+
|
|
17
|
+
## Compatibility and requiredness
|
|
18
|
+
|
|
19
|
+
The new answer is a flat optional string. It has no default, discriminator, `oneOf`, or additional requiredness. The sixth-edition attachment requirement is removed. Explicit No needs neither attachments nor certificate type; Yes supports both attachment choices and can be saved without a status. Attachment-only records remain valid. An empty certificate object remains unanswered, never inferred as No. Existing outer electrical-work conditions and requirements for details and the certificate object are unchanged.
|
|
20
|
+
|
|
21
|
+
Permit documents stay optional in all four applicable branches: Septic tank, Cesspit, Sewerage treatment plant and Other. Absence stays absent.
|
|
22
|
+
|
|
23
|
+
No other v3 overlay or extension overlay artifact changes. The shared base acquires the optional certificate field and wider permit enum; consumers validating these paths with the base therefore see the same additions. BASPI and TA6 fourth-edition certificate requirements are unchanged, including when combined with a sixth-edition overlay. Heating/mains-gas schema is unchanged.
|
|
24
|
+
|
|
25
|
+
Differential verification against the registry tarball uses `getSubschemaValidator` and `getValidator` with complete baseline-valid transaction fixtures for both editions:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
node src/utils/checkTa6OmissionCompatibility.js /path/to/unpacked/dev.29/package
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
352 comparisons: legacy shapes have 64 valid-to-valid, 24 invalid-to-valid, 64 invalid-to-invalid and **zero valid-to-invalid** results. New-answer cases have 32 valid-to-valid, 16 invalid-to-valid, 104 invalid-to-invalid and 48 valid-to-invalid results. The 48 tightenings are exclusively `Maybe`, empty string or null already stored at the previously unconstrained new `yesNo` path, combined with a valid legacy attachment status (including both validators and editions). This is not a claim of universal compatibility with arbitrary additional-property data; no production corpus scan was performed.
|
|
32
|
+
|
|
33
|
+
## Buyer Ready dependency
|
|
34
|
+
|
|
35
|
+
Buyer Ready main `6d2e4cbfe` pins dev.29 in its lockfile. Sellers need a frontend dependency and lockfile bump to the published candidate version, followed by a frontend release, to see these choices. A backend-only bump does not update the seller UI.
|
|
36
|
+
|
|
37
|
+
22 mounted `FormElement.vue` tests against the candidate package confirm both overlays: the certificate answer and attachment status are optional; attachment choices remain visible for Yes, No and unanswered; no update/default is emitted on mount; the existing outer work-Yes condition is preserved; and Not applicable is available in each drainage branch. The current UI does not hide attachment controls on certificate No. The backend must suppress stale attachment ticks, without deleting seller data. No frontend product code change is needed for basic visibility or requiredness. These are component-level checks, not a deployed browser acceptance claim.
|
|
38
|
+
|
|
39
|
+
## Backend mapping contract
|
|
40
|
+
|
|
41
|
+
For §11.2, explicit Yes/No takes precedence. No ticks only `11.2 no` and suppresses stale attachment ticks. Yes ticks `11.2 yes` and uses the attachment status. With no answer, Attached/To follow retain the legacy Yes inference. With neither, leave all four boxes blank.
|
|
42
|
+
|
|
43
|
+
For §11.7(j), use the actual `11.7j na` widget. The three statuses are mutually exclusive. Prefer `permitDocuments`; fall back to `plantRegistered/attachments` only when the newer value is absent. Explicit new values override conflicting legacy statuses.
|
|
44
|
+
|
|
45
|
+
The backend MR is separate from the six mapping fixes in MR !4579 (open at initial verification, head `7f650a32f`). It must not merge or deploy without approval. Do not regenerate signed PDFs or modify production claims.
|
|
46
|
+
|
|
47
|
+
## Release checks
|
|
48
|
+
|
|
49
|
+
Edit only `src/schemas/v3/combined.json`; regenerate with `extract-overlays`, `extract-extension-overlays`, and `generate:v4` after the package version bump. All v4 headers must carry the candidate version and combined-source SHA-256.
|
|
50
|
+
|
|
51
|
+
After approval: merge the schema PR into dev, publish with `npm run publish:dev`, verify the exact npm version and dev dist-tag from the registry, then bump backend/frontend package metadata and lockfiles to that verified version. Recheck concurrent versions before publishing. Never publish this candidate to latest.
|
package/package.json
CHANGED
|
@@ -24445,7 +24445,7 @@
|
|
|
24445
24445
|
"ta6ed6Title": "If you have a permit or documents relating to any of your answers to questions 11.7(a)-(i), supply a copy",
|
|
24446
24446
|
"ta6ed6v2Title": "If you have a permit or documents relating to any of your answers to questions 11.7(a)-(i), supply a copy",
|
|
24447
24447
|
"type": "string",
|
|
24448
|
-
"enum": ["Attached", "To follow"]
|
|
24448
|
+
"enum": ["Attached", "To follow", "Not applicable"]
|
|
24449
24449
|
}
|
|
24450
24450
|
},
|
|
24451
24451
|
"baspi4Required": [
|
|
@@ -24530,7 +24530,7 @@
|
|
|
24530
24530
|
"ta6ed6Title": "If you have a permit or documents relating to any of your answers to questions 11.7(a)-(i), supply a copy",
|
|
24531
24531
|
"ta6ed6v2Title": "If you have a permit or documents relating to any of your answers to questions 11.7(a)-(i), supply a copy",
|
|
24532
24532
|
"type": "string",
|
|
24533
|
-
"enum": ["Attached", "To follow"]
|
|
24533
|
+
"enum": ["Attached", "To follow", "Not applicable"]
|
|
24534
24534
|
}
|
|
24535
24535
|
},
|
|
24536
24536
|
"baspi4Required": ["dateLastEmptied"],
|
|
@@ -24641,7 +24641,7 @@
|
|
|
24641
24641
|
"ta6ed6Title": "If you have a permit or documents relating to any of your answers to questions 11.7(a)-(i), supply a copy",
|
|
24642
24642
|
"ta6ed6v2Title": "If you have a permit or documents relating to any of your answers to questions 11.7(a)-(i), supply a copy",
|
|
24643
24643
|
"type": "string",
|
|
24644
|
-
"enum": ["Attached", "To follow"]
|
|
24644
|
+
"enum": ["Attached", "To follow", "Not applicable"]
|
|
24645
24645
|
}
|
|
24646
24646
|
},
|
|
24647
24647
|
"baspi4Required": [
|
|
@@ -24695,7 +24695,7 @@
|
|
|
24695
24695
|
"ta6ed6Title": "If you have a permit or documents relating to any of your answers to questions 11.7(a)-(i), supply a copy",
|
|
24696
24696
|
"ta6ed6v2Title": "If you have a permit or documents relating to any of your answers to questions 11.7(a)-(i), supply a copy",
|
|
24697
24697
|
"type": "string",
|
|
24698
|
-
"enum": ["Attached", "To follow"]
|
|
24698
|
+
"enum": ["Attached", "To follow", "Not applicable"]
|
|
24699
24699
|
}
|
|
24700
24700
|
},
|
|
24701
24701
|
"ntsRequired": ["details"],
|
|
@@ -31418,9 +31418,14 @@
|
|
|
31418
31418
|
"baspi4Required": ["certificateType", "attachments"],
|
|
31419
31419
|
"baspi5Required": ["certificateType", "attachments"],
|
|
31420
31420
|
"ta6Required": ["certificateType", "attachments"],
|
|
31421
|
-
"ta6ed6Required": ["attachments"],
|
|
31422
|
-
"ta6ed6v2Required": ["attachments"],
|
|
31423
31421
|
"properties": {
|
|
31422
|
+
"yesNo": {
|
|
31423
|
+
"ta6ed6Ref": "11.2.1",
|
|
31424
|
+
"ta6ed6v2Ref": "11.2.1",
|
|
31425
|
+
"title": "Does the property have any certificates for electrical installation works?",
|
|
31426
|
+
"type": "string",
|
|
31427
|
+
"enum": ["Yes", "No"]
|
|
31428
|
+
},
|
|
31424
31429
|
"certificateType": {
|
|
31425
31430
|
"baspi4Ref": "B4.2.3.1",
|
|
31426
31431
|
"baspi5Ref": "B4.2.3.1",
|
|
@@ -31436,8 +31441,8 @@
|
|
|
31436
31441
|
"baspi4Ref": "B4.2.3.2",
|
|
31437
31442
|
"baspi5Ref": "B4.2.3.2",
|
|
31438
31443
|
"ta6Ref": "12.2.2a.2",
|
|
31439
|
-
"ta6ed6Ref": "11.2",
|
|
31440
|
-
"ta6ed6v2Ref": "11.2",
|
|
31444
|
+
"ta6ed6Ref": "11.2.2",
|
|
31445
|
+
"ta6ed6v2Ref": "11.2.2",
|
|
31441
31446
|
"title": "Attachments",
|
|
31442
31447
|
"type": "string",
|
|
31443
31448
|
"enum": ["Attached", "To follow", "Not available"],
|
|
@@ -5704,13 +5704,13 @@
|
|
|
5704
5704
|
},
|
|
5705
5705
|
"suppliedCertificate": {
|
|
5706
5706
|
"ta6ed6Ref": "11.2",
|
|
5707
|
-
"required": [
|
|
5708
|
-
"attachments"
|
|
5709
|
-
],
|
|
5710
5707
|
"title": "Please supply any certificates for electrical installation work",
|
|
5711
5708
|
"properties": {
|
|
5709
|
+
"yesNo": {
|
|
5710
|
+
"ta6ed6Ref": "11.2.1"
|
|
5711
|
+
},
|
|
5712
5712
|
"attachments": {
|
|
5713
|
-
"ta6ed6Ref": "11.2",
|
|
5713
|
+
"ta6ed6Ref": "11.2.2",
|
|
5714
5714
|
"enum": [
|
|
5715
5715
|
"Attached",
|
|
5716
5716
|
"To follow"
|
|
@@ -3824,13 +3824,13 @@
|
|
|
3824
3824
|
},
|
|
3825
3825
|
"suppliedCertificate": {
|
|
3826
3826
|
"ta6ed6v2Ref": "11.2",
|
|
3827
|
-
"required": [
|
|
3828
|
-
"attachments"
|
|
3829
|
-
],
|
|
3830
3827
|
"title": "Please supply any certificates for electrical installation work",
|
|
3831
3828
|
"properties": {
|
|
3829
|
+
"yesNo": {
|
|
3830
|
+
"ta6ed6v2Ref": "11.2.1"
|
|
3831
|
+
},
|
|
3832
3832
|
"attachments": {
|
|
3833
|
-
"ta6ed6v2Ref": "11.2",
|
|
3833
|
+
"ta6ed6v2Ref": "11.2.2",
|
|
3834
3834
|
"enum": [
|
|
3835
3835
|
"Attached",
|
|
3836
3836
|
"To follow"
|
|
@@ -19780,7 +19780,8 @@
|
|
|
19780
19780
|
"type": "string",
|
|
19781
19781
|
"enum": [
|
|
19782
19782
|
"Attached",
|
|
19783
|
-
"To follow"
|
|
19783
|
+
"To follow",
|
|
19784
|
+
"Not applicable"
|
|
19784
19785
|
]
|
|
19785
19786
|
}
|
|
19786
19787
|
}
|
|
@@ -19826,7 +19827,8 @@
|
|
|
19826
19827
|
"type": "string",
|
|
19827
19828
|
"enum": [
|
|
19828
19829
|
"Attached",
|
|
19829
|
-
"To follow"
|
|
19830
|
+
"To follow",
|
|
19831
|
+
"Not applicable"
|
|
19830
19832
|
]
|
|
19831
19833
|
}
|
|
19832
19834
|
}
|
|
@@ -19893,7 +19895,8 @@
|
|
|
19893
19895
|
"type": "string",
|
|
19894
19896
|
"enum": [
|
|
19895
19897
|
"Attached",
|
|
19896
|
-
"To follow"
|
|
19898
|
+
"To follow",
|
|
19899
|
+
"Not applicable"
|
|
19897
19900
|
]
|
|
19898
19901
|
}
|
|
19899
19902
|
}
|
|
@@ -19915,7 +19918,8 @@
|
|
|
19915
19918
|
"type": "string",
|
|
19916
19919
|
"enum": [
|
|
19917
19920
|
"Attached",
|
|
19918
|
-
"To follow"
|
|
19921
|
+
"To follow",
|
|
19922
|
+
"Not applicable"
|
|
19919
19923
|
]
|
|
19920
19924
|
}
|
|
19921
19925
|
}
|
|
@@ -24742,6 +24746,14 @@
|
|
|
24742
24746
|
"title": "Please supply one of the following:",
|
|
24743
24747
|
"type": "object",
|
|
24744
24748
|
"properties": {
|
|
24749
|
+
"yesNo": {
|
|
24750
|
+
"title": "Does the property have any certificates for electrical installation works?",
|
|
24751
|
+
"type": "string",
|
|
24752
|
+
"enum": [
|
|
24753
|
+
"Yes",
|
|
24754
|
+
"No"
|
|
24755
|
+
]
|
|
24756
|
+
},
|
|
24745
24757
|
"certificateType": {
|
|
24746
24758
|
"type": "string",
|
|
24747
24759
|
"enum": [
|
package/src/schemas/v4/Gift.json
CHANGED
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
"description": "A gift of funds towards a purchase, made by a giftor. Implies the Giftor role.",
|
|
7
7
|
"x-pdtf-source": {
|
|
8
8
|
"packageName": "@pdtf/schemas",
|
|
9
|
-
"packageVersion": "3.6.0-dev.
|
|
9
|
+
"packageVersion": "3.6.0-dev.30",
|
|
10
10
|
"v3SchemaId": "https://trust.propdata.org.uk/schemas/v3/pdtf-transaction.json",
|
|
11
11
|
"combinedPath": "src/schemas/v3/combined.json",
|
|
12
|
-
"combinedSha256": "
|
|
12
|
+
"combinedSha256": "4e95946a946b37088b153052034fd0584cc27a6eb53f78ede52cd0ab1fde669f"
|
|
13
13
|
},
|
|
14
14
|
"properties": {
|
|
15
15
|
"id": {
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
"description": "An offer made by a prospective buyer in a property transaction.",
|
|
7
7
|
"x-pdtf-source": {
|
|
8
8
|
"packageName": "@pdtf/schemas",
|
|
9
|
-
"packageVersion": "3.6.0-dev.
|
|
9
|
+
"packageVersion": "3.6.0-dev.30",
|
|
10
10
|
"v3SchemaId": "https://trust.propdata.org.uk/schemas/v3/pdtf-transaction.json",
|
|
11
11
|
"combinedPath": "src/schemas/v3/combined.json",
|
|
12
|
-
"combinedSha256": "
|
|
12
|
+
"combinedSha256": "4e95946a946b37088b153052034fd0584cc27a6eb53f78ede52cd0ab1fde669f"
|
|
13
13
|
},
|
|
14
14
|
"properties": {
|
|
15
15
|
"id": {
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
"description": "A legal entity (company, firm, partnership) participating in a property transaction.",
|
|
7
7
|
"x-pdtf-source": {
|
|
8
8
|
"packageName": "@pdtf/schemas",
|
|
9
|
-
"packageVersion": "3.6.0-dev.
|
|
9
|
+
"packageVersion": "3.6.0-dev.30",
|
|
10
10
|
"v3SchemaId": "https://trust.propdata.org.uk/schemas/v3/pdtf-transaction.json",
|
|
11
11
|
"combinedPath": "src/schemas/v3/combined.json",
|
|
12
|
-
"combinedSha256": "
|
|
12
|
+
"combinedSha256": "4e95946a946b37088b153052034fd0584cc27a6eb53f78ede52cd0ab1fde669f"
|
|
13
13
|
},
|
|
14
14
|
"properties": {
|
|
15
15
|
"id": {
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
"description": "A natural person participating in a property transaction — name, contact details, address, verification status.",
|
|
7
7
|
"x-pdtf-source": {
|
|
8
8
|
"packageName": "@pdtf/schemas",
|
|
9
|
-
"packageVersion": "3.6.0-dev.
|
|
9
|
+
"packageVersion": "3.6.0-dev.30",
|
|
10
10
|
"v3SchemaId": "https://trust.propdata.org.uk/schemas/v3/pdtf-transaction.json",
|
|
11
11
|
"combinedPath": "src/schemas/v3/combined.json",
|
|
12
|
-
"combinedSha256": "
|
|
12
|
+
"combinedSha256": "4e95946a946b37088b153052034fd0584cc27a6eb53f78ede52cd0ab1fde669f"
|
|
13
13
|
},
|
|
14
14
|
"properties": {
|
|
15
15
|
"name": {
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
"description": "Physical and environmental facts about a property — address, construction, fixtures, services, searches, documents. Excludes ownership, titles, and participants.",
|
|
7
7
|
"x-pdtf-source": {
|
|
8
8
|
"packageName": "@pdtf/schemas",
|
|
9
|
-
"packageVersion": "3.6.0-dev.
|
|
9
|
+
"packageVersion": "3.6.0-dev.30",
|
|
10
10
|
"v3SchemaId": "https://trust.propdata.org.uk/schemas/v3/pdtf-transaction.json",
|
|
11
11
|
"combinedPath": "src/schemas/v3/combined.json",
|
|
12
|
-
"combinedSha256": "
|
|
12
|
+
"combinedSha256": "4e95946a946b37088b153052034fd0584cc27a6eb53f78ede52cd0ab1fde669f"
|
|
13
13
|
},
|
|
14
14
|
"properties": {
|
|
15
15
|
"address": {
|
|
@@ -13470,7 +13470,8 @@
|
|
|
13470
13470
|
"type": "string",
|
|
13471
13471
|
"enum": [
|
|
13472
13472
|
"Attached",
|
|
13473
|
-
"To follow"
|
|
13473
|
+
"To follow",
|
|
13474
|
+
"Not applicable"
|
|
13474
13475
|
]
|
|
13475
13476
|
}
|
|
13476
13477
|
}
|
|
@@ -13526,7 +13527,8 @@
|
|
|
13526
13527
|
"type": "string",
|
|
13527
13528
|
"enum": [
|
|
13528
13529
|
"Attached",
|
|
13529
|
-
"To follow"
|
|
13530
|
+
"To follow",
|
|
13531
|
+
"Not applicable"
|
|
13530
13532
|
]
|
|
13531
13533
|
}
|
|
13532
13534
|
}
|
|
@@ -13607,7 +13609,8 @@
|
|
|
13607
13609
|
"type": "string",
|
|
13608
13610
|
"enum": [
|
|
13609
13611
|
"Attached",
|
|
13610
|
-
"To follow"
|
|
13612
|
+
"To follow",
|
|
13613
|
+
"Not applicable"
|
|
13611
13614
|
]
|
|
13612
13615
|
}
|
|
13613
13616
|
}
|
|
@@ -13631,7 +13634,8 @@
|
|
|
13631
13634
|
"type": "string",
|
|
13632
13635
|
"enum": [
|
|
13633
13636
|
"Attached",
|
|
13634
|
-
"To follow"
|
|
13637
|
+
"To follow",
|
|
13638
|
+
"Not applicable"
|
|
13635
13639
|
]
|
|
13636
13640
|
}
|
|
13637
13641
|
}
|
|
@@ -19028,6 +19032,14 @@
|
|
|
19028
19032
|
"ta6ed6v2Title": "Please supply any certificates for electrical installation work",
|
|
19029
19033
|
"type": "object",
|
|
19030
19034
|
"properties": {
|
|
19035
|
+
"yesNo": {
|
|
19036
|
+
"title": "Does the property have any certificates for electrical installation works?",
|
|
19037
|
+
"type": "string",
|
|
19038
|
+
"enum": [
|
|
19039
|
+
"Yes",
|
|
19040
|
+
"No"
|
|
19041
|
+
]
|
|
19042
|
+
},
|
|
19031
19043
|
"certificateType": {
|
|
19032
19044
|
"type": "string",
|
|
19033
19045
|
"enum": [
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
"description": "A professional representation relationship — one party instructed by another, e.g. a conveyancer acting for a seller. One entity per (representative, represented party) pair: a conveyancer instructed jointly by two sellers yields two, and sellers who instruct separate conveyancers yield one each.",
|
|
7
7
|
"x-pdtf-source": {
|
|
8
8
|
"packageName": "@pdtf/schemas",
|
|
9
|
-
"packageVersion": "3.6.0-dev.
|
|
9
|
+
"packageVersion": "3.6.0-dev.30",
|
|
10
10
|
"v3SchemaId": "https://trust.propdata.org.uk/schemas/v3/pdtf-transaction.json",
|
|
11
11
|
"combinedPath": "src/schemas/v3/combined.json",
|
|
12
|
-
"combinedSha256": "
|
|
12
|
+
"combinedSha256": "4e95946a946b37088b153052034fd0584cc27a6eb53f78ede52cd0ab1fde669f"
|
|
13
13
|
},
|
|
14
14
|
"properties": {
|
|
15
15
|
"id": {
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
"description": "The legal capacity in which a seller is selling a given title. Derived from the V3 participants 'Seller' branch (sellersCapacity, dateBecameOwnerOrAuthority).",
|
|
7
7
|
"x-pdtf-source": {
|
|
8
8
|
"packageName": "@pdtf/schemas",
|
|
9
|
-
"packageVersion": "3.6.0-dev.
|
|
9
|
+
"packageVersion": "3.6.0-dev.30",
|
|
10
10
|
"v3SchemaId": "https://trust.propdata.org.uk/schemas/v3/pdtf-transaction.json",
|
|
11
11
|
"combinedPath": "src/schemas/v3/combined.json",
|
|
12
|
-
"combinedSha256": "
|
|
12
|
+
"combinedSha256": "4e95946a946b37088b153052034fd0584cc27a6eb53f78ede52cd0ab1fde669f"
|
|
13
13
|
},
|
|
14
14
|
"properties": {
|
|
15
15
|
"id": {
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
"description": "HM Land Registry title — register extract, tenure type, and legal interest details for a single title number.",
|
|
7
7
|
"x-pdtf-source": {
|
|
8
8
|
"packageName": "@pdtf/schemas",
|
|
9
|
-
"packageVersion": "3.6.0-dev.
|
|
9
|
+
"packageVersion": "3.6.0-dev.30",
|
|
10
10
|
"v3SchemaId": "https://trust.propdata.org.uk/schemas/v3/pdtf-transaction.json",
|
|
11
11
|
"combinedPath": "src/schemas/v3/combined.json",
|
|
12
|
-
"combinedSha256": "
|
|
12
|
+
"combinedSha256": "4e95946a946b37088b153052034fd0584cc27a6eb53f78ede52cd0ab1fde669f"
|
|
13
13
|
},
|
|
14
14
|
"properties": {
|
|
15
15
|
"titleNumber": {
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
"description": "Transaction-level metadata — status, milestones, chain, contracts, offers, enquiries, and sale context.",
|
|
7
7
|
"x-pdtf-source": {
|
|
8
8
|
"packageName": "@pdtf/schemas",
|
|
9
|
-
"packageVersion": "3.6.0-dev.
|
|
9
|
+
"packageVersion": "3.6.0-dev.30",
|
|
10
10
|
"v3SchemaId": "https://trust.propdata.org.uk/schemas/v3/pdtf-transaction.json",
|
|
11
11
|
"combinedPath": "src/schemas/v3/combined.json",
|
|
12
|
-
"combinedSha256": "
|
|
12
|
+
"combinedSha256": "4e95946a946b37088b153052034fd0584cc27a6eb53f78ede52cd0ab1fde669f"
|
|
13
13
|
},
|
|
14
14
|
"properties": {
|
|
15
15
|
"transactionId": {
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
"description": "A party's role in a transaction, where no more specific relationship credential applies. Asserts participation in a role, not a relationship to another named party.",
|
|
7
7
|
"x-pdtf-source": {
|
|
8
8
|
"packageName": "@pdtf/schemas",
|
|
9
|
-
"packageVersion": "3.6.0-dev.
|
|
9
|
+
"packageVersion": "3.6.0-dev.30",
|
|
10
10
|
"v3SchemaId": "https://trust.propdata.org.uk/schemas/v3/pdtf-transaction.json",
|
|
11
11
|
"combinedPath": "src/schemas/v3/combined.json",
|
|
12
|
-
"combinedSha256": "
|
|
12
|
+
"combinedSha256": "4e95946a946b37088b153052034fd0584cc27a6eb53f78ede52cd0ab1fde669f"
|
|
13
13
|
},
|
|
14
14
|
"properties": {
|
|
15
15
|
"id": {
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
"generator": "src/utils/generateV4Schemas.js",
|
|
6
6
|
"source": {
|
|
7
7
|
"packageName": "@pdtf/schemas",
|
|
8
|
-
"packageVersion": "3.6.0-dev.
|
|
8
|
+
"packageVersion": "3.6.0-dev.30",
|
|
9
9
|
"v3SchemaId": "https://trust.propdata.org.uk/schemas/v3/pdtf-transaction.json",
|
|
10
10
|
"combinedPath": "src/schemas/v3/combined.json",
|
|
11
|
-
"combinedSha256": "
|
|
11
|
+
"combinedSha256": "4e95946a946b37088b153052034fd0584cc27a6eb53f78ede52cd0ab1fde669f"
|
|
12
12
|
},
|
|
13
13
|
"entities": {
|
|
14
14
|
"Property": {
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
// Run against an unpacked published npm package, not a git approximation:
|
|
2
|
+
// node src/utils/checkTa6OmissionCompatibility.js /path/to/baseline/package
|
|
3
|
+
const assert = require("assert");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const current = require("../../index.js");
|
|
6
|
+
const baseline = require(path.resolve(process.argv[2]));
|
|
7
|
+
const schemaId =
|
|
8
|
+
"https://trust.propdata.org.uk/schemas/v3/pdtf-transaction.json";
|
|
9
|
+
const electricalPath = "/propertyPack/electricalWorks/electricalWorkSince2005";
|
|
10
|
+
const drainagePath =
|
|
11
|
+
"/propertyPack/waterAndDrainage/drainage/mainsFoulDrainage/offMainsDrainageSystem";
|
|
12
|
+
const jp = require("jsonpointer");
|
|
13
|
+
const clone = (v) => JSON.parse(JSON.stringify(v));
|
|
14
|
+
const results = {
|
|
15
|
+
baseline: require(path.resolve(process.argv[2], "package.json")).version,
|
|
16
|
+
candidate: require("../../package.json").version,
|
|
17
|
+
comparisons: 0,
|
|
18
|
+
legacy: {
|
|
19
|
+
validToValid: 0,
|
|
20
|
+
invalidToValid: 0,
|
|
21
|
+
invalidToInvalid: 0,
|
|
22
|
+
validToInvalid: [],
|
|
23
|
+
},
|
|
24
|
+
newAnswer: {
|
|
25
|
+
validToValid: 0,
|
|
26
|
+
invalidToValid: 0,
|
|
27
|
+
invalidToInvalid: 0,
|
|
28
|
+
validToInvalid: [],
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
for (const overlay of ["ta6ed6", "ta6ed6v2"]) {
|
|
32
|
+
const fixture = require(`../tests/fixtures/ta6/${overlay}.json`);
|
|
33
|
+
assert(
|
|
34
|
+
baseline.getValidator(schemaId, [overlay])(clone(fixture)),
|
|
35
|
+
`${overlay} whole fixture must be baseline-valid`,
|
|
36
|
+
);
|
|
37
|
+
const compare = (target, value, group) => {
|
|
38
|
+
for (const whole of [false, true]) {
|
|
39
|
+
const record = whole ? clone(fixture) : value;
|
|
40
|
+
if (whole) {
|
|
41
|
+
jp.set(record, target, value);
|
|
42
|
+
if (target === drainagePath)
|
|
43
|
+
jp.set(
|
|
44
|
+
record,
|
|
45
|
+
"/propertyPack/waterAndDrainage/drainage/mainsFoulDrainage/yesNo",
|
|
46
|
+
"No",
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
const get = (pkg) =>
|
|
50
|
+
whole
|
|
51
|
+
? pkg.getValidator(schemaId, [overlay])
|
|
52
|
+
: pkg.getSubschemaValidator(target, schemaId, [overlay]);
|
|
53
|
+
const before = get(baseline)(clone(record));
|
|
54
|
+
const after = get(current)(clone(record));
|
|
55
|
+
results.comparisons++;
|
|
56
|
+
if (before && !after)
|
|
57
|
+
results[group].validToInvalid.push({ overlay, whole, target, value });
|
|
58
|
+
else
|
|
59
|
+
results[group][
|
|
60
|
+
before
|
|
61
|
+
? "validToValid"
|
|
62
|
+
: after
|
|
63
|
+
? "invalidToValid"
|
|
64
|
+
: "invalidToInvalid"
|
|
65
|
+
]++;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
for (const answer of [undefined, "Yes", "No", "Maybe", "", null]) {
|
|
69
|
+
for (const attachments of [
|
|
70
|
+
undefined,
|
|
71
|
+
"Attached",
|
|
72
|
+
"To follow",
|
|
73
|
+
"Not available",
|
|
74
|
+
"Invalid",
|
|
75
|
+
]) {
|
|
76
|
+
for (const certificateType of [
|
|
77
|
+
undefined,
|
|
78
|
+
"Electrical Safety Certificate (BS7671)",
|
|
79
|
+
]) {
|
|
80
|
+
const suppliedCertificate = {};
|
|
81
|
+
if (answer !== undefined) suppliedCertificate.yesNo = answer;
|
|
82
|
+
if (attachments !== undefined)
|
|
83
|
+
suppliedCertificate.attachments = attachments;
|
|
84
|
+
if (certificateType !== undefined)
|
|
85
|
+
suppliedCertificate.certificateType = certificateType;
|
|
86
|
+
compare(
|
|
87
|
+
electricalPath,
|
|
88
|
+
{ yesNo: "Yes", details: "Electrical work", suppliedCertificate },
|
|
89
|
+
answer === undefined ? "legacy" : "newAnswer",
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
for (const type of [
|
|
95
|
+
"Septic tank",
|
|
96
|
+
"Cesspit",
|
|
97
|
+
"Sewerage treatment plant",
|
|
98
|
+
"Other",
|
|
99
|
+
]) {
|
|
100
|
+
for (const permitDocuments of [
|
|
101
|
+
undefined,
|
|
102
|
+
"Attached",
|
|
103
|
+
"To follow",
|
|
104
|
+
"Not applicable",
|
|
105
|
+
"Invalid",
|
|
106
|
+
"",
|
|
107
|
+
null,
|
|
108
|
+
]) {
|
|
109
|
+
compare(
|
|
110
|
+
drainagePath,
|
|
111
|
+
{
|
|
112
|
+
offMainsDrainageSystemType: type,
|
|
113
|
+
otherConnectedProperties: { yesNo: "No" },
|
|
114
|
+
plantOnOtherLand: { yesNo: "No" },
|
|
115
|
+
plantDrainsIntoWaterway: { yesNo: "Yes" },
|
|
116
|
+
dateDischargeCommenced: "2020-01-01",
|
|
117
|
+
dateInstalled: "2020-01-01",
|
|
118
|
+
dateLastEmptied: "2025-01-01",
|
|
119
|
+
dateLastServiced: "2025-01-01",
|
|
120
|
+
supplier: "Provider",
|
|
121
|
+
makeModel: "Model",
|
|
122
|
+
serviceProviderName: "Servicer",
|
|
123
|
+
...(permitDocuments === undefined ? {} : { permitDocuments }),
|
|
124
|
+
},
|
|
125
|
+
"legacy",
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
// An unrelated question must remain byte-for-byte identical.
|
|
130
|
+
assert.deepStrictEqual(
|
|
131
|
+
current.getSubschema("/propertyPack/heating", schemaId, [overlay]),
|
|
132
|
+
baseline.getSubschema("/propertyPack/heating", schemaId, [overlay]),
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
assert.strictEqual(
|
|
136
|
+
results.legacy.validToInvalid.length,
|
|
137
|
+
0,
|
|
138
|
+
"Existing answer shapes regressed",
|
|
139
|
+
);
|
|
140
|
+
// Previously unconstrained values at the NEW property are the only expected tightening.
|
|
141
|
+
assert(
|
|
142
|
+
results.newAnswer.validToInvalid.every(
|
|
143
|
+
({ value }) => !["Yes", "No"].includes(value.suppliedCertificate.yesNo),
|
|
144
|
+
),
|
|
145
|
+
);
|
|
146
|
+
console.log(JSON.stringify(results, null, 2));
|