From ca6f92da11e33ee00d593e23b500d369938dce2a Mon Sep 17 00:00:00 2001 From: Ed Molyneux Date: Fri, 11 Nov 2022 07:00:16 +0000 Subject: [PATCH 1/7] Revise ownership and legal owners structures --- package.json | 2 +- src/examples/exampleTransaction.json | 21 ++-- src/schemas/v1/legal-information.json | 65 +++++----- src/schemas/v1/material-facts.json | 167 +++++++++++--------------- 4 files changed, 117 insertions(+), 138 deletions(-) diff --git a/package.json b/package.json index f807348..495af13 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@pdtf/schemas", - "version": "0.10.8", + "version": "0.11.0-1", "description": "Property Data Trust Framework Schemas and Utilities", "main": "index.js", "directories": { diff --git a/src/examples/exampleTransaction.json b/src/examples/exampleTransaction.json index ef33609..c4e7c19 100644 --- a/src/examples/exampleTransaction.json +++ b/src/examples/exampleTransaction.json @@ -31,12 +31,7 @@ }, "ownership": { "ownershipType": "Leasehold", - "sharedOwnership": { - "isSharedOwnership": "Yes", - "sharedOwnershipPercentage": 25, - "sharedOwnershipRent": 225, - "sharedOwnershipRentFrequency": "Monthly" - }, + "sharedOwnership": { "isSharedOwnership": "No" }, "startYearOfLease": 1900, "lengthOfLeaseInYears": 999, "currentGroundRent": 1750, @@ -427,12 +422,14 @@ } }, "additionalLegalInfo": { - "namesOfLegalOwners": [ - { - "firstName": "Peter", - "lastName": "Hetherington-Smythe" - } - ], + "legalOwners": { + "namesOfLegalOwners": [ + { + "firstName": "Peter", + "lastName": "Hetherington-Smythe" + } + ] + }, "sellersCapacity": { "capacity": "Legal Owner" }, "legalBoundaries": { "left": "Seller", diff --git a/src/schemas/v1/legal-information.json b/src/schemas/v1/legal-information.json index 041b415..d9acf17 100644 --- a/src/schemas/v1/legal-information.json +++ b/src/schemas/v1/legal-information.json @@ -6,7 +6,7 @@ "description": "A schema defining Part B of BASPI v2.0 spporting mapping to BASPI, Law Society and RICS Data Schema elements.", "baspiRef": "B", "required": [ - "namesOfLegalOwners", + "legalOwners", "sellersCapacity", "legalBoundaries", "servicesCrossing", @@ -18,37 +18,44 @@ "confirmationOfAccuracyByOwners" ], "properties": { - "namesOfLegalOwners": { - "baspiRef": "B1.1", - "RDSRef": "RightsHolders", - "title": "Full names of all legal owner(s)", - "type": "array", - "minItems": 1, - "items": { - "type": "object", - "baspiRef": "B1.1.1", - "title": "Owner name", - "required": ["firstName", "lastName"], - "properties": { - "firstName": { + "legalOwners": { + "baspiRef": "B1", + "type": "object", + "properties": { + "namesOfLegalOwners": { + "baspiRef": "B1.1", + "RDSRef": "RightsHolders", + "title": "Full names of all legal owner(s)", + "type": "array", + "minItems": 1, + "items": { + "type": "object", "baspiRef": "B1.1.1", - "title": "First name", - "type": "string", - "minLength": 1 - }, - "middleNames": { - "baspiRef": "B1.1.2", - "title": "Middle names", - "type": "string" - }, - "lastName": { - "baspiRef": "B1.1.3", - "title": "Last name", - "type": "string", - "minLength": 1 + "title": "Owner name", + "required": ["firstName", "lastName"], + "properties": { + "firstName": { + "baspiRef": "B1.1.1", + "title": "First name", + "type": "string", + "minLength": 1 + }, + "middleNames": { + "baspiRef": "B1.1.2", + "title": "Middle names", + "type": "string" + }, + "lastName": { + "baspiRef": "B1.1.3", + "title": "Last name", + "type": "string", + "minLength": 1 + } + } } } - } + }, + "required": ["namesOfLegalOwners"] }, "sellersCapacity": { "baspiRef": "B1.3", diff --git a/src/schemas/v1/material-facts.json b/src/schemas/v1/material-facts.json index f2d94e0..f4289c0 100644 --- a/src/schemas/v1/material-facts.json +++ b/src/schemas/v1/material-facts.json @@ -3,7 +3,7 @@ "$id": "https://trust.propdata.org.uk/schemas/v1/material-facts.json", "type": "object", "title": "Material facts at the point of marketing", - "description": "BASPI v2.0 Part A - Disclosure of material facts at the point of marketing, supporting mapping to BASPI, Law Society and RICS Data Schema elements.", + "description": "BASPI v2.0 Part A - Disclosure of material facts at the point of marketing, supporting mapping to BASPI, Law Society, NTS and RICS Data Schema elements.", "baspiRef": "A", "required": [ "uprn", @@ -171,9 +171,15 @@ "RDSRef": "Tenure/Tenure", "lawSocietyRef": "TA7/1.1", "title": "What type of ownership is the property?", - "description": "Choose Freehold if your property is a Managed Freehold or Commonhold. Choose Leasehold if your property is under a Shared Ownership arrangement.", + "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.", "type": "string", - "enum": ["Freehold", "Leasehold", "Other"] + "enum": [ + "Freehold", + "Managed Freehold", + "Commonhold", + "Leasehold", + "Other" + ] } }, "dependencies": { @@ -183,102 +189,72 @@ "properties": { "ownershipType": { "enum": ["Freehold"] + } + }, + "wholeFreeholdForSale": { + "title": "Is the entire freehold being sold?", + "description": "If not, describe the share for sale (e.g. Ground floor flat only)", + "$ref": "#/$defs/yesNoDetailIfNo" + }, + "required": ["wholeFreeholdForSale"], + "additionalProperties": false + }, + { + "properties": { + "ownershipType": { + "enum": ["Managed Freehold", "Commonhold"] }, - "wholeFreeholdForSale": { - "title": "Is the entire freehold being sold?", - "description": "If not, describe the share for sale (e.g. Ground floor flat only)", - "$ref": "#/$defs/yesNoDetailIfNo" + "annualServiceCharge": { + "baspiRef": "A1.5.1", + "lawSocietyRef": "TA6/10.1", + "ntsRef": "A1.6", + "RDSRef": "TenureAgreements/ServiceCharges", + "title": "Amount of current annual service charge/estate rentcharge/maintenance contribution (£)", + "type": "number" }, - "managedFreeholdOrCommonhold": { - "title": "Managed Freehold or Commonhold", - "type": "object", - "properties": { - "isManagedFreeholdOrCommonhold": { - "title": "Is the Freehold a Managed Freehold or Commonhold?", - "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.", - "type": "string", - "enum": ["Neither", "Managed Freehold", "Commonhold"] - } - }, - "required": ["isManagedFreeholdOrCommonhold"], - "dependencies": { - "isManagedFreeholdOrCommonhold": { - "oneOf": [ - { - "properties": { - "isManagedFreeholdOrCommonhold": { - "enum": ["Neither"] - } - }, - "additionalProperties": false - }, - { - "properties": { - "isManagedFreeholdOrCommonhold": { - "enum": ["Managed Freehold", "Commonhold"] - }, - "annualServiceCharge": { - "baspiRef": "A1.5.1", - "lawSocietyRef": "TA6/10.1", - "ntsRef": "A1.6", - "RDSRef": "TenureAgreements/ServiceCharges", - "title": "Amount of current annual service charge/estate rentcharge/maintenance contribution (£)", - "type": "number" - }, - "largeAdditionalExpense": { - "baspiRef": "A1.5.2", - "lawSocietyRef": "TA6/10.1", - "RDSRef": "TenureAgreements/Repairs,TenureAgreements/ServicesCharges/Breakdown", - "title": "Have you received notice of any large expense in addition to the annual payment?", - "$ref": "#/$defs/yesNoDetailIfYes", - "description": "If yes, please provide details and confirm whether there is a reserve fund or sinking fund which will cover the cost of the works." - }, - "additionalFeesOnSale": { - "baspiRef": "A1.5.3", - "lawSocietyRef": "TA6/10.1", - "RDSRef": "TenureAgreements/LegalCosts/Actual, TenureAgreements/LegalCosts/Estimated", - "title": "Additional fees payable on sale (£)", - "type": "number" - }, - "freeholderContactDetails": { - "baspiRef": "A1.5.4", - "lawSocietyRef": "TA7/4.1a", - "RDSRef": "TenureAgreements/Assignor", - "title": "The contact details of the freeholder or rentcharge owner", - "$ref": "#/$defs/contactDetails" - }, - "managingAgentContactDetails": { - "baspiRef": "A1.5.5", - "lawSocietyRef": "TA7/4.1b", - "RDSRef": "Participants/Role", - "title": "The contact details of the managing agent", - "$ref": "#/$defs/contactDetails" - }, - "managementCompanyDirectorRequirement": { - "baspiRef": "A1.5.6", - "RDSRef": "Property/Flags", - "title": "Is the owner of the property required to become a director in a management company for the maintenance of shared amenities?", - "$ref": "#/$defs/yesNo" - } - }, - "required": [ - "annualServiceCharge", - "largeAdditionalExpense", - "additionalFeesOnSale", - "freeholderContactDetails", - "managingAgentContactDetails", - "managementCompanyDirectorRequirement" - ], - "additionalProperties": false - } - ] - } - } + "largeAdditionalExpense": { + "baspiRef": "A1.5.2", + "lawSocietyRef": "TA6/10.1", + "RDSRef": "TenureAgreements/Repairs,TenureAgreements/ServicesCharges/Breakdown", + "title": "Have you received notice of any large expense in addition to the annual payment?", + "$ref": "#/$defs/yesNoDetailIfYes", + "description": "If yes, please provide details and confirm whether there is a reserve fund or sinking fund which will cover the cost of the works." + }, + "additionalFeesOnSale": { + "baspiRef": "A1.5.3", + "lawSocietyRef": "TA6/10.1", + "RDSRef": "TenureAgreements/LegalCosts/Actual, TenureAgreements/LegalCosts/Estimated", + "title": "Additional fees payable on sale (£)", + "type": "number" + }, + "freeholderContactDetails": { + "baspiRef": "A1.5.4", + "lawSocietyRef": "TA7/4.1a", + "RDSRef": "TenureAgreements/Assignor", + "title": "The contact details of the freeholder or rentcharge owner", + "$ref": "#/$defs/contactDetails" + }, + "managingAgentContactDetails": { + "baspiRef": "A1.5.5", + "lawSocietyRef": "TA7/4.1a", + "RDSRef": "Participants/Role", + "title": "The contact details of the managing agent", + "$ref": "#/$defs/contactDetails" + }, + "managementCompanyDirectorRequirement": { + "baspiRef": "A1.5.6", + "RDSRef": "Property/Flags", + "title": "Is the owner of the property required to become a director in a management company for the maintenance of shared amenities?", + "$ref": "#/$defs/yesNo" } }, "required": [ - "wholeFreeholdForSale", - "managedFreeholdOrCommonhold" + "annualServiceCharge", + "largeAdditionalExpense", + "additionalFeesOnSale", + "freeholderContactDetails", + "managingAgentContactDetails", + "managementCompanyDirectorRequirement" ], "additionalProperties": false }, @@ -338,8 +314,7 @@ "sharedOwnershipPercentage", "sharedOwnershipRent", "sharedOwnershipRentFrequency" - ], - "additionalProperties": false + ] } ] } From 6eedbd12993f526d3b8e7d8d7572a7826502bb37 Mon Sep 17 00:00:00 2001 From: Ed Molyneux Date: Fri, 11 Nov 2022 07:48:11 +0000 Subject: [PATCH 2/7] Remove pesky additional properties again --- package.json | 2 +- src/schemas/v1/material-facts.json | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 495af13..809e1b4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@pdtf/schemas", - "version": "0.11.0-1", + "version": "0.11.0-2", "description": "Property Data Trust Framework Schemas and Utilities", "main": "index.js", "directories": { diff --git a/src/schemas/v1/material-facts.json b/src/schemas/v1/material-facts.json index f4289c0..e296764 100644 --- a/src/schemas/v1/material-facts.json +++ b/src/schemas/v1/material-facts.json @@ -196,8 +196,7 @@ "description": "If not, describe the share for sale (e.g. Ground floor flat only)", "$ref": "#/$defs/yesNoDetailIfNo" }, - "required": ["wholeFreeholdForSale"], - "additionalProperties": false + "required": ["wholeFreeholdForSale"] }, { "properties": { @@ -255,8 +254,7 @@ "freeholderContactDetails", "managingAgentContactDetails", "managementCompanyDirectorRequirement" - ], - "additionalProperties": false + ] }, { "properties": { @@ -402,8 +400,7 @@ "freeholderContactDetails", "managingAgentContactDetails", "managementCompanyDirectorRequirement" - ], - "additionalProperties": false + ] }, { "properties": { @@ -417,8 +414,7 @@ "minLength": 1 } }, - "required": ["otherOwnershipDetails"], - "additionalProperties": false + "required": ["otherOwnershipDetails"] } ] } From b93a22937fc2348193d615244cfc7ac4b6f0f99c Mon Sep 17 00:00:00 2001 From: Ed Molyneux Date: Fri, 11 Nov 2022 08:08:52 +0000 Subject: [PATCH 3/7] Fix nesting --- package.json | 2 +- src/schemas/v1/material-facts.json | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 809e1b4..4e6ae9b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@pdtf/schemas", - "version": "0.11.0-2", + "version": "0.11.0-3", "description": "Property Data Trust Framework Schemas and Utilities", "main": "index.js", "directories": { diff --git a/src/schemas/v1/material-facts.json b/src/schemas/v1/material-facts.json index e296764..6c534e2 100644 --- a/src/schemas/v1/material-facts.json +++ b/src/schemas/v1/material-facts.json @@ -189,13 +189,13 @@ "properties": { "ownershipType": { "enum": ["Freehold"] + }, + "wholeFreeholdForSale": { + "title": "Is the entire freehold being sold?", + "description": "If not, describe the share for sale (e.g. Ground floor flat only)", + "$ref": "#/$defs/yesNoDetailIfNo" } }, - "wholeFreeholdForSale": { - "title": "Is the entire freehold being sold?", - "description": "If not, describe the share for sale (e.g. Ground floor flat only)", - "$ref": "#/$defs/yesNoDetailIfNo" - }, "required": ["wholeFreeholdForSale"] }, { From 2d6577954cb9157e4dc213efcb31c46b35eca31e Mon Sep 17 00:00:00 2001 From: Ed Molyneux Date: Fri, 11 Nov 2022 08:55:19 +0000 Subject: [PATCH 4/7] Add missing title --- package.json | 2 +- src/schemas/v1/legal-information.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 4e6ae9b..3095fd8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@pdtf/schemas", - "version": "0.11.0-3", + "version": "0.11.0-4", "description": "Property Data Trust Framework Schemas and Utilities", "main": "index.js", "directories": { diff --git a/src/schemas/v1/legal-information.json b/src/schemas/v1/legal-information.json index d9acf17..23b5c0b 100644 --- a/src/schemas/v1/legal-information.json +++ b/src/schemas/v1/legal-information.json @@ -20,6 +20,7 @@ "properties": { "legalOwners": { "baspiRef": "B1", + "title": "Legal Owners", "type": "object", "properties": { "namesOfLegalOwners": { From 5a8caefa304612f56db5f2dc7e6f26eec2c5dde2 Mon Sep 17 00:00:00 2001 From: Ed Molyneux Date: Fri, 11 Nov 2022 14:26:00 +0000 Subject: [PATCH 5/7] Fixes #23 --- index.js | 20 +- src/schemas/v1/legal-information.json | 1003 +++++----- src/schemas/v1/material-facts.json | 1732 ++++++++--------- src/schemas/v1/searches.json | 298 ++- .../v1/searches/drainage-and-water.json | 88 +- .../v1/searches/local-searches-required.json | 44 +- src/tests/pdtfVerifiedClaims.test.js | 1 + 7 files changed, 1524 insertions(+), 1662 deletions(-) diff --git a/index.js b/index.js index 0731551..9ed52f3 100644 --- a/index.js +++ b/index.js @@ -37,6 +37,7 @@ const ajv = new Ajv({ allErrors: true, // schema contains additional baspiRef and RDSRef metadata which is not strictly valid strictSchema: false, + discriminator: true, }); // Adds date formats among other types to the validator. addFormats(ajv); @@ -45,18 +46,14 @@ const validator = ajv.compile(transactionSchema); const getSubschema = (path) => { const pathArray = path.split("/").slice(1); - if (pathArray.length < 1) { - return transactionSchema; - } - + if (pathArray.length < 1) return transactionSchema; return pathArray.reduce((schema, pathElement) => { if (schema.type === "array") return schema.items; if (schema.properties[pathElement]) return schema.properties[pathElement]; - const dependencies = schema.dependencies; - if (dependencies) { + const discriminator = schema.discriminator?.propertyName; + if (discriminator) { // only single dependency discriminator, oneOf keyword is supported - const dependencyDiscriminator = Object.keys(dependencies)[0]; - const oneOfs = dependencies[dependencyDiscriminator].oneOf; + const oneOfs = schema.oneOf; const matchingOneOf = oneOfs.find( (oneOf) => oneOf["properties"][pathElement] ); @@ -112,11 +109,10 @@ const getTitleAtPath = (schema, path, rootPath = path) => { subSchema = schema.items; return getTitleAtPath(subSchema, subPath, rootPath); } - const dependencies = schema.dependencies; - if (dependencies) { + const discriminator = schema.discriminator?.propertyName; + if (discriminator) { // only single dependency discriminator, oneOf keyword is supported - const dependencyDiscriminator = Object.keys(dependencies)[0]; - const oneOfs = dependencies[dependencyDiscriminator].oneOf; + const oneOfs = schema.oneOf; const matchingOneOf = oneOfs.find( (oneOf) => oneOf["properties"][propertyName] ); diff --git a/src/schemas/v1/legal-information.json b/src/schemas/v1/legal-information.json index 23b5c0b..d3c6c7d 100644 --- a/src/schemas/v1/legal-information.json +++ b/src/schemas/v1/legal-information.json @@ -78,38 +78,34 @@ ] } }, - "dependencies": { - "capacity": { - "oneOf": [ - { - "properties": { - "capacity": { - "enum": ["Legal Owner", "Mortgagee in Possession"] - } - }, - "additionalProperties": false + "discriminator": { "propertyName": "capacity" }, + "oneOf": [ + { + "properties": { + "capacity": { + "enum": ["Legal Owner", "Mortgagee in Possession"] + } + } + }, + { + "properties": { + "capacity": { + "enum": [ + "Personal Representative for a Deceased Owner", + "Under Power of Attorney", + "Other" + ] }, - { - "properties": { - "capacity": { - "enum": [ - "Personal Representative for a Deceased Owner", - "Under Power of Attorney", - "Other" - ] - }, - "sellersCapacityDetails": { - "baspiRef": "B1.4", - "RDSRef": "Participants/OtherDocumentation", - "title": "Please provide details and provide any probate, grant of representation or power of attorney ", - "type": "string" - } - }, - "required": ["sellersCapacityDetails"] + "sellersCapacityDetails": { + "baspiRef": "B1.4", + "RDSRef": "Participants/OtherDocumentation", + "title": "Please provide details and provide any probate, grant of representation or power of attorney ", + "type": "string" } - ] + }, + "required": ["sellersCapacityDetails"] } - } + ] }, "legalBoundaries": { "baspiRef": "B2.1", @@ -266,78 +262,86 @@ } }, "required": ["hasSolarPanels"], - "dependencies": { - "hasSolarPanels": { - "oneOf": [ - { - "properties": { - "hasSolarPanels": { - "enum": ["No"] - } - }, - "additionalProperties": false + "discriminator": { "propertyName": "hasSolarPanels" }, + "oneOf": [ + { + "properties": { + "hasSolarPanels": { + "enum": ["No"] + } + } + }, + { + "properties": { + "hasSolarPanels": { + "enum": ["Yes"] }, - { - "properties": { - "hasSolarPanels": { - "enum": ["Yes"] - }, - "yearInstalled": { - "baspiRef": "B4.3.1", - "lawSocietyRef": "TA6/4.6a", - "RDSRef": "Objects/Installation", - "title": "What year were they installed?", - "type": "number" - }, - "panelsOwnedOutright": { - "baspiRef": "", - "lawSocietyRef": "TA6/4.6b", - "RDSRef": "Objects/Ownership", - "title": "Do you own the panels, and all equipment related to them, outright?", - "$ref": "#/$defs/yesNoDetailIfNo", - "description": "If no, provide details of who owns them and the relevant documentation" - }, - "panelProviderLease": { - "baspiRef": "B4.3.2", - "lawSocietyRef": "TA6/4.6c", - "RDSRef": "Objects/Ownership", - "title": "Is there an existing long lease of the roof/air space granted to a panel provider?", - "$ref": "#/$defs/yesNoDetailIfYes", - "description": "If yes, please supply copies of the relevant documents and the name of the provider" - }, - "lastMaintained": { - "baspiRef": "B4.3.4", - "RDSRef": "Objects/Servicing", - "title": "When was the system last maintained or serviced?", - "type": "string", - "format": "date" - }, - "inGoodWorkingOrder": { - "baspiRef": "B4.3.5", - "RDSRef": "Objects/isNotWorking=yes|no|true|false", - "title": "Is the system in good working order to your satisfaction?", - "$ref": "#/$defs/yesNoDetailIfNo" - }, - "isConnectedToNationalGrid": { - "baspiRef": "B4.3.6", - "RDSRef": "Objects/isExternallyConnected=yes|no|true|false,Connection,Objects/ExternalConnection", - "title": "Is the system connected to the National Grid e.g. for feed-in tariffs (FiT) or Smart Export Guarantee (SEG)", - "type": "string", - "enum": ["Yes (FiT)", "Yes (SEG)", "No"] - } - }, - "required": [ - "yearInstalled", - "panelsOwnedOutright", - "panelProviderLease", - "lastMaintained", - "inGoodWorkingOrder", - "isConnectedToNationalGrid" - ] + "yearInstalled": { + "baspiRef": "B4.3.1", + "lawSocietyRef": "TA6/4.6a", + "RDSRef": "Objects/Installation", + "title": "What year were they installed?", + "type": "number" + }, + "panelsOwnedOutright": { + "baspiRef": "", + "lawSocietyRef": "TA6/4.6b", + "RDSRef": "Objects/Ownership", + "title": "Do you own the panels, and all equipment related to them, outright?", + "$ref": "#/$defs/yesNoDetailIfNo", + "description": "If no, provide details of who owns them and the relevant documentation" + }, + "panelProviderLease": { + "baspiRef": "B4.3.2", + "lawSocietyRef": "TA6/4.6c", + "RDSRef": "Objects/Ownership", + "title": "Is there an existing long lease of the roof/air space granted to a panel provider?", + "$ref": "#/$defs/yesNoDetailIfYes", + "description": "If yes, please supply copies of the relevant documents and the name of the provider" + }, + "lastMaintained": { + "baspiRef": "B4.3.4", + "RDSRef": "Objects/Servicing", + "title": "When was the system last maintained or serviced?", + "type": "string", + "format": "date" + }, + "inGoodWorkingOrder": { + "baspiRef": "B4.3.5", + "RDSRef": "Objects/isNotWorking=yes|no|true|false", + "title": "Is the system in good working order to your satisfaction?", + "$ref": "#/$defs/yesNoDetailIfNo" + }, + "isConnectedToNationalGrid": { + "baspiRef": "B4.3.6", + "RDSRef": "Objects/isExternallyConnected=yes|no|true|false,Connection,Objects/ExternalConnection", + "title": "Is the system connected to the National Grid e.g. for feed-in tariffs (FiT) or Smart Export Guarantee (SEG)", + "type": "string", + "enum": ["Yes (FiT)", "Yes (SEG)", "No"] + }, + "photovoltaicMeterPanelLocation": { + "baspiRef": "B4.7", + "RDSRef": "Objects/class='meters|valve|stopcock'&access=?&accessLocation=?", + "title": "Please describe, or attach a photograph of, the location of any photovoltaic panel meter", + "type": "string" + }, + "photovoltaicBatteriesLocation": { + "baspiRef": "B4.8", + "RDSRef": "Objects/class='meters|valve|stopcock'&access=?&accessLocation=?", + "title": "Please describe, or attach a photograph of, the location of any photovoltaic batteries", + "type": "string" } + }, + "required": [ + "yearInstalled", + "panelsOwnedOutright", + "panelProviderLease", + "lastMaintained", + "inGoodWorkingOrder", + "isConnectedToNationalGrid" ] } - } + ] }, "electricityMeterLocation": { "baspiRef": "B4.4", @@ -359,18 +363,6 @@ "RDSRef": "Objects/class='meters|valve|stopcock'&access=?&accessLocation=?", "title": "Please describe, or attach a photograph of, the location of any stopcock and water meter", "type": "string" - }, - "photovoltaicMeterPanelLocation": { - "baspiRef": "B4.7", - "RDSRef": "Objects/class='meters|valve|stopcock'&access=?&accessLocation=?", - "title": "Please describe, or attach a photograph of, the location of any photovoltaic panel meter", - "type": "string" - }, - "photovoltaicBatteriesLocation": { - "baspiRef": "B4.8", - "RDSRef": "Objects/class='meters|valve|stopcock'&access=?&accessLocation=?", - "title": "Please describe, or attach a photograph of, the location of any photovoltaic batteries", - "type": "string" } } }, @@ -386,53 +378,49 @@ "enum": ["Yes", "No"] } }, - "dependencies": { - "hasSmartHomeSystems": { - "oneOf": [ - { - "properties": { - "hasSmartHomeSystems": { - "enum": ["No"] - } - }, - "additionalProperties": false + "discriminator": { "propertyName": "hasSmartHomeSystems" }, + "oneOf": [ + { + "properties": { + "hasSmartHomeSystems": { + "enum": ["No"] + } + } + }, + { + "properties": { + "hasSmartHomeSystems": { + "enum": ["Yes"] }, - { - "properties": { - "hasSmartHomeSystems": { - "enum": ["Yes"] - }, - "heatingAndPower": { - "title": "Heating and Power", - "description": "E.g. remote boiler control, solar panels, EV charging point, power storage, indoor or outdoor lighting systems", - "$ref": "#/$defs/yesNoDetailIfYes" - }, - "security": { - "title": "Security", - "description": "E.g. CCTV, alarms, barriers, doors or gates", - "$ref": "#/$defs/yesNoDetailIfYes" - }, - "entertainment": { - "title": "Entertainment", - "description": "E.g. integrated audio system", - "$ref": "#/$defs/yesNoDetailIfYes" - }, - "handoverOnCompletion": { - "title": "Confirm that you will handover details on day of completion", - "description": "Confirm that you will provide the buyer with the login, password and link to user instructions for the relevant system(s). [NOTE: It is recommended that you reset the password before handing it over to avoid security issues by passing on your own password.]", - "type": "boolean" - } - }, - "required": [ - "heatingAndPower", - "security", - "entertainment", - "handoverOnCompletion" - ] + "heatingAndPower": { + "title": "Heating and Power", + "description": "E.g. remote boiler control, solar panels, EV charging point, power storage, indoor or outdoor lighting systems", + "$ref": "#/$defs/yesNoDetailIfYes" + }, + "security": { + "title": "Security", + "description": "E.g. CCTV, alarms, barriers, doors or gates", + "$ref": "#/$defs/yesNoDetailIfYes" + }, + "entertainment": { + "title": "Entertainment", + "description": "E.g. integrated audio system", + "$ref": "#/$defs/yesNoDetailIfYes" + }, + "handoverOnCompletion": { + "title": "Confirm that you will handover details on day of completion", + "description": "Confirm that you will provide the buyer with the login, password and link to user instructions for the relevant system(s). [NOTE: It is recommended that you reset the password before handing it over to avoid security issues by passing on your own password.]", + "type": "boolean" } + }, + "required": [ + "heatingAndPower", + "security", + "entertainment", + "handoverOnCompletion" ] } - } + ] }, "guaranteesWarrantiesAndIndemnityInsurances": { "baspiRef": "B5", @@ -450,132 +438,128 @@ "enum": ["Yes", "No"] } }, - "dependencies": { - "hasValidGuaranteesOrWarranties": { - "oneOf": [ - { - "properties": { - "hasValidGuaranteesOrWarranties": { - "enum": ["No"] - } - }, - "additionalProperties": false + "discriminator": { "propertyName": "hasValidGuaranteesOrWarranties" }, + "oneOf": [ + { + "properties": { + "hasValidGuaranteesOrWarranties": { + "enum": ["No"] + } + } + }, + { + "properties": { + "hasValidGuaranteesOrWarranties": { + "enum": ["Yes"] }, - { - "properties": { - "hasValidGuaranteesOrWarranties": { - "enum": ["Yes"] - }, - "newHomeWarranty": { - "baspiRef": "B5.1.1", - "RDSRef": "Certificates", - "lawSocietyRef": "TA6/5.1a", - "title": "New Home Warranty (NHBC or similar)", - "$ref": "#/$defs/yesNoDetailIfYes", - "description": "If yes, please confirm the name of the warranty provider and the date of the warranty:" - }, - "roofingWork": { - "baspiRef": "B5.1.2", - "RDSRef": "Certificates", - "lawSocietyRef": "TA6/5.1f", - "title": "Roofing work", - "$ref": "#/$defs/yesNo" - }, - "dampProofingTreatment": { - "baspiRef": "B5.1.3", - "RDSRef": "Certificates", - "lawSocietyRef": "TA6/5.1b", - "title": "Damp proofing treatment", - "$ref": "#/$defs/yesNo" - }, - "timberRotOrInfestationTreatment": { - "baspiRef": "B5.1.4", - "RDSRef": "Certificates", - "lawSocietyRef": "TA6/5.1c", - "title": "Timber rot or infestation treatment", - "$ref": "#/$defs/yesNo" - }, - "centralHeatingAndorPlumbing": { - "baspiRef": "B5.1.5", - "RDSRef": "Certificates", - "lawSocietyRef": "TA6/5.1g", - "title": "Central heating and/or plumbing", - "$ref": "#/$defs/yesNo" - }, - "doubleGlazing": { - "baspiRef": "B5.1.6", - "RDSRef": "Certificates", - "lawSocietyRef": "TA6/5.1d", - "title": "Double glazing (windows, doors, roof lights, conservatory etc)", - "$ref": "#/$defs/yesNo" - }, - "electricalRepairOrInstallation": { - "baspiRef": "B5.1.7", - "RDSRef": "Certificates", - "lawSocietyRef": "TA6/5.1e", - "title": "Electrical repair or installation", - "$ref": "#/$defs/yesNo" - }, - "subsidenceWork": { - "baspiRef": "B5.1.8", - "RDSRef": "Certificates", - "lawSocietyRef": "TA6/5.1h", - "title": "Underpinning or other preventative work and/or remedial action relating to subsidence", - "$ref": "#/$defs/yesNo" - }, - "solarPanels": { - "baspiRef": "B5.1.9", - "RDSRef": "Certificates", - "title": "Solar panels", - "$ref": "#/$defs/yesNo" - }, - "otherGuarantees": { - "baspiRef": "B5.1.10", - "RDSRef": "Certificates", - "lawSocietyRef": "TA6/5.1i", - "title": "Other Guarantees or Warranties", - "$ref": "#/$defs/yesNo" - }, - "willLeaveGuaranteePaperwork": { - "baspiRef": "B5.1.11", - "RDSRef": "Property/Flags", - "title": "Please confirm that you will leave all paperwork relating to any guarantee or warranty at the property when you move out", - "type": "boolean" - }, - "outstandingClaimsOrApplications": { - "baspiRef": "B5.2", - "RDSRef": "Certificates", - "lawSocietyRef": "TA6/5.2", - "title": "Are there any outstanding claims or current applications relating to any of the above?", - "$ref": "#/$defs/yesNoDetailIfYes" - }, - "titleDefectInsurance": { - "baspiRef": "B5.3", - "RDSRef": "Certificates", - "title": "Do you have any title defect insurance policies e.g. for breach of planning permission, buildings regulations, restrictions, chancel repair etc", - "$ref": "#/$defs/yesNoDetailIfYes", - "description": "If yes, please provide details and give the policy to your property lawyer" - } - }, - "required": [ - "newHomeWarranty", - "roofingWork", - "dampProofingTreatment", - "timberRotOrInfestationTreatment", - "centralHeatingAndorPlumbing", - "doubleGlazing", - "electricalRepairOrInstallation", - "subsidenceWork", - "solarPanels", - "otherGuarantees", - "willLeaveGuaranteePaperwork", - "outstandingClaimsOrApplications", - "titleDefectInsurance" - ] + "newHomeWarranty": { + "baspiRef": "B5.1.1", + "RDSRef": "Certificates", + "lawSocietyRef": "TA6/5.1a", + "title": "New Home Warranty (NHBC or similar)", + "$ref": "#/$defs/yesNoDetailIfYes", + "description": "If yes, please confirm the name of the warranty provider and the date of the warranty:" + }, + "roofingWork": { + "baspiRef": "B5.1.2", + "RDSRef": "Certificates", + "lawSocietyRef": "TA6/5.1f", + "title": "Roofing work", + "$ref": "#/$defs/yesNo" + }, + "dampProofingTreatment": { + "baspiRef": "B5.1.3", + "RDSRef": "Certificates", + "lawSocietyRef": "TA6/5.1b", + "title": "Damp proofing treatment", + "$ref": "#/$defs/yesNo" + }, + "timberRotOrInfestationTreatment": { + "baspiRef": "B5.1.4", + "RDSRef": "Certificates", + "lawSocietyRef": "TA6/5.1c", + "title": "Timber rot or infestation treatment", + "$ref": "#/$defs/yesNo" + }, + "centralHeatingAndorPlumbing": { + "baspiRef": "B5.1.5", + "RDSRef": "Certificates", + "lawSocietyRef": "TA6/5.1g", + "title": "Central heating and/or plumbing", + "$ref": "#/$defs/yesNo" + }, + "doubleGlazing": { + "baspiRef": "B5.1.6", + "RDSRef": "Certificates", + "lawSocietyRef": "TA6/5.1d", + "title": "Double glazing (windows, doors, roof lights, conservatory etc)", + "$ref": "#/$defs/yesNo" + }, + "electricalRepairOrInstallation": { + "baspiRef": "B5.1.7", + "RDSRef": "Certificates", + "lawSocietyRef": "TA6/5.1e", + "title": "Electrical repair or installation", + "$ref": "#/$defs/yesNo" + }, + "subsidenceWork": { + "baspiRef": "B5.1.8", + "RDSRef": "Certificates", + "lawSocietyRef": "TA6/5.1h", + "title": "Underpinning or other preventative work and/or remedial action relating to subsidence", + "$ref": "#/$defs/yesNo" + }, + "solarPanels": { + "baspiRef": "B5.1.9", + "RDSRef": "Certificates", + "title": "Solar panels", + "$ref": "#/$defs/yesNo" + }, + "otherGuarantees": { + "baspiRef": "B5.1.10", + "RDSRef": "Certificates", + "lawSocietyRef": "TA6/5.1i", + "title": "Other Guarantees or Warranties", + "$ref": "#/$defs/yesNo" + }, + "willLeaveGuaranteePaperwork": { + "baspiRef": "B5.1.11", + "RDSRef": "Property/Flags", + "title": "Please confirm that you will leave all paperwork relating to any guarantee or warranty at the property when you move out", + "type": "boolean" + }, + "outstandingClaimsOrApplications": { + "baspiRef": "B5.2", + "RDSRef": "Certificates", + "lawSocietyRef": "TA6/5.2", + "title": "Are there any outstanding claims or current applications relating to any of the above?", + "$ref": "#/$defs/yesNoDetailIfYes" + }, + "titleDefectInsurance": { + "baspiRef": "B5.3", + "RDSRef": "Certificates", + "title": "Do you have any title defect insurance policies e.g. for breach of planning permission, buildings regulations, restrictions, chancel repair etc", + "$ref": "#/$defs/yesNoDetailIfYes", + "description": "If yes, please provide details and give the policy to your property lawyer" } + }, + "required": [ + "newHomeWarranty", + "roofingWork", + "dampProofingTreatment", + "timberRotOrInfestationTreatment", + "centralHeatingAndorPlumbing", + "doubleGlazing", + "electricalRepairOrInstallation", + "subsidenceWork", + "solarPanels", + "otherGuarantees", + "willLeaveGuaranteePaperwork", + "outstandingClaimsOrApplications", + "titleDefectInsurance" ] } - } + ] }, "occupiers": { "baspiRef": "B6", @@ -607,121 +591,115 @@ "enum": ["Yes", "No"] } }, - "dependencies": { - "hasOthersAged17OrOver": { - "oneOf": [ - { + "discriminator": { "propertyName": "hasOthersAged17OrOver" }, + "oneOf": [ + { + "properties": { + "hasOthersAged17OrOver": { + "enum": ["No"] + } + } + }, + { + "properties": { + "hasOthersAged17OrOver": { + "enum": ["Yes"] + }, + "aged17OrOverNames": { + "lawSocietyRef": "TA6/11.3", + "title": "Please specify their full names and ages.", + "type": "array", + "minItems": 1, + "items": { + "type": "object", + "properties": { + "firstName": { + "title": "First Name", + "type": "string", + "minLength": 1 + }, + "middleNames": { + "title": "Middle name(s) if any", + "type": "string" + }, + "lastName": { + "title": "Last Name", + "type": "string", + "minLength": 1 + }, + "age": { + "title": "Age", + "type": "integer" + } + }, + "required": ["firstName", "lastName", "age"] + } + }, + "aged17OrOverTenantsOrLodgers": { + "baspiRef": "B6.1", + "RDSRef": "Property/Flags", + "lawSocietyRef": "TA6/11.4", + "title": "Are any of them tenants or lodgers?", + "$ref": "#/$defs/yesNo" + }, + "vacantPossession": { + "lawSocietyRef": "TA6/11.5", + "type": "object", + "required": ["soldWithVacantPossession"], "properties": { - "hasOthersAged17OrOver": { - "enum": ["No"] + "soldWithVacantPossession": { + "type": "string", + "title": "Is the property being sold with vacant possession?", + "enum": ["Yes", "No"] } }, - "additionalProperties": false - }, - { - "properties": { - "hasOthersAged17OrOver": { - "enum": ["Yes"] - }, - "aged17OrOverNames": { - "lawSocietyRef": "TA6/11.3", - "title": "Please specify their full names and ages.", - "type": "array", - "minItems": 1, - "items": { - "type": "object", - "properties": { - "firstName": { - "title": "First Name", - "type": "string", - "minLength": 1 - }, - "middleNames": { - "title": "Middle name(s) if any", - "type": "string" - }, - "lastName": { - "title": "Last Name", - "type": "string", - "minLength": 1 - }, - "age": { - "title": "Age", - "type": "integer" - } - }, - "required": ["firstName", "lastName", "age"] + "discriminator": { + "propertyName": "soldWithVacantPossession" + }, + "oneOf": [ + { + "properties": { + "soldWithVacantPossession": { + "enum": ["No"] + } } }, - "aged17OrOverTenantsOrLodgers": { - "baspiRef": "B6.1", - "RDSRef": "Property/Flags", - "lawSocietyRef": "TA6/11.4", - "title": "Are any of them tenants or lodgers?", - "$ref": "#/$defs/yesNo" - }, - "vacantPossession": { - "lawSocietyRef": "TA6/11.5", - "type": "object", - "required": ["soldWithVacantPossession"], + { "properties": { "soldWithVacantPossession": { - "type": "string", - "title": "Is the property being sold with vacant possession?", - "enum": ["Yes", "No"] + "enum": ["Yes"] + }, + "aged17OrOverAgreedToLeave": { + "baspiRef": "B6.4", + "RDSRef": "RightsHolders,TenureAgreements,Notifications", + "lawSocietyRef": "TA6/11.5a", + "title": "Have all occupiers aged 17 or over agreed to leave prior to completion?", + "$ref": "#/$defs/yesNo" + }, + "aged17OrOverWillSignToConfirmWillVacate": { + "baspiRef": "B6.4", + "RDSRef": "RightsHolders,TenureAgreements,Notifications", + "lawSocietyRef": "TA6/11.5b", + "title": "Have all occupiers aged 17 or over, agreed to sign the sale contract?", + "$ref": "#/$defs/yesNoDetailIfNo", + "description": "If 'No', please supply other evidence that the property will be vacant on completion." } }, - "dependencies": { - "soldWithVacantPossession": { - "oneOf": [ - { - "properties": { - "soldWithVacantPossession": { - "enum": ["No"] - } - }, - "additionalProperties": false - }, - { - "properties": { - "soldWithVacantPossession": { - "enum": ["Yes"] - }, - "aged17OrOverAgreedToLeave": { - "baspiRef": "B6.4", - "RDSRef": "RightsHolders,TenureAgreements,Notifications", - "lawSocietyRef": "TA6/11.5a", - "title": "Have all occupiers aged 17 or over agreed to leave prior to completion?", - "$ref": "#/$defs/yesNo" - }, - "aged17OrOverWillSignToConfirmWillVacate": { - "baspiRef": "B6.4", - "RDSRef": "RightsHolders,TenureAgreements,Notifications", - "lawSocietyRef": "TA6/11.5b", - "title": "Have all occupiers aged 17 or over, agreed to sign the sale contract?", - "$ref": "#/$defs/yesNoDetailIfNo", - "description": "If 'No', please supply other evidence that the property will be vacant on completion." - } - }, - "required": [ - "aged17OrOverAgreedToLeave", - "aged17OrOverWillSignToConfirmWillVacate" - ] - } - ] - } - } + "required": [ + "aged17OrOverAgreedToLeave", + "aged17OrOverWillSignToConfirmWillVacate" + ] } - }, - "required": [ - "aged17OrOverNames", - "aged17OrOverTenantsOrLodgers", - "vacantPossession" ] } + }, + "required": [ + "aged17OrOverNames", + "aged17OrOverTenantsOrLodgers", + "vacantPossession" ] } - } + ] } } }, @@ -759,39 +737,32 @@ } }, "required": ["yesNo"], - "dependencies": { - "yesNo": { - "oneOf": [ - { - "properties": { - "yesNo": { - "enum": ["No"] - } - }, - "additionalProperties": false + "discriminator": { "propertyName": "yesNo" }, + "oneOf": [ + { + "properties": { + "yesNo": { + "enum": ["No"] + } + } + }, + { + "properties": { + "yesNo": { + "enum": ["Yes"] }, - { - "properties": { - "yesNo": { - "enum": ["Yes"] - }, - "propertyDependencyType": { - "type": "string", - "enum": ["Sale", "Purchase", "Remortgage"] - }, - "dependentPropertyAddress": { - "title": "Address", - "$ref": "#/$defs/address" - } - }, - "required": [ - "propertyDependencyType", - "dependentPropertyAddress" - ] + "propertyDependencyType": { + "type": "string", + "enum": ["Sale", "Purchase", "Remortgage"] + }, + "dependentPropertyAddress": { + "title": "Address", + "$ref": "#/$defs/address" } - ] + }, + "required": ["propertyDependencyType", "dependentPropertyAddress"] } - } + ] }, "moveRestrictionDates": { "baspiRef": "B7.3", @@ -808,35 +779,31 @@ } }, "required": ["yesNo"], - "dependencies": { - "yesNo": { - "oneOf": [ - { - "properties": { - "yesNo": { - "enum": ["No"] - } - }, - "additionalProperties": false + "discriminator": { "propertyName": "yesNo" }, + "oneOf": [ + { + "properties": { + "yesNo": { + "enum": ["No"] + } + } + }, + { + "properties": { + "yesNo": { + "enum": ["Yes"] }, - { - "properties": { - "yesNo": { - "enum": ["Yes"] - }, - "restrictedDates": { - "type": "array", - "items": { - "type": "string", - "format": "date" - } - } - }, - "required": ["restrictedDates"] + "restrictedDates": { + "type": "array", + "items": { + "type": "string", + "format": "date" + } } - ] + }, + "required": ["restrictedDates"] } - } + ] }, "sufficientToRepayAllMortgages": { "lawSocietyRef": "TA6/14.3", @@ -856,32 +823,28 @@ } }, "required": ["yesNo"], - "dependencies": { - "yesNo": { - "oneOf": [ - { - "properties": { - "yesNo": { - "enum": ["No"] - } - }, - "additionalProperties": false + "discriminator": { "propertyName": "yesNo" }, + "oneOf": [ + { + "properties": { + "yesNo": { + "enum": ["No"] + } + } + }, + { + "properties": { + "yesNo": { + "enum": ["Yes"] }, - { - "properties": { - "yesNo": { - "enum": ["Yes"] - }, - "willHandoverLogbook": { - "title": "Please confirm that on completion you will transfer it to the new owner", - "type": "boolean" - } - }, - "required": ["willHandoverLogbook"] + "willHandoverLogbook": { + "title": "Please confirm that on completion you will transfer it to the new owner", + "type": "boolean" } - ] + }, + "required": ["willHandoverLogbook"] } - } + ] } } }, @@ -929,33 +892,29 @@ } }, "required": ["yesNo"], - "dependencies": { - "yesNo": { - "oneOf": [ - { - "properties": { - "yesNo": { - "enum": ["No"] - } - }, - "additionalProperties": false + "discriminator": { "propertyName": "yesNo" }, + "oneOf": [ + { + "properties": { + "yesNo": { + "enum": ["No"] + } + } + }, + { + "properties": { + "yesNo": { + "enum": ["Yes"] }, - { - "properties": { - "yesNo": { - "enum": ["Yes"] - }, - "details": { - "title": "Details", - "type": "string", - "minLength": 1 - } - }, - "required": ["details"] + "details": { + "title": "Details", + "type": "string", + "minLength": 1 } - ] + }, + "required": ["details"] } - } + ] }, "yesNoDetailIfNo": { "type": "object", @@ -967,33 +926,29 @@ } }, "required": ["yesNo"], - "dependencies": { - "yesNo": { - "oneOf": [ - { - "properties": { - "yesNo": { - "enum": ["Yes"] - } - }, - "additionalProperties": false + "discriminator": { "propertyName": "yesNo" }, + "oneOf": [ + { + "properties": { + "yesNo": { + "enum": ["Yes"] + } + } + }, + { + "properties": { + "yesNo": { + "enum": ["No"] }, - { - "properties": { - "yesNo": { - "enum": ["No"] - }, - "details": { - "title": "Details", - "type": "string", - "minLength": 1 - } - }, - "required": ["details"] + "details": { + "title": "Details", + "type": "string", + "minLength": 1 } - ] + }, + "required": ["details"] } - } + ] }, "yesNoNotRequiredDetailIfNoNotRequired": { "type": "object", @@ -1005,33 +960,29 @@ } }, "required": ["yesNo"], - "dependencies": { - "yesNo": { - "oneOf": [ - { - "properties": { - "yesNo": { - "enum": ["Yes"] - } - }, - "additionalProperties": false + "discriminator": { "propertyName": "yesNo" }, + "oneOf": [ + { + "properties": { + "yesNo": { + "enum": ["Yes"] + } + } + }, + { + "properties": { + "yesNo": { + "enum": ["No", "Not required"] }, - { - "properties": { - "yesNo": { - "enum": ["No", "Not required"] - }, - "details": { - "title": "Please outline the reasons why", - "type": "string", - "minLength": 1 - } - }, - "required": ["details"] + "details": { + "title": "Please outline the reasons why", + "type": "string", + "minLength": 1 } - ] + }, + "required": ["details"] } - } + ] }, "address": { "type": "object", diff --git a/src/schemas/v1/material-facts.json b/src/schemas/v1/material-facts.json index 6c534e2..90a86c3 100644 --- a/src/schemas/v1/material-facts.json +++ b/src/schemas/v1/material-facts.json @@ -182,243 +182,236 @@ ] } }, - "dependencies": { - "ownershipType": { - "oneOf": [ - { - "properties": { - "ownershipType": { - "enum": ["Freehold"] - }, - "wholeFreeholdForSale": { - "title": "Is the entire freehold being sold?", - "description": "If not, describe the share for sale (e.g. Ground floor flat only)", - "$ref": "#/$defs/yesNoDetailIfNo" - } - }, - "required": ["wholeFreeholdForSale"] + "discriminator": { "propertyName": "ownershipType" }, + "oneOf": [ + { + "properties": { + "ownershipType": { + "enum": ["Freehold"] }, - { + "wholeFreeholdForSale": { + "title": "Is the entire freehold being sold?", + "description": "If not, describe the share for sale (e.g. Ground floor flat only)", + "$ref": "#/$defs/yesNoDetailIfNo" + } + }, + "required": ["wholeFreeholdForSale"] + }, + { + "properties": { + "ownershipType": { + "enum": ["Managed Freehold", "Commonhold"] + }, + "annualServiceCharge": { + "baspiRef": "A1.5.1", + "lawSocietyRef": "TA6/10.1", + "ntsRef": "A1.6", + "RDSRef": "TenureAgreements/ServiceCharges", + "title": "Amount of current annual service charge/estate rentcharge/maintenance contribution (£)", + "type": "number" + }, + "largeAdditionalExpense": { + "baspiRef": "A1.5.2", + "lawSocietyRef": "TA6/10.1", + "RDSRef": "TenureAgreements/Repairs,TenureAgreements/ServicesCharges/Breakdown", + "title": "Have you received notice of any large expense in addition to the annual payment?", + "$ref": "#/$defs/yesNoDetailIfYes", + "description": "If yes, please provide details and confirm whether there is a reserve fund or sinking fund which will cover the cost of the works." + }, + "additionalFeesOnSale": { + "baspiRef": "A1.5.3", + "lawSocietyRef": "TA6/10.1", + "RDSRef": "TenureAgreements/LegalCosts/Actual, TenureAgreements/LegalCosts/Estimated", + "title": "Additional fees payable on sale (£)", + "type": "number" + }, + "freeholderContactDetails": { + "baspiRef": "A1.5.4", + "lawSocietyRef": "TA7/4.1a", + "RDSRef": "TenureAgreements/Assignor", + "title": "The contact details of the freeholder or rentcharge owner", + "$ref": "#/$defs/contactDetails" + }, + "managingAgentContactDetails": { + "baspiRef": "A1.5.5", + "lawSocietyRef": "TA7/4.1a", + "RDSRef": "Participants/Role", + "title": "The contact details of the managing agent", + "$ref": "#/$defs/contactDetails" + }, + "managementCompanyDirectorRequirement": { + "baspiRef": "A1.5.6", + "RDSRef": "Property/Flags", + "title": "Is the owner of the property required to become a director in a management company for the maintenance of shared amenities?", + "$ref": "#/$defs/yesNo" + } + }, + "required": [ + "annualServiceCharge", + "largeAdditionalExpense", + "additionalFeesOnSale", + "freeholderContactDetails", + "managingAgentContactDetails", + "managementCompanyDirectorRequirement" + ] + }, + { + "properties": { + "ownershipType": { + "enum": ["Leasehold"] + }, + "sharedOwnership": { + "title": "Shared ownership", + "type": "object", "properties": { - "ownershipType": { - "enum": ["Managed Freehold", "Commonhold"] - }, - "annualServiceCharge": { - "baspiRef": "A1.5.1", - "lawSocietyRef": "TA6/10.1", - "ntsRef": "A1.6", - "RDSRef": "TenureAgreements/ServiceCharges", - "title": "Amount of current annual service charge/estate rentcharge/maintenance contribution (£)", - "type": "number" - }, - "largeAdditionalExpense": { - "baspiRef": "A1.5.2", - "lawSocietyRef": "TA6/10.1", - "RDSRef": "TenureAgreements/Repairs,TenureAgreements/ServicesCharges/Breakdown", - "title": "Have you received notice of any large expense in addition to the annual payment?", - "$ref": "#/$defs/yesNoDetailIfYes", - "description": "If yes, please provide details and confirm whether there is a reserve fund or sinking fund which will cover the cost of the works." - }, - "additionalFeesOnSale": { - "baspiRef": "A1.5.3", - "lawSocietyRef": "TA6/10.1", - "RDSRef": "TenureAgreements/LegalCosts/Actual, TenureAgreements/LegalCosts/Estimated", - "title": "Additional fees payable on sale (£)", - "type": "number" - }, - "freeholderContactDetails": { - "baspiRef": "A1.5.4", - "lawSocietyRef": "TA7/4.1a", - "RDSRef": "TenureAgreements/Assignor", - "title": "The contact details of the freeholder or rentcharge owner", - "$ref": "#/$defs/contactDetails" - }, - "managingAgentContactDetails": { - "baspiRef": "A1.5.5", - "lawSocietyRef": "TA7/4.1a", - "RDSRef": "Participants/Role", - "title": "The contact details of the managing agent", - "$ref": "#/$defs/contactDetails" - }, - "managementCompanyDirectorRequirement": { - "baspiRef": "A1.5.6", - "RDSRef": "Property/Flags", - "title": "Is the owner of the property required to become a director in a management company for the maintenance of shared amenities?", - "$ref": "#/$defs/yesNo" + "isSharedOwnership": { + "title": "Is the property under Shared Owenership or a Part-buy Part-rent arrangement?", + "type": "string", + "enum": ["Yes", "No"] } }, - "required": [ - "annualServiceCharge", - "largeAdditionalExpense", - "additionalFeesOnSale", - "freeholderContactDetails", - "managingAgentContactDetails", - "managementCompanyDirectorRequirement" - ] - }, - { - "properties": { - "ownershipType": { - "enum": ["Leasehold"] + "required": ["isSharedOwnership"], + "discriminator": { "propertyName": "isSharedOwnership" }, + "oneOf": [ + { + "properties": { + "isSharedOwnership": { + "enum": ["No"] + } + } }, - "sharedOwnership": { - "title": "Shared ownership", - "type": "object", + { "properties": { "isSharedOwnership": { - "title": "Is the property under Shared Owenership or a Part-buy Part-rent arrangement?", + "enum": ["Yes"] + }, + "sharedOwnershipPercentage": { + "ntsRef": "A1.7", + "title": "Shared ownership percentage", + "type": "integer", + "minimum": 5, + "exclusiveMaximum": 100 + }, + "sharedOwnershipRent": { + "ntsRef": "A1.7", + "title": "Shared ownership rent (£)", + "type": "number", + "minimum": 0 + }, + "sharedOwnershipRentFrequency": { + "ntsRef": "A1.7", + "title": "Shared ownership rent frequency", "type": "string", - "enum": ["Yes", "No"] + "enum": ["Yearly", "Monthly", "Weekly"] } }, - "required": ["isSharedOwnership"], - "dependencies": { - "isSharedOwnership": { - "oneOf": [ - { - "properties": { - "isSharedOwnership": { - "enum": ["No"] - } - }, - "additionalProperties": false - }, - { - "properties": { - "isSharedOwnership": { - "enum": ["Yes"] - }, - "sharedOwnershipPercentage": { - "ntsRef": "A1.7", - "title": "Shared ownership percentage", - "type": "integer", - "minimum": 5, - "exclusiveMaximum": 100 - }, - "sharedOwnershipRent": { - "ntsRef": "A1.7", - "title": "Shared ownership rent (£)", - "type": "number", - "minimum": 0 - }, - "sharedOwnershipRentFrequency": { - "ntsRef": "A1.7", - "title": "Shared ownership rent frequency", - "type": "string", - "enum": ["Yearly", "Monthly", "Weekly"] - } - }, - "required": [ - "sharedOwnershipPercentage", - "sharedOwnershipRent", - "sharedOwnershipRentFrequency" - ] - } - ] - } - } - }, - "startYearOfLease": { - "baspiRef": "A1.4.1b", - "ntsRef": "A1.2", - "title": "Year that the lease commenced", - "type": "integer", - "minimum": 1000 - }, - "lengthOfLeaseInYears": { - "baspiRef": "A1.4.1a", - "ntsRef": "A1.3", - "title": "Length of lease (years)", - "type": "integer" - }, - "currentGroundRent": { - "baspiRef": "A1.4.2", - "ntsRef": "A1.4", - "RDSRef": "TenureAgreements/RentPayable/Value", - "lawSocietyRef": "TA7/1.2a", - "title": "Current annual ground rent (£)", - "type": "number" - }, - "rentIncrease": { - "baspiRef": "A1.4.3", - "ntsRef": "A1.5", - "RDSRef": "TenureAgreement/isRentChangeable, TenureAgreements/RentChanges", - "title": "Does the ground rent increase?", - "$ref": "#/$defs/yesNoDetailIfYes", - "description": "Please provide full details of the ground rent increase e.g. how often and by how much and when the next increase is due." - }, - "annualServiceCharge": { - "baspiRef": "A1.5.1", - "ntsRef": "A1.6", - "RDSRef": "TenureAgreements/ServiceCharges", - "title": "Amount of current annual service charge/estate rentcharge/maintenance contribution (£)", - "type": "number" - }, - "largeAdditionalExpense": { - "baspiRef": "A1.5.2", - "RDSRef": "TenureAgreements/Repairs,TenureAgreements/ServicesCharges/Breakdown", - "title": "Have you received notice of any large expense in addition to the annual payment?", - "$ref": "#/$defs/yesNoDetailIfYes", - "description": "If yes, please provide details and confirm whether there is a reserve fund or sinking fund which will cover the cost of the works." - }, - "additionalFeesOnSale": { - "baspiRef": "A1.5.3", - "RDSRef": "TenureAgreements/LegalCosts/Actual, TenureAgreements/LegalCosts/Estimated", - "title": "Additional fees payable on sale (£)", - "type": "number" - }, - "freeholderContactDetails": { - "baspiRef": "A1.5.4", - "lawSocietyRef": "TA7/4.1a", - "RDSRef": "TenureAgreements/Assignor", - "title": "The name, address and email address of the freeholder or rentcharge owner", - "$ref": "#/$defs/contactDetails" - }, - "managingAgentContactDetails": { - "baspiRef": "A1.5.5", - "lawSocietyRef": "TA7/4.1b", - "RDSRef": "Participants/Role", - "title": "The name, address and email address of the managing agent", - "$ref": "#/$defs/contactDetails" - }, - "managementCompanyDirectorRequirement": { - "baspiRef": "A1.5.6", - "RDSRef": "Property/Flags", - "title": "Is the owner of the property required to become a director in a management company for the maintenance of shared amenities?", - "$ref": "#/$defs/yesNo" + "required": [ + "sharedOwnershipPercentage", + "sharedOwnershipRent", + "sharedOwnershipRentFrequency" + ] } - }, - "required": [ - "sharedOwnership", - "startYearOfLease", - "lengthOfLeaseInYears", - "currentGroundRent", - "rentIncrease", - "annualServiceCharge", - "largeAdditionalExpense", - "additionalFeesOnSale", - "freeholderContactDetails", - "managingAgentContactDetails", - "managementCompanyDirectorRequirement" ] }, - { - "properties": { - "ownershipType": { - "enum": ["Other"] - }, - "otherOwnershipDetails": { - "baspiRef": "A1.3.2", - "title": "Details of the ownership type", - "type": "string", - "minLength": 1 - } - }, - "required": ["otherOwnershipDetails"] + "startYearOfLease": { + "baspiRef": "A1.4.1b", + "ntsRef": "A1.2", + "title": "Year that the lease commenced", + "type": "integer", + "minimum": 1000 + }, + "lengthOfLeaseInYears": { + "baspiRef": "A1.4.1a", + "ntsRef": "A1.3", + "title": "Length of lease (years)", + "type": "integer" + }, + "currentGroundRent": { + "baspiRef": "A1.4.2", + "ntsRef": "A1.4", + "RDSRef": "TenureAgreements/RentPayable/Value", + "lawSocietyRef": "TA7/1.2a", + "title": "Current annual ground rent (£)", + "type": "number" + }, + "rentIncrease": { + "baspiRef": "A1.4.3", + "ntsRef": "A1.5", + "RDSRef": "TenureAgreement/isRentChangeable, TenureAgreements/RentChanges", + "title": "Does the ground rent increase?", + "$ref": "#/$defs/yesNoDetailIfYes", + "description": "Please provide full details of the ground rent increase e.g. how often and by how much and when the next increase is due." + }, + "annualServiceCharge": { + "baspiRef": "A1.5.1", + "ntsRef": "A1.6", + "RDSRef": "TenureAgreements/ServiceCharges", + "title": "Amount of current annual service charge/estate rentcharge/maintenance contribution (£)", + "type": "number" + }, + "largeAdditionalExpense": { + "baspiRef": "A1.5.2", + "RDSRef": "TenureAgreements/Repairs,TenureAgreements/ServicesCharges/Breakdown", + "title": "Have you received notice of any large expense in addition to the annual payment?", + "$ref": "#/$defs/yesNoDetailIfYes", + "description": "If yes, please provide details and confirm whether there is a reserve fund or sinking fund which will cover the cost of the works." + }, + "additionalFeesOnSale": { + "baspiRef": "A1.5.3", + "RDSRef": "TenureAgreements/LegalCosts/Actual, TenureAgreements/LegalCosts/Estimated", + "title": "Additional fees payable on sale (£)", + "type": "number" + }, + "freeholderContactDetails": { + "baspiRef": "A1.5.4", + "lawSocietyRef": "TA7/4.1a", + "RDSRef": "TenureAgreements/Assignor", + "title": "The name, address and email address of the freeholder or rentcharge owner", + "$ref": "#/$defs/contactDetails" + }, + "managingAgentContactDetails": { + "baspiRef": "A1.5.5", + "lawSocietyRef": "TA7/4.1b", + "RDSRef": "Participants/Role", + "title": "The name, address and email address of the managing agent", + "$ref": "#/$defs/contactDetails" + }, + "managementCompanyDirectorRequirement": { + "baspiRef": "A1.5.6", + "RDSRef": "Property/Flags", + "title": "Is the owner of the property required to become a director in a management company for the maintenance of shared amenities?", + "$ref": "#/$defs/yesNo" } + }, + "required": [ + "sharedOwnership", + "startYearOfLease", + "lengthOfLeaseInYears", + "currentGroundRent", + "rentIncrease", + "annualServiceCharge", + "largeAdditionalExpense", + "additionalFeesOnSale", + "freeholderContactDetails", + "managingAgentContactDetails", + "managementCompanyDirectorRequirement" ] + }, + { + "properties": { + "ownershipType": { + "enum": ["Other"] + }, + "otherOwnershipDetails": { + "baspiRef": "A1.3.2", + "title": "Details of the ownership type", + "type": "string", + "minLength": 1 + } + }, + "required": ["otherOwnershipDetails"] } - } + ] }, "parking": { "baspiRef": "A1.6", @@ -455,42 +448,38 @@ ] } }, - "dependencies": { - "parkingArrangementsType": { - "oneOf": [ - { - "properties": { - "parkingArrangementsType": { - "enum": [ - "Garage", - "Allocated parking space", - "Driveway", - "On street", - "Resident permit", - "Metered parking", - "Communal parking", - "None" - ] - } - }, - "additionalProperties": false + "discriminator": { "propertyName": "parkingArrangementsType" }, + "oneOf": [ + { + "properties": { + "parkingArrangementsType": { + "enum": [ + "Garage", + "Allocated parking space", + "Driveway", + "On street", + "Resident permit", + "Metered parking", + "Communal parking", + "None" + ] + } + } + }, + { + "properties": { + "parkingArrangementsType": { + "enum": ["Other"] }, - { - "properties": { - "parkingArrangementsType": { - "enum": ["Other"] - }, - "otherParkingType": { - "baspiRef": "A1.6.2", - "title": "Please describe the other parking arrangements", - "type": "string" - } - }, - "required": ["otherParkingType"] + "otherParkingType": { + "baspiRef": "A1.6.2", + "title": "Please describe the other parking arrangements", + "type": "string" } - ] + }, + "required": ["otherParkingType"] } - } + ] }, "controlledParking": { "lawSocietyRef": "TA6/9.2", @@ -545,41 +534,37 @@ } }, "required": ["yesNo"], - "dependencies": { - "yesNo": { - "oneOf": [ - { - "properties": { - "yesNo": { - "enum": ["No"] - } - }, - "additionalProperties": false + "discriminator": { "propertyName": "yesNo" }, + "oneOf": [ + { + "properties": { + "yesNo": { + "enum": ["No"] + } + } + }, + { + "properties": { + "yesNo": { + "enum": ["Yes"] }, - { - "properties": { - "yesNo": { - "enum": ["Yes"] - }, - "details": { - "title": "Details", - "RDSRef": "Protections", - "type": "string", - "minLength": 1 - }, - "workCarriedOut": { - "RDSRef": "WorksAlterationsChanges", - "lawSocietyRef": "TA6/4.8a", - "title": "If work has been carried out to any trees which are protected by the order, were the relevant consents obtained? Provide any relevant documentation", - "type": "string", - "minLength": 1 - } - }, - "required": ["details", "workCarriedOut"] + "details": { + "title": "Details", + "RDSRef": "Protections", + "type": "string", + "minLength": 1 + }, + "workCarriedOut": { + "RDSRef": "WorksAlterationsChanges", + "lawSocietyRef": "TA6/4.8a", + "title": "If work has been carried out to any trees which are protected by the order, were the relevant consents obtained? Provide any relevant documentation", + "type": "string", + "minLength": 1 } - ] + }, + "required": ["details", "workCarriedOut"] } - } + ] } } }, @@ -740,41 +725,37 @@ } }, "required": ["yesNo"], - "dependencies": { - "yesNo": { - "oneOf": [ - { - "properties": { - "yesNo": { - "enum": ["No"] - } - }, - "additionalProperties": false + "discriminator": { "propertyName": "yesNo" }, + "oneOf": [ + { + "properties": { + "yesNo": { + "enum": ["No"] + } + } + }, + { + "properties": { + "yesNo": { + "enum": ["Yes"] }, - { - "properties": { - "yesNo": { - "enum": ["Yes"] - }, - "details": { - "RDSRef": "Buildings,BuildingsSections/StructureAuthorised,BuildingsSections/StructureUnauthorised", - "title": "Details", - "type": "string", - "minLength": 1 - }, - "willingToInsure": { - "baspiRef": "A3.8", - "RDSRef": "Insurance/isWillingToProvide", - "title": "If yes, confirm whether you will pay for an insurance policy if the Local Authority still have power to enforce the breach. Your property lawyer can obtain a quote for you. (If you already have a policy please give it to your property lawyer and include details in Question 6 of Section B) [*Note: It will be a term of the insurance policy that the Local Authority is not contacted so if you have contacted the Local Authority the option of indemnity insurance will not be available.]", - "type": "string", - "enum": ["Yes", "No"] - } - }, - "required": ["details", "willingToInsure"] + "details": { + "RDSRef": "Buildings,BuildingsSections/StructureAuthorised,BuildingsSections/StructureUnauthorised", + "title": "Details", + "type": "string", + "minLength": 1 + }, + "willingToInsure": { + "baspiRef": "A3.8", + "RDSRef": "Insurance/isWillingToProvide", + "title": "If yes, confirm whether you will pay for an insurance policy if the Local Authority still have power to enforce the breach. Your property lawyer can obtain a quote for you. (If you already have a policy please give it to your property lawyer and include details in Question 6 of Section B) [*Note: It will be a term of the insurance policy that the Local Authority is not contacted so if you have contacted the Local Authority the option of indemnity insurance will not be available.]", + "type": "string", + "enum": ["Yes", "No"] } - ] + }, + "required": ["details", "willingToInsure"] } - } + ] }, "unresolvedPlanningIssues": { "baspiRef": "A3.7", @@ -790,41 +771,37 @@ } }, "required": ["yesNo"], - "dependencies": { - "yesNo": { - "oneOf": [ - { - "properties": { - "yesNo": { - "enum": ["No"] - } - }, - "additionalProperties": false + "discriminator": { "propertyName": "yesNo" }, + "oneOf": [ + { + "properties": { + "yesNo": { + "enum": ["No"] + } + } + }, + { + "properties": { + "yesNo": { + "enum": ["Yes"] }, - { - "properties": { - "yesNo": { - "enum": ["Yes"] - }, - "details": { - "RDSRef": "Buildings,BuildingsSections/StructureAuthorised,BuildingsSections/StructureUnauthorised", - "title": "Details", - "type": "string", - "minLength": 1 - }, - "willingToInsure": { - "baspiRef": "A3.8", - "RDSRef": "Insurance/isWillingToProvide", - "title": "If yes, confirm whether you will pay for an insurance policy if the Local Authority still have power to enforce the breach. Your property lawyer can obtain a quote for you. (If you already have a policy please give it to your property lawyer and include details in Question 6 of Section B) [*Note: It will be a term of the insurance policy that the Local Authority is not contacted so if you have contacted the Local Authority the option of indemnity insurance will not be available.]", - "type": "string", - "enum": ["Yes", "No"] - } - }, - "required": ["details", "willingToInsure"] + "details": { + "RDSRef": "Buildings,BuildingsSections/StructureAuthorised,BuildingsSections/StructureUnauthorised", + "title": "Details", + "type": "string", + "minLength": 1 + }, + "willingToInsure": { + "baspiRef": "A3.8", + "RDSRef": "Insurance/isWillingToProvide", + "title": "If yes, confirm whether you will pay for an insurance policy if the Local Authority still have power to enforce the breach. Your property lawyer can obtain a quote for you. (If you already have a policy please give it to your property lawyer and include details in Question 6 of Section B) [*Note: It will be a term of the insurance policy that the Local Authority is not contacted so if you have contacted the Local Authority the option of indemnity insurance will not be available.]", + "type": "string", + "enum": ["Yes", "No"] } - ] + }, + "required": ["details", "willingToInsure"] } - } + ] } } }, @@ -1004,185 +981,175 @@ "enum": ["Yes", "To be connected", "No"] } }, - "dependencies": { - "yesNo": { - "oneOf": [ - { + "discriminator": { "propertyName": "yesNo" }, + "oneOf": [ + { + "properties": { + "yesNo": { + "enum": ["No"] + }, + "sustainableDrainageSystem": { + "baspiRef": "A7.2.1", + "RDSRef": "Services/OtherServices/{description=?,type=?},Services/OtherServices/Installed|Upgraded|Replaced|Serviced|Certificates", + "title": "Sustainable Drainage System", + "$ref": "#/$defs/yesNoConnectedSupplier" + }, + "septicTank": { + "baspiRef": "A7.2.2", + "RDSRef": "Services/OtherServices/{description=?,type=?},Services/OtherServices/Installed|Upgraded|Replaced|Serviced|Certificates", + "lawSocietyRef": "TA6/12.5", + "title": "Septic tank", + "$ref": "#/$defs/yesNoDetailIfYes", + "description": "If yes, please specify date replaced or updated and date last emptied" + }, + "cesspit": { + "baspiRef": "A7.2.3", + "RDSRef": "Services/OtherServices/{description=?,type=?},Services/OtherServices/Installed|Upgraded|Replaced|Serviced|Certificates", + "lawSocietyRef": "TA6/12.7", + "title": "Cesspit", + "$ref": "#/$defs/yesNoDetailIfYes", + "description": "If yes, please specify date last emptied" + }, + "sewerageTreatmentPlant": { + "baspiRef": "A7.2.4", + "RDSRef": "Services/OtherServices/{description=?,type=?},Services/OtherServices/Installed|Upgraded|Replaced|Serviced|Certificates", + "lawSocietyRef": "TA6/12.8", + "title": "Sewerage treatment plant", + "$ref": "#/$defs/yesNoDetailIfYes", + "description": "If yes, please specify date last serviced" + }, + "otherConnectedProperties": { + "baspiRef": "A7.2.5", + "RDSRef": "Services/OtherServices/SharedWith", + "lawSocietyRef": "TA6/12.6", + "title": "Do other properties connect to the septic tank, cesspit or sewerage treatment plant?", + "$ref": "#/$defs/yesNoDetailIfYes", + "description": "If yes, provide details of the properties sharing the system and explain how maintenance of the system is arranged and paid for." + }, + "yearSystemInstalled": { + "lawSocietyRef": "TA6/12.9", + "title": "What year was the system installed?", + "type": "integer", + "minimum": 1000 + }, + "plantOnOtherLand": { + "baspiRef": "A7.2.6", + "RDSRef": "Services/OtherServices/Located,Services/OtherServices/{access=?}", + "lawSocietyRef": "TA6/12.10", + "title": "Is any part of the septic tank, cesspit or sewerage treatment plant located on someone else’s land?", + "$ref": "#/$defs/yesNoDetailIfYes", + "description": "If yes, please supply a plan showing the location of the system and how access is obtained." + }, + "plantRegistered": { + "baspiRef": "A7.2.7", + "RDSRef": "Services/OtherServices/Certificates", + "title": "Is the septic tank, cesspit or sewerage treatment plant registered with the Environment Agency or exempted?", + "$ref": "#/$defs/yesNoDetailIfYes", + "description": "If yes, please supply the appropriate permit to discharge or exemption certificate" + }, + "plantDrainsIntoWaterway": { + "baspiRef": "A7.2.8", + "RDSRef": "Services/OtherServices/{isExternallyConnected='yes?true'}", + "title": "Does the septic tank, cesspit or sewerage treatment plant drain into a waterway (lake, river, stream etc)", + "type": "object", "properties": { "yesNo": { - "enum": ["No"] - }, - "sustainableDrainageSystem": { - "baspiRef": "A7.2.1", - "RDSRef": "Services/OtherServices/{description=?,type=?},Services/OtherServices/Installed|Upgraded|Replaced|Serviced|Certificates", - "title": "Sustainable Drainage System", - "$ref": "#/$defs/yesNoConnectedSupplier" - }, - "septicTank": { - "baspiRef": "A7.2.2", - "RDSRef": "Services/OtherServices/{description=?,type=?},Services/OtherServices/Installed|Upgraded|Replaced|Serviced|Certificates", - "lawSocietyRef": "TA6/12.5", - "title": "Septic tank", - "$ref": "#/$defs/yesNoDetailIfYes", - "description": "If yes, please specify date replaced or updated and date last emptied" - }, - "cesspit": { - "baspiRef": "A7.2.3", - "RDSRef": "Services/OtherServices/{description=?,type=?},Services/OtherServices/Installed|Upgraded|Replaced|Serviced|Certificates", - "lawSocietyRef": "TA6/12.7", - "title": "Cesspit", - "$ref": "#/$defs/yesNoDetailIfYes", - "description": "If yes, please specify date last emptied" - }, - "sewerageTreatmentPlant": { - "baspiRef": "A7.2.4", - "RDSRef": "Services/OtherServices/{description=?,type=?},Services/OtherServices/Installed|Upgraded|Replaced|Serviced|Certificates", - "lawSocietyRef": "TA6/12.8", - "title": "Sewerage treatment plant", - "$ref": "#/$defs/yesNoDetailIfYes", - "description": "If yes, please specify date last serviced" - }, - "otherConnectedProperties": { - "baspiRef": "A7.2.5", - "RDSRef": "Services/OtherServices/SharedWith", - "lawSocietyRef": "TA6/12.6", - "title": "Do other properties connect to the septic tank, cesspit or sewerage treatment plant?", - "$ref": "#/$defs/yesNoDetailIfYes", - "description": "If yes, provide details of the properties sharing the system and explain how maintenance of the system is arranged and paid for." - }, - "yearSystemInstalled": { - "lawSocietyRef": "TA6/12.9", - "title": "What year was the system installed?", - "type": "integer", - "minimum": 1000 - }, - "plantOnOtherLand": { - "baspiRef": "A7.2.6", - "RDSRef": "Services/OtherServices/Located,Services/OtherServices/{access=?}", - "lawSocietyRef": "TA6/12.10", - "title": "Is any part of the septic tank, cesspit or sewerage treatment plant located on someone else’s land?", - "$ref": "#/$defs/yesNoDetailIfYes", - "description": "If yes, please supply a plan showing the location of the system and how access is obtained." - }, - "plantRegistered": { - "baspiRef": "A7.2.7", - "RDSRef": "Services/OtherServices/Certificates", - "title": "Is the septic tank, cesspit or sewerage treatment plant registered with the Environment Agency or exempted?", - "$ref": "#/$defs/yesNoDetailIfYes", - "description": "If yes, please supply the appropriate permit to discharge or exemption certificate" - }, - "plantDrainsIntoWaterway": { - "baspiRef": "A7.2.8", - "RDSRef": "Services/OtherServices/{isExternallyConnected='yes?true'}", - "title": "Does the septic tank, cesspit or sewerage treatment plant drain into a waterway (lake, river, stream etc)", - "type": "object", + "type": "string", + "title": "", + "enum": [ + "Yes", + "No, the effluent is discharged through a soakaway system." + ] + } + }, + "required": ["yesNo"], + "discriminator": { "propertyName": "yesNo" }, + "oneOf": [ + { "properties": { "yesNo": { - "type": "string", - "title": "", "enum": [ - "Yes", "No, the effluent is discharged through a soakaway system." ] } - }, - "required": ["yesNo"], - "dependencies": { + } + }, + { + "properties": { "yesNo": { - "oneOf": [ - { - "properties": { - "yesNo": { - "enum": [ - "No, the effluent is discharged through a soakaway system." - ] - } - }, - "additionalProperties": false - }, - { - "properties": { - "yesNo": { - "enum": ["Yes"] - }, - "dischargeCompliesWithGBR": { - "baspiRef": "A7.2.9", - "RDSRef": "Services/OtherServices/ExternalConnections/Flags", - "title": "Does it comply with the General Binding Rules for discharge into a waterway?", - "type": "string", - "enum": [ - "Yes", - "No, it does not comply with the rules for discharge into a waterway." - ] - } - }, - "required": ["dischargeCompliesWithGBR"] - } + "enum": ["Yes"] + }, + "dischargeCompliesWithGBR": { + "baspiRef": "A7.2.9", + "RDSRef": "Services/OtherServices/ExternalConnections/Flags", + "title": "Does it comply with the General Binding Rules for discharge into a waterway?", + "type": "string", + "enum": [ + "Yes", + "No, it does not comply with the rules for discharge into a waterway." ] } - } + }, + "required": ["dischargeCompliesWithGBR"] } - }, - "additionalProperties": false, - "required": [ - "sustainableDrainageSystem", - "septicTank", - "cesspit", - "sewerageTreatmentPlant", - "otherConnectedProperties", - "yearSystemInstalled", - "plantOnOtherLand", - "plantRegistered", - "plantDrainsIntoWaterway" ] + } + }, + "required": [ + "sustainableDrainageSystem", + "septicTank", + "cesspit", + "sewerageTreatmentPlant", + "otherConnectedProperties", + "yearSystemInstalled", + "plantOnOtherLand", + "plantRegistered", + "plantDrainsIntoWaterway" + ] + }, + { + "properties": { + "yesNo": { + "enum": ["Yes"] }, - { - "properties": { - "yesNo": { - "enum": ["Yes"] - }, - "supplier": { - "title": "Supplier (if known)", - "type": "string", - "minLength": 1 - }, - "maintenanceAgreements": { - "baspiRef": "A7.2", - "RDSRef": "Services/Certificates,Services/OtherServices/Certificates", - "title": "Do you have any licences, maintenance agreements, contracts or service agreements in relation to this service?", - "$ref": "#/$defs/yesNoDetailIfYes" - } - }, - "additionalProperties": false, - "required": ["maintenanceAgreements"] + "supplier": { + "title": "Supplier (if known)", + "type": "string", + "minLength": 1 }, - { - "properties": { - "yesNo": { - "enum": ["To be connected"] - }, - "dateToBeConnected": { - "title": "Date to be connected", - "type": "string", - "format": "date" - }, - "supplier": { - "title": "Supplier (if known)", - "type": "string" - }, - "maintenanceAgreements": { - "baspiRef": "A7.2", - "RDSRef": "Services/Certificates,Services/OtherServices/Certificates", - "title": "Do you have any licences, maintenance agreements, contracts or service agreements in relation to this service?", - "$ref": "#/$defs/yesNoDetailIfYes" - } - }, - "additionalProperties": false, - "required": ["dateToBeConnected", "maintenanceAgreements"] + "maintenanceAgreements": { + "baspiRef": "A7.2", + "RDSRef": "Services/Certificates,Services/OtherServices/Certificates", + "title": "Do you have any licences, maintenance agreements, contracts or service agreements in relation to this service?", + "$ref": "#/$defs/yesNoDetailIfYes" } - ] + }, + "required": ["maintenanceAgreements"] + }, + { + "properties": { + "yesNo": { + "enum": ["To be connected"] + }, + "dateToBeConnected": { + "title": "Date to be connected", + "type": "string", + "format": "date" + }, + "supplier": { + "title": "Supplier (if known)", + "type": "string" + }, + "maintenanceAgreements": { + "baspiRef": "A7.2", + "RDSRef": "Services/Certificates,Services/OtherServices/Certificates", + "title": "Do you have any licences, maintenance agreements, contracts or service agreements in relation to this service?", + "$ref": "#/$defs/yesNoDetailIfYes" + } + }, + "required": ["dateToBeConnected", "maintenanceAgreements"] } - } + ] } } }, @@ -1297,118 +1264,110 @@ "enum": ["Yes", "No"] } }, - "dependencies": { - "hasCentralHeating": { - "oneOf": [ - { - "properties": { - "hasCentralHeating": { - "enum": ["No"] - } - }, - "additionalProperties": false + "discriminator": { "propertyName": "hasCentralHeating" }, + "oneOf": [ + { + "properties": { + "hasCentralHeating": { + "enum": ["No"] + } + } + }, + { + "properties": { + "hasCentralHeating": { + "enum": ["Yes"] }, - { + "centralHeatingDetails": { + "type": "object", + "title": "Central Heating Details", "properties": { - "hasCentralHeating": { - "enum": ["Yes"] - }, - "centralHeatingDetails": { + "centralHeatingFuel": { + "baspiRef": "A7.5.1", + "RDSRef": "Buildings|BuildingSections/Heating/isGas=no|yes|true|false", "type": "object", - "title": "Central Heating Details", + "title": "Central Heating Fuel", + "required": ["centralHeatingFuelType"], "properties": { - "centralHeatingFuel": { - "baspiRef": "A7.5.1", - "RDSRef": "Buildings|BuildingSections/Heating/isGas=no|yes|true|false", - "type": "object", - "title": "Central Heating Fuel", - "required": ["centralHeatingFuelType"], + "centralHeatingFuelType": { + "baspiRef": "A7.5.1a", + "lawSocietyRef": "TA6/12.3a", + "title": "What type of fuel does the system and boiler run on?", + "type": "string", + "enum": ["Gas", "Electricity", "Oil", "LPG", "Other"] + } + }, + "discriminator": { "propertyName": "centralHeatingFuelType" }, + "oneOf": [ + { "properties": { "centralHeatingFuelType": { - "baspiRef": "A7.5.1a", + "enum": ["Gas", "Electricity", "Oil", "LPG"] + } + } + }, + { + "properties": { + "centralHeatingFuelType": { + "enum": ["Other"] + }, + "otherCentralHeatingFuelType": { + "baspiRef": "A7.5.1b", "lawSocietyRef": "TA6/12.3a", - "title": "What type of fuel does the system and boiler run on?", + "title": "Please describe the other fuel type", "type": "string", - "enum": ["Gas", "Electricity", "Oil", "LPG", "Other"] + "minLength": 1 } }, - "dependencies": { - "centralHeatingFuelType": { - "oneOf": [ - { - "properties": { - "centralHeatingFuelType": { - "enum": ["Gas", "Electricity", "Oil", "LPG"] - } - }, - "additionalProperties": false - }, - { - "properties": { - "centralHeatingFuelType": { - "enum": ["Other"] - }, - "otherCentralHeatingFuelType": { - "baspiRef": "A7.5.1b", - "lawSocietyRef": "TA6/12.3a", - "title": "Please describe the other fuel type", - "type": "string", - "minLength": 1 - } - }, - "required": ["otherCentralHeatingFuelType"] - } - ] - } - } - }, - "centralHeatingInstalled": { - "baspiRef": "A7.5.2", - "RDSRef": "Objects/Installed", - "lawSocietyRef": "TA6/12.3b", - "title": "When was the heating system and boiler installed?", - "type": "string", - "format": "date" - }, - "boilerInstallationCertificate": { - "baspiRef": "A7.5.3", - "RDSRef": "Objects/Installation,Objects/Certificates", - "lawSocietyRef": "TA6/12.3b", - "title": "Was a gas boiler installed after 1st April 2005, or a solid fuel or oil boiler installed after 1st October 2010?", - "$ref": "#/$defs/yesNoDetailIfYes", - "description": "If yes, please supply a copy of the installation completion certificate from a competent person qualified under the relevant self-certification scheme e.g. HETAS etc" - }, - "heatingLastServiced": { - "baspiRef": "A7.5.4", - "RDSRef": "Objects/Maintenance", - "lawSocietyRef": "TA6/12.3d", - "title": "When was the heating system and boiler last serviced or maintained? Please provide a copy of the service or maintenance works report ", - "type": "string", - "format": "date" - }, - "heatingInGoodWorkingOrder": { - "baspiRef": "A7.5.6", - "RDSRef": "Objects/Condition=?", - "lawSocietyRef": "TA6/12.3c", - "title": "Is the heating system in good working order to your satisfaction?", - "$ref": "#/$defs/yesNoDetailIfNo", - "description": "If 'No' please provide details" + "required": ["otherCentralHeatingFuelType"] } - }, - "required": [ - "centralHeatingFuel", - "centralHeatingInstalled", - "boilerInstallationCertificate", - "heatingLastServiced", - "heatingInGoodWorkingOrder" ] + }, + "centralHeatingInstalled": { + "baspiRef": "A7.5.2", + "RDSRef": "Objects/Installed", + "lawSocietyRef": "TA6/12.3b", + "title": "When was the heating system and boiler installed?", + "type": "string", + "format": "date" + }, + "boilerInstallationCertificate": { + "baspiRef": "A7.5.3", + "RDSRef": "Objects/Installation,Objects/Certificates", + "lawSocietyRef": "TA6/12.3b", + "title": "Was a gas boiler installed after 1st April 2005, or a solid fuel or oil boiler installed after 1st October 2010?", + "$ref": "#/$defs/yesNoDetailIfYes", + "description": "If yes, please supply a copy of the installation completion certificate from a competent person qualified under the relevant self-certification scheme e.g. HETAS etc" + }, + "heatingLastServiced": { + "baspiRef": "A7.5.4", + "RDSRef": "Objects/Maintenance", + "lawSocietyRef": "TA6/12.3d", + "title": "When was the heating system and boiler last serviced or maintained? Please provide a copy of the service or maintenance works report ", + "type": "string", + "format": "date" + }, + "heatingInGoodWorkingOrder": { + "baspiRef": "A7.5.6", + "RDSRef": "Objects/Condition=?", + "lawSocietyRef": "TA6/12.3c", + "title": "Is the heating system in good working order to your satisfaction?", + "$ref": "#/$defs/yesNoDetailIfNo", + "description": "If 'No' please provide details" } }, - "required": ["centralHeatingDetails"] + "required": [ + "centralHeatingFuel", + "centralHeatingInstalled", + "boilerInstallationCertificate", + "heatingLastServiced", + "heatingInGoodWorkingOrder" + ] } - ] + }, + "required": ["centralHeatingDetails"] } - } + ] }, "insurance": { "baspiRef": "A8", @@ -1426,48 +1385,44 @@ "enum": ["Yes", "No"] } }, - "dependencies": { - "isInsured": { - "oneOf": [ - { - "properties": { - "isInsured": { - "enum": ["No"] - }, - "details": { - "title": "Why not?", - "type": "string", - "minLength": 1 - } - }, - "required": ["details"], - "additionalProperties": false + "discriminator": { "propertyName": "isInsured" }, + "oneOf": [ + { + "properties": { + "isInsured": { + "enum": ["No"] }, - { - "properties": { - "isInsured": { - "enum": ["Yes"] - }, - "difficultiesObtainingInsurance": { - "baspiRef": "A8.2", - "RDSRef": "Insurance/Flags,Insurance/refusalReason=?", - "lawSocietyRef": "TA6/6.4", - "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)", - "$ref": "#/$defs/yesNoDetailIfYes" - }, - "insuranceClaims": { - "baspiRef": "A8.3", - "RDSRef": "Insurance/Claims", - "lawSocietyRef": "TA6/6.5", - "title": "Have you ever made a claim against your building insurance in relation to the property?", - "$ref": "#/$defs/yesNoDetailIfYes" - } - }, - "required": ["difficultiesObtainingInsurance", "insuranceClaims"] + "details": { + "title": "Why not?", + "type": "string", + "minLength": 1 } - ] + }, + "required": ["details"] + }, + { + "properties": { + "isInsured": { + "enum": ["Yes"] + }, + "difficultiesObtainingInsurance": { + "baspiRef": "A8.2", + "RDSRef": "Insurance/Flags,Insurance/refusalReason=?", + "lawSocietyRef": "TA6/6.4", + "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)", + "$ref": "#/$defs/yesNoDetailIfYes" + }, + "insuranceClaims": { + "baspiRef": "A8.3", + "RDSRef": "Insurance/Claims", + "lawSocietyRef": "TA6/6.5", + "title": "Have you ever made a claim against your building insurance in relation to the property?", + "$ref": "#/$defs/yesNoDetailIfYes" + } + }, + "required": ["difficultiesObtainingInsurance", "insuranceClaims"] } - } + ] }, "boundaries": { "baspiRef": "A9", @@ -1644,79 +1599,76 @@ "enum": ["Yes", "No"] } }, - "dependencies": { - "hasBeenFlooded": { - "oneOf": [ - { - "properties": { - "hasBeenFlooded": { - "enum": ["No"] - } - } + "discriminator": { "propertyName": "hasBeenFlooded" }, + "oneOf": [ + { + "properties": { + "hasBeenFlooded": { + "enum": ["No"] + } + } + }, + { + "properties": { + "hasBeenFlooded": { + "enum": ["Yes"] }, - { + "details": { + "lawSocietyRef": "TA6/7.1", + "type": "string", + "minLength": 1 + }, + "typeOfFlooding": { + "baspiRef": "A11.1", + "RDSRef": "Sustainability/Environmental|Natural|Situational", + "lawSocietyRef": "TA6/7.2", + "title": "What type of flooding occurred?", + "type": "object", "properties": { - "hasBeenFlooded": { - "enum": ["Yes"] + "groundWater": { + "lawSocietyRef": "TA6/7.2a", + "title": "Ground water", + "$ref": "#/$defs/yesNo" }, - "details": { - "lawSocietyRef": "TA6/7.1", - "type": "string", - "minLength": 1 + "sewer": { + "lawSocietyRef": "TA6/7.2b", + "title": "Sewer", + "$ref": "#/$defs/yesNo" }, - "typeOfFlooding": { - "baspiRef": "A11.1", - "RDSRef": "Sustainability/Environmental|Natural|Situational", - "lawSocietyRef": "TA6/7.2", - "title": "What type of flooding occurred?", - "type": "object", - "properties": { - "groundWater": { - "lawSocietyRef": "TA6/7.2a", - "title": "Ground water", - "$ref": "#/$defs/yesNo" - }, - "sewer": { - "lawSocietyRef": "TA6/7.2b", - "title": "Sewer", - "$ref": "#/$defs/yesNo" - }, - "surfaceWater": { - "lawSocietyRef": "TA6/7.2c", - "title": "Surface water", - "$ref": "#/$defs/yesNo" - }, - "coastal": { - "lawSocietyRef": "TA6/7.2d", - "title": "Coastal flooding", - "$ref": "#/$defs/yesNo" - }, - "river": { - "lawSocietyRef": "TA6/7.2e", - "title": "River flooding", - "$ref": "#/$defs/yesNo" - }, - "other": { - "title": "Other", - "$ref": "#/$defs/yesNoDetailIfYes", - "description": "Please state" - } - }, - "required": [ - "groundWater", - "sewer", - "surfaceWater", - "coastal", - "river", - "other" - ] + "surfaceWater": { + "lawSocietyRef": "TA6/7.2c", + "title": "Surface water", + "$ref": "#/$defs/yesNo" + }, + "coastal": { + "lawSocietyRef": "TA6/7.2d", + "title": "Coastal flooding", + "$ref": "#/$defs/yesNo" + }, + "river": { + "lawSocietyRef": "TA6/7.2e", + "title": "River flooding", + "$ref": "#/$defs/yesNo" + }, + "other": { + "title": "Other", + "$ref": "#/$defs/yesNoDetailIfYes", + "description": "Please state" } }, - "required": ["typeOfFlooding", "details"] + "required": [ + "groundWater", + "sewer", + "surfaceWater", + "coastal", + "river", + "other" + ] } - ] + }, + "required": ["typeOfFlooding", "details"] } - } + ] }, "radon": { "baspiRef": "A11.1", @@ -1831,33 +1783,29 @@ } }, "required": ["yesNo"], - "dependencies": { - "yesNo": { - "oneOf": [ - { - "properties": { - "yesNo": { - "enum": ["No"] - } - }, - "additionalProperties": false + "discriminator": { "propertyName": "yesNo" }, + "oneOf": [ + { + "properties": { + "yesNo": { + "enum": ["No"] + } + } + }, + { + "properties": { + "yesNo": { + "enum": ["Yes"] }, - { - "properties": { - "yesNo": { - "enum": ["Yes"] - }, - "details": { - "title": "Details", - "type": "string", - "minLength": 1 - } - }, - "required": ["details"] + "details": { + "title": "Details", + "type": "string", + "minLength": 1 } - ] + }, + "required": ["details"] } - } + ] }, "yesNoDetailIfNo": { "type": "object", @@ -1869,33 +1817,29 @@ } }, "required": ["yesNo"], - "dependencies": { - "yesNo": { - "oneOf": [ - { - "properties": { - "yesNo": { - "enum": ["Yes"] - } - }, - "additionalProperties": false + "discriminator": { "propertyName": "yesNo" }, + "oneOf": [ + { + "properties": { + "yesNo": { + "enum": ["Yes"] + } + } + }, + { + "properties": { + "yesNo": { + "enum": ["No"] }, - { - "properties": { - "yesNo": { - "enum": ["No"] - }, - "details": { - "title": "Details", - "type": "string", - "minLength": 1 - } - }, - "required": ["details"] + "details": { + "title": "Details", + "type": "string", + "minLength": 1 } - ] + }, + "required": ["details"] } - } + ] }, "yesNoNotRequiredDetailIfNo": { "type": "object", @@ -1907,33 +1851,29 @@ } }, "required": ["yesNo"], - "dependencies": { - "yesNo": { - "oneOf": [ - { - "properties": { - "yesNo": { - "enum": ["Yes", "Not required"] - } - }, - "additionalProperties": false + "discriminator": { "propertyName": "yesNo" }, + "oneOf": [ + { + "properties": { + "yesNo": { + "enum": ["Yes", "Not required"] + } + } + }, + { + "properties": { + "yesNo": { + "enum": ["No"] }, - { - "properties": { - "yesNo": { - "enum": ["No"] - }, - "details": { - "title": "Please outline the reasons why", - "type": "string", - "minLength": 1 - } - }, - "required": ["details"] + "details": { + "title": "Please outline the reasons why", + "type": "string", + "minLength": 1 } - ] + }, + "required": ["details"] } - } + ] }, "yesNoConnectedSupplier": { "type": "object", @@ -1945,61 +1885,57 @@ } }, "required": ["yesNo"], - "dependencies": { - "yesNo": { - "oneOf": [ - { - "properties": { - "yesNo": { - "enum": ["No"] - } - }, - "additionalProperties": false + "discriminator": { "propertyName": "yesNo" }, + "oneOf": [ + { + "properties": { + "yesNo": { + "enum": ["No"] + } + } + }, + { + "properties": { + "yesNo": { + "enum": ["Yes"] }, - { - "properties": { - "yesNo": { - "enum": ["Yes"] - }, - "supplier": { - "title": "Supplier (if known)", - "type": "string" - }, - "maintenanceAgreements": { - "baspiRef": "A7.2", - "RDSRef": "Services/Certificates,Services/OtherServices/Certificates", - "title": "Do you have any licences, maintenance agreements, contracts or service agreements in relation to this service?", - "$ref": "#/$defs/yesNoDetailIfYes" - } - }, - "required": ["maintenanceAgreements"] + "supplier": { + "title": "Supplier (if known)", + "type": "string" }, - { - "properties": { - "yesNo": { - "enum": ["To be connected"] - }, - "dateToBeConnected": { - "title": "Date to be connected", - "type": "string", - "format": "date" - }, - "supplier": { - "title": "Supplier (if known)", - "type": "string" - }, - "maintenanceAgreements": { - "baspiRef": "A7.2", - "RDSRef": "Services/Certificates,Services/OtherServices/Certificates", - "title": "Do you have any licences, maintenance agreements, contracts or service agreements in relation to this service?", - "$ref": "#/$defs/yesNoDetailIfYes" - } - }, - "required": ["dateToBeConnected", "maintenanceAgreements"] + "maintenanceAgreements": { + "baspiRef": "A7.2", + "RDSRef": "Services/Certificates,Services/OtherServices/Certificates", + "title": "Do you have any licences, maintenance agreements, contracts or service agreements in relation to this service?", + "$ref": "#/$defs/yesNoDetailIfYes" } - ] + }, + "required": ["maintenanceAgreements"] + }, + { + "properties": { + "yesNo": { + "enum": ["To be connected"] + }, + "dateToBeConnected": { + "title": "Date to be connected", + "type": "string", + "format": "date" + }, + "supplier": { + "title": "Supplier (if known)", + "type": "string" + }, + "maintenanceAgreements": { + "baspiRef": "A7.2", + "RDSRef": "Services/Certificates,Services/OtherServices/Certificates", + "title": "Do you have any licences, maintenance agreements, contracts or service agreements in relation to this service?", + "$ref": "#/$defs/yesNoDetailIfYes" + } + }, + "required": ["dateToBeConnected", "maintenanceAgreements"] } - } + ] }, "yesNoDetailConsents": { "type": "object", @@ -2011,75 +1947,71 @@ } }, "required": ["yesNo"], - "dependencies": { - "yesNo": { - "oneOf": [ - { - "properties": { - "yesNo": { - "enum": ["No"] - } - }, - "additionalProperties": false + "discriminator": { "propertyName": "yesNo" }, + "oneOf": [ + { + "properties": { + "yesNo": { + "enum": ["No"] + } + } + }, + { + "properties": { + "yesNo": { + "enum": ["Yes"] }, - { - "properties": { - "yesNo": { - "enum": ["Yes"] - }, - "details": { - "title": "Details", - "type": "string", - "minLength": 1 - }, - "buildingRegApproval": { - "baspiRef": "A3.4.1", - "RDSRef": "WorksAlterationsChanges/ConsentApproval", - "lawSocietyRef": "TA6/4.2", - "title": "Was building regulation approval and a completion certificate obtained or an equivalent Competent Person Scheme Certificate?", - "$ref": "#/$defs/yesNoNotRequiredDetailIfNo" - }, - "planningPermission": { - "baspiRef": "A3.4.2", - "RDSRef": "WorksAlterationsChanges/ConsentApproval", - "lawSocietyRef": "TA6/4.4", - "title": "Was planning permission obtained?", - "$ref": "#/$defs/yesNoNotRequiredDetailIfNo" - }, - "listedBuildingConsent": { - "baspiRef": "A3.4.3", - "RDSRef": "WorksAlterationsChanges/ConsentApproval", - "lawSocietyRef": "TA6/4.2", - "title": "Was listed building consent obtained?", - "$ref": "#/$defs/yesNoNotRequiredDetailIfNo" - }, - "deedRestrictionConsent": { - "baspiRef": "A3.4.4", - "RDSRef": "WorksAlterationsChanges/ConsentApproval", - "lawSocietyRef": "TA6/4.2", - "title": "Was any consent under a restriction in the deeds obtained? E.g. if your deeds require consent from someone else to alter or extend the property", - "$ref": "#/$defs/yesNoNotRequiredDetailIfNo" - }, - "unfinished": { - "baspiRef": "A3.5", - "RDSRef": "WorksAlterationsChanges/isIncomplete", - "lawSocietyRef": "TA6/4.3", - "title": "Are any of the works listed above unfinished?", - "$ref": "#/$defs/yesNoDetailIfYes" - } - }, - "required": [ - "details", - "buildingRegApproval", - "planningPermission", - "listedBuildingConsent", - "deedRestrictionConsent", - "unfinished" - ] + "details": { + "title": "Details", + "type": "string", + "minLength": 1 + }, + "buildingRegApproval": { + "baspiRef": "A3.4.1", + "RDSRef": "WorksAlterationsChanges/ConsentApproval", + "lawSocietyRef": "TA6/4.2", + "title": "Was building regulation approval and a completion certificate obtained or an equivalent Competent Person Scheme Certificate?", + "$ref": "#/$defs/yesNoNotRequiredDetailIfNo" + }, + "planningPermission": { + "baspiRef": "A3.4.2", + "RDSRef": "WorksAlterationsChanges/ConsentApproval", + "lawSocietyRef": "TA6/4.4", + "title": "Was planning permission obtained?", + "$ref": "#/$defs/yesNoNotRequiredDetailIfNo" + }, + "listedBuildingConsent": { + "baspiRef": "A3.4.3", + "RDSRef": "WorksAlterationsChanges/ConsentApproval", + "lawSocietyRef": "TA6/4.2", + "title": "Was listed building consent obtained?", + "$ref": "#/$defs/yesNoNotRequiredDetailIfNo" + }, + "deedRestrictionConsent": { + "baspiRef": "A3.4.4", + "RDSRef": "WorksAlterationsChanges/ConsentApproval", + "lawSocietyRef": "TA6/4.2", + "title": "Was any consent under a restriction in the deeds obtained? E.g. if your deeds require consent from someone else to alter or extend the property", + "$ref": "#/$defs/yesNoNotRequiredDetailIfNo" + }, + "unfinished": { + "baspiRef": "A3.5", + "RDSRef": "WorksAlterationsChanges/isIncomplete", + "lawSocietyRef": "TA6/4.3", + "title": "Are any of the works listed above unfinished?", + "$ref": "#/$defs/yesNoDetailIfYes" } + }, + "required": [ + "details", + "buildingRegApproval", + "planningPermission", + "listedBuildingConsent", + "deedRestrictionConsent", + "unfinished" ] } - } + ] }, "address": { "type": "object", diff --git a/src/schemas/v1/searches.json b/src/schemas/v1/searches.json index 0ff68df..2330b6b 100644 --- a/src/schemas/v1/searches.json +++ b/src/schemas/v1/searches.json @@ -39,173 +39,167 @@ } }, "required": ["displayName", "status"], - "dependencies": { - "status": { - "oneOf": [ - { - "properties": { - "status": { - "enum": ["Ordered"] - }, - "orderDate": { - "title": "Date search was ordered", - "type": "string", - "format": "date-time" - }, - "expectedDeliveryDate": { - "title": "Date search provider indicates to expect delivery", - "type": "string", - "format": "date-time" - }, - "searchContentTypes": { - "type": "array", - "items": { + "discriminator": { "propertyName": "status" }, + "oneOf": [ + { + "properties": { + "status": { + "enum": ["Ordered"] + }, + "orderDate": { + "title": "Date search was ordered", + "type": "string", + "format": "date-time" + }, + "expectedDeliveryDate": { + "title": "Date search provider indicates to expect delivery", + "type": "string", + "format": "date-time" + }, + "searchContentTypes": { + "type": "array", + "items": { + "$ref": "#/$defs/contentTypes" + } + } + }, + "required": ["providerName", "orderDate"] + }, + { + "properties": { + "status": { + "enum": ["Delivered"] + }, + "reportDate": { + "title": "Report date", + "type": "string", + "format": "date-time" + }, + "summary": { + "title": "Summary of report", + "type": "string", + "minLength": 1 + }, + "recommendations": { + "title": "Report recommendations", + "type": "string", + "minLength": 1 + }, + "actionAlertRating": { + "title": "Action alert rating (1 is Green, 5 is Red)", + "type": "string", + "enum": ["1", "2", "3", "4", "5"] + }, + "complianceStatement": { + "title": "Statement of methodology and compliance with reporting standards", + "type": "string", + "minLength": 1 + }, + "results": { + "type": "array", + "items": { + "type": "object", + "properties": { + "contentType": { "$ref": "#/$defs/contentTypes" } - } - }, - "required": ["providerName", "orderDate"] - }, - { - "properties": { - "status": { - "enum": ["Delivered"] - }, - "reportDate": { - "title": "Report date", - "type": "string", - "format": "date-time" - }, - "summary": { - "title": "Summary of report", - "type": "string", - "minLength": 1 - }, - "recommendations": { - "title": "Report recommendations", - "type": "string", - "minLength": 1 }, - "actionAlertRating": { - "title": "Action alert rating (1 is Green, 5 is Red)", - "type": "string", - "enum": ["1", "2", "3", "4", "5"] - }, - "complianceStatement": { - "title": "Statement of methodology and compliance with reporting standards", - "type": "string", - "minLength": 1 - }, - "results": { - "type": "array", - "items": { - "type": "object", + "required": ["contentType"], + "discriminator": { "propertyName": "contentType" }, + "oneOf": [ + { + "properties": { + "contentType": { + "enum": ["Local Land Charges"] + }, + "localLandCharges": { + "$ref": "https://trust.propdata.org.uk/schemas/v1/searches/local-land-charges.json" + } + }, + "required": ["localLandCharges"] + }, + { + "properties": { + "contentType": { + "enum": ["Required Local Searches"] + }, + "requiredLocalSearches": { + "$ref": "https://trust.propdata.org.uk/schemas/v1/searches/local-searches-required.json" + } + }, + "required": ["requiredLocalSearches"] + }, + { "properties": { "contentType": { - "$ref": "#/$defs/contentTypes" + "enum": ["Drainage and Water Searches"] + }, + "drainageAndWater": { + "$ref": "https://trust.propdata.org.uk/schemas/v1/searches/drainage-and-water.json" } }, - "required": ["contentType"], - "dependencies": { + "required": ["con29DW"] + }, + { + "properties": { "contentType": { - "oneOf": [ - { - "properties": { - "contentType": { - "enum": ["Local Land Charges"] - }, - "localLandCharges": { - "$ref": "https://trust.propdata.org.uk/schemas/v1/searches/local-land-charges.json" - } - }, - "required": ["localLandCharges"] - }, - { - "properties": { - "contentType": { - "enum": ["Required Local Searches"] - }, - "requiredLocalSearches": { - "$ref": "https://trust.propdata.org.uk/schemas/v1/searches/local-searches-required.json" - } - }, - "required": ["requiredLocalSearches"] - }, - { - "properties": { - "contentType": { - "enum": ["Drainage and Water Searches"] - }, - "drainageAndWater": { - "$ref": "https://trust.propdata.org.uk/schemas/v1/searches/drainage-and-water.json" - } - }, - "required": ["con29DW"] - }, - { - "properties": { - "contentType": { - "enum": [ - "Flood", - "Contaminated Land", - "Coal", - "Bath Stone", - "Metalliferous (Tin)", - "Kaolin & Ball Clay", - "Limestone", - "Brine", - "HS2", - "Crossrail", - "Energy Exploration", - "Wind Farms", - "Renewable Power Plants", - "Solar Farms", - "London Underground", - "Ground Stability", - "Non Coal Mining", - "Ground Movement", - "Mineral", - "Radon", - "Other" - ] - }, - "recommendedActionIndicator": { - "title": "Recommended action indicator", - "type": "string", - "enum": ["Yes", "No"] - }, - "actionAlertRating": { - "title": "Action alert rating (1 is Green, 5 is Red)", - "type": "string", - "enum": ["1", "2", "3", "4", "5"] - }, - "summary": { - "title": "Summary of report", - "type": "string", - "minLength": 1 - }, - "recommendations": { - "title": "Report recommendations", - "type": "string", - "minLength": 1 - }, - "complianceStatement": { - "title": "Statement of methodology and compliance with reporting standards", - "type": "string", - "minLength": 1 - } - } - } + "enum": [ + "Flood", + "Contaminated Land", + "Coal", + "Bath Stone", + "Metalliferous (Tin)", + "Kaolin & Ball Clay", + "Limestone", + "Brine", + "HS2", + "Crossrail", + "Energy Exploration", + "Wind Farms", + "Renewable Power Plants", + "Solar Farms", + "London Underground", + "Ground Stability", + "Non Coal Mining", + "Ground Movement", + "Mineral", + "Radon", + "Other" ] + }, + "recommendedActionIndicator": { + "title": "Recommended action indicator", + "type": "string", + "enum": ["Yes", "No"] + }, + "actionAlertRating": { + "title": "Action alert rating (1 is Green, 5 is Red)", + "type": "string", + "enum": ["1", "2", "3", "4", "5"] + }, + "summary": { + "title": "Summary of report", + "type": "string", + "minLength": 1 + }, + "recommendations": { + "title": "Report recommendations", + "type": "string", + "minLength": 1 + }, + "complianceStatement": { + "title": "Statement of methodology and compliance with reporting standards", + "type": "string", + "minLength": 1 } } } - } + ] } } - ] + } } - } + ] }, "$defs": { "contentTypes": { diff --git a/src/schemas/v1/searches/drainage-and-water.json b/src/schemas/v1/searches/drainage-and-water.json index d3bdd79..a5cccba 100644 --- a/src/schemas/v1/searches/drainage-and-water.json +++ b/src/schemas/v1/searches/drainage-and-water.json @@ -199,33 +199,29 @@ } }, "required": ["yesNo"], - "dependencies": { - "yesNo": { - "oneOf": [ - { - "properties": { - "yesNo": { - "enum": ["No"] - } - }, - "additionalProperties": false + "discriminator": { "propertyName": "yesNo" }, + "oneOf": [ + { + "properties": { + "yesNo": { + "enum": ["No"] + } + } + }, + { + "properties": { + "yesNo": { + "enum": ["Yes"] }, - { - "properties": { - "yesNo": { - "enum": ["Yes"] - }, - "details": { - "title": "Details", - "type": "string", - "minLength": 1 - } - }, - "required": ["details"] + "details": { + "title": "Details", + "type": "string", + "minLength": 1 } - ] + }, + "required": ["details"] } - } + ] }, "yesNoDetailIfNo": { "type": "object", @@ -237,33 +233,29 @@ } }, "required": ["yesNo"], - "dependencies": { - "yesNo": { - "oneOf": [ - { - "properties": { - "yesNo": { - "enum": ["Yes"] - } - }, - "additionalProperties": false + "discriminator": { "propertyName": "yesNo" }, + "oneOf": [ + { + "properties": { + "yesNo": { + "enum": ["Yes"] + } + } + }, + { + "properties": { + "yesNo": { + "enum": ["No"] }, - { - "properties": { - "yesNo": { - "enum": ["No"] - }, - "details": { - "title": "Details", - "type": "string", - "minLength": 1 - } - }, - "required": ["details"] + "details": { + "title": "Details", + "type": "string", + "minLength": 1 } - ] + }, + "required": ["details"] } - } + ] } } } diff --git a/src/schemas/v1/searches/local-searches-required.json b/src/schemas/v1/searches/local-searches-required.json index 67924da..9b86cc5 100644 --- a/src/schemas/v1/searches/local-searches-required.json +++ b/src/schemas/v1/searches/local-searches-required.json @@ -773,33 +773,29 @@ } }, "required": ["yesNo"], - "dependencies": { - "yesNo": { - "oneOf": [ - { - "properties": { - "yesNo": { - "enum": ["No"] - } - }, - "additionalProperties": false + "discriminator": { "propertyName": "yesNo" }, + "oneOf": [ + { + "properties": { + "yesNo": { + "enum": ["No"] + } + } + }, + { + "properties": { + "yesNo": { + "enum": ["Yes"] }, - { - "properties": { - "yesNo": { - "enum": ["Yes"] - }, - "details": { - "title": "Details", - "type": "string", - "minLength": 1 - } - }, - "required": ["details"] + "details": { + "title": "Details", + "type": "string", + "minLength": 1 } - ] + }, + "required": ["details"] } - } + ] }, "planningApplicationList": { "type": "array", diff --git a/src/tests/pdtfVerifiedClaims.test.js b/src/tests/pdtfVerifiedClaims.test.js index aa7551a..b6189a9 100644 --- a/src/tests/pdtfVerifiedClaims.test.js +++ b/src/tests/pdtfVerifiedClaims.test.js @@ -9,6 +9,7 @@ const exampleDocumentedVouch = require("../examples/exampleDocumentedVouch.json" const ajv = new Ajv({ allErrors: true, strictSchema: false, + discriminator: true, }); addFormats(ajv); From 5c5ef0e3fbb132561dff9f397f1104329428aa4d Mon Sep 17 00:00:00 2001 From: Ed Molyneux Date: Fri, 11 Nov 2022 14:27:13 +0000 Subject: [PATCH 6/7] Bump pre-release version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3095fd8..a6b6ec9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@pdtf/schemas", - "version": "0.11.0-4", + "version": "0.11.0-5", "description": "Property Data Trust Framework Schemas and Utilities", "main": "index.js", "directories": { From e36fac0ca31e68e7a4d27d88b14f5f15cc877871 Mon Sep 17 00:00:00 2001 From: Ed Molyneux Date: Fri, 25 Nov 2022 15:59:03 +0000 Subject: [PATCH 7/7] Fixes #27, fixes #20, adds more NTS Refs --- package.json | 2 +- src/examples/exampleTransaction.json | 32 +-------------------------- src/schemas/v1/legal-information.json | 4 ++-- src/schemas/v1/material-facts.json | 7 +++--- src/schemas/v1/pdtf-transaction.json | 10 +++------ 5 files changed, 11 insertions(+), 44 deletions(-) diff --git a/package.json b/package.json index a6b6ec9..1501423 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@pdtf/schemas", - "version": "0.11.0-5", + "version": "0.11.0-6", "description": "Property Data Trust Framework Schemas and Utilities", "main": "index.js", "directories": { diff --git a/src/examples/exampleTransaction.json b/src/examples/exampleTransaction.json index c4e7c19..31ccb04 100644 --- a/src/examples/exampleTransaction.json +++ b/src/examples/exampleTransaction.json @@ -487,37 +487,7 @@ "titlesToBeSold": [ { "titleNumber": "HD221222", - "titleExtents": [ - { - "type": "Feature", - "properties": { - "POLY_ID": 19851403, - "TITLE_NO": "HD221222", - "INSERT": "2016-02-05T13:36:55", - "UPDATE": "2016-02-05T13:36:55", - "REC_STATUS": "A" - }, - "geometry": { - "type": "Polygon", - "coordinates": [ - [ - [-2.578781821932439, 51.48576411094672], - [-2.578669662492341, 51.48572105544199], - [-2.5786421470447154, 51.48570905261714], - [-2.5785524174118404, 51.48567442829361], - [-2.5785328794340825, 51.48566688186638], - [-2.5785279074169107, 51.4856723013566], - [-2.5784923376884157, 51.48570664492474], - [-2.5785118756765826, 51.48571419135863], - [-2.578603776881019, 51.48574970415372], - [-2.578629846557485, 51.48576126454427], - [-2.578738400129546, 51.48580388830907], - [-2.578781821932439, 51.48576411094672] - ] - ] - } - } - ], + "titleExtents": "{'type':'Polygon','coordinates':[[[-2.5787833768108985,51.48576273335823],[-2.578739952913823,51.48580251052463],[-2.578631396439736,51.48575988696783],[-2.578605326085179,51.48574832663401],[-2.578513422397467,51.48571281401381],[-2.578493883879733,51.48570526761721],[-2.578529455342914,51.48567092421916],[-2.578534427612858,51.485665504755744],[-2.578553966121065,51.485673051145575],[-2.5786436981835235,51.48570767529821],[-2.578671214351269,51.48571967806404],[-2.5787833768108985,51.48576273335823]]]}", "registerExtract": { "OCSummaryData": { "Title": { diff --git a/src/schemas/v1/legal-information.json b/src/schemas/v1/legal-information.json index d3c6c7d..aa7b920 100644 --- a/src/schemas/v1/legal-information.json +++ b/src/schemas/v1/legal-information.json @@ -775,7 +775,7 @@ "yesNo": { "type": "string", "title": "", - "enum": ["No", "Yes"] + "enum": ["Yes", "No"] } }, "required": ["yesNo"], @@ -819,7 +819,7 @@ "yesNo": { "type": "string", "title": "", - "enum": ["No", "Yes"] + "enum": ["Yes", "No"] } }, "required": ["yesNo"], diff --git a/src/schemas/v1/material-facts.json b/src/schemas/v1/material-facts.json index 90a86c3..4dca2c9 100644 --- a/src/schemas/v1/material-facts.json +++ b/src/schemas/v1/material-facts.json @@ -261,6 +261,7 @@ "enum": ["Leasehold"] }, "sharedOwnership": { + "ntsRef": "A1.7", "title": "Shared ownership", "type": "object", "properties": { @@ -286,20 +287,20 @@ "enum": ["Yes"] }, "sharedOwnershipPercentage": { - "ntsRef": "A1.7", + "ntsRef": "A1.7.1", "title": "Shared ownership percentage", "type": "integer", "minimum": 5, "exclusiveMaximum": 100 }, "sharedOwnershipRent": { - "ntsRef": "A1.7", + "ntsRef": "A1.7.2", "title": "Shared ownership rent (£)", "type": "number", "minimum": 0 }, "sharedOwnershipRentFrequency": { - "ntsRef": "A1.7", + "ntsRef": "A1.7.3", "title": "Shared ownership rent frequency", "type": "string", "enum": ["Yearly", "Monthly", "Weekly"] diff --git a/src/schemas/v1/pdtf-transaction.json b/src/schemas/v1/pdtf-transaction.json index 68b105e..a3e8990 100644 --- a/src/schemas/v1/pdtf-transaction.json +++ b/src/schemas/v1/pdtf-transaction.json @@ -17,8 +17,7 @@ }, "transactionId": { "title": "UUID for the transaction", - "type": "string", - "format": "uuid" + "type": "string" }, "status": { "type": "string", @@ -133,11 +132,8 @@ "titleExtents": { "RDSRef": "", "title": "Title Extents", - "description": "One or more index polygons describing indicative location of registered title from National Polygon Dataset", - "type": "array", - "items": { - "$ref": "https://geojson.org/schema/GeoJSON.json" - } + "description": "One or more index polygons describing indicative location of registered title from National Polygon Dataset, JSON.stringified to ensure compatibility", + "type": "string" }, "registerExtract": { "title": "HMLR Register Extract",