From 1a11d5e087d6c22e4d12bd47ce65098d9d08476b Mon Sep 17 00:00:00 2001 From: Jessica McInchak Date: Sun, 10 Sep 2023 14:32:51 +0200 Subject: [PATCH 1/3] first response type --- examples/data/Responses.ts | 32 ++ examples/index.ts | 9 +- schema/schema.json | 639 ++++++++++++++++++++++++++++++++++++- types/schema/Responses.ts | 32 +- 4 files changed, 698 insertions(+), 14 deletions(-) create mode 100644 examples/data/Responses.ts diff --git a/examples/data/Responses.ts b/examples/data/Responses.ts new file mode 100644 index 00000000..0b151bdb --- /dev/null +++ b/examples/data/Responses.ts @@ -0,0 +1,32 @@ +import { Schema } from '../../types/Schema'; + +export const validResponses: Schema['responses'] = [ + { + "metadata": { + "section_name": "The property", + "auto_answered": true + }, + "question": "Is the property in London Borough of Southwark?", + "responses": [ + { + "value": "Yes" + } + ] + }, + { + "metadata": { + "policy_refs": [ + { + "text": "Town and Country Planning Act 1990, Part 7, Section 191 & Section 192" + } + ], + "section_name": "About the project" + }, + "question": "What are you applying about?", + "responses": [ + { + "value": "Proposed changes I want to make in the future" + } + ] + }, +]; diff --git a/examples/index.ts b/examples/index.ts index cedc08b6..10cb6f2c 100644 --- a/examples/index.ts +++ b/examples/index.ts @@ -3,6 +3,7 @@ import {validAgent, validApplicant} from './data/Applicant'; import {validApplication} from './data/Application'; import {validProperty} from './data/Property'; import {validProposal} from './data/Proposal'; +import { validResponses } from './data/Responses'; const validMetadata: Schema['metadata'] = { service: { @@ -68,9 +69,7 @@ export const validExampleApplicant: Schema = { }, result: validResult, metadata: validMetadata, - responses: { - name: 'Test', - }, + repsonses: validResponses, files: validFiles, }; @@ -86,8 +85,6 @@ export const validExampleAgent: Schema = { }, result: validResult, metadata: validMetadata, - responses: { - name: 'Test', - }, + repsonses: validResponses, files: validFiles, }; diff --git a/schema/schema.json b/schema/schema.json index 3e0907a6..15c3f8c8 100644 --- a/schema/schema.json +++ b/schema/schema.json @@ -11668,30 +11668,657 @@ ], "type": "object" }, - "Responses": { + "QuestionAndResponses": { "additionalProperties": false, "properties": { - "name": { + "metadata": { + "$ref": "#/definitions/QuestionMetaData" + }, + "question": { "type": "string" + }, + "responses": { + "anyOf": [ + { + "items": { + "$ref": "#/definitions/Response" + }, + "type": "array" + }, + { + "type": "string" + } + ] } }, "required": [ - "name" + "question", + "responses" ], "type": "object" }, - "Result": { + "QuestionMetaData": { "additionalProperties": false, "properties": { - "name": { + "auto_answered": { + "type": "boolean" + }, + "feedback": { + "type": "string" + }, + "notes": { + "type": "string" + }, + "policy_refs": { + "items": { + "additionalProperties": false, + "properties": { + "text": { + "type": "string" + }, + "url": { + "type": "string" + } + }, + "type": "object" + }, + "type": "array" + }, + "section_name": { + "type": "string" + } + }, + "type": "object" + }, + "Response": { + "additionalProperties": false, + "properties": { + "metadata": { + "$ref": "#/definitions/ResponseMetaData" + }, + "value": { "type": "string" } }, "required": [ - "name" + "value" ], "type": "object" }, + "ResponseMetaData": { + "additionalProperties": false, + "properties": { + "flags": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "Responses": { + "$id": "#Responses", + "description": "The ordered list of questions, answers, and their metadata for this application", + "items": { + "$ref": "#/definitions/QuestionAndResponses" + }, + "type": "array" + }, + "Result": { + "$id": "#Result", + "description": "The result of this application. Results are determined by flags corresponding to responses; each application can have up to one result per flagset", + "items": { + "$ref": "#/definitions/ResultFlag" + }, + "type": "array" + }, + "ResultFlag": { + "$id": "#ResultFlag", + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "description": { + "const": "It looks like the changes may now be beyond the time limit for enforcement action. This does not apply if the changes have been deliberately concealed.", + "type": "string" + }, + "value": { + "const": "Planning permission / Immune", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "There is some key information missing that will be needed to assess this application.", + "type": "string" + }, + "value": { + "const": "Planning permission / Missing information", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "It looks like the proposed changes may require planning permission.", + "type": "string" + }, + "value": { + "const": "Planning permission / Permission needed", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "It looks like the proposed changes do not require planning permission, however the applicant must apply for Prior Approval before proceeding.", + "type": "string" + }, + "value": { + "const": "Planning permission / Prior approval", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "It looks like the proposed changes may not require planning permission, however the applicant must provide notice to the planning authority before proceeding.", + "type": "string" + }, + "value": { + "const": "Planning permission / Notice", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "It looks like the proposed changes may fall within the rules for Permitted Development and therefore would not need planning permission.", + "type": "string" + }, + "value": { + "const": "Planning permission / Permitted development", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "It looks like the proposed changes may not fall within the legal definition of 'development', and therefore would not require planning permission.", + "type": "string" + }, + "value": { + "const": "Planning permission / Not development", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "", + "type": "string" + }, + "value": { + "const": "Listed building consent / Missing information", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "", + "type": "string" + }, + "value": { + "const": "Listed building consent / Required", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "", + "type": "string" + }, + "value": { + "const": "Listed building consent / De minimis", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "", + "type": "string" + }, + "value": { + "const": "Listed building consent / Not required", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "", + "type": "string" + }, + "value": { + "const": "Works to trees & hedges / Missing information", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "", + "type": "string" + }, + "value": { + "const": "Works to trees & hedges / Required", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "", + "type": "string" + }, + "value": { + "const": "Works to trees & hedges / De minimis", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "", + "type": "string" + }, + "value": { + "const": "Works to trees & hedges / Not required", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "", + "type": "string" + }, + "value": { + "const": "Demolition in a conservation area / Missing information", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "", + "type": "string" + }, + "value": { + "const": "Demolition in a conservation area / Required", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "", + "type": "string" + }, + "value": { + "const": "Demolition in a conservation area / De minimis", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "", + "type": "string" + }, + "value": { + "const": "Demolition in a conservation area / Not required", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "", + "type": "string" + }, + "value": { + "const": "Planning policy / Missing information", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "", + "type": "string" + }, + "value": { + "const": "Planning policy / Fails to meet policy", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "", + "type": "string" + }, + "value": { + "const": "Planning policy / Edge case", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "", + "type": "string" + }, + "value": { + "const": "Planning policy / Meets policy", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "", + "type": "string" + }, + "value": { + "const": "Community infrastructure levy / Missing information", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "", + "type": "string" + }, + "value": { + "const": "Community infrastructure levy / Exemption void", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "", + "type": "string" + }, + "value": { + "const": "Community infrastructure levy / Exempt", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "", + "type": "string" + }, + "value": { + "const": "Community infrastructure levy / Relief void", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "", + "type": "string" + }, + "value": { + "const": "Community infrastructure levy / Relief", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "", + "type": "string" + }, + "value": { + "const": "Community infrastructure levy / Liable", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "", + "type": "string" + }, + "value": { + "const": "Community infrastructure levy / Not liable", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + } + ], + "description": "An individual result of this application" + }, "SiteContact": { "$id": "#SiteContact", "anyOf": [ diff --git a/types/schema/Responses.ts b/types/schema/Responses.ts index acf9e663..9766566a 100644 --- a/types/schema/Responses.ts +++ b/types/schema/Responses.ts @@ -1,3 +1,31 @@ -export interface Responses { - name: string; +/** + * @id #Responses + * @description The ordered list of questions, answers, and their metadata for this application + */ +export type Responses = QuestionAndResponses[]; + +export interface QuestionMetaData { + auto_answered?: boolean; + policy_refs?: Array<{ + url?: string; + text?: string; + }>; + section_name?: string; + feedback?: string; + notes?: string; } + +export interface ResponseMetaData { + flags?: Array; // @todo connect to result/flags enum +} + +export interface Response { + value: string; + metadata?: ResponseMetaData; +} + +export interface QuestionAndResponses { + question: string; + responses: Array | string; + metadata?: QuestionMetaData; +}; From 90ad8e26de2d50c2325e69150f3d89c99edfe82b Mon Sep 17 00:00:00 2001 From: Jessica McInchak Date: Mon, 18 Sep 2023 11:38:56 +0200 Subject: [PATCH 2/3] fix type errors --- examples/data/Responses.ts | 38 ++++++++++----------- examples/index.ts | 17 +++++----- types/enums/Flags.ts | 67 +++++++++++++++++++++----------------- types/schema/Responses.ts | 2 +- types/schema/Result.ts | 2 +- 5 files changed, 67 insertions(+), 59 deletions(-) diff --git a/examples/data/Responses.ts b/examples/data/Responses.ts index 0b151bdb..9a332f0f 100644 --- a/examples/data/Responses.ts +++ b/examples/data/Responses.ts @@ -1,32 +1,32 @@ -import { Schema } from '../../types/Schema'; +import {Schema} from '../../types/Schema'; export const validResponses: Schema['responses'] = [ { - "metadata": { - "section_name": "The property", - "auto_answered": true + metadata: { + section_name: 'The property', + auto_answered: true, }, - "question": "Is the property in London Borough of Southwark?", - "responses": [ + question: 'Is the property in London Borough of Southwark?', + responses: [ { - "value": "Yes" - } - ] + value: 'Yes', + }, + ], }, { - "metadata": { - "policy_refs": [ + metadata: { + policy_refs: [ { - "text": "Town and Country Planning Act 1990, Part 7, Section 191 & Section 192" - } + text: 'Town and Country Planning Act 1990, Part 7, Section 191 & Section 192', + }, ], - "section_name": "About the project" + section_name: 'About the project', }, - "question": "What are you applying about?", - "responses": [ + question: 'What are you applying about?', + responses: [ { - "value": "Proposed changes I want to make in the future" - } - ] + value: 'Proposed changes I want to make in the future', + }, + ], }, ]; diff --git a/examples/index.ts b/examples/index.ts index 10cb6f2c..65226c54 100644 --- a/examples/index.ts +++ b/examples/index.ts @@ -3,7 +3,7 @@ import {validAgent, validApplicant} from './data/Applicant'; import {validApplication} from './data/Application'; import {validProperty} from './data/Property'; import {validProposal} from './data/Proposal'; -import { validResponses } from './data/Responses'; +import {validResponses} from './data/Responses'; const validMetadata: Schema['metadata'] = { service: { @@ -46,14 +46,15 @@ const validFiles: Schema['files'] = [ }, ]; -const validResult = [ +const validResult: Schema['result'] = [ { - value: "Planning permission / Permitted development", - description: "It looks like the proposed changes may fall within the rules for Permitted Development and therefore would not need planning permission." + value: 'Planning permission / Permitted development', + description: + 'It looks like the proposed changes may fall within the rules for Permitted Development and therefore would not need planning permission.', }, { - value: "Listed building consent / Not required", - description: "", + value: 'Listed building consent / Not required', + description: '', }, ]; @@ -69,7 +70,7 @@ export const validExampleApplicant: Schema = { }, result: validResult, metadata: validMetadata, - repsonses: validResponses, + responses: validResponses, files: validFiles, }; @@ -85,6 +86,6 @@ export const validExampleAgent: Schema = { }, result: validResult, metadata: validMetadata, - repsonses: validResponses, + responses: validResponses, files: validFiles, }; diff --git a/types/enums/Flags.ts b/types/enums/Flags.ts index 55b5c65a..506da97c 100644 --- a/types/enums/Flags.ts +++ b/types/enums/Flags.ts @@ -2,34 +2,41 @@ * Flags */ export const Flags = { - "Planning permission / Immune": "It looks like the changes may now be beyond the time limit for enforcement action. This does not apply if the changes have been deliberately concealed.", - "Planning permission / Missing information": "There is some key information missing that will be needed to assess this application.", - "Planning permission / Permission needed": "It looks like the proposed changes may require planning permission.", - "Planning permission / Prior approval": "It looks like the proposed changes do not require planning permission, however the applicant must apply for Prior Approval before proceeding.", - "Planning permission / Notice": "It looks like the proposed changes may not require planning permission, however the applicant must provide notice to the planning authority before proceeding.", - "Planning permission / Permitted development": "It looks like the proposed changes may fall within the rules for Permitted Development and therefore would not need planning permission.", - "Planning permission / Not development": "It looks like the proposed changes may not fall within the legal definition of 'development', and therefore would not require planning permission.", - "Listed building consent / Missing information": "", - "Listed building consent / Required": "", - "Listed building consent / De minimis": "", - "Listed building consent / Not required": "", - "Works to trees & hedges / Missing information": "", - "Works to trees & hedges / Required": "", - "Works to trees & hedges / De minimis": "", - "Works to trees & hedges / Not required": "", - "Demolition in a conservation area / Missing information": "", - "Demolition in a conservation area / Required": "", - "Demolition in a conservation area / De minimis": "", - "Demolition in a conservation area / Not required": "", - "Planning policy / Missing information": "", - "Planning policy / Fails to meet policy": "", - "Planning policy / Edge case": "", - "Planning policy / Meets policy": "", - "Community infrastructure levy / Missing information": "", - "Community infrastructure levy / Exemption void": "", - "Community infrastructure levy / Exempt": "", - "Community infrastructure levy / Relief void": "", - "Community infrastructure levy / Relief": "", - "Community infrastructure levy / Liable": "", - "Community infrastructure levy / Not liable": "", + 'Planning permission / Immune': + 'It looks like the changes may now be beyond the time limit for enforcement action. This does not apply if the changes have been deliberately concealed.', + 'Planning permission / Missing information': + 'There is some key information missing that will be needed to assess this application.', + 'Planning permission / Permission needed': + 'It looks like the proposed changes may require planning permission.', + 'Planning permission / Prior approval': + 'It looks like the proposed changes do not require planning permission, however the applicant must apply for Prior Approval before proceeding.', + 'Planning permission / Notice': + 'It looks like the proposed changes may not require planning permission, however the applicant must provide notice to the planning authority before proceeding.', + 'Planning permission / Permitted development': + 'It looks like the proposed changes may fall within the rules for Permitted Development and therefore would not need planning permission.', + 'Planning permission / Not development': + "It looks like the proposed changes may not fall within the legal definition of 'development', and therefore would not require planning permission.", + 'Listed building consent / Missing information': '', + 'Listed building consent / Required': '', + 'Listed building consent / De minimis': '', + 'Listed building consent / Not required': '', + 'Works to trees & hedges / Missing information': '', + 'Works to trees & hedges / Required': '', + 'Works to trees & hedges / De minimis': '', + 'Works to trees & hedges / Not required': '', + 'Demolition in a conservation area / Missing information': '', + 'Demolition in a conservation area / Required': '', + 'Demolition in a conservation area / De minimis': '', + 'Demolition in a conservation area / Not required': '', + 'Planning policy / Missing information': '', + 'Planning policy / Fails to meet policy': '', + 'Planning policy / Edge case': '', + 'Planning policy / Meets policy': '', + 'Community infrastructure levy / Missing information': '', + 'Community infrastructure levy / Exemption void': '', + 'Community infrastructure levy / Exempt': '', + 'Community infrastructure levy / Relief void': '', + 'Community infrastructure levy / Relief': '', + 'Community infrastructure levy / Liable': '', + 'Community infrastructure levy / Not liable': '', }; diff --git a/types/schema/Responses.ts b/types/schema/Responses.ts index 9766566a..15e1bedb 100644 --- a/types/schema/Responses.ts +++ b/types/schema/Responses.ts @@ -28,4 +28,4 @@ export interface QuestionAndResponses { question: string; responses: Array | string; metadata?: QuestionMetaData; -}; +} diff --git a/types/schema/Result.ts b/types/schema/Result.ts index 4b8dadaa..ffd4c46b 100644 --- a/types/schema/Result.ts +++ b/types/schema/Result.ts @@ -1,4 +1,4 @@ -import {Flags} from "../enums/Flags"; +import {Flags} from '../enums/Flags'; /** * @id #Result From c0298272b2c6901833e9b69056e8088594da6936 Mon Sep 17 00:00:00 2001 From: Jessica McInchak Date: Mon, 18 Sep 2023 12:37:12 +0200 Subject: [PATCH 3/3] pr feedback --- examples/data/Responses.ts | 8 ++--- examples/validExampleAgent.json | 46 +++++++++++++++++++++++++---- examples/validExampleApplicant.json | 46 +++++++++++++++++++++++++---- schema/schema.json | 12 ++------ types/schema/Responses.ts | 8 ++--- 5 files changed, 90 insertions(+), 30 deletions(-) diff --git a/examples/data/Responses.ts b/examples/data/Responses.ts index 9a332f0f..8dcddd6e 100644 --- a/examples/data/Responses.ts +++ b/examples/data/Responses.ts @@ -3,8 +3,8 @@ import {Schema} from '../../types/Schema'; export const validResponses: Schema['responses'] = [ { metadata: { - section_name: 'The property', - auto_answered: true, + sectionName: 'The property', + autoAnswered: true, }, question: 'Is the property in London Borough of Southwark?', responses: [ @@ -15,12 +15,12 @@ export const validResponses: Schema['responses'] = [ }, { metadata: { - policy_refs: [ + policyRefs: [ { text: 'Town and Country Planning Act 1990, Part 7, Section 191 & Section 192', }, ], - section_name: 'About the project', + sectionName: 'About the project', }, question: 'What are you applying about?', responses: [ diff --git a/examples/validExampleAgent.json b/examples/validExampleAgent.json index 58c63314..3ee9ce33 100644 --- a/examples/validExampleAgent.json +++ b/examples/validExampleAgent.json @@ -134,9 +134,16 @@ "description": "This is a test application" } }, - "result": { - "name": "Test" - }, + "result": [ + { + "value": "Planning permission / Permitted development", + "description": "It looks like the proposed changes may fall within the rules for Permitted Development and therefore would not need planning permission." + }, + { + "value": "Listed building consent / Not required", + "description": "" + } + ], "metadata": { "service": { "publishedFlowId": "b3320abe-f5bc-4185-b61f-40e9e65f07ad", @@ -151,9 +158,36 @@ "submittedAt": "2018-11-13T20:20:39+00:00" } }, - "responses": { - "name": "Test" - }, + "responses": [ + { + "metadata": { + "sectionName": "The property", + "autoAnswered": true + }, + "question": "Is the property in London Borough of Southwark?", + "responses": [ + { + "value": "Yes" + } + ] + }, + { + "metadata": { + "policyRefs": [ + { + "text": "Town and Country Planning Act 1990, Part 7, Section 191 & Section 192" + } + ], + "sectionName": "About the project" + }, + "question": "What are you applying about?", + "responses": [ + { + "value": "Proposed changes I want to make in the future" + } + ] + } + ], "files": [ { "name": "https://api.editor.planx.uk/file/private/folderId/file1.pdf", diff --git a/examples/validExampleApplicant.json b/examples/validExampleApplicant.json index 67bcb74f..f903106f 100644 --- a/examples/validExampleApplicant.json +++ b/examples/validExampleApplicant.json @@ -107,9 +107,16 @@ "description": "This is a test application" } }, - "result": { - "name": "Test" - }, + "result": [ + { + "value": "Planning permission / Permitted development", + "description": "It looks like the proposed changes may fall within the rules for Permitted Development and therefore would not need planning permission." + }, + { + "value": "Listed building consent / Not required", + "description": "" + } + ], "metadata": { "service": { "publishedFlowId": "b3320abe-f5bc-4185-b61f-40e9e65f07ad", @@ -124,9 +131,36 @@ "submittedAt": "2018-11-13T20:20:39+00:00" } }, - "responses": { - "name": "Test" - }, + "responses": [ + { + "metadata": { + "sectionName": "The property", + "autoAnswered": true + }, + "question": "Is the property in London Borough of Southwark?", + "responses": [ + { + "value": "Yes" + } + ] + }, + { + "metadata": { + "policyRefs": [ + { + "text": "Town and Country Planning Act 1990, Part 7, Section 191 & Section 192" + } + ], + "sectionName": "About the project" + }, + "question": "What are you applying about?", + "responses": [ + { + "value": "Proposed changes I want to make in the future" + } + ] + } + ], "files": [ { "name": "https://api.editor.planx.uk/file/private/folderId/file1.pdf", diff --git a/schema/schema.json b/schema/schema.json index 15c3f8c8..9a009f7b 100644 --- a/schema/schema.json +++ b/schema/schema.json @@ -11700,16 +11700,10 @@ "QuestionMetaData": { "additionalProperties": false, "properties": { - "auto_answered": { + "autoAnswered": { "type": "boolean" }, - "feedback": { - "type": "string" - }, - "notes": { - "type": "string" - }, - "policy_refs": { + "policyRefs": { "items": { "additionalProperties": false, "properties": { @@ -11724,7 +11718,7 @@ }, "type": "array" }, - "section_name": { + "sectionName": { "type": "string" } }, diff --git a/types/schema/Responses.ts b/types/schema/Responses.ts index 15e1bedb..5c2d1a45 100644 --- a/types/schema/Responses.ts +++ b/types/schema/Responses.ts @@ -5,14 +5,12 @@ export type Responses = QuestionAndResponses[]; export interface QuestionMetaData { - auto_answered?: boolean; - policy_refs?: Array<{ + autoAnswered?: boolean; + policyRefs?: Array<{ url?: string; text?: string; }>; - section_name?: string; - feedback?: string; - notes?: string; + sectionName?: string; } export interface ResponseMetaData {