diff --git a/examples/data/ldcE.ts b/examples/data/ldcE.ts index eeff926a..89e1a660 100644 --- a/examples/data/ldcE.ts +++ b/examples/data/ldcE.ts @@ -1233,6 +1233,44 @@ 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: [ + { + value: 'photographs.proposed', + description: 'Photographs - proposed', + condition: 'required', + }, + { + value: 'sitePlan.proposed', + description: 'Site plan - proposed', + condition: 'required', + }, + + { + value: 'elevations.proposed', + description: 'Elevations - proposed', + condition: 'required', + }, + { + value: 'floorPlan.proposed', + description: 'Floor plan - proposed', + condition: 'recommended', + }, + { + value: 'floorPlan.proposed', + description: 'Floor plan - proposed', + condition: 'optional', + }, + { + value: 'otherEvidence', + description: 'Other - evidence or correspondence', + condition: 'optional', + }, + { + value: 'constructionInvoice', + description: 'Construction invoice', + condition: 'optional', + }, + ], }, submittedAt: '2023-10-02t00:00:00z', schema: diff --git a/examples/data/ldcP.ts b/examples/data/ldcP.ts index a02062e5..71628d04 100644 --- a/examples/data/ldcP.ts +++ b/examples/data/ldcP.ts @@ -837,6 +837,48 @@ 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: [ + { + value: 'roofPlan.existing', + description: 'Roof plan - existing', + condition: 'required', + }, + { + value: 'sitePlan.existing', + description: 'Site plan - existing', + condition: 'required', + }, + { + value: 'roofPlan.proposed', + description: 'Roof plan - proposed', + condition: 'required', + }, + { + value: 'sitePlan.proposed', + description: 'Site plan - proposed', + condition: 'required', + }, + { + value: 'elevations.existing', + description: 'Elevations - existing', + condition: 'required', + }, + { + value: 'floorPlan.existing', + description: 'Floor plan - existing', + condition: 'recommended', + }, + { + value: 'elevations.proposed', + description: 'Elevations - proposed', + condition: 'recommended', + }, + { + value: 'floorPlan.proposed', + description: 'Floor plan - proposed', + condition: 'recommended', + }, + ], }, submittedAt: '2023-10-02T00:00:00+01:00', schema: diff --git a/examples/data/planningPermission.ts b/examples/data/planningPermission.ts index a17b09ba..42b2c2a0 100644 --- a/examples/data/planningPermission.ts +++ b/examples/data/planningPermission.ts @@ -1255,6 +1255,48 @@ export const validPlanningPermission: Schema = { service: { flowId: '01e38c5d-e701-4e44-acdc-4d6b5cc3b854', url: 'https://www.editor.planx.dev/lambeth/apply-for-planning-permission/preview', + files: [ + { + value: 'roofPlan.existing', + description: 'Roof plan - existing', + condition: 'required', + }, + { + value: 'roofPlan.proposed', + description: 'Roof plan - proposed', + condition: 'required', + }, + { + value: 'sitePlan.existing', + description: 'Site plan - existing', + condition: 'required', + }, + { + value: 'sitePlan.proposed', + description: 'Site plan - proposed', + condition: 'recommended', + }, + { + value: 'elevations.existing', + description: 'Elevations - existing', + condition: 'recommended', + }, + { + value: 'elevations.proposed', + description: 'Elevations - proposed', + condition: 'recommended', + }, + { + value: 'floorPlan.existing', + description: 'Floor plan - existing', + condition: 'recommended', + }, + { + value: 'floorPlan.proposed', + description: 'Floor plan - proposed', + condition: 'recommended', + }, + ], }, submittedAt: '2023-10-02T00:00:00.00Z', schema: diff --git a/examples/data/priorApproval.ts b/examples/data/priorApproval.ts index 7a726f90..4569c487 100644 --- a/examples/data/priorApproval.ts +++ b/examples/data/priorApproval.ts @@ -772,6 +772,18 @@ export const validPriorApproval: Schema = { service: { flowId: 'c6628103-c648-4663-81e1-bfa0a1a18340', url: 'https://www.editor.planx.dev/southwark/apply-for-prior-approval/preview', + files: [ + { + value: 'otherDrawing', + description: 'Other - drawing', + condition: 'required', + }, + { + value: 'sitePlan.proposed', + description: 'Site plan - proposed', + condition: 'optional', + }, + ], }, submittedAt: '2023-10-02T00:00:00Z', schema: diff --git a/schema/schema.json b/schema/schema.json index 04af4cb8..02e28e33 100644 --- a/schema/schema.json +++ b/schema/schema.json @@ -1736,6 +1736,15 @@ ], "type": "object" }, + "FileCondition": { + "$id": "#FileCondition", + "enum": [ + "required", + "recommended", + "optional" + ], + "type": "string" + }, "FileType": { "$id": "#FileType", "anyOf": [ @@ -4381,6 +4390,13 @@ "service": { "additionalProperties": false, "properties": { + "files": { + "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.", + "items": { + "$ref": "#/definitions/RequestedFileType" + }, + "type": "array" + }, "flowId": { "$ref": "#/definitions/UUID" }, @@ -4390,7 +4406,8 @@ }, "required": [ "flowId", - "url" + "url", + "files" ], "type": "object" }, @@ -20273,6 +20290,1838 @@ }, "type": "object" }, + "RequestedFileType": { + "$id": "#RequestedFileType", + "anyOf": [ + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Affordable housing statement", + "type": "string" + }, + "value": { + "const": "affordableHousingStatement", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Arboriculturist report", + "type": "string" + }, + "value": { + "const": "arboriculturistReport", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Bank statement", + "type": "string" + }, + "value": { + "const": "bankStatement", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Basement impact statement", + "type": "string" + }, + "value": { + "const": "basementImpactStatement", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Bio-aerosol assessment", + "type": "string" + }, + "value": { + "const": "bioaerosolAssessment", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Birdstrike risk management plan", + "type": "string" + }, + "value": { + "const": "birdstrikeRiskManagementPlan", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Borehole or trial pit analysis", + "type": "string" + }, + "value": { + "const": "boreholeOrTrialPitAnalysis", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Building control certificate", + "type": "string" + }, + "value": { + "const": "buildingControlCertificate", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Structural or building condition survey", + "type": "string" + }, + "value": { + "const": "conditionSurvey", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Construction invoice", + "type": "string" + }, + "value": { + "const": "constructionInvoice", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Contamination report", + "type": "string" + }, + "value": { + "const": "contaminationReport", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Council tax bill", + "type": "string" + }, + "value": { + "const": "councilTaxBill", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Crime prevention strategy", + "type": "string" + }, + "value": { + "const": "crimePreventionStrategy", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Design and Access Statement", + "type": "string" + }, + "value": { + "const": "designAndAccessStatement", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Evidence for application fee exemption - disability", + "type": "string" + }, + "value": { + "const": "disabilityExemptionEvidence", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Ecology report", + "type": "string" + }, + "value": { + "const": "ecologyReport", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Elevations - existing", + "type": "string" + }, + "value": { + "const": "elevations.existing", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Elevations - proposed", + "type": "string" + }, + "value": { + "const": "elevations.proposed", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Scheme for mitigation and monitoring of emissions (dust, odour and vibrations)", + "type": "string" + }, + "value": { + "const": "emissionsMitigationAndMonitoringScheme", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Energy statement", + "type": "string" + }, + "value": { + "const": "energyStatement", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Environmental Impact Assessment (EIA)", + "type": "string" + }, + "value": { + "const": "environmentalImpactAssessment", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Fire safety report", + "type": "string" + }, + "value": { + "const": "fireSafetyReport", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Flood risk assessment (FRA)", + "type": "string" + }, + "value": { + "const": "floodRiskAssessment", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Floor plan - existing", + "type": "string" + }, + "value": { + "const": "floorPlan.existing", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Floor plan - proposed", + "type": "string" + }, + "value": { + "const": "floorPlan.proposed", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Foul drainage assessment", + "type": "string" + }, + "value": { + "const": "foulDrainageAssessment", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Geodiversity assessment", + "type": "string" + }, + "value": { + "const": "geodiversityAssessment", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Heritage Statement", + "type": "string" + }, + "value": { + "const": "heritageStatement", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Hydrological and hydrogeological assessment", + "type": "string" + }, + "value": { + "const": "hydrologicalAssessment", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Hydrology report", + "type": "string" + }, + "value": { + "const": "hydrologyReport", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Internal elevations", + "type": "string" + }, + "value": { + "const": "internalElevations", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Internal sections", + "type": "string" + }, + "value": { + "const": "internalSections", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Land contamination assessment", + "type": "string" + }, + "value": { + "const": "landContaminationAssessment", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Landscape and visual impact assessment (LVIA)", + "type": "string" + }, + "value": { + "const": "landscapeAndVisualImpactAssessment", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Landscape strategy or landscape plan", + "type": "string" + }, + "value": { + "const": "landscapeStrategy", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Lighting assessment", + "type": "string" + }, + "value": { + "const": "lightingAssessment", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Details of litter, vermin and bird control", + "type": "string" + }, + "value": { + "const": "litterVerminAndBirdControlDetails", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Location plan", + "type": "string" + }, + "value": { + "const": "locationPlan", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Minerals and waste assessment", + "type": "string" + }, + "value": { + "const": "mineralsAndWasteAssessment", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "New dwellings schedule", + "type": "string" + }, + "value": { + "const": "newDwellingsSchedule", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Noise assessment", + "type": "string" + }, + "value": { + "const": "noiseAssessment", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Open space assessment", + "type": "string" + }, + "value": { + "const": "openSpaceAssessment", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Other - document", + "type": "string" + }, + "value": { + "const": "otherDocument", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Other - drawing", + "type": "string" + }, + "value": { + "const": "otherDrawing", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Other - evidence or correspondence", + "type": "string" + }, + "value": { + "const": "otherEvidence", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Parking plan", + "type": "string" + }, + "value": { + "const": "parkingPlan", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Photographs - existing", + "type": "string" + }, + "value": { + "const": "photographs.existing", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Photographs - proposed", + "type": "string" + }, + "value": { + "const": "photographs.proposed", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Planning statement", + "type": "string" + }, + "value": { + "const": "planningStatement", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Roof plan - existing", + "type": "string" + }, + "value": { + "const": "roofPlan.existing", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Roof plan - proposed", + "type": "string" + }, + "value": { + "const": "roofPlan.proposed", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Sections - existing", + "type": "string" + }, + "value": { + "const": "sections.existing", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Sections - proposed", + "type": "string" + }, + "value": { + "const": "sections.proposed", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Site plan - existing", + "type": "string" + }, + "value": { + "const": "sitePlan.existing", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Site plan - proposed", + "type": "string" + }, + "value": { + "const": "sitePlan.proposed", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Sketch plan", + "type": "string" + }, + "value": { + "const": "sketchPlan", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Statement of community involvement", + "type": "string" + }, + "value": { + "const": "statementOfCommunityInvolvement", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Statuatory declaration", + "type": "string" + }, + "value": { + "const": "statuatoryDeclaration", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Details of storage treatment or disposal of waste", + "type": "string" + }, + "value": { + "const": "storageTreatmentAndWasteDisposalDetails", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Street scene drawing", + "type": "string" + }, + "value": { + "const": "streetScene", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Subsidence report", + "type": "string" + }, + "value": { + "const": "subsidenceReport", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Sunlight and daylight report", + "type": "string" + }, + "value": { + "const": "sunlightAndDaylightReport", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Sustainability statement", + "type": "string" + }, + "value": { + "const": "sustainabilityStatement", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Technical evidence", + "type": "string" + }, + "value": { + "const": "technicalEvidence", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Tenancy agreement", + "type": "string" + }, + "value": { + "const": "tenancyAgreement", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Tenancy invoice", + "type": "string" + }, + "value": { + "const": "tenancyInvoice", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Town centre uses - Impact assessment", + "type": "string" + }, + "value": { + "const": "townCentreImpactAssessment", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Town centre uses - Sequential assessment", + "type": "string" + }, + "value": { + "const": "townCentreSequentialAssessment", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Transport assessment", + "type": "string" + }, + "value": { + "const": "transportAssessment", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Travel plan", + "type": "string" + }, + "value": { + "const": "travelPlan", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Tree canopy calculator", + "type": "string" + }, + "value": { + "const": "treeCanopyCalculator", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Tree condition report", + "type": "string" + }, + "value": { + "const": "treeConditionReport", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Trees report", + "type": "string" + }, + "value": { + "const": "treesReport", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Unit plan - existing", + "type": "string" + }, + "value": { + "const": "unitPlan.existing", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Unit plan - proposed", + "type": "string" + }, + "value": { + "const": "unitPlan.proposed", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Use plan - existing", + "type": "string" + }, + "value": { + "const": "usePlan.existing", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Use plan - proposed", + "type": "string" + }, + "value": { + "const": "usePlan.proposed", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Utility bill", + "type": "string" + }, + "value": { + "const": "utilitiesBill", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Utilities statement", + "type": "string" + }, + "value": { + "const": "utilitiesStatement", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Ventilation or extraction statement", + "type": "string" + }, + "value": { + "const": "ventilationStatement", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Visualisations", + "type": "string" + }, + "value": { + "const": "visualisations", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Waste and recycling strategy", + "type": "string" + }, + "value": { + "const": "wasteAndRecyclingStrategy", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + }, + { + "additionalProperties": false, + "properties": { + "condition": { + "$ref": "#/definitions/FileCondition" + }, + "description": { + "const": "Water environment assessment", + "type": "string" + }, + "value": { + "const": "waterEnvironmentAssessment", + "type": "string" + } + }, + "required": [ + "condition", + "description", + "value" + ], + "type": "object" + } + ], + "description": "Types of planning documents and drawings, with an attached condition as presented to the applicant" + }, "Response": { "additionalProperties": false, "properties": { diff --git a/types/schema/File.ts b/types/schema/File.ts index 0b744e42..28b6c45b 100644 --- a/types/schema/File.ts +++ b/types/schema/File.ts @@ -26,3 +26,14 @@ type FileTypeMap = { * @description Types of planning documents and drawings */ export type FileType = FileTypeMap[keyof FileTypeMap]; + +/** + * @id #FileCondition + */ +export type FileCondition = 'required' | 'recommended' | 'optional'; + +/** + * @id #RequestedFileType + * @description Types of planning documents and drawings, with an attached condition as presented to the applicant + */ +export type RequestedFileType = FileType & {condition: FileCondition}; diff --git a/types/schema/Metadata.ts b/types/schema/Metadata.ts index 71e7733c..24944db4 100644 --- a/types/schema/Metadata.ts +++ b/types/schema/Metadata.ts @@ -1,4 +1,5 @@ import {DateTime, URL, UUID} from './../utils'; +import {RequestedFileType} from './File'; /** * @id #DigitalPlanningMetadata @@ -33,5 +34,9 @@ export interface PlanXMetadata extends BaseMetadata { service: { flowId: UUID; url: URL; + /** + * @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. + */ + files: RequestedFileType[]; }; }