From a7b58bfd340026b1c6448719874f3545ec9ed5b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dafydd=20Ll=C5=B7r=20Pearson?= Date: Thu, 8 Feb 2024 11:20:09 +0000 Subject: [PATCH 1/2] feat: Add `RequestedFiles` (v1) (#110) --- examples/data/ldcE.ts | 35 ++++++++++++++++++++++++++ examples/data/ldcP.ts | 38 ++++++++++++++++++++++++++++ examples/data/planningPermission.ts | 39 +++++++++++++++++++++++++++++ examples/data/priorApproval.ts | 15 +++++++++++ schema/schema.json | 37 ++++++++++++++++++++++++++- types/schema/Metadata.ts | 12 +++++++++ 6 files changed, 175 insertions(+), 1 deletion(-) diff --git a/examples/data/ldcE.ts b/examples/data/ldcE.ts index eeff926a..33367068 100644 --- a/examples/data/ldcE.ts +++ b/examples/data/ldcE.ts @@ -1233,6 +1233,41 @@ export const validLDCE: Schema = { service: { flowId: '824628b2-deeb-48b0-92b1-2ca7f3b17163', url: 'https://www.editor.planx.dev/buckinghamshire/apply-for-a-lawful-development-certificate/preview', + files: { + required: [ + { + value: 'photographs.proposed', + description: 'Photographs - proposed', + }, + { + value: 'sitePlan.proposed', + description: 'Site plan - proposed', + }, + { + value: 'elevations.proposed', + description: 'Elevations - proposed', + }, + { + value: 'floorPlan.proposed', + description: 'Floor plan - proposed', + }, + { + value: 'floorPlan.proposed', + description: 'Floor plan - proposed', + }, + ], + recommended: [ + { + value: 'otherEvidence', + description: 'Other - evidence or correspondence', + }, + { + value: 'constructionInvoice', + description: 'Construction invoice', + }, + ], + optional: [], + }, }, submittedAt: '2023-10-02t00:00:00z', schema: diff --git a/examples/data/ldcP.ts b/examples/data/ldcP.ts index a02062e5..d44c69f8 100644 --- a/examples/data/ldcP.ts +++ b/examples/data/ldcP.ts @@ -837,6 +837,44 @@ export const validLDCP: Schema = { service: { flowId: '824628b2-deeb-48b0-92b1-2ca7f3b17163', url: 'https://www.editor.planx.dev/buckinghamshire/apply-for-a-lawful-development-certificate/preview', + files: { + required: [ + { + value: 'roofPlan.existing', + description: 'Roof plan - existing', + }, + { + value: 'sitePlan.existing', + description: 'Site plan - existing', + }, + { + value: 'roofPlan.proposed', + description: 'Roof plan - proposed', + }, + { + value: 'sitePlan.proposed', + description: 'Site plan - proposed', + }, + { + value: 'elevations.existing', + description: 'Elevations - existing', + }, + { + value: 'floorPlan.existing', + description: 'Floor plan - existing', + }, + { + value: 'elevations.proposed', + description: 'Elevations - proposed', + }, + { + value: 'floorPlan.proposed', + description: 'Floor plan - proposed', + }, + ], + recommended: [], + optional: [], + }, }, submittedAt: '2023-10-02T00:00:00+01:00', schema: diff --git a/examples/data/planningPermission.ts b/examples/data/planningPermission.ts index a17b09ba..c4b7f922 100644 --- a/examples/data/planningPermission.ts +++ b/examples/data/planningPermission.ts @@ -1255,6 +1255,45 @@ export const validPlanningPermission: Schema = { service: { flowId: '01e38c5d-e701-4e44-acdc-4d6b5cc3b854', url: 'https://www.editor.planx.dev/lambeth/apply-for-planning-permission/preview', + files: { + required: [ + { + value: 'roofPlan.existing', + description: 'Roof plan - existing', + }, + { + value: 'roofPlan.proposed', + description: 'Roof plan - proposed', + }, + { + value: 'sitePlan.existing', + description: 'Site plan - existing', + }, + { + value: 'sitePlan.proposed', + description: 'Site plan - proposed', + }, + { + value: 'elevations.existing', + description: 'Elevations - existing', + }, + { + value: 'elevations.proposed', + description: 'Elevations - proposed', + }, + ], + recommended: [ + { + value: 'floorPlan.existing', + description: 'Floor plan - existing', + }, + { + value: 'floorPlan.proposed', + description: 'Floor plan - proposed', + }, + ], + optional: [], + }, }, submittedAt: '2023-10-02T00:00:00.00Z', schema: diff --git a/examples/data/priorApproval.ts b/examples/data/priorApproval.ts index 7a726f90..4d4eb1bc 100644 --- a/examples/data/priorApproval.ts +++ b/examples/data/priorApproval.ts @@ -772,6 +772,21 @@ export const validPriorApproval: Schema = { service: { flowId: 'c6628103-c648-4663-81e1-bfa0a1a18340', url: 'https://www.editor.planx.dev/southwark/apply-for-prior-approval/preview', + files: { + required: [ + { + value: 'otherDrawing', + description: 'Other - drawing', + }, + ], + recommended: [ + { + value: 'sitePlan.proposed', + description: 'Site plan - proposed', + }, + ], + optional: [], + }, }, submittedAt: '2023-10-02T00:00:00Z', schema: diff --git a/schema/schema.json b/schema/schema.json index 407c50c8..d16e5965 100644 --- a/schema/schema.json +++ b/schema/schema.json @@ -4381,6 +4381,9 @@ "service": { "additionalProperties": false, "properties": { + "files": { + "$ref": "#/definitions/RequestedFiles" + }, "flowId": { "$ref": "#/definitions/UUID" }, @@ -4390,7 +4393,8 @@ }, "required": [ "flowId", - "url" + "url", + "files" ], "type": "object" }, @@ -20504,6 +20508,37 @@ }, "type": "object" }, + "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.", + "properties": { + "optional": { + "items": { + "$ref": "#/definitions/FileType" + }, + "type": "array" + }, + "recommended": { + "items": { + "$ref": "#/definitions/FileType" + }, + "type": "array" + }, + "required": { + "items": { + "$ref": "#/definitions/FileType" + }, + "type": "array" + } + }, + "required": [ + "required", + "recommended", + "optional" + ], + "type": "object" + }, "Response": { "additionalProperties": false, "properties": { diff --git a/types/schema/Metadata.ts b/types/schema/Metadata.ts index 71e7733c..35128ef0 100644 --- a/types/schema/Metadata.ts +++ b/types/schema/Metadata.ts @@ -1,4 +1,5 @@ import {DateTime, URL, UUID} from './../utils'; +import {FileType} from './File'; /** * @id #DigitalPlanningMetadata @@ -24,6 +25,16 @@ export interface BaseMetadata { schema: URL; } +/** + * @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. + */ +export interface RequestedFiles { + required: FileType[]; + recommended: FileType[]; + optional: FileType[]; +} + /** * @id #PlanXMetadata * @description Additional metadata associated with applications submitted via PlanX @@ -33,5 +44,6 @@ export interface PlanXMetadata extends BaseMetadata { service: { flowId: UUID; url: URL; + files: RequestedFiles; }; } From 2510a94eeb8000fa0ca78786ed02e10e08a2bfc9 Mon Sep 17 00:00:00 2001 From: Jessica McInchak Date: Thu, 8 Feb 2024 14:21:43 +0000 Subject: [PATCH 2/2] fix: add two additional `FileTypes` (#112) --- schema/schema.json | 38 +++++++++++++++++++++++++++++++++++++- types/enums/FileTypes.ts | 4 +++- 2 files changed, 40 insertions(+), 2 deletions(-) diff --git a/schema/schema.json b/schema/schema.json index d16e5965..b21b5d7d 100644 --- a/schema/schema.json +++ b/schema/schema.json @@ -2315,6 +2315,42 @@ ], "type": "object" }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Joiner's report", + "type": "string" + }, + "value": { + "const": "joinersReport", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "description": { + "const": "Joinery section report", + "type": "string" + }, + "value": { + "const": "joinerySections", + "type": "string" + } + }, + "required": [ + "value", + "description" + ], + "type": "object" + }, { "additionalProperties": false, "properties": { @@ -3133,7 +3169,7 @@ "type": "string" }, "value": { - "const": "utilitiesBill", + "const": "utilityBill", "type": "string" } }, diff --git a/types/enums/FileTypes.ts b/types/enums/FileTypes.ts index ba2cc2e6..d7cc1935 100644 --- a/types/enums/FileTypes.ts +++ b/types/enums/FileTypes.ts @@ -36,6 +36,8 @@ export const FileTypes = { hydrologyReport: 'Hydrology report', internalElevations: 'Internal elevations', internalSections: 'Internal sections', + joinersReport: "Joiner's report", + joinerySections: 'Joinery section report', landContaminationAssessment: 'Land contamination assessment', landscapeAndVisualImpactAssessment: 'Landscape and visual impact assessment (LVIA)', @@ -84,7 +86,7 @@ export const FileTypes = { 'unitPlan.proposed': 'Unit plan - proposed', 'usePlan.existing': 'Use plan - existing', 'usePlan.proposed': 'Use plan - proposed', - utilitiesBill: 'Utility bill', + utilityBill: 'Utility bill', utilitiesStatement: 'Utilities statement', ventilationStatement: 'Ventilation or extraction statement', visualisations: 'Visualisations',