@pdtf/schemas 3.3.0 → 3.4.0-2
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/schemas/v3/combined.json +1072 -345
- package/src/schemas/v3/overlays/lpe1.json +6 -1
- package/src/schemas/v3/overlays/{nts-sef.json → nts2.json} +714 -222
- package/src/schemas/v3/overlays/ntsl2.json +2094 -0
- package/src/schemas/v3/overlays/ta6.json +1 -0
- package/src/schemas/v3/pdtf-transaction.json +283 -5
- package/src/schemas/v3/skeleton.json +31 -1
- package/src/tests/v3/transactionSchema.test.js +36 -0
- package/src/utils/extractOverlay.js +2 -1
|
@@ -183,8 +183,13 @@
|
|
|
183
183
|
"externalIds": {
|
|
184
184
|
"type": "object"
|
|
185
185
|
},
|
|
186
|
-
"
|
|
187
|
-
"type": "
|
|
186
|
+
"participantStatus": {
|
|
187
|
+
"type": "string",
|
|
188
|
+
"enum": [
|
|
189
|
+
"Active",
|
|
190
|
+
"Removed",
|
|
191
|
+
"Pending"
|
|
192
|
+
]
|
|
188
193
|
}
|
|
189
194
|
},
|
|
190
195
|
"oneOf": [
|
|
@@ -875,10 +880,19 @@
|
|
|
875
880
|
"type": "integer"
|
|
876
881
|
},
|
|
877
882
|
"outsideAreas": {
|
|
878
|
-
"title": "
|
|
883
|
+
"title": "What outside areas are there?",
|
|
879
884
|
"type": "array",
|
|
880
885
|
"items": {
|
|
881
|
-
"type": "string"
|
|
886
|
+
"type": "string",
|
|
887
|
+
"enum": [
|
|
888
|
+
"None",
|
|
889
|
+
"Front garden",
|
|
890
|
+
"Rear garden",
|
|
891
|
+
"Side garden",
|
|
892
|
+
"Balcony",
|
|
893
|
+
"Roof garden",
|
|
894
|
+
"Communal garden"
|
|
895
|
+
]
|
|
882
896
|
}
|
|
883
897
|
}
|
|
884
898
|
}
|
|
@@ -1347,6 +1361,7 @@
|
|
|
1347
1361
|
"ownershipType": {
|
|
1348
1362
|
"title": "What type of ownership is the property?",
|
|
1349
1363
|
"description": "A Managed Freehold is any freehold where there are shared amenities, the maintenance of which you pay for through an estate rentcharge, service charge, informal or formal contribution. Choose Leasehold if your property is under a Shared Ownership arrangement.",
|
|
1364
|
+
"nts2Description": "",
|
|
1350
1365
|
"type": "string",
|
|
1351
1366
|
"enum": [
|
|
1352
1367
|
"Freehold",
|
|
@@ -1365,6 +1380,49 @@
|
|
|
1365
1380
|
"Freehold"
|
|
1366
1381
|
]
|
|
1367
1382
|
},
|
|
1383
|
+
"estateRentcharges": {
|
|
1384
|
+
"title": "Are there any estate rentcharges, management charges or service charges payable?",
|
|
1385
|
+
"type": "object",
|
|
1386
|
+
"properties": {
|
|
1387
|
+
"yesNo": {
|
|
1388
|
+
"type": "string",
|
|
1389
|
+
"title": "",
|
|
1390
|
+
"enum": [
|
|
1391
|
+
"Yes",
|
|
1392
|
+
"No"
|
|
1393
|
+
]
|
|
1394
|
+
}
|
|
1395
|
+
},
|
|
1396
|
+
"oneOf": [
|
|
1397
|
+
{
|
|
1398
|
+
"properties": {
|
|
1399
|
+
"yesNo": {
|
|
1400
|
+
"enum": [
|
|
1401
|
+
"Yes"
|
|
1402
|
+
]
|
|
1403
|
+
}
|
|
1404
|
+
}
|
|
1405
|
+
},
|
|
1406
|
+
{
|
|
1407
|
+
"properties": {
|
|
1408
|
+
"yesNo": {
|
|
1409
|
+
"enum": [
|
|
1410
|
+
"No"
|
|
1411
|
+
]
|
|
1412
|
+
},
|
|
1413
|
+
"details": {
|
|
1414
|
+
"title": "Details",
|
|
1415
|
+
"type": "string",
|
|
1416
|
+
"minLength": 1
|
|
1417
|
+
},
|
|
1418
|
+
"amount": {
|
|
1419
|
+
"title": "Amount payable annually",
|
|
1420
|
+
"type": "number"
|
|
1421
|
+
}
|
|
1422
|
+
}
|
|
1423
|
+
}
|
|
1424
|
+
]
|
|
1425
|
+
},
|
|
1368
1426
|
"wholeFreeholdForSale": {
|
|
1369
1427
|
"title": "Is the entire freehold being sold?",
|
|
1370
1428
|
"type": "object",
|
|
@@ -7874,6 +7932,17 @@
|
|
|
7874
7932
|
"enum": [
|
|
7875
7933
|
"Yes"
|
|
7876
7934
|
]
|
|
7935
|
+
},
|
|
7936
|
+
"constructionType": {
|
|
7937
|
+
"title": "Details",
|
|
7938
|
+
"type": "string",
|
|
7939
|
+
"enum": [
|
|
7940
|
+
"Brick and block",
|
|
7941
|
+
"Steel frame",
|
|
7942
|
+
"Timber frame",
|
|
7943
|
+
"Insulated concrete framework",
|
|
7944
|
+
"Structural insulated panel (SIP)"
|
|
7945
|
+
]
|
|
7877
7946
|
}
|
|
7878
7947
|
}
|
|
7879
7948
|
},
|
|
@@ -17098,6 +17167,7 @@
|
|
|
17098
17167
|
"Solar water",
|
|
17099
17168
|
"Underfloor heating",
|
|
17100
17169
|
"Wood burner",
|
|
17170
|
+
"Aga/Rayburn",
|
|
17101
17171
|
"Open fire",
|
|
17102
17172
|
"Ground source heat pump",
|
|
17103
17173
|
"Air source heat pump",
|
|
@@ -18298,6 +18368,45 @@
|
|
|
18298
18368
|
}
|
|
18299
18369
|
}
|
|
18300
18370
|
]
|
|
18371
|
+
},
|
|
18372
|
+
"floodDefences": {
|
|
18373
|
+
"title": "Flood defences",
|
|
18374
|
+
"type": "object",
|
|
18375
|
+
"properties": {
|
|
18376
|
+
"hasFloodDefences": {
|
|
18377
|
+
"title": "Are there any defences to prevent flooding installed at the property?",
|
|
18378
|
+
"type": "string",
|
|
18379
|
+
"enum": [
|
|
18380
|
+
"Yes",
|
|
18381
|
+
"No"
|
|
18382
|
+
]
|
|
18383
|
+
}
|
|
18384
|
+
},
|
|
18385
|
+
"oneOf": [
|
|
18386
|
+
{
|
|
18387
|
+
"properties": {
|
|
18388
|
+
"hasFloodDefences": {
|
|
18389
|
+
"enum": [
|
|
18390
|
+
"No"
|
|
18391
|
+
]
|
|
18392
|
+
}
|
|
18393
|
+
}
|
|
18394
|
+
},
|
|
18395
|
+
{
|
|
18396
|
+
"properties": {
|
|
18397
|
+
"hasFloodDefences": {
|
|
18398
|
+
"enum": [
|
|
18399
|
+
"Yes"
|
|
18400
|
+
]
|
|
18401
|
+
},
|
|
18402
|
+
"details": {
|
|
18403
|
+
"title": "Please provide details",
|
|
18404
|
+
"type": "string",
|
|
18405
|
+
"minLength": 1
|
|
18406
|
+
}
|
|
18407
|
+
}
|
|
18408
|
+
}
|
|
18409
|
+
]
|
|
18301
18410
|
}
|
|
18302
18411
|
}
|
|
18303
18412
|
},
|
|
@@ -19331,7 +19440,7 @@
|
|
|
19331
19440
|
"properties": {
|
|
19332
19441
|
"riskIndicator": {
|
|
19333
19442
|
"type": "string",
|
|
19334
|
-
"title": "Is the property impacted?",
|
|
19443
|
+
"title": "Is the property impacted by coastal erosion?",
|
|
19335
19444
|
"enum": [
|
|
19336
19445
|
"Yes",
|
|
19337
19446
|
"No"
|
|
@@ -34235,6 +34344,175 @@
|
|
|
34235
34344
|
}
|
|
34236
34345
|
}
|
|
34237
34346
|
}
|
|
34347
|
+
},
|
|
34348
|
+
"chain": {
|
|
34349
|
+
"title": "Data Containing the Related Chain",
|
|
34350
|
+
"description": "the data through which the chain for this tranasaction can be built.",
|
|
34351
|
+
"type": "object",
|
|
34352
|
+
"properties": {
|
|
34353
|
+
"onwardPurchase": {
|
|
34354
|
+
"type": "array",
|
|
34355
|
+
"minItems": 1,
|
|
34356
|
+
"items": {
|
|
34357
|
+
"type": "object",
|
|
34358
|
+
"title": "onwards Purchases",
|
|
34359
|
+
"properties": {
|
|
34360
|
+
"transactionId": {
|
|
34361
|
+
"title": "UUID for the onward transaction",
|
|
34362
|
+
"type": "string"
|
|
34363
|
+
},
|
|
34364
|
+
"externalIds": {
|
|
34365
|
+
"type": "object"
|
|
34366
|
+
},
|
|
34367
|
+
"address": {
|
|
34368
|
+
"title": "Address",
|
|
34369
|
+
"type": "object",
|
|
34370
|
+
"properties": {
|
|
34371
|
+
"buildingNumber": {
|
|
34372
|
+
"title": "Building number",
|
|
34373
|
+
"type": "string",
|
|
34374
|
+
"minLength": 1
|
|
34375
|
+
},
|
|
34376
|
+
"buildingName": {
|
|
34377
|
+
"title": "Building name",
|
|
34378
|
+
"type": "string"
|
|
34379
|
+
},
|
|
34380
|
+
"subBuilding": {
|
|
34381
|
+
"title": "Sub building name",
|
|
34382
|
+
"type": "string"
|
|
34383
|
+
},
|
|
34384
|
+
"street": {
|
|
34385
|
+
"title": "Street",
|
|
34386
|
+
"type": "string",
|
|
34387
|
+
"minLength": 1
|
|
34388
|
+
},
|
|
34389
|
+
"line1": {
|
|
34390
|
+
"title": "Address 1",
|
|
34391
|
+
"type": "string",
|
|
34392
|
+
"minLength": 1
|
|
34393
|
+
},
|
|
34394
|
+
"line2": {
|
|
34395
|
+
"title": "Address 2",
|
|
34396
|
+
"type": "string"
|
|
34397
|
+
},
|
|
34398
|
+
"line 3": {
|
|
34399
|
+
"title": "Address 3",
|
|
34400
|
+
"type": "string"
|
|
34401
|
+
},
|
|
34402
|
+
"town": {
|
|
34403
|
+
"title": "Town",
|
|
34404
|
+
"type": "string"
|
|
34405
|
+
},
|
|
34406
|
+
"postcode": {
|
|
34407
|
+
"title": "Postcode",
|
|
34408
|
+
"type": "string",
|
|
34409
|
+
"minLength": 1
|
|
34410
|
+
},
|
|
34411
|
+
"homeNation": {
|
|
34412
|
+
"title": "Home nation",
|
|
34413
|
+
"type": "string",
|
|
34414
|
+
"enum": [
|
|
34415
|
+
"England",
|
|
34416
|
+
"Wales",
|
|
34417
|
+
"Scotland",
|
|
34418
|
+
"Northern Ireland"
|
|
34419
|
+
]
|
|
34420
|
+
}
|
|
34421
|
+
}
|
|
34422
|
+
},
|
|
34423
|
+
"uprn": {
|
|
34424
|
+
"title": "Unique Property Reference Number",
|
|
34425
|
+
"type": "integer"
|
|
34426
|
+
},
|
|
34427
|
+
"sellingAgent": {
|
|
34428
|
+
"title": "Estate Agent selling the property",
|
|
34429
|
+
"type": "string"
|
|
34430
|
+
}
|
|
34431
|
+
}
|
|
34432
|
+
}
|
|
34433
|
+
}
|
|
34434
|
+
},
|
|
34435
|
+
"buyersSale": {
|
|
34436
|
+
"type": "array",
|
|
34437
|
+
"minItems": 1,
|
|
34438
|
+
"items": {
|
|
34439
|
+
"type": "object",
|
|
34440
|
+
"title": "the properties the buyer/buyers are selling to finance the purchase",
|
|
34441
|
+
"properties": {
|
|
34442
|
+
"transactionId": {
|
|
34443
|
+
"title": "UUID for the onward transaction",
|
|
34444
|
+
"type": "string"
|
|
34445
|
+
},
|
|
34446
|
+
"externalIds": {
|
|
34447
|
+
"type": "object"
|
|
34448
|
+
},
|
|
34449
|
+
"address": {
|
|
34450
|
+
"title": "Address",
|
|
34451
|
+
"type": "object",
|
|
34452
|
+
"properties": {
|
|
34453
|
+
"buildingNumber": {
|
|
34454
|
+
"title": "Building number",
|
|
34455
|
+
"type": "string",
|
|
34456
|
+
"minLength": 1
|
|
34457
|
+
},
|
|
34458
|
+
"buildingName": {
|
|
34459
|
+
"title": "Building name",
|
|
34460
|
+
"type": "string"
|
|
34461
|
+
},
|
|
34462
|
+
"subBuilding": {
|
|
34463
|
+
"title": "Sub building name",
|
|
34464
|
+
"type": "string"
|
|
34465
|
+
},
|
|
34466
|
+
"street": {
|
|
34467
|
+
"title": "Street",
|
|
34468
|
+
"type": "string",
|
|
34469
|
+
"minLength": 1
|
|
34470
|
+
},
|
|
34471
|
+
"line1": {
|
|
34472
|
+
"title": "Address 1",
|
|
34473
|
+
"type": "string",
|
|
34474
|
+
"minLength": 1
|
|
34475
|
+
},
|
|
34476
|
+
"line2": {
|
|
34477
|
+
"title": "Address 2",
|
|
34478
|
+
"type": "string"
|
|
34479
|
+
},
|
|
34480
|
+
"line 3": {
|
|
34481
|
+
"title": "Address 3",
|
|
34482
|
+
"type": "string"
|
|
34483
|
+
},
|
|
34484
|
+
"town": {
|
|
34485
|
+
"title": "Town",
|
|
34486
|
+
"type": "string"
|
|
34487
|
+
},
|
|
34488
|
+
"postcode": {
|
|
34489
|
+
"title": "Postcode",
|
|
34490
|
+
"type": "string",
|
|
34491
|
+
"minLength": 1
|
|
34492
|
+
},
|
|
34493
|
+
"homeNation": {
|
|
34494
|
+
"title": "Home nation",
|
|
34495
|
+
"type": "string",
|
|
34496
|
+
"enum": [
|
|
34497
|
+
"England",
|
|
34498
|
+
"Wales",
|
|
34499
|
+
"Scotland",
|
|
34500
|
+
"Northern Ireland"
|
|
34501
|
+
]
|
|
34502
|
+
}
|
|
34503
|
+
}
|
|
34504
|
+
},
|
|
34505
|
+
"uprn": {
|
|
34506
|
+
"title": "Unique Property Reference Number",
|
|
34507
|
+
"type": "integer"
|
|
34508
|
+
},
|
|
34509
|
+
"sellingAgent": {
|
|
34510
|
+
"title": "Estate Agent selling the property",
|
|
34511
|
+
"type": "string"
|
|
34512
|
+
}
|
|
34513
|
+
}
|
|
34514
|
+
}
|
|
34515
|
+
}
|
|
34238
34516
|
}
|
|
34239
34517
|
}
|
|
34240
34518
|
}
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"organisationReference": {},
|
|
31
31
|
"role": {},
|
|
32
32
|
"externalIds": {},
|
|
33
|
-
"
|
|
33
|
+
"participantStatus": {},
|
|
34
34
|
"sellersCapacity": {
|
|
35
35
|
"capacity": {},
|
|
36
36
|
"sellersCapacityDetails": {},
|
|
@@ -215,6 +215,11 @@
|
|
|
215
215
|
"titleNumber": {},
|
|
216
216
|
"titlePropertyDescription": {},
|
|
217
217
|
"ownershipType": {},
|
|
218
|
+
"estateRentcharges": {
|
|
219
|
+
"yesNo": {},
|
|
220
|
+
"details": {},
|
|
221
|
+
"amount": {}
|
|
222
|
+
},
|
|
218
223
|
"wholeFreeholdForSale": {
|
|
219
224
|
"yesNo": {},
|
|
220
225
|
"details": {}
|
|
@@ -1067,6 +1072,7 @@
|
|
|
1067
1072
|
"typeOfConstruction": {
|
|
1068
1073
|
"isStandardForm": {
|
|
1069
1074
|
"yesNo": {},
|
|
1075
|
+
"constructionType": {},
|
|
1070
1076
|
"details": {}
|
|
1071
1077
|
},
|
|
1072
1078
|
"buildingSafety": {
|
|
@@ -2338,6 +2344,10 @@
|
|
|
2338
2344
|
"hasBeenFlooded": {},
|
|
2339
2345
|
"typeOfFlooding": {},
|
|
2340
2346
|
"details": {}
|
|
2347
|
+
},
|
|
2348
|
+
"floodDefences": {
|
|
2349
|
+
"hasFloodDefences": {},
|
|
2350
|
+
"details": {}
|
|
2341
2351
|
}
|
|
2342
2352
|
},
|
|
2343
2353
|
"radon": {
|
|
@@ -4114,5 +4124,25 @@
|
|
|
4114
4124
|
"signedOn": {},
|
|
4115
4125
|
"externalIds": {}
|
|
4116
4126
|
}
|
|
4127
|
+
},
|
|
4128
|
+
"chain": {
|
|
4129
|
+
"onwardPurchase": {
|
|
4130
|
+
"transactionId": {},
|
|
4131
|
+
"externalIds": {},
|
|
4132
|
+
"address": {
|
|
4133
|
+
"buildingNumber": {},
|
|
4134
|
+
"buildingName": {},
|
|
4135
|
+
"subBuilding": {},
|
|
4136
|
+
"street": {},
|
|
4137
|
+
"line1": {},
|
|
4138
|
+
"line2": {},
|
|
4139
|
+
"line 3": {},
|
|
4140
|
+
"town": {},
|
|
4141
|
+
"postcode": {},
|
|
4142
|
+
"homeNation": {}
|
|
4143
|
+
},
|
|
4144
|
+
"uprn": {},
|
|
4145
|
+
"sellingAgent": {}
|
|
4146
|
+
}
|
|
4117
4147
|
}
|
|
4118
4148
|
}
|
|
@@ -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);
|