diff --git a/schema/schema.json b/schema/schema.json index c347350f..a5cf6650 100644 --- a/schema/schema.json +++ b/schema/schema.json @@ -1,7 +1,7 @@ { - "$id": "@next", + "$id": "--no-top-ref", + "$ref": "#/definitions/Schema", "$schema": "http://json-schema.org/draft-07/schema#", - "additionalProperties": false, "definitions": { "AddressInput": { "$id": "#AddressInput", @@ -4760,8 +4760,7 @@ "description": "Details of the pre-application, if applicable", "properties": { "date": { - "format": "date-time", - "type": "string" + "$ref": "#/definitions/Date" }, "officer": { "type": "string" @@ -15360,12 +15359,10 @@ "additionalProperties": false, "properties": { "completion": { - "format": "date-time", - "type": "string" + "$ref": "#/definitions/Date" }, "start": { - "format": "date-time", - "type": "string" + "$ref": "#/definitions/Date" } }, "type": "object" @@ -16097,6 +16094,64 @@ ], "description": "The result of a single flagset" }, + "Schema": { + "additionalProperties": false, + "description": "The root schema for an application generated by a digital planning service", + "properties": { + "data": { + "additionalProperties": false, + "properties": { + "applicant": { + "$ref": "#/definitions/Applicant" + }, + "application": { + "$ref": "#/definitions/Application" + }, + "property": { + "$ref": "#/definitions/Property" + }, + "proposal": { + "$ref": "#/definitions/Proposal" + }, + "user": { + "$ref": "#/definitions/User" + } + }, + "required": [ + "application", + "user", + "applicant", + "property", + "proposal" + ], + "type": "object" + }, + "files": { + "items": { + "$ref": "#/definitions/File" + }, + "type": "array" + }, + "metadata": { + "$ref": "#/definitions/Metadata" + }, + "responses": { + "$ref": "#/definitions/Responses" + }, + "result": { + "$ref": "#/definitions/Result" + } + }, + "required": [ + "data", + "result", + "metadata", + "responses", + "files" + ], + "title": "Digital Planning Application", + "type": "object" + }, "SiteContact": { "$id": "#SiteContact", "anyOf": [ @@ -16797,60 +16852,5 @@ ], "description": "Vehicle parking types" } - }, - "description": "The root schema for an application generated by a digital planning service", - "properties": { - "data": { - "additionalProperties": false, - "properties": { - "applicant": { - "$ref": "#/definitions/Applicant" - }, - "application": { - "$ref": "#/definitions/Application" - }, - "property": { - "$ref": "#/definitions/Property" - }, - "proposal": { - "$ref": "#/definitions/Proposal" - }, - "user": { - "$ref": "#/definitions/User" - } - }, - "required": [ - "application", - "user", - "applicant", - "property", - "proposal" - ], - "type": "object" - }, - "files": { - "items": { - "$ref": "#/definitions/File" - }, - "type": "array" - }, - "metadata": { - "$ref": "#/definitions/Metadata" - }, - "responses": { - "$ref": "#/definitions/Responses" - }, - "result": { - "$ref": "#/definitions/Result" - } - }, - "required": [ - "data", - "result", - "metadata", - "responses", - "files" - ], - "title": "Digital Planning Application", - "type": "object" + } } \ No newline at end of file diff --git a/types/schema/data/Application.ts b/types/schema/data/Application.ts index 45015518..f7a4aa9c 100644 --- a/types/schema/data/Application.ts +++ b/types/schema/data/Application.ts @@ -1,4 +1,5 @@ import {ApplicationTypes} from '../../enums/ApplicationTypes'; +import {Date} from '../../utils'; /** * @id #Application diff --git a/types/schema/data/Proposal.ts b/types/schema/data/Proposal.ts index 56ce85ef..707c93a5 100644 --- a/types/schema/data/Proposal.ts +++ b/types/schema/data/Proposal.ts @@ -1,6 +1,6 @@ import {ProjectTypes} from '../../enums/ProjectTypes'; import {VehicleParking} from '../../enums/VehicleParking'; -import {Area, GeoJSON} from '../../utils'; +import {Area, Date, GeoJSON} from '../../utils'; /** * @id #Proposal