diff --git a/docs/schemas/2024-10/address.json b/docs/schemas/2024-10/address.json new file mode 100644 index 00000000..8eb96cd9 --- /dev/null +++ b/docs/schemas/2024-10/address.json @@ -0,0 +1,47 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://data-dictionary.opg.service.justice.gov.uk/schema/lpa/2024-10/address.json", + "description": "An address", + "type": "object", + "required": ["line1", "country"], + "properties": { + "line1": { + "type": "string", + "x-faker": "address.streetAddress" + }, + "line2": { + "type": "string", + "x-faker": "address.streetName" + }, + "line3": { + "type": "string", + "x-faker": "address.cityName" + }, + "town": { + "type": "string", + "x-faker": "address.cityName" + }, + "postcode": { + "type": "string", + "x-faker": { + "helpers.replaceSymbols": "??# #??" + } + }, + "country": { + "type": "string", + "format": "ISO-3166-1", + "minLength": 2, + "maxLength": 2, + "x-faker": "address.countryCode" + } + }, + "additionalProperties": false, + "example": { + "line1": "Flat 3", + "line2": "42 Primrose Lane", + "line3": "Greenfields", + "town": "Manchester", + "postcode": "M17 2XY", + "country": "GB" + } +} diff --git a/docs/schemas/2024-10/attorney.json b/docs/schemas/2024-10/attorney.json new file mode 100644 index 00000000..015e31dc --- /dev/null +++ b/docs/schemas/2024-10/attorney.json @@ -0,0 +1,38 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://data-dictionary.opg.service.justice.gov.uk/schema/lpa/2024-10/attorney.json", + "allOf": [ + { + "$ref": "https://data-dictionary.opg.service.justice.gov.uk/schema/lpa/2024-10/person.json" + } + ], + "type": "object", + "required": ["dateOfBirth", "status", "channel"], + "properties": { + "dateOfBirth": { + "type": "string", + "format": "date" + }, + "email": { + "type": "string", + "x-faker": "internet.email" + }, + "status": { + "type": "string", + "enum": ["active", "replacement", "removed"] + }, + "channel": { + "type": "string", + "enum": ["paper", "online"] + } + }, + "if": { + "required": ["channel"], + "properties": { + "channel": { "const": "online" } + } + }, + "then": { + "required": ["email"] + } +} diff --git a/docs/schemas/2024-10/donor-details.json b/docs/schemas/2024-10/donor-details.json index 445765a1..b7b9dd98 100644 --- a/docs/schemas/2024-10/donor-details.json +++ b/docs/schemas/2024-10/donor-details.json @@ -23,7 +23,7 @@ "donor": { "allOf": [ { - "$ref": "#/$defs/Person" + "$ref": "https://data-dictionary.opg.service.justice.gov.uk/schema/lpa/2024-10/person.json" } ], "type": "object", @@ -50,20 +50,20 @@ "attorneys": { "type": "array", "items": { - "$ref": "#/$defs/Attorney" + "$ref": "https://data-dictionary.opg.service.justice.gov.uk/schema/lpa/2024-10/attorney.json" }, "minLength": 1 }, "trustCorporations": { "type": "array", "items": { - "$ref": "#/$defs/TrustCorporation" + "$ref": "https://data-dictionary.opg.service.justice.gov.uk/schema/lpa/2024-10/trust-corporation.json" } }, "certificateProvider": { "allOf": [ { - "$ref": "#/$defs/Person" + "$ref": "https://data-dictionary.opg.service.justice.gov.uk/schema/lpa/2024-10/person.json" } ], "type": "object", @@ -95,7 +95,7 @@ "peopleToNotify": { "type": "array", "items": { - "$ref": "#/$defs/PersonToNotify" + "$ref": "https://data-dictionary.opg.service.justice.gov.uk/schema/lpa/2024-10/person-to-notify.json" } }, "howAttorneysMakeDecisions": { @@ -158,173 +158,10 @@ "restrictionsAndConditionsImages": { "type": "array", "items": { - "$ref": "#/$defs/File" + "$ref": "https://data-dictionary.opg.service.justice.gov.uk/schema/lpa/2024-10/file.json" } } } }, - "additionalProperties": false, - "$defs": { - "Address": { - "type": "object", - "required": ["line1", "country"], - "properties": { - "line1": { - "type": "string", - "x-faker": "address.streetAddress" - }, - "line2": { - "type": "string", - "x-faker": "address.streetName" - }, - "line3": { - "type": "string", - "x-faker": "address.cityName" - }, - "town": { - "type": "string", - "x-faker": "address.cityName" - }, - "postcode": { - "type": "string", - "x-faker": { - "helpers.replaceSymbols": "??# #??" - } - }, - "country": { - "type": "string", - "format": "ISO-3166-1", - "minLength": 2, - "maxLength": 2, - "x-faker": "address.countryCode" - } - }, - "additionalProperties": false, - "example": { - "line1": "Flat 3", - "line2": "42 Primrose Lane", - "line3": "Greenfields", - "town": "Manchester", - "postcode": "M17 2XY", - "country": "GB" - } - }, - "Person": { - "type": "object", - "required": ["uid", "firstNames", "lastName", "address"], - "properties": { - "uid": { - "type": "string", - "format": "uuid" - }, - "firstNames": { - "type": "string", - "x-faker": "name.firstName" - }, - "lastName": { - "type": "string", - "x-faker": "name.lastName" - }, - "address": { - "$ref": "#/$defs/Address" - } - } - }, - "Attorney": { - "allOf": [ - { - "$ref": "#/$defs/Person" - } - ], - "type": "object", - "required": ["dateOfBirth", "status", "channel"], - "properties": { - "dateOfBirth": { - "type": "string", - "format": "date" - }, - "email": { - "type": "string", - "x-faker": "internet.email" - }, - "status": { - "type": "string", - "enum": ["active", "replacement", "removed"] - }, - "channel": { - "type": "string", - "enum": ["paper", "online"] - } - }, - "if": { - "required": ["channel"], - "properties": { - "channel": { "const": "online" } - } - }, - "then": { - "required": ["email"] - } - }, - "TrustCorporation": { - "type": "object", - "required": ["name", "companyNumber", "address", "status", "channel", "uid"], - "properties": { - "uid": { - "type": "string", - "format": "uuid" - }, - "name": { - "type": "string" - }, - "companyNumber": { - "type": "string" - }, - "email": { - "type": "string", - "x-faker": "internet.email" - }, - "address": { - "$ref": "#/$defs/Address" - }, - "status": { - "type": "string", - "enum": ["active", "replacement", "removed"] - }, - "channel": { - "type": "string", - "enum": ["paper", "online"] - } - }, - "if": { - "required": ["channel"], - "properties": { - "channel": { "const": "online" } - } - }, - "then": { - "required": ["email"] - } - }, - "PersonToNotify": { - "allOf": [ - { - "$ref": "#/$defs/Person" - } - ], - "type": "object" - }, - "File": { - "type": "object", - "required": ["filename", "data"], - "properties": { - "filename": { - "type": "string" - }, - "data": { - "type": "string" - } - } - } - } + "additionalProperties": false } diff --git a/docs/schemas/2024-10/file.json b/docs/schemas/2024-10/file.json new file mode 100644 index 00000000..c251e7a9 --- /dev/null +++ b/docs/schemas/2024-10/file.json @@ -0,0 +1,14 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://data-dictionary.opg.service.justice.gov.uk/schema/lpa/2024-10/file.json", + "type": "object", + "required": ["filename", "data"], + "properties": { + "filename": { + "type": "string" + }, + "data": { + "type": "string" + } + } +} diff --git a/docs/schemas/2024-10/person-to-notify.json b/docs/schemas/2024-10/person-to-notify.json new file mode 100644 index 00000000..f422f763 --- /dev/null +++ b/docs/schemas/2024-10/person-to-notify.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://data-dictionary.opg.service.justice.gov.uk/schema/lpa/2024-10/person-to-notify.json", + "allOf": [ + { + "$ref": "https://data-dictionary.opg.service.justice.gov.uk/schema/lpa/2024-10/person.json" + } + ], + "type": "object" +} diff --git a/docs/schemas/2024-10/person.json b/docs/schemas/2024-10/person.json new file mode 100644 index 00000000..e0623ed6 --- /dev/null +++ b/docs/schemas/2024-10/person.json @@ -0,0 +1,23 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://data-dictionary.opg.service.justice.gov.uk/schema/lpa/2024-10/person.json", + "type": "object", + "required": ["uid", "firstNames", "lastName", "address"], + "properties": { + "uid": { + "type": "string", + "format": "uuid" + }, + "firstNames": { + "type": "string", + "x-faker": "name.firstName" + }, + "lastName": { + "type": "string", + "x-faker": "name.lastName" + }, + "address": { + "$ref": "https://data-dictionary.opg.service.justice.gov.uk/schema/lpa/2024-10/address.json" + } + } +} diff --git a/docs/schemas/2024-10/trust-corporation.json b/docs/schemas/2024-10/trust-corporation.json new file mode 100644 index 00000000..ebfbda09 --- /dev/null +++ b/docs/schemas/2024-10/trust-corporation.json @@ -0,0 +1,42 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://data-dictionary.opg.service.justice.gov.uk/schema/lpa/2024-10/trust-corporation.json", + "type": "object", + "required": ["name", "companyNumber", "address", "status", "channel", "uid"], + "properties": { + "uid": { + "type": "string", + "format": "uuid" + }, + "name": { + "type": "string" + }, + "companyNumber": { + "type": "string" + }, + "email": { + "type": "string", + "x-faker": "internet.email" + }, + "address": { + "$ref": "https://data-dictionary.opg.service.justice.gov.uk/schema/lpa/2024-10/address.json" + }, + "status": { + "type": "string", + "enum": ["active", "replacement", "removed"] + }, + "channel": { + "type": "string", + "enum": ["paper", "online"] + } + }, + "if": { + "required": ["channel"], + "properties": { + "channel": { "const": "online" } + } + }, + "then": { + "required": ["email"] + } +}