@pdtf/schemas 3.2.1-15 → 3.2.1-16

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": "3.2.1-15",
3
+ "version": "3.2.1-16",
4
4
  "description": "Property Data Trust Framework Schemas and Utilities",
5
5
  "main": "index.js",
6
6
  "directories": {
@@ -1377,7 +1377,9 @@
1377
1377
  "Trunk road/motorway",
1378
1378
  "Airport",
1379
1379
  "Helipad",
1380
- "Other"
1380
+ "Other",
1381
+ "Tramway",
1382
+ "Underground/Subway"
1381
1383
  ]
1382
1384
  },
1383
1385
  "latitude": {
@@ -3954,6 +3956,7 @@
3954
3956
  }
3955
3957
  }
3956
3958
  },
3959
+ "ntsRequired": ["managedFreeholdOrCommonholdInformation"],
3957
3960
  "fme1Required": ["managedFreeholdOrCommonholdInformation"],
3958
3961
  "baspi4Required": [
3959
3962
  "managedFreeholdOrCommonholdInformation"
@@ -8954,6 +8957,7 @@
8954
8957
  }
8955
8958
  }
8956
8959
  },
8960
+ "ntsRequired": ["leaseholdInformation"],
8957
8961
  "lpe1Required": ["leaseholdInformation"],
8958
8962
  "baspi4Required": ["leaseholdInformation"],
8959
8963
  "baspi5Required": ["leaseholdInformation"],
@@ -275,7 +275,10 @@
275
275
  }
276
276
  }
277
277
  }
278
- }
278
+ },
279
+ "required": [
280
+ "managedFreeholdOrCommonholdInformation"
281
+ ]
279
282
  },
280
283
  {
281
284
  "properties": {
@@ -524,7 +527,10 @@
524
527
  }
525
528
  }
526
529
  }
527
- }
530
+ },
531
+ "required": [
532
+ "leaseholdInformation"
533
+ ]
528
534
  },
529
535
  {
530
536
  "properties": {
@@ -1095,7 +1095,9 @@
1095
1095
  "Trunk road/motorway",
1096
1096
  "Airport",
1097
1097
  "Helipad",
1098
- "Other"
1098
+ "Other",
1099
+ "Tramway",
1100
+ "Underground/Subway"
1099
1101
  ]
1100
1102
  },
1101
1103
  "latitude": {
@@ -91,6 +91,18 @@ test("sample with missing dependent required fields is invalid", () => {
91
91
  expect(isValid).toBe(false);
92
92
  });
93
93
 
94
+ test("sample with missing dependent required fields with NTS overlay is invalid", () => {
95
+ // Previously a required field was missing from the NTS overlay
96
+ const clonedExampleTransaction = JSON.parse(
97
+ JSON.stringify(exampleTransaction)
98
+ );
99
+ clonedExampleTransaction.propertyPack.ownership.ownershipsToBeTransferred[0].leaseholdInformation =
100
+ undefined;
101
+ const validator = getValidator(schemaId, ["nts2023"]);
102
+ const isValid = validator(clonedExampleTransaction);
103
+ expect(isValid).toBe(false);
104
+ });
105
+
94
106
  test("correctly gets a top level subschema", () => {
95
107
  const subschema = getSubschema("/propertyPack");
96
108
  expect(subschema.title).toBe("Property Pack");