@pdtf/schemas 2.0.0-2 → 2.0.0-3
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
|
@@ -81,12 +81,12 @@
|
|
|
81
81
|
"title": "Address 2",
|
|
82
82
|
"type": "string"
|
|
83
83
|
},
|
|
84
|
-
"
|
|
85
|
-
"title": "
|
|
84
|
+
"line 3": {
|
|
85
|
+
"title": "Address 3",
|
|
86
86
|
"type": "string"
|
|
87
87
|
},
|
|
88
|
-
"
|
|
89
|
-
"title": "
|
|
88
|
+
"town": {
|
|
89
|
+
"title": "Town",
|
|
90
90
|
"type": "string"
|
|
91
91
|
},
|
|
92
92
|
"postcode": {
|
|
@@ -12501,16 +12501,13 @@
|
|
|
12501
12501
|
"baspiRef": "A13",
|
|
12502
12502
|
"title": "Consumer Protection Regulations Declaration",
|
|
12503
12503
|
"type": "object",
|
|
12504
|
-
"
|
|
12504
|
+
"required": ["consumerProtectionRegulationsResponse"],
|
|
12505
12505
|
"properties": {
|
|
12506
12506
|
"consumerProtectionRegulationsResponse": {
|
|
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
|
-
"
|
|
12511
|
-
"type": "string",
|
|
12512
|
-
"enum": ["true", "false"]
|
|
12513
|
-
}
|
|
12510
|
+
"type": "boolean"
|
|
12514
12511
|
}
|
|
12515
12512
|
}
|
|
12516
12513
|
}
|
|
@@ -14299,13 +14296,10 @@
|
|
|
14299
14296
|
"willRemoveAllRubbish": {
|
|
14300
14297
|
"baspiRef": "B7.1",
|
|
14301
14298
|
"rdsRef": "RightsHolders/Flags",
|
|
14302
|
-
"
|
|
14299
|
+
"ta6Ref": "14.4",
|
|
14303
14300
|
"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
14301
|
"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
|
-
"
|
|
14306
|
-
"type": "string",
|
|
14307
|
-
"enum": ["true", "false"]
|
|
14308
|
-
}
|
|
14302
|
+
"type": "boolean"
|
|
14309
14303
|
},
|
|
14310
14304
|
"otherPropertyInChain": {
|
|
14311
14305
|
"baspiRef": "B7.2",
|
|
@@ -14505,7 +14499,7 @@
|
|
|
14505
14499
|
"baspiRef": "B8",
|
|
14506
14500
|
"title": "Confirmation to be supplied by all owners or their representative",
|
|
14507
14501
|
"type": "object",
|
|
14508
|
-
"
|
|
14502
|
+
"required": [
|
|
14509
14503
|
"confirmWillProvideAdditionalDocumentation",
|
|
14510
14504
|
"confirmInformationIsAccurate"
|
|
14511
14505
|
],
|
|
@@ -14513,18 +14507,12 @@
|
|
|
14513
14507
|
"confirmWillProvideAdditionalDocumentation": {
|
|
14514
14508
|
"baspiRef": "B8.1",
|
|
14515
14509
|
"title": "I/we will provide my property lawyer with the additional documentation in support of the information supplied.",
|
|
14516
|
-
"
|
|
14517
|
-
"type": "string",
|
|
14518
|
-
"enum": ["true", "false"]
|
|
14519
|
-
}
|
|
14510
|
+
"type": "boolean"
|
|
14520
14511
|
},
|
|
14521
14512
|
"confirmInformationIsAccurate": {
|
|
14522
14513
|
"baspiRef": "B8.2",
|
|
14523
14514
|
"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
|
-
"
|
|
14525
|
-
"type": "string",
|
|
14526
|
-
"enum": ["true", "false"]
|
|
14527
|
-
}
|
|
14515
|
+
"type": "boolean"
|
|
14528
14516
|
}
|
|
14529
14517
|
}
|
|
14530
14518
|
}
|
|
@@ -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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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/
|
|
152
|
+
"/propertyPack/materialFacts/energyEfficiency/certificate"
|
|
145
153
|
);
|
|
146
154
|
expect(validator).not.toBeNull();
|
|
147
155
|
const anotherValidator = getSubschemaValidator(
|
|
148
|
-
"/propertyPack/
|
|
156
|
+
"/propertyPack/materialFacts/energyEfficiency/certificate"
|
|
149
157
|
);
|
|
150
158
|
expect(anotherValidator).not.toBeNull();
|
|
151
159
|
});
|