From 324e2356b4ebc2181aed81b5e4af2600326dcaac Mon Sep 17 00:00:00 2001 From: Jessica McInchak Date: Wed, 21 Feb 2024 13:58:35 +0100 Subject: [PATCH] first draft --- examples/data/ldcE.ts | 4 ++ examples/data/ldcP.ts | 36 ++++++++++++++++ examples/data/planningPermission.ts | 4 ++ examples/data/priorApproval.ts | 4 ++ schema/schema.json | 64 ++++++++++++++++++++++++++++- types/schema/Metadata.ts | 22 +++++++++- 6 files changed, 131 insertions(+), 3 deletions(-) diff --git a/examples/data/ldcE.ts b/examples/data/ldcE.ts index 1f3bdc56..c43adb24 100644 --- a/examples/data/ldcE.ts +++ b/examples/data/ldcE.ts @@ -1274,6 +1274,10 @@ export const validLDCE: Schema = { ], optional: [], }, + fees: { + calculated: [], + payable: [], + }, }, submittedAt: '2023-10-02t00:00:00z', schema: diff --git a/examples/data/ldcP.ts b/examples/data/ldcP.ts index d44c69f8..d572bfaa 100644 --- a/examples/data/ldcP.ts +++ b/examples/data/ldcP.ts @@ -875,6 +875,42 @@ export const validLDCP: Schema = { recommended: [], optional: [], }, + fees: { + calculated: [ + { + description: + 'The plannning fee for an application for a Certificate of Lawfulness relating to the proposed alteration or extension of a single home is £129', + policyRefs: [ + { + text: 'UK Stuatory Instruments 2023 No. 1197', + url: 'https://www.legislation.gov.uk/uksi/2023/1197/made', + }, + ], + }, + ], + payable: [ + { + description: + 'If the proposed works (to either a home or within the curtilage of a home) is for the sole purpose of providing either: a means of access to (or within) the dwellinghouse for a disabled resident (current or future); providing facilities that are designed to ensure the disabled persons safety, health or comfort; or providing disabled access to a public building. Then no planning fee will be payable for this application.', + policyRefs: [ + { + text: 'UK Statutory Instruments 2012 No. 2920 Regulation 4', + url: 'https://www.legislation.gov.uk/uksi/2012/2920/regulation/4/made', + }, + ], + }, + { + description: + 'In the case of an application that is the first resubmission of an application on the same site that is similar in character and description, no planning fee is payable.', + policyRefs: [ + { + text: 'UK Statutory Instruments 2012 No. 2920 Regulation 8', + url: 'https://www.legislation.gov.uk/uksi/2012/2920/regulation/8/made', + }, + ], + }, + ], + }, }, submittedAt: '2023-10-02T00:00:00+01:00', schema: diff --git a/examples/data/planningPermission.ts b/examples/data/planningPermission.ts index c4b7f922..86dd7e28 100644 --- a/examples/data/planningPermission.ts +++ b/examples/data/planningPermission.ts @@ -1294,6 +1294,10 @@ export const validPlanningPermission: Schema = { ], optional: [], }, + fees: { + calculated: [], + payable: [], + }, }, submittedAt: '2023-10-02T00:00:00.00Z', schema: diff --git a/examples/data/priorApproval.ts b/examples/data/priorApproval.ts index dc27c4db..806ceb35 100644 --- a/examples/data/priorApproval.ts +++ b/examples/data/priorApproval.ts @@ -802,6 +802,10 @@ export const validPriorApproval: Schema = { ], optional: [], }, + fees: { + calculated: [], + payable: [], + }, }, submittedAt: '2023-10-02T00:00:00Z', schema: diff --git a/schema/schema.json b/schema/schema.json index e866a5e9..e90608b6 100644 --- a/schema/schema.json +++ b/schema/schema.json @@ -1605,6 +1605,38 @@ }, "type": "object" }, + "CalculateMetadata": { + "$id": "#CalculateMetadata", + "additionalProperties": false, + "description": "Metadata associated with PlanX Calculate components used to determine fees throughout a service", + "properties": { + "description": { + "type": "string" + }, + "policyRefs": { + "items": { + "additionalProperties": false, + "properties": { + "text": { + "type": "string" + }, + "url": { + "$ref": "#/definitions/URL" + } + }, + "required": [ + "text" + ], + "type": "object" + }, + "type": "array" + } + }, + "required": [ + "description" + ], + "type": "object" + }, "Date": { "format": "date", "type": "string" @@ -1717,6 +1749,30 @@ ], "type": "object" }, + "FeesExplanation": { + "$id": "#FeesExplanation", + "additionalProperties": false, + "description": "An explanation, including policy references, of the calculated and payable fees associated with this application", + "properties": { + "calculated": { + "items": { + "$ref": "#/definitions/CalculateMetadata" + }, + "type": "array" + }, + "payable": { + "items": { + "$ref": "#/definitions/CalculateMetadata" + }, + "type": "array" + } + }, + "required": [ + "calculated", + "payable" + ], + "type": "object" + }, "File": { "$id": "#File", "additionalProperties": false, @@ -4422,6 +4478,9 @@ "service": { "additionalProperties": false, "properties": { + "fees": { + "$ref": "#/definitions/FeesExplanation" + }, "files": { "$ref": "#/definitions/RequestedFiles" }, @@ -4435,7 +4494,8 @@ "required": [ "flowId", "url", - "files" + "files", + "fees" ], "type": "object" }, @@ -21102,7 +21162,7 @@ "RequestedFiles": { "$id": "#RequestedFiles", "additionalProperties": false, - "description": "File types requested by this service. Schema[\"files\"] will be a subset of this list based on the user's journey through the service.", + "description": "File types requested by this service. Schema[\"files\"] will be a subset of this list based on the user's journey through the service", "properties": { "optional": { "items": { diff --git a/types/schema/Metadata.ts b/types/schema/Metadata.ts index aeb33919..106389fe 100644 --- a/types/schema/Metadata.ts +++ b/types/schema/Metadata.ts @@ -1,5 +1,6 @@ import {DateTime, URL, UUID} from './../utils'; import {FileType} from './File'; +import {QuestionMetaData} from './Responses'; /** * @id #DigitalPlanningMetadata @@ -35,7 +36,7 @@ export interface AnyProviderMetadata extends BaseMetadata { /** * @id #RequestedFiles - * @description File types requested by this service. Schema["files"] will be a subset of this list based on the user's journey through the service. + * @description File types requested by this service. Schema["files"] will be a subset of this list based on the user's journey through the service */ export interface RequestedFiles { required: FileType[]; @@ -43,6 +44,24 @@ export interface RequestedFiles { optional: FileType[]; } +/** + * @id #CalculateMetadata + * @description Metadata associated with PlanX Calculate components used to determine fees throughout a service + */ +export interface CalculateMetadata { + description: string; + policyRefs: QuestionMetaData['policyRefs']; +} + +/** + * @id #FeesExplanation + * @description An explanation, including policy references, of the calculated and payable fees associated with this application + */ +export interface FeesExplanation { + calculated: CalculateMetadata[]; + payable: CalculateMetadata[]; +} + /** * @id #PlanXMetadata * @description Additional metadata associated with applications submitted via PlanX @@ -53,5 +72,6 @@ export interface PlanXMetadata extends BaseMetadata { flowId: UUID; url: URL; files: RequestedFiles; + fees: FeesExplanation; }; }