@pdtf/schemas 0.9.4 → 0.10.1

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": "0.9.4",
3
+ "version": "0.10.1",
4
4
  "description": "Property Data Trust Framework Schemas and Utilities",
5
5
  "main": "index.js",
6
6
  "directories": {
@@ -30,7 +30,21 @@
30
30
  "hasDelayFactors": { "yesNo": "No" }
31
31
  },
32
32
  "ownership": {
33
- "ownershipType": "Freehold"
33
+ "ownershipType": "Leasehold",
34
+ "startYearOfLease": 1900,
35
+ "lengthOfLeaseInYears": 999,
36
+ "currentGroundRent": 1750,
37
+ "rentIncrease": { "yesNo": "No" },
38
+ "annualServiceCharge": 250.23,
39
+ "largeAdditionalExpense": { "yesNo": "No" },
40
+ "additionalFeesOnSale": 0,
41
+ "freeholderContactDetails": {
42
+ "nameOrOrganisation": "Fleesum Properties"
43
+ },
44
+ "managingAgentContactDetails": {
45
+ "nameOrOrganisation": "Pricee Living"
46
+ },
47
+ "managementCompanyDirectorRequirement": { "yesNo": "No" }
34
48
  },
35
49
  "parking": {
36
50
  "parkingArrangements": {
@@ -55,7 +69,7 @@
55
69
  "isStandardForm": {
56
70
  "yesNo": "Yes"
57
71
  },
58
- "hasFlammableExternalWallSystem": "No"
72
+ "hasFlammableExternalWallSystem": { "yesNo": "No" }
59
73
  },
60
74
  "energyEfficiency": {
61
75
  "energyEfficiencyRating": "A",
@@ -216,6 +230,7 @@
216
230
  "cesspit": { "yesNo": "No" },
217
231
  "sewerageTreatmentPlant": { "yesNo": "No" },
218
232
  "otherConnectedProperties": { "yesNo": "No" },
233
+ "yearSystemInstalled": 1980,
219
234
  "plantOnOtherLand": { "yesNo": "No" },
220
235
  "plantRegistered": { "yesNo": "No" },
221
236
  "plantDrainsIntoWaterway": {
@@ -348,7 +363,36 @@
348
363
  }
349
364
  },
350
365
  "otherIssues": {
351
- "environmental": {
366
+ "flooding": {
367
+ "floodRiskReport": { "yesNo": "No" },
368
+ "hasBeenFlooded": "Yes",
369
+ "details": "Minor basement flood",
370
+ "typeOfFlooding": {
371
+ "groundWater": {
372
+ "yesNo": "No"
373
+ },
374
+ "sewer": {
375
+ "yesNo": "Yes"
376
+ },
377
+ "surfaceWater": {
378
+ "yesNo": "No"
379
+ },
380
+ "coastal": {
381
+ "yesNo": "No"
382
+ },
383
+ "river": {
384
+ "yesNo": "No"
385
+ },
386
+ "other": {
387
+ "yesNo": "No"
388
+ }
389
+ }
390
+ },
391
+ "radon": {
392
+ "radonTest": { "yesNo": "No" },
393
+ "remedialMeasuresOnConstruction": { "yesNo": "No" }
394
+ },
395
+ "otherEnvironmental": {
352
396
  "yesNo": "No"
353
397
  },
354
398
  "excessiveNoise": {
@@ -392,7 +436,6 @@
392
436
  "areBoundariesUniform": { "yesNo": "Yes" },
393
437
  "haveBoundaryFeaturesMoved": { "yesNo": "No" },
394
438
  "adjacentLandIncluded": { "yesNo": "No" },
395
- "titlePlanAccurate": { "yesNo": "Yes" },
396
439
  "flyingFreehold": { "yesNo": "No" }
397
440
  },
398
441
  "servicesCrossing": {
@@ -411,12 +454,14 @@
411
454
  },
412
455
  "occupiers": {
413
456
  "sellerLivesAtProperty": { "yesNo": "Yes" },
414
- "otherOver17sAtProperty": {
415
- "hasOver17s": "Yes",
416
- "over17sNames": [
417
- { "firstName": "Freya", "lastName": "Jones", "age": 21 }
418
- ],
419
- "over17sTenantsOrLodgers": { "yesNo": "No" },
457
+ "hasOthersAged17OrOver": "Yes",
458
+ "aged17OrOverNames": [
459
+ { "firstName": "Freya", "lastName": "Jones", "age": 21 }
460
+ ],
461
+ "aged17OrOverTenantsOrLodgers": { "yesNo": "No" },
462
+ "vacantPossession": {
463
+ "soldWithVacantPosesssion": "Yes",
464
+ "aged17OrOverAgreedToLeave": { "yesNo": "Yes" },
420
465
  "over17sWillSignToConfirmWillVacate": { "yesNo": "Yes" }
421
466
  }
422
467
  },
@@ -117,7 +117,6 @@
117
117
  "areBoundariesUniform",
118
118
  "haveBoundaryFeaturesMoved",
119
119
  "adjacentLandIncluded",
120
- "titlePlanAccurate",
121
120
  "flyingFreehold"
122
121
  ],
123
122
  "properties": {
@@ -175,12 +174,6 @@
175
174
  "title": "Has any adjacent land or property been purchased by you that will be included in the sale?",
176
175
  "$ref": "#/$defs/yesNoDetailIfYes"
177
176
  },
178
- "titlePlanAccurate": {
179
- "baspiRef": "B2.4",
180
- "RDSRef": "Tenure/BoundaryDifferences,Tenure/CadastralMapOfParcels",
181
- "title": "Does the title plan for the property accurately show the extent of the land and property which you are selling?",
182
- "$ref": "#/$defs/yesNoDetailIfNo"
183
- },
184
177
  "flyingFreehold": {
185
178
  "baspiRef": "B2.5",
186
179
  "RDSRef": "Tenure/tenure=?",
@@ -581,7 +574,7 @@
581
574
  "lawSocietyRef": "TA6/11",
582
575
  "title": "Occupiers",
583
576
  "type": "object",
584
- "required": ["sellerLivesAtProperty", "otherOver17sAtProperty"],
577
+ "required": ["sellerLivesAtProperty", "hasOthersAged17OrOver"],
585
578
  "properties": {
586
579
  "sellerLivesAtProperty": {
587
580
  "baspiRef": "B6.1",
@@ -590,90 +583,128 @@
590
583
  "title": "Does the seller live at the property?",
591
584
  "$ref": "#/$defs/yesNo"
592
585
  },
593
- "otherOver17sAtProperty": {
586
+ "hasOthersAged17OrOver": {
594
587
  "baspiRef": "B6.2",
595
588
  "RDSRef": "Participants",
596
589
  "lawSocietyRef": "TA6/11.2",
597
590
  "title": "Does anyone else, aged 17 or over, live at the property?",
598
- "type": "object",
599
- "properties": {
600
- "hasOver17s": {
601
- "type": "string",
602
- "title": "",
603
- "enum": ["Yes", "No"]
604
- }
605
- },
606
- "required": ["hasOver17s"],
607
- "dependencies": {
608
- "hasOver17s": {
609
- "oneOf": [
610
- {
591
+ "type": "string",
592
+ "enum": ["Yes", "No"]
593
+ }
594
+ },
595
+ "dependencies": {
596
+ "hasOthersAged17OrOver": {
597
+ "oneOf": [
598
+ {
599
+ "properties": {
600
+ "hasOthersAged17OrOver": {
601
+ "enum": ["No"]
602
+ }
603
+ },
604
+ "additionalProperties": false
605
+ },
606
+ {
607
+ "properties": {
608
+ "hasOthersAged17OrOver": {
609
+ "enum": ["Yes"]
610
+ },
611
+ "aged17OrOverNames": {
612
+ "lawSocietyRef": "TA6/11.3",
613
+ "title": "Please specify their full names and ages.",
614
+ "type": "array",
615
+ "minItems": 1,
616
+ "items": {
617
+ "type": "object",
618
+ "properties": {
619
+ "firstName": {
620
+ "title": "First Name",
621
+ "type": "string",
622
+ "minLength": 1
623
+ },
624
+ "middleNames": {
625
+ "title": "Middle name(s) if any",
626
+ "type": "string"
627
+ },
628
+ "lastName": {
629
+ "title": "Last Name",
630
+ "type": "string",
631
+ "minLength": 1
632
+ },
633
+ "age": {
634
+ "title": "Age",
635
+ "type": "integer"
636
+ }
637
+ },
638
+ "required": ["firstName", "lastName", "age"]
639
+ }
640
+ },
641
+ "aged17OrOverTenantsOrLodgers": {
642
+ "baspiRef": "B6.1",
643
+ "RDSRef": "Property/Flags",
644
+ "lawSocietyRef": "TA6/11.4",
645
+ "title": "Are any of them tenants or lodgers?",
646
+ "$ref": "#/$defs/yesNo"
647
+ },
648
+ "vacantPossesssion": {
649
+ "lawSocietyRef": "TA6/11.5",
650
+ "type": "object",
651
+ "required": ["soldWithVacantPossession"],
611
652
  "properties": {
612
- "hasOver17s": {
613
- "enum": ["No"]
653
+ "soldWithVacantPosesssion": {
654
+ "type": "string",
655
+ "title": "Is the property being sold with vacant possession?",
656
+ "enum": ["Yes", "No"]
614
657
  }
615
658
  },
616
- "additionalProperties": false
617
- },
618
- {
619
- "properties": {
620
- "hasOver17s": {
621
- "enum": ["Yes"]
622
- },
623
- "over17sNames": {
624
- "lawSocietyRef": "TA6/11.3",
625
- "title": "Please specify their full names and ages.",
626
- "type": "array",
627
- "items": {
628
- "type": "object",
629
- "properties": {
630
- "firstName": {
631
- "title": "First Name",
632
- "type": "string",
633
- "minLength": 1
634
- },
635
- "middleNames": {
636
- "title": "Middle name(s) if any",
637
- "type": "string"
659
+ "dependencies": {
660
+ "soldWithVacantPossession": {
661
+ "oneOf": [
662
+ {
663
+ "properties": {
664
+ "soldWithVacantPossesssion": {
665
+ "enum": ["No"]
666
+ }
638
667
  },
639
- "lastName": {
640
- "title": "Last Name",
641
- "type": "string",
642
- "minLength": 1
643
- },
644
- "age": {
645
- "title": "Age",
646
- "type": "integer"
647
- }
668
+ "additionalProperties": false
648
669
  },
649
- "required": ["firstName", "lastName", "age"]
650
- }
651
- },
652
- "over17sTenantsOrLodgers": {
653
- "baspiRef": "B6.1",
654
- "RDSRef": "Property/Flags",
655
- "lawSocietyRef": "TA6/11.4",
656
- "title": "Are any of them tenants or lodgers?",
657
- "$ref": "#/$defs/yesNo"
658
- },
659
- "over17sWillSignToConfirmWillVacate": {
660
- "baspiRef": "B6.4",
661
- "RDSRef": "RightsHolders,TenureAgreements,Notifications",
662
- "lawSocietyRef": "TA6/11.5",
663
- "title": "Have all occupiers aged over 17, agreed to sign the contract to confirm that they will vacate the property prior to completion of the sale?",
664
- "$ref": "#/$defs/yesNoDetailIfNo",
665
- "description": "If 'No', please provide details (e.g. the property is sold let to tenants) and supply a copy of the tenancy agreement together with a copy of any notice to quit which has been served upon them."
670
+ {
671
+ "properties": {
672
+ "soldWithVacantPosesssion": {
673
+ "enum": ["Yes"]
674
+ },
675
+ "aged17OrOverAgreedToLeave": {
676
+ "baspiRef": "B6.4",
677
+ "RDSRef": "RightsHolders,TenureAgreements,Notifications",
678
+ "lawSocietyRef": "TA6/11.5a",
679
+ "title": "Have all occupiers aged 17 or over agreed to leave prior to completion?",
680
+ "$ref": "#/$defs/yesNo"
681
+ },
682
+ "aged17OrOverWillSignToConfirmWillVacate": {
683
+ "baspiRef": "B6.4",
684
+ "RDSRef": "RightsHolders,TenureAgreements,Notifications",
685
+ "lawSocietyRef": "TA6/11.5b",
686
+ "title": "Have all occupiers aged 17 or over, agreed to sign the sale contract?",
687
+ "$ref": "#/$defs/yesNoDetailIfNo",
688
+ "description": "If 'No', please supply other evidence that the property will be vacant on completion."
689
+ }
690
+ },
691
+ "required": [
692
+ "aged17OrOverAgreedToLeave",
693
+ "aged17OrOverWillSignToConfirmWillVacate"
694
+ ]
695
+ }
696
+ ]
666
697
  }
667
- },
668
- "required": [
669
- "over17sNames",
670
- "over17sTenantsOrLodgers",
671
- "over17sWillSignToConfirmWillVacate"
672
- ]
698
+ }
673
699
  }
700
+ },
701
+ "required": [
702
+ "aged17OrOverNames",
703
+ "aged17OrOverTenantsOrLodgers",
704
+ "vacantPossession"
674
705
  ]
675
706
  }
676
- }
707
+ ]
677
708
  }
678
709
  }
679
710
  },
@@ -602,12 +602,8 @@
602
602
  "baspiRef": "A2.1",
603
603
  "RDSRef": "Tenure/DisputesComplaints,Tenure/LegalClaims",
604
604
  "title": "Does the property have potentially flammable external wall system - including cladding and balconies etc?",
605
- "type": "string",
606
- "enum": [
607
- "Yes (EWS form attached)",
608
- "Yes (No external wall system review to hand)",
609
- "No"
610
- ]
605
+ "$ref": "#/$defs/yesNoDetailIfYes",
606
+ "description": "If yes, please give details and attach an EWS form or state if none is to hand"
611
607
  }
612
608
  }
613
609
  },
@@ -1055,6 +1051,12 @@
1055
1051
  "$ref": "#/$defs/yesNoDetailIfYes",
1056
1052
  "description": "If yes, provide details of the properties sharing the system and explain how maintenance of the system is arranged and paid for."
1057
1053
  },
1054
+ "yearSystemInstalled": {
1055
+ "lawSocietyRef": "TA6/12.9",
1056
+ "title": "What year was the system installed?",
1057
+ "type": "integer",
1058
+ "minimum": 1000
1059
+ },
1058
1060
  "plantOnOtherLand": {
1059
1061
  "baspiRef": "A7.2.6",
1060
1062
  "RDSRef": "Services/OtherServices/Located,Services/OtherServices/{access=?}",
@@ -1129,6 +1131,7 @@
1129
1131
  "cesspit",
1130
1132
  "sewerageTreatmentPlant",
1131
1133
  "otherConnectedProperties",
1134
+ "yearSystemInstalled",
1132
1135
  "plantOnOtherLand",
1133
1136
  "plantRegistered",
1134
1137
  "plantDrainsIntoWaterway"
@@ -1450,7 +1453,7 @@
1450
1453
  "baspiRef": "A8.2",
1451
1454
  "RDSRef": "Insurance/Flags,Insurance/refusalReason=?",
1452
1455
  "lawSocietyRef": "TA6/6.4",
1453
- "title": "Have you had any difficulty obtaining competitively priced building insurance due to the structure or location of the property or had insurance refused (e.g. high premiums, excess over £1,500, special conditions etc )",
1456
+ "title": "Have you had any difficulty obtaining competitively priced building insurance due to the structure or location of the property or had insurance refused (e.g. high premiums, excess over £1,500, special conditions etc)",
1454
1457
  "$ref": "#/$defs/yesNoDetailIfYes"
1455
1458
  },
1456
1459
  "insuranceClaims": {
@@ -1609,20 +1612,142 @@
1609
1612
  "title": "Other Issues Affecting the Property",
1610
1613
  "type": "object",
1611
1614
  "required": [
1612
- "environmental",
1615
+ "flooding",
1616
+ "radon",
1617
+ "otherEnvironmental",
1613
1618
  "excessiveNoise",
1614
1619
  "crime",
1615
1620
  "cautionOrConviction",
1616
1621
  "failedTransactionsInLast12Months"
1617
1622
  ],
1618
1623
  "properties": {
1619
- "environmental": {
1624
+ "flooding": {
1625
+ "baspiRef": "A11.1",
1626
+ "RDSRef": "Sustainability/Environmental|Natural|Situational",
1627
+ "lawSocietyRef": "TA6/7.1",
1628
+ "title": "Flooding",
1629
+ "type": "object",
1630
+ "required": ["floodRiskReport", "hasBeenFlooded"],
1631
+ "properties": {
1632
+ "floodRiskReport": {
1633
+ "baspiRef": "A11.1",
1634
+ "RDSRef": "Sustainability/Environmental|Natural|Situational",
1635
+ "lawSocietyRef": "TA6/7.3",
1636
+ "title": "Has a Flood Risk Report been prepared?",
1637
+ "$ref": "#/$defs/yesNoDetailIfYes",
1638
+ "description": "If yes, please supply a copy."
1639
+ },
1640
+ "hasBeenFlooded": {
1641
+ "title": "Has any part of the property (whether buildings or surrounding garden or land) ever been flooded?",
1642
+ "description": "If yes, please state when the flooding occurred and identify the parts that flooded",
1643
+ "lawSocietyRef": "TA6/7.2",
1644
+ "type": "string",
1645
+ "enum": ["Yes", "No"]
1646
+ }
1647
+ },
1648
+ "dependencies": {
1649
+ "hasBeenFlooded": {
1650
+ "oneOf": [
1651
+ {
1652
+ "properties": {
1653
+ "hasBeenFlooded": {
1654
+ "enum": ["No"]
1655
+ },
1656
+ "additionalProperties": false
1657
+ }
1658
+ },
1659
+ {
1660
+ "properties": {
1661
+ "hasBeenFlooded": {
1662
+ "enum": ["Yes"]
1663
+ },
1664
+ "details": {
1665
+ "lawSocietyRef": "TA6/7.1",
1666
+ "type": "string",
1667
+ "minLength": 1
1668
+ },
1669
+ "typeOfFlooding": {
1670
+ "baspiRef": "A11.1",
1671
+ "RDSRef": "Sustainability/Environmental|Natural|Situational",
1672
+ "lawSocietyRef": "TA6/7.2",
1673
+ "title": "What type of flooding occurred?",
1674
+ "type": "object",
1675
+ "properties": {
1676
+ "groundWater": {
1677
+ "lawSocietyRef": "TA6/7.2a",
1678
+ "title": "Ground water",
1679
+ "$ref": "#/$defs/yesNo"
1680
+ },
1681
+ "sewer": {
1682
+ "lawSocietyRef": "TA6/7.2b",
1683
+ "title": "Sewer",
1684
+ "$ref": "#/$defs/yesNo"
1685
+ },
1686
+ "surfaceWater": {
1687
+ "lawSocietyRef": "TA6/7.2c",
1688
+ "title": "Surface water",
1689
+ "$ref": "#/$defs/yesNo"
1690
+ },
1691
+ "coastal": {
1692
+ "lawSocietyRef": "TA6/7.2d",
1693
+ "title": "Coastal flooding",
1694
+ "$ref": "#/$defs/yesNo"
1695
+ },
1696
+ "river": {
1697
+ "lawSocietyRef": "TA6/7.2e",
1698
+ "title": "River flooding",
1699
+ "$ref": "#/$defs/yesNo"
1700
+ },
1701
+ "other": {
1702
+ "title": "Other",
1703
+ "$ref": "#/$defs/yesNoDetailIfYes",
1704
+ "description": "Please state"
1705
+ }
1706
+ },
1707
+ "required": [
1708
+ "groundWater",
1709
+ "sewer",
1710
+ "surfaceWater",
1711
+ "coastal",
1712
+ "river",
1713
+ "other"
1714
+ ]
1715
+ }
1716
+ },
1717
+ "required": ["typeOfFlooding", "details"]
1718
+ }
1719
+ ]
1720
+ }
1721
+ }
1722
+ },
1723
+ "radon": {
1724
+ "baspiRef": "A11.1",
1725
+ "RDSRef": "Sustainability/Environmental|Natural|Situational",
1726
+ "lawSocietyRef": "TA6/7.4",
1727
+ "title": "Radon",
1728
+ "type": "object",
1729
+ "required": ["remedialMeasuresOnConstruction", "radonTest"],
1730
+ "properties": {
1731
+ "radonTest": {
1732
+ "lawSocietyRef": "TA6/7.4",
1733
+ "title": "Has a Radon test been carried out on the property?",
1734
+ "$ref": "#/$defs/yesNoDetailIfYes",
1735
+ "description": "If yes, please supply a copy of the report and indicate if the test result was below the recommended level."
1736
+ },
1737
+ "remedialMeasuresOnConstruction": {
1738
+ "RDSRef": "Sustainability/Environmental|Natural|Situational",
1739
+ "lawSocietyRef": "TA6/7.5",
1740
+ "title": "Were any remedial measures undertaken on construction to reduce Radon gas levels on the property?",
1741
+ "$ref": "#/$defs/yesNo"
1742
+ }
1743
+ }
1744
+ },
1745
+ "otherEnvironmental": {
1620
1746
  "baspiRef": "A11.1",
1621
1747
  "RDSRef": "Sustainability/Environmental|Natural|Situational",
1622
- "lawSocietyRef": "TA6/7",
1623
- "title": "To your knowledge, has there been any environmental issues that affect the property or garden (for example, these could include air pollution, flooding, radon gas, mining, sink holes, quarrying or fracking etc)?",
1748
+ "title": "To your knowledge, have there been any other environmental issues that affect the property or garden (for example, these could include air pollution, mining, sink holes, quarrying or fracking etc)?",
1624
1749
  "$ref": "#/$defs/yesNoDetailIfYes",
1625
- "description": "If yes, please provide details. For example the level of air pollution, type of flooding (e.g. ground water, coastal, river, surface water, sewer, etc), level of radon, a copy of any radon report, location of fracking etc, and whether any action has been taken to prevent harm."
1750
+ "description": "If yes, please provide details. For example the level of air pollution, location of fracking etc, and whether any action has been taken to prevent harm."
1626
1751
  },
1627
1752
  "excessiveNoise": {
1628
1753
  "baspiRef": "A11.2",
@@ -1989,13 +2114,8 @@
1989
2114
  "contactDetails": {
1990
2115
  "type": "object",
1991
2116
  "properties": {
1992
- "firstName": {
1993
- "title": "First name",
1994
- "type": "string",
1995
- "minLength": 1
1996
- },
1997
- "lastName": {
1998
- "title": "Last name",
2117
+ "nameOrOrganisation": {
2118
+ "title": "Name or organisation",
1999
2119
  "type": "string",
2000
2120
  "minLength": 1
2001
2121
  },
@@ -2006,33 +2126,12 @@
2006
2126
  },
2007
2127
  "address": {
2008
2128
  "title": "Address",
2009
- "type": "object",
2010
- "properties": {
2011
- "line1": {
2012
- "title": "Address 1",
2013
- "type": "string",
2014
- "minLength": 1
2015
- },
2016
- "line2": {
2017
- "title": "Address 2",
2018
- "type": "string"
2019
- },
2020
- "town": {
2021
- "title": "Town",
2022
- "type": "string"
2023
- },
2024
- "county": {
2025
- "title": "County",
2026
- "type": "string"
2027
- },
2028
- "postcode": {
2029
- "title": "Postcode",
2030
- "type": "string",
2031
- "minLength": 1
2032
- }
2033
- }
2129
+
2130
+ "type": "string",
2131
+ "minLength": 1
2034
2132
  }
2035
- }
2133
+ },
2134
+ "required": ["nameOrOrganisation"]
2036
2135
  }
2037
2136
  }
2038
2137
  }
@@ -184,7 +184,7 @@ test("correctly gets titles across schemas, arrays and non-existient title prope
184
184
  expect(
185
185
  getTitleAtPath(
186
186
  transactionSchema,
187
- "/propertyPack/additionalLegalInfo/occupiers/otherOver17sAtProperty/over17sNames/0/firstName"
187
+ "/propertyPack/additionalLegalInfo/occupiers/aged17OrOverNames/0/firstName"
188
188
  )
189
189
  ).toBe("First Name");
190
190
  });