@pdtf/schemas 3.4.0-1 → 3.4.0-10
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/index.js +2 -1
- package/package.json +1 -1
- package/src/examples/v3/exampleTransaction.json +2 -2
- package/src/schemas/v3/combined.json +274 -182
- package/src/schemas/v3/overlays/baspi4.json +1 -6
- package/src/schemas/v3/overlays/baspi5.json +3 -7
- package/src/schemas/v3/overlays/nts.json +5 -4
- package/src/schemas/v3/overlays/nts2.json +196 -48
- package/src/schemas/v3/overlays/ntsl.json +4 -2
- package/src/schemas/v3/overlays/ntsl2.json +189 -10
- package/src/schemas/v3/overlays/ta10.json +124 -134
- package/src/schemas/v3/overlays/ta6.json +2 -1
- package/src/schemas/v3/pdtf-transaction.json +6209 -1701
- package/src/schemas/v3/skeleton.json +8 -1
- package/src/tests/v3/transactionSchema.test.js +36 -0
|
@@ -1500,6 +1500,7 @@
|
|
|
1500
1500
|
"otherItems": {
|
|
1501
1501
|
"itemName": {},
|
|
1502
1502
|
"isIncludedOrExcluded": {},
|
|
1503
|
+
"comments": {},
|
|
1503
1504
|
"price": {}
|
|
1504
1505
|
}
|
|
1505
1506
|
},
|
|
@@ -1587,6 +1588,7 @@
|
|
|
1587
1588
|
"otherItems": {
|
|
1588
1589
|
"itemName": {},
|
|
1589
1590
|
"isIncludedOrExcluded": {},
|
|
1591
|
+
"comments": {},
|
|
1590
1592
|
"fittedOrFreestanding": {
|
|
1591
1593
|
"fittedOrFreestanding": {}
|
|
1592
1594
|
},
|
|
@@ -1727,6 +1729,7 @@
|
|
|
1727
1729
|
"otherRooms": {
|
|
1728
1730
|
"itemName": {},
|
|
1729
1731
|
"isIncludedOrExcluded": {},
|
|
1732
|
+
"comments": {},
|
|
1730
1733
|
"price": {}
|
|
1731
1734
|
}
|
|
1732
1735
|
},
|
|
@@ -1812,6 +1815,7 @@
|
|
|
1812
1815
|
"otherRooms": {
|
|
1813
1816
|
"itemName": {},
|
|
1814
1817
|
"isIncludedOrExcluded": {},
|
|
1818
|
+
"comments": {},
|
|
1815
1819
|
"price": {}
|
|
1816
1820
|
}
|
|
1817
1821
|
},
|
|
@@ -1854,6 +1858,7 @@
|
|
|
1854
1858
|
"otherRooms": {
|
|
1855
1859
|
"itemName": {},
|
|
1856
1860
|
"isIncludedOrExcluded": {},
|
|
1861
|
+
"comments": {},
|
|
1857
1862
|
"price": {}
|
|
1858
1863
|
}
|
|
1859
1864
|
},
|
|
@@ -1921,6 +1926,7 @@
|
|
|
1921
1926
|
"otherItems": {
|
|
1922
1927
|
"itemName": {},
|
|
1923
1928
|
"isIncludedOrExcluded": {},
|
|
1929
|
+
"comments": {},
|
|
1924
1930
|
"price": {}
|
|
1925
1931
|
}
|
|
1926
1932
|
},
|
|
@@ -1967,6 +1973,7 @@
|
|
|
1967
1973
|
"otherItems": {
|
|
1968
1974
|
"itemName": {},
|
|
1969
1975
|
"isIncludedOrExcluded": {},
|
|
1976
|
+
"comments": {},
|
|
1970
1977
|
"price": {}
|
|
1971
1978
|
}
|
|
1972
1979
|
},
|
|
@@ -4145,4 +4152,4 @@
|
|
|
4145
4152
|
"sellingAgent": {}
|
|
4146
4153
|
}
|
|
4147
4154
|
}
|
|
4148
|
-
}
|
|
4155
|
+
}
|
|
@@ -44,6 +44,42 @@ test("sample is valid NTS", () => {
|
|
|
44
44
|
expect(isValid).toBe(true);
|
|
45
45
|
});
|
|
46
46
|
|
|
47
|
+
test("sample is not valid nts2025 out of the box", () => {
|
|
48
|
+
const validator = getValidator(schemaId, ["nts2025"]);
|
|
49
|
+
const isValid = validator(exampleTransaction);
|
|
50
|
+
expect(isValid).toBe(false);
|
|
51
|
+
expect(validator.errors.length).toBe(3);
|
|
52
|
+
expect(validator.errors.map((e) => e.message)).toEqual([
|
|
53
|
+
"must have required property 'transferFees'",
|
|
54
|
+
"must have required property 'constructionType'",
|
|
55
|
+
"must have required property 'floodDefences'",
|
|
56
|
+
]);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
test("sample is valid nts2025 with some additions", () => {
|
|
60
|
+
const validator = getValidator(schemaId, ["nts2025"]);
|
|
61
|
+
const clonedExampleTransaction = JSON.parse(
|
|
62
|
+
JSON.stringify(exampleTransaction)
|
|
63
|
+
);
|
|
64
|
+
clonedExampleTransaction.propertyPack.ownership.ownershipsToBeTransferred[0].leaseholdInformation.serviceCharge.transferFees =
|
|
65
|
+
{
|
|
66
|
+
yesNo: "Yes",
|
|
67
|
+
details: "Transfer fees exist",
|
|
68
|
+
};
|
|
69
|
+
clonedExampleTransaction.propertyPack.typeOfConstruction.isStandardForm = {
|
|
70
|
+
yesNo: "Yes",
|
|
71
|
+
constructionType: "Timber frame",
|
|
72
|
+
};
|
|
73
|
+
clonedExampleTransaction.propertyPack.environmentalIssues.flooding.floodDefences =
|
|
74
|
+
{
|
|
75
|
+
hasFloodDefences: "Yes",
|
|
76
|
+
details: "Flood defences exist",
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const isValid = validator(clonedExampleTransaction);
|
|
80
|
+
expect(isValid).toBe(true);
|
|
81
|
+
});
|
|
82
|
+
|
|
47
83
|
test("sample is not valid NTSL (lettings)", () => {
|
|
48
84
|
const validator = getValidator(schemaId, ["ntsl2023"]);
|
|
49
85
|
const isValid = validator(exampleTransaction);
|