@pdtf/schemas 2.0.0-2 → 2.0.0-4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pdtf/schemas",
3
- "version": "2.0.0-2",
3
+ "version": "2.0.0-4",
4
4
  "description": "Property Data Trust Framework Schemas and Utilities",
5
5
  "main": "index.js",
6
6
  "directories": {
@@ -21,8 +21,8 @@
21
21
  "address": {
22
22
  "line1": "47 Park Road",
23
23
  "line2": "",
24
+ "line3": "",
24
25
  "town": "HARPENDEN",
25
- "county": "Herts",
26
26
  "postcode": "AL3 5AF"
27
27
  },
28
28
  "delayFactors": {
@@ -562,9 +562,6 @@
562
562
  "confirmInformationIsAccurate": true
563
563
  }
564
564
  },
565
- "energyPerformanceCertificate": {
566
- "certificate": { "currentEnergyRating": "B" }
567
- },
568
565
  "titlesToBeSold": [
569
566
  {
570
567
  "titleNumber": "HD221222",
@@ -81,12 +81,12 @@
81
81
  "title": "Address 2",
82
82
  "type": "string"
83
83
  },
84
- "town": {
85
- "title": "Town",
84
+ "line 3": {
85
+ "title": "Address 3",
86
86
  "type": "string"
87
87
  },
88
- "county": {
89
- "title": "County",
88
+ "town": {
89
+ "title": "Town",
90
90
  "type": "string"
91
91
  },
92
92
  "postcode": {
@@ -12507,10 +12507,7 @@
12507
12507
  "baspiRef": "A13.1",
12508
12508
  "title": "Seller’s declaration",
12509
12509
  "description": "I/we confirm the answers to be truthful and accurate and to the best of my/our knowledge. The questions have been designed to assist with the disclosure of material information and any misleading or incorrect answers are likely to be exposed later in the legal process which may hinder my/our sale. I/we will provide my property lawyer with the additional documentation in support of the information supplied on this form. If there are any changes which alter the information provided, I/we will immediately notify the person marketing the property as well as my/our property lawyer.",
12510
- "confirmation": {
12511
- "type": "string",
12512
- "enum": ["true", "false"]
12513
- }
12510
+ "type": "boolean"
12514
12511
  }
12515
12512
  }
12516
12513
  }
@@ -13959,12 +13956,9 @@
13959
13956
  },
13960
13957
  "willLeaveGuaranteePaperwork": {
13961
13958
  "baspiRef": "B5.1.11",
13962
- "rdsRef": "Property/Flags",
13959
+ "RDSRef": "Property/Flags",
13963
13960
  "title": "Please confirm that you will leave all paperwork relating to any guarantee or warranty at the property when you move out",
13964
- "confirmation": {
13965
- "type": "string",
13966
- "enum": ["true", "false"]
13967
- }
13961
+ "type": "boolean"
13968
13962
  },
13969
13963
  "outstandingClaimsOrApplications": {
13970
13964
  "baspiRef": "B5.2",
@@ -14299,13 +14293,10 @@
14299
14293
  "willRemoveAllRubbish": {
14300
14294
  "baspiRef": "B7.1",
14301
14295
  "rdsRef": "RightsHolders/Flags",
14302
- "TA6Ref": "14.4",
14296
+ "ta6Ref": "14.4",
14303
14297
  "title": "Please confirm that on completion you will remove all rubbish and items not included in the sale from the property including its garden, loft and any sheds or outbuildings.",
14304
14298
  "description": "When the property is cleared out you will be expected to take reasonable care when clearing the property, leaving it clean and tidy and repairing any damage caused when removing items from the property and making safe any light or electrical fittings which are being removed.\n\nKeys for all door and window locks, along with any alarm codes, should be available for the buyer on the day of completion. If there is any reason why you cannot do this you should let the estate agent and your property lawyer know. For all internet connected services eg doorbells, boiler controls, burglar alarms, CCTV cameras etc) access to them will need to be provided to the buyer on the day of completion so that they can control them or sign up to the service. If there is any reason why you cannot do this you should let the estate agent and your property lawyer know.",
14305
- "confirmation": {
14306
- "type": "string",
14307
- "enum": ["true", "false"]
14308
- }
14299
+ "type": "boolean"
14309
14300
  },
14310
14301
  "otherPropertyInChain": {
14311
14302
  "baspiRef": "B7.2",
@@ -14513,18 +14504,12 @@
14513
14504
  "confirmWillProvideAdditionalDocumentation": {
14514
14505
  "baspiRef": "B8.1",
14515
14506
  "title": "I/we will provide my property lawyer with the additional documentation in support of the information supplied.",
14516
- "confirmation": {
14517
- "type": "string",
14518
- "enum": ["true", "false"]
14519
- }
14507
+ "type": "boolean"
14520
14508
  },
14521
14509
  "confirmInformationIsAccurate": {
14522
14510
  "baspiRef": "B8.2",
14523
14511
  "title": "I/we confirm that all information provided is accurate to the best of our knowledge and if we become aware of any change to/changes which alter the information supplied/provided prior to exchange of contracts for the sale of the property, I/we will update immediately notify the person marketing the property as well as my/our property lawyer. All sellers should sign this form",
14524
- "confirmation": {
14525
- "type": "string",
14526
- "enum": ["true", "false"]
14527
- }
14512
+ "type": "boolean"
14528
14513
  }
14529
14514
  }
14530
14515
  }
@@ -82,12 +82,12 @@
82
82
  "title": "Address 2",
83
83
  "type": "string"
84
84
  },
85
- "town": {
86
- "title": "Town",
85
+ "line 3": {
86
+ "title": "Address 3",
87
87
  "type": "string"
88
88
  },
89
- "county": {
90
- "title": "County",
89
+ "town": {
90
+ "title": "Town",
91
91
  "type": "string"
92
92
  },
93
93
  "postcode": {
@@ -11491,13 +11491,7 @@
11491
11491
  "consumerProtectionRegulationsResponse": {
11492
11492
  "title": "Seller’s declaration",
11493
11493
  "description": "I/we confirm the answers to be truthful and accurate and to the best of my/our knowledge. The questions have been designed to assist with the disclosure of material information and any misleading or incorrect answers are likely to be exposed later in the legal process which may hinder my/our sale. I/we will provide my property lawyer with the additional documentation in support of the information supplied on this form. If there are any changes which alter the information provided, I/we will immediately notify the person marketing the property as well as my/our property lawyer.",
11494
- "confirmation": {
11495
- "type": "string",
11496
- "enum": [
11497
- "true",
11498
- "false"
11499
- ]
11500
- }
11494
+ "type": "boolean"
11501
11495
  }
11502
11496
  }
11503
11497
  }
@@ -12857,14 +12851,9 @@
12857
12851
  ]
12858
12852
  },
12859
12853
  "willLeaveGuaranteePaperwork": {
12854
+ "RDSRef": "Property/Flags",
12860
12855
  "title": "Please confirm that you will leave all paperwork relating to any guarantee or warranty at the property when you move out",
12861
- "confirmation": {
12862
- "type": "string",
12863
- "enum": [
12864
- "true",
12865
- "false"
12866
- ]
12867
- }
12856
+ "type": "boolean"
12868
12857
  },
12869
12858
  "outstandingClaimsOrApplications": {
12870
12859
  "TA6Ref": "5.2",
@@ -13160,16 +13149,9 @@
13160
13149
  "type": "object",
13161
13150
  "properties": {
13162
13151
  "willRemoveAllRubbish": {
13163
- "TA6Ref": "14.4",
13164
13152
  "title": "Please confirm that on completion you will remove all rubbish and items not included in the sale from the property including its garden, loft and any sheds or outbuildings.",
13165
13153
  "description": "When the property is cleared out you will be expected to take reasonable care when clearing the property, leaving it clean and tidy and repairing any damage caused when removing items from the property and making safe any light or electrical fittings which are being removed.\n\nKeys for all door and window locks, along with any alarm codes, should be available for the buyer on the day of completion. If there is any reason why you cannot do this you should let the estate agent and your property lawyer know. For all internet connected services eg doorbells, boiler controls, burglar alarms, CCTV cameras etc) access to them will need to be provided to the buyer on the day of completion so that they can control them or sign up to the service. If there is any reason why you cannot do this you should let the estate agent and your property lawyer know.",
13166
- "confirmation": {
13167
- "type": "string",
13168
- "enum": [
13169
- "true",
13170
- "false"
13171
- ]
13172
- }
13154
+ "type": "boolean"
13173
13155
  },
13174
13156
  "otherPropertyInChain": {
13175
13157
  "TA6Ref": "14.1",
@@ -13358,23 +13340,11 @@
13358
13340
  "properties": {
13359
13341
  "confirmWillProvideAdditionalDocumentation": {
13360
13342
  "title": "I/we will provide my property lawyer with the additional documentation in support of the information supplied.",
13361
- "confirmation": {
13362
- "type": "string",
13363
- "enum": [
13364
- "true",
13365
- "false"
13366
- ]
13367
- }
13343
+ "type": "boolean"
13368
13344
  },
13369
13345
  "confirmInformationIsAccurate": {
13370
13346
  "title": "I/we confirm that all information provided is accurate to the best of our knowledge and if we become aware of any change to/changes which alter the information supplied/provided prior to exchange of contracts for the sale of the property, I/we will update immediately notify the person marketing the property as well as my/our property lawyer. All sellers should sign this form",
13371
- "confirmation": {
13372
- "type": "string",
13373
- "enum": [
13374
- "true",
13375
- "false"
13376
- ]
13377
- }
13347
+ "type": "boolean"
13378
13348
  }
13379
13349
  }
13380
13350
  }
@@ -61,12 +61,12 @@
61
61
  "title": "Address 2",
62
62
  "type": "string"
63
63
  },
64
- "town": {
65
- "title": "Town",
64
+ "line 3": {
65
+ "title": "Address 3",
66
66
  "type": "string"
67
67
  },
68
- "county": {
69
- "title": "County",
68
+ "town": {
69
+ "title": "Town",
70
70
  "type": "string"
71
71
  },
72
72
  "postcode": {
@@ -13285,13 +13285,7 @@
13285
13285
  "baspiRef": "A13.1",
13286
13286
  "title": "Seller’s declaration",
13287
13287
  "description": "I/we confirm the answers to be truthful and accurate and to the best of my/our knowledge. The questions have been designed to assist with the disclosure of material information and any misleading or incorrect answers are likely to be exposed later in the legal process which may hinder my/our sale. I/we will provide my property lawyer with the additional documentation in support of the information supplied on this form. If there are any changes which alter the information provided, I/we will immediately notify the person marketing the property as well as my/our property lawyer.",
13288
- "confirmation": {
13289
- "type": "string",
13290
- "enum": [
13291
- "true",
13292
- "false"
13293
- ]
13294
- }
13288
+ "type": "boolean"
13295
13289
  }
13296
13290
  },
13297
13291
  "type": "object"
@@ -15115,13 +15109,8 @@
15115
15109
  "willLeaveGuaranteePaperwork": {
15116
15110
  "baspiRef": "B5.1.11",
15117
15111
  "title": "Please confirm that you will leave all paperwork relating to any guarantee or warranty at the property when you move out",
15118
- "confirmation": {
15119
- "type": "string",
15120
- "enum": [
15121
- "true",
15122
- "false"
15123
- ]
15124
- }
15112
+ "RDSRef": "Property/Flags",
15113
+ "type": "boolean"
15125
15114
  },
15126
15115
  "outstandingClaimsOrApplications": {
15127
15116
  "baspiRef": "B5.2",
@@ -15547,14 +15536,7 @@
15547
15536
  "baspiRef": "B7.1",
15548
15537
  "title": "Please confirm that on completion you will remove all rubbish and items not included in the sale from the property including its garden, loft and any sheds or outbuildings.",
15549
15538
  "description": "When the property is cleared out you will be expected to take reasonable care when clearing the property, leaving it clean and tidy and repairing any damage caused when removing items from the property and making safe any light or electrical fittings which are being removed.\n\nKeys for all door and window locks, along with any alarm codes, should be available for the buyer on the day of completion. If there is any reason why you cannot do this you should let the estate agent and your property lawyer know. For all internet connected services eg doorbells, boiler controls, burglar alarms, CCTV cameras etc) access to them will need to be provided to the buyer on the day of completion so that they can control them or sign up to the service. If there is any reason why you cannot do this you should let the estate agent and your property lawyer know.",
15550
- "TA6Ref": "14.4",
15551
- "confirmation": {
15552
- "type": "string",
15553
- "enum": [
15554
- "true",
15555
- "false"
15556
- ]
15557
- }
15539
+ "type": "boolean"
15558
15540
  },
15559
15541
  "otherPropertyInChain": {
15560
15542
  "baspiRef": "B7.2",
@@ -15805,24 +15787,12 @@
15805
15787
  "confirmWillProvideAdditionalDocumentation": {
15806
15788
  "baspiRef": "B8.1",
15807
15789
  "title": "I/we will provide my property lawyer with the additional documentation in support of the information supplied.",
15808
- "confirmation": {
15809
- "type": "string",
15810
- "enum": [
15811
- "true",
15812
- "false"
15813
- ]
15814
- }
15790
+ "type": "boolean"
15815
15791
  },
15816
15792
  "confirmInformationIsAccurate": {
15817
15793
  "baspiRef": "B8.2",
15818
15794
  "title": "I/we confirm that all information provided is accurate to the best of our knowledge and if we become aware of any change to/changes which alter the information supplied/provided prior to exchange of contracts for the sale of the property, I/we will update immediately notify the person marketing the property as well as my/our property lawyer. All sellers should sign this form",
15819
- "confirmation": {
15820
- "type": "string",
15821
- "enum": [
15822
- "true",
15823
- "false"
15824
- ]
15825
- }
15795
+ "type": "boolean"
15826
15796
  }
15827
15797
  },
15828
15798
  "type": "object"
@@ -3524,10 +3524,6 @@
3524
3524
  }
3525
3525
  ]
3526
3526
  },
3527
- "willLeaveGuaranteePaperwork": {
3528
- "rdsRef": "Property/Flags",
3529
- "title": "Please confirm that you will leave all paperwork relating to any guarantee or warranty at the property when you move out"
3530
- },
3531
3527
  "outstandingClaimsOrApplications": {
3532
3528
  "rdsRef": "Certificates",
3533
3529
  "title": "Are there any outstanding claims or current applications relating to any of the above?",
@@ -2304,6 +2304,19 @@
2304
2304
  }
2305
2305
  }
2306
2306
  }
2307
+ },
2308
+ "additionalLegalInfo": {
2309
+ "properties": {
2310
+ "completionAndMoving": {
2311
+ "properties": {
2312
+ "willRemoveAllRubbish": {
2313
+ "ta6Ref": "14.4",
2314
+ "title": "Please confirm that on completion you will remove all rubbish and items not included in the sale from the property including its garden, loft and any sheds or outbuildings.",
2315
+ "description": "When the property is cleared out you will be expected to take reasonable care when clearing the property, leaving it clean and tidy and repairing any damage caused when removing items from the property and making safe any light or electrical fittings which are being removed.\n\nKeys for all door and window locks, along with any alarm codes, should be available for the buyer on the day of completion. If there is any reason why you cannot do this you should let the estate agent and your property lawyer know. For all internet connected services eg doorbells, boiler controls, burglar alarms, CCTV cameras etc) access to them will need to be provided to the buyer on the day of completion so that they can control them or sign up to the service. If there is any reason why you cannot do this you should let the estate agent and your property lawyer know."
2316
+ }
2317
+ }
2318
+ }
2319
+ }
2307
2320
  }
2308
2321
  }
2309
2322
  }
@@ -10,6 +10,14 @@ const {
10
10
  } = require("../../../index.js");
11
11
  const exampleTransaction = require("../../examples/v1/exampleTransaction.json");
12
12
 
13
+ const getV1Subschema = (path) => {
14
+ return getSubschema(
15
+ path,
16
+ "https://trust.propdata.org.uk/schemas/v1/pdtf-transaction.json",
17
+ null
18
+ );
19
+ };
20
+
13
21
  test("exports a property pack schema", () => {
14
22
  expect(transactionSchema).not.toBeNull();
15
23
  });
@@ -65,45 +73,45 @@ test("correctly identifies an array invalid path", () => {
65
73
  });
66
74
 
67
75
  test("correctly gets a subschema", () => {
68
- const subschema = getSubschema("/propertyPack/materialFacts/notices");
76
+ const subschema = getV1Subschema("/propertyPack/materialFacts/notices");
69
77
  expect(subschema.title).toBe("Notices which Affect the Property");
70
78
  });
71
79
 
72
80
  test("correctly gets a subschema through an arrays element", () => {
73
- const subschema = getSubschema(
81
+ const subschema = getV1Subschema(
74
82
  "/propertyPack/titlesToBeSold/0/registerExtract"
75
83
  );
76
84
  expect(subschema.title).toBe("HMLR Official Copy Register Extract");
77
85
  });
78
86
 
79
87
  test("correctly gets another subschema through an arrays element", () => {
80
- const subschema = getSubschema("/participants/0/name/firstName");
88
+ const subschema = getV1Subschema("/participants/0/name/firstName");
81
89
  expect(subschema.title).toBe("First name");
82
90
  });
83
91
 
84
92
  test("correctly gets a subschema through a dependency", () => {
85
- const subschema = getSubschema(
93
+ const subschema = getV1Subschema(
86
94
  "/propertyPack/materialFacts/delayFactors/hasDelayFactors/details"
87
95
  );
88
96
  expect(subschema.title).toBe("Details");
89
97
  });
90
98
 
91
99
  test("correctly gets another subschema through a dependency", () => {
92
- const subschema = getSubschema(
100
+ const subschema = getV1Subschema(
93
101
  "/propertyPack/materialFacts/ownership/ownershipsToBeTransferred/0/lengthOfLeaseInYears"
94
102
  );
95
103
  expect(subschema.title).toBe("Length of lease (years)");
96
104
  });
97
105
 
98
106
  test("correctly gets yet another subschema through a dependency", () => {
99
- const subschema = getSubschema(
107
+ const subschema = getV1Subschema(
100
108
  "/propertyPack/materialFacts/ownership/ownershipsToBeTransferred/0/rentIncrease/details"
101
109
  );
102
110
  expect(subschema.title).toBe("Details");
103
111
  });
104
112
 
105
113
  test("correctly gets yet, yet another subschema through a dependency", () => {
106
- const subschema = getSubschema(
114
+ const subschema = getV1Subschema(
107
115
  "/propertyPack/materialFacts/listingAndConservation/isConservationArea/yesNo"
108
116
  );
109
117
  expect(subschema.type).toBe("string");
@@ -111,7 +119,7 @@ test("correctly gets yet, yet another subschema through a dependency", () => {
111
119
  });
112
120
 
113
121
  test("correctly gets yet, yet, yet another subschema through a dependency", () => {
114
- const subschema = getSubschema(
122
+ const subschema = getV1Subschema(
115
123
  "/propertyPack/materialFacts/otherIssues/flooding/typeOfFlooding/groundWater/yesNo"
116
124
  );
117
125
  expect(subschema.type).toBe("string");
@@ -119,21 +127,21 @@ test("correctly gets yet, yet, yet another subschema through a dependency", () =
119
127
  });
120
128
 
121
129
  test("correctly gets yet, yet, yet another subschema through a second item dependency", () => {
122
- const subschema = getSubschema(
130
+ const subschema = getV1Subschema(
123
131
  "/propertyPack/materialFacts/otherIssues/flooding/typeOfFlooding"
124
132
  );
125
133
  expect(subschema.type).toBe("object");
126
134
  });
127
135
 
128
136
  test("correctly gets yes another subschema but through a non-baspi oneOf structure", () => {
129
- const subschema = getSubschema(
137
+ const subschema = getV1Subschema(
130
138
  "/propertyPack/titlesToBeSold/0/registerExtract/OCSummaryData/RestrictionDetails/RestrictionEntry/ChargeRestriction/EntryDetails/EntryText"
131
139
  );
132
140
  expect(subschema).toEqual({ type: "string" });
133
141
  });
134
142
 
135
143
  test("correctly gets yes another subschema but through a non-baspi oneOf structure with array option", () => {
136
- const subschema = getSubschema(
144
+ const subschema = getV1Subschema(
137
145
  "/propertyPack/titlesToBeSold/0/registerExtract/OCSummaryData/RestrictionDetails/RestrictionEntry/0/ChargeRestriction/EntryDetails/EntryText"
138
146
  );
139
147
  expect(subschema).toEqual({ type: "string" });
@@ -141,11 +149,11 @@ test("correctly gets yes another subschema but through a non-baspi oneOf structu
141
149
 
142
150
  test("correctly gets a subschema validator which is already cached", () => {
143
151
  const validator = getSubschemaValidator(
144
- "/propertyPack/energyPerformanceCertificate"
152
+ "/propertyPack/materialFacts/energyEfficiency/certificate"
145
153
  );
146
154
  expect(validator).not.toBeNull();
147
155
  const anotherValidator = getSubschemaValidator(
148
- "/propertyPack/energyPerformanceCertificate"
156
+ "/propertyPack/materialFacts/energyEfficiency/certificate"
149
157
  );
150
158
  expect(anotherValidator).not.toBeNull();
151
159
  });