@pdtf/schemas 3.6.0-20 → 3.6.0-22
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 +3 -2
- package/src/schemas/v3/combined.json +31 -13
- package/src/schemas/v3/compactSkeleton.txt +1 -1
- package/src/schemas/v3/overlays/baspi5.json +2 -2
- package/src/schemas/v3/overlays/extensions/pc.json +10 -2
- package/src/schemas/v3/overlays/extensions/ph.json +7 -1
- package/src/schemas/v3/overlays/extensions/sc.json +8 -2
- package/src/schemas/v3/pdtf-transaction.json +33 -13
- package/src/schemas/v3/skeleton.json +1 -1
- package/src/tests/v3/extensionOverlays.test.js +13 -10
- package/src/utils/extractExtensionOverlays.js +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pdtf/schemas",
|
|
3
|
-
"version": "3.6.0-
|
|
3
|
+
"version": "3.6.0-22",
|
|
4
4
|
"description": "Property Data Trust Framework Schemas and Utilities",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"directories": {
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
"scripts": {
|
|
10
10
|
"test": "jest",
|
|
11
11
|
"test:watch": "jest --watch",
|
|
12
|
-
"extract-overlays": "cd src/utils && node extractOverlay.js"
|
|
12
|
+
"extract-overlays": "cd src/utils && node extractOverlay.js",
|
|
13
|
+
"extract-extension-overlays": "cd src/utils && node extractExtensionOverlays.js"
|
|
13
14
|
},
|
|
14
15
|
"repository": {
|
|
15
16
|
"type": "git",
|
|
@@ -10360,19 +10360,21 @@
|
|
|
10360
10360
|
"yesNo": {
|
|
10361
10361
|
"enum": ["Yes"]
|
|
10362
10362
|
},
|
|
10363
|
-
"
|
|
10363
|
+
"costOfPermit": {
|
|
10364
10364
|
"baspi5Ref": "A1.6.0.2.2",
|
|
10365
|
+
"sef25Ref": "P1.1",
|
|
10365
10366
|
"title": "Cost of permit (£)",
|
|
10366
10367
|
"type": "number"
|
|
10367
10368
|
},
|
|
10368
10369
|
"costOfPermitFrequency": {
|
|
10369
|
-
"sef25Ref": "P1.
|
|
10370
|
+
"sef25Ref": "P1.2",
|
|
10370
10371
|
"title": "Payment frequency",
|
|
10371
10372
|
"type": "string",
|
|
10372
|
-
"enum": ["Per month", "Per year"]
|
|
10373
|
+
"enum": ["Per month", "Per year", "Not applicable"]
|
|
10373
10374
|
}
|
|
10374
10375
|
},
|
|
10375
|
-
"baspi5Required": ["
|
|
10376
|
+
"baspi5Required": ["costOfPermit"],
|
|
10377
|
+
"sef25Required": ["costOfPermit", "costOfPermitFrequency"]
|
|
10376
10378
|
}
|
|
10377
10379
|
]
|
|
10378
10380
|
},
|
|
@@ -15613,6 +15615,12 @@
|
|
|
15613
15615
|
"subsidenceOrStructuralFault",
|
|
15614
15616
|
"ongoingHealthOrSafetyIssue"
|
|
15615
15617
|
],
|
|
15618
|
+
"sef25Required": [
|
|
15619
|
+
"wellsDitchesShaft",
|
|
15620
|
+
"damagedOrExposedElectrics",
|
|
15621
|
+
"damageToFlooringOrStaircases",
|
|
15622
|
+
"knownAreasInPoorCondition"
|
|
15623
|
+
],
|
|
15616
15624
|
"properties": {
|
|
15617
15625
|
"dryRotEtcTreatment": {
|
|
15618
15626
|
"baspi4Ref": "A5.1",
|
|
@@ -22312,20 +22320,24 @@
|
|
|
22312
22320
|
},
|
|
22313
22321
|
"associatedCost": {
|
|
22314
22322
|
"sef25Ref": "U1.1",
|
|
22315
|
-
"title": "
|
|
22323
|
+
"title": "Please provide the associated costs for water supply",
|
|
22316
22324
|
"type": "object",
|
|
22317
22325
|
"sef25Required": ["amount", "frequency"],
|
|
22318
22326
|
"properties": {
|
|
22319
22327
|
"amount": {
|
|
22320
22328
|
"sef25Ref": "U1.1.1",
|
|
22321
|
-
"title": "
|
|
22329
|
+
"title": "Associated costs of supply if any (£)",
|
|
22322
22330
|
"type": "number"
|
|
22323
22331
|
},
|
|
22324
22332
|
"frequency": {
|
|
22325
22333
|
"sef25Ref": "U1.1.2",
|
|
22326
|
-
"title": "Payment frequency",
|
|
22334
|
+
"title": "Payment frequency if costs are associated",
|
|
22327
22335
|
"type": "string",
|
|
22328
|
-
"enum": [
|
|
22336
|
+
"enum": [
|
|
22337
|
+
"Per month",
|
|
22338
|
+
"Per year",
|
|
22339
|
+
"Not applicable"
|
|
22340
|
+
]
|
|
22329
22341
|
}
|
|
22330
22342
|
}
|
|
22331
22343
|
}
|
|
@@ -22333,7 +22345,8 @@
|
|
|
22333
22345
|
"ntsRequired": ["details"],
|
|
22334
22346
|
"nts2Required": ["details"],
|
|
22335
22347
|
"ntslRequired": ["details"],
|
|
22336
|
-
"ntsl2Required": ["details"]
|
|
22348
|
+
"ntsl2Required": ["details"],
|
|
22349
|
+
"sef25Required": ["associatedCost"]
|
|
22337
22350
|
},
|
|
22338
22351
|
{
|
|
22339
22352
|
"properties": {
|
|
@@ -23350,14 +23363,18 @@
|
|
|
23350
23363
|
"properties": {
|
|
23351
23364
|
"amount": {
|
|
23352
23365
|
"sef25Ref": "U1.2.1",
|
|
23353
|
-
"title": "
|
|
23366
|
+
"title": "Associated costs for sewerage if any (£)",
|
|
23354
23367
|
"type": "number"
|
|
23355
23368
|
},
|
|
23356
23369
|
"frequency": {
|
|
23357
23370
|
"sef25Ref": "U1.2.2",
|
|
23358
|
-
"title": "Payment frequency",
|
|
23371
|
+
"title": "Payment frequency if costs are associated",
|
|
23359
23372
|
"type": "string",
|
|
23360
|
-
"enum": [
|
|
23373
|
+
"enum": [
|
|
23374
|
+
"Per month",
|
|
23375
|
+
"Per year",
|
|
23376
|
+
"Not applicable"
|
|
23377
|
+
]
|
|
23361
23378
|
}
|
|
23362
23379
|
}
|
|
23363
23380
|
}
|
|
@@ -23365,7 +23382,8 @@
|
|
|
23365
23382
|
"ntsRequired": ["offMainsDrainageSystem"],
|
|
23366
23383
|
"nts2Required": ["offMainsDrainageSystem"],
|
|
23367
23384
|
"ntslRequired": ["offMainsDrainageSystem"],
|
|
23368
|
-
"ntsl2Required": ["offMainsDrainageSystem"]
|
|
23385
|
+
"ntsl2Required": ["offMainsDrainageSystem"],
|
|
23386
|
+
"sef25Required": ["associatedCost"]
|
|
23369
23387
|
}
|
|
23370
23388
|
]
|
|
23371
23389
|
},
|
|
@@ -9,11 +9,19 @@
|
|
|
9
9
|
null,
|
|
10
10
|
{
|
|
11
11
|
"properties": {
|
|
12
|
-
"
|
|
12
|
+
"costOfPermit": {
|
|
13
13
|
"ntsRef": "P1.1",
|
|
14
|
+
"type": "number"
|
|
15
|
+
},
|
|
16
|
+
"costOfPermitFrequency": {
|
|
17
|
+
"ntsRef": "P1.2",
|
|
14
18
|
"type": "string"
|
|
15
19
|
}
|
|
16
|
-
}
|
|
20
|
+
},
|
|
21
|
+
"required": [
|
|
22
|
+
"costOfPermit",
|
|
23
|
+
"costOfPermitFrequency"
|
|
24
|
+
]
|
|
17
25
|
}
|
|
18
26
|
]
|
|
19
27
|
}
|
|
@@ -8370,20 +8370,26 @@
|
|
|
8370
8370
|
"Yes"
|
|
8371
8371
|
]
|
|
8372
8372
|
},
|
|
8373
|
-
"
|
|
8373
|
+
"costOfPermit": {
|
|
8374
|
+
"sef25Ref": "P1.1",
|
|
8374
8375
|
"title": "Cost of permit (£)",
|
|
8375
8376
|
"type": "number"
|
|
8376
8377
|
},
|
|
8377
8378
|
"costOfPermitFrequency": {
|
|
8378
|
-
"sef25Ref": "P1.
|
|
8379
|
+
"sef25Ref": "P1.2",
|
|
8379
8380
|
"title": "Payment frequency",
|
|
8380
8381
|
"type": "string",
|
|
8381
8382
|
"enum": [
|
|
8382
8383
|
"Per month",
|
|
8383
|
-
"Per year"
|
|
8384
|
+
"Per year",
|
|
8385
|
+
"Not applicable"
|
|
8384
8386
|
]
|
|
8385
8387
|
}
|
|
8386
|
-
}
|
|
8388
|
+
},
|
|
8389
|
+
"sef25Required": [
|
|
8390
|
+
"costOfPermit",
|
|
8391
|
+
"costOfPermitFrequency"
|
|
8392
|
+
]
|
|
8387
8393
|
}
|
|
8388
8394
|
]
|
|
8389
8395
|
},
|
|
@@ -12429,6 +12435,12 @@
|
|
|
12429
12435
|
"specialistIssues": {
|
|
12430
12436
|
"title": "Specialist Issues",
|
|
12431
12437
|
"type": "object",
|
|
12438
|
+
"sef25Required": [
|
|
12439
|
+
"wellsDitchesShaft",
|
|
12440
|
+
"damagedOrExposedElectrics",
|
|
12441
|
+
"damageToFlooringOrStaircases",
|
|
12442
|
+
"knownAreasInPoorCondition"
|
|
12443
|
+
],
|
|
12432
12444
|
"properties": {
|
|
12433
12445
|
"dryRotEtcTreatment": {
|
|
12434
12446
|
"title": "To your knowledge, has there been any preventative work for, or treatment of dry rot, wet rot or damp carried out at the property?",
|
|
@@ -18588,7 +18600,7 @@
|
|
|
18588
18600
|
},
|
|
18589
18601
|
"associatedCost": {
|
|
18590
18602
|
"sef25Ref": "U1.1",
|
|
18591
|
-
"title": "
|
|
18603
|
+
"title": "Please provide the associated costs for water supply",
|
|
18592
18604
|
"type": "object",
|
|
18593
18605
|
"sef25Required": [
|
|
18594
18606
|
"amount",
|
|
@@ -18597,21 +18609,25 @@
|
|
|
18597
18609
|
"properties": {
|
|
18598
18610
|
"amount": {
|
|
18599
18611
|
"sef25Ref": "U1.1.1",
|
|
18600
|
-
"title": "
|
|
18612
|
+
"title": "Associated costs of supply if any (£)",
|
|
18601
18613
|
"type": "number"
|
|
18602
18614
|
},
|
|
18603
18615
|
"frequency": {
|
|
18604
18616
|
"sef25Ref": "U1.1.2",
|
|
18605
|
-
"title": "Payment frequency",
|
|
18617
|
+
"title": "Payment frequency if costs are associated",
|
|
18606
18618
|
"type": "string",
|
|
18607
18619
|
"enum": [
|
|
18608
18620
|
"Per month",
|
|
18609
|
-
"Per year"
|
|
18621
|
+
"Per year",
|
|
18622
|
+
"Not applicable"
|
|
18610
18623
|
]
|
|
18611
18624
|
}
|
|
18612
18625
|
}
|
|
18613
18626
|
}
|
|
18614
|
-
}
|
|
18627
|
+
},
|
|
18628
|
+
"sef25Required": [
|
|
18629
|
+
"associatedCost"
|
|
18630
|
+
]
|
|
18615
18631
|
},
|
|
18616
18632
|
{
|
|
18617
18633
|
"properties": {
|
|
@@ -19273,21 +19289,25 @@
|
|
|
19273
19289
|
"properties": {
|
|
19274
19290
|
"amount": {
|
|
19275
19291
|
"sef25Ref": "U1.2.1",
|
|
19276
|
-
"title": "
|
|
19292
|
+
"title": "Associated costs for sewerage if any (£)",
|
|
19277
19293
|
"type": "number"
|
|
19278
19294
|
},
|
|
19279
19295
|
"frequency": {
|
|
19280
19296
|
"sef25Ref": "U1.2.2",
|
|
19281
|
-
"title": "Payment frequency",
|
|
19297
|
+
"title": "Payment frequency if costs are associated",
|
|
19282
19298
|
"type": "string",
|
|
19283
19299
|
"enum": [
|
|
19284
19300
|
"Per month",
|
|
19285
|
-
"Per year"
|
|
19301
|
+
"Per year",
|
|
19302
|
+
"Not applicable"
|
|
19286
19303
|
]
|
|
19287
19304
|
}
|
|
19288
19305
|
}
|
|
19289
19306
|
}
|
|
19290
|
-
}
|
|
19307
|
+
},
|
|
19308
|
+
"sef25Required": [
|
|
19309
|
+
"associatedCost"
|
|
19310
|
+
]
|
|
19291
19311
|
}
|
|
19292
19312
|
]
|
|
19293
19313
|
},
|
|
@@ -507,7 +507,7 @@ describe("Extension Overlays", () => {
|
|
|
507
507
|
expect(cost.required).toEqual(["amount", "frequency"]);
|
|
508
508
|
});
|
|
509
509
|
|
|
510
|
-
test("should merge parking permit frequency into controlledParking Yes branch", () => {
|
|
510
|
+
test("should merge parking permit cost and frequency into controlledParking Yes branch", () => {
|
|
511
511
|
const schema = getTransactionSchema(schemaId, ["pc"]);
|
|
512
512
|
const controlled =
|
|
513
513
|
schema.properties?.propertyPack?.properties?.parking?.properties
|
|
@@ -517,13 +517,15 @@ describe("Extension Overlays", () => {
|
|
|
517
517
|
|
|
518
518
|
// Branch 1 is yesNo="Yes"
|
|
519
519
|
const yesBranch = controlled.oneOf[1];
|
|
520
|
+
const cost = yesBranch?.properties?.costOfPermit;
|
|
521
|
+
expect(cost).toBeDefined();
|
|
522
|
+
expect(cost.sef25Ref).toBe("P1.1");
|
|
523
|
+
expect(cost.type).toBe("number");
|
|
524
|
+
|
|
520
525
|
const freq = yesBranch?.properties?.costOfPermitFrequency;
|
|
521
526
|
expect(freq).toBeDefined();
|
|
522
|
-
expect(freq.sef25Ref).toBe("P1.
|
|
527
|
+
expect(freq.sef25Ref).toBe("P1.2");
|
|
523
528
|
expect(freq.type).toBe("string");
|
|
524
|
-
|
|
525
|
-
// Existing annualCostOfPermit should still be present
|
|
526
|
-
expect(yesBranch.properties.annualCostOfPermit).toBeDefined();
|
|
527
529
|
});
|
|
528
530
|
|
|
529
531
|
test("should merge all 4 property hazard fields into specialistIssues", () => {
|
|
@@ -640,7 +642,7 @@ describe("Extension Overlays", () => {
|
|
|
640
642
|
expect(result).toBe(true);
|
|
641
643
|
});
|
|
642
644
|
|
|
643
|
-
test("should
|
|
645
|
+
test("should require associated cost for private water supply", () => {
|
|
644
646
|
const validator = getSubschemaValidator(
|
|
645
647
|
"/propertyPack/waterAndDrainage/water/mainsWater",
|
|
646
648
|
schemaId,
|
|
@@ -652,7 +654,8 @@ describe("Extension Overlays", () => {
|
|
|
652
654
|
details: "Private well",
|
|
653
655
|
});
|
|
654
656
|
|
|
655
|
-
|
|
657
|
+
// associatedCost is required by the sc extension
|
|
658
|
+
expect(result).toBe(false);
|
|
656
659
|
});
|
|
657
660
|
|
|
658
661
|
test("should reject invalid frequency value for water cost", () => {
|
|
@@ -764,7 +767,7 @@ describe("Extension Overlays", () => {
|
|
|
764
767
|
|
|
765
768
|
const result = validator({
|
|
766
769
|
yesNo: "Yes",
|
|
767
|
-
|
|
770
|
+
costOfPermit: 150,
|
|
768
771
|
costOfPermitFrequency: "Per year",
|
|
769
772
|
});
|
|
770
773
|
|
|
@@ -780,7 +783,7 @@ describe("Extension Overlays", () => {
|
|
|
780
783
|
|
|
781
784
|
const result = validator({
|
|
782
785
|
yesNo: "Yes",
|
|
783
|
-
|
|
786
|
+
costOfPermit: 12.50,
|
|
784
787
|
costOfPermitFrequency: "Per month",
|
|
785
788
|
});
|
|
786
789
|
|
|
@@ -796,7 +799,7 @@ describe("Extension Overlays", () => {
|
|
|
796
799
|
|
|
797
800
|
const result = validator({
|
|
798
801
|
yesNo: "Yes",
|
|
799
|
-
|
|
802
|
+
costOfPermit: 150,
|
|
800
803
|
costOfPermitFrequency: "Per quarter",
|
|
801
804
|
});
|
|
802
805
|
|
|
@@ -203,6 +203,7 @@ const extensionMappings = {
|
|
|
203
203
|
description: "Parking permit cost and frequency",
|
|
204
204
|
refType: "sef25Ref",
|
|
205
205
|
paths: [
|
|
206
|
+
"/properties/propertyPack/properties/parking/properties/controlledParking/oneOf/1/properties/costOfPermit",
|
|
206
207
|
"/properties/propertyPack/properties/parking/properties/controlledParking/oneOf/1/properties/costOfPermitFrequency",
|
|
207
208
|
],
|
|
208
209
|
},
|