From 90ad8e26de2d50c2325e69150f3d89c99edfe82b Mon Sep 17 00:00:00 2001 From: Jessica McInchak Date: Mon, 18 Sep 2023 11:38:56 +0200 Subject: [PATCH] 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