Skip to content

Commit

Permalink
feat: support files submitted as "data" (#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicamcinchak authored Jun 13, 2024
1 parent 2100b23 commit f7b2f8d
Show file tree
Hide file tree
Showing 8 changed files with 262 additions and 96 deletions.
282 changes: 204 additions & 78 deletions schema/schema.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions types/Schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {PreAssessment} from './schema/PreAssessment';
import {Responses} from './schema/Responses';
import {Applicant} from './schema/data/Applicant';
import {Application} from './schema/data/Application';
import {FilesAsData} from './schema/data/Files';
import {Property} from './schema/data/Property';
import {Proposal} from './schema/data/Proposal';
import {User} from './schema/data/User';
Expand All @@ -19,6 +20,7 @@ export interface Schema {
applicant: Applicant;
property: Property;
proposal: Proposal;
files?: FilesAsData;
};
preAssessment?: PreAssessment;
responses: Responses;
Expand Down
6 changes: 4 additions & 2 deletions types/enums/ApplicationTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
*/
export const ApplicationTypes = {
advertConsent: 'Consent to display an advertisement',
'amendment.minorMaterial':'Consent to make small (minor material) changes to a project with planning permission',
'amendment.nonMaterial': 'Consent to make small (non-material) changes to a project with planning permission',
'amendment.minorMaterial':
'Consent to make small (minor material) changes to a project with planning permission',
'amendment.nonMaterial':
'Consent to make small (non-material) changes to a project with planning permission',
hazardousSubstanceConsent:
'Consent to move and dispose of hazardous substances',
hedgerowRemovalNotice: 'Notice to remove a hedge',
Expand Down
9 changes: 6 additions & 3 deletions types/enums/FileTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ export const FileTypes = {
'floorPlan.proposed': 'Floor plan - proposed',
foulDrainageAssessment: 'Foul drainage assessment',
geodiversityAssessment: 'Geodiversity assessment',
hedgerowsInformation: 'Plans showing the stretches of hedgerows to be removed',
'hedgerowsInformation.plantingDate': 'Evidence of the date of planting of the removed hedgerows',
hedgerowsInformation:
'Plans showing the stretches of hedgerows to be removed',
'hedgerowsInformation.plantingDate':
'Evidence of the date of planting of the removed hedgerows',
heritageStatement: 'Heritage Statement',
hydrologicalAssessment: 'Hydrological and hydrogeological assessment',
hydrologyReport: 'Hydrology report',
Expand All @@ -62,7 +64,8 @@ export const FileTypes = {
'photographs.existing': 'Photographs - existing',
'photographs.proposed': 'Photographs - proposed',
planningStatement: 'Planning statement',
relevantInformation: 'Information the applicant considers relevant to the application',
relevantInformation:
'Information the applicant considers relevant to the application',
'roofPlan.existing': 'Roof plan - existing',
'roofPlan.proposed': 'Roof plan - proposed',
'sections.existing': 'Sections - existing',
Expand Down
33 changes: 33 additions & 0 deletions types/schema/data/Files.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import {GeoBoundary} from './shared';

/**
* @id #FilesAsData
* @description File types that can optionally be provided by answering structured questions, rather than via document upload (see root `files` for uploads)
*/
export type FilesAsData = {
designAndAccessStatement?: DesignAndAccessStatement;
heritageStatement?: HeritageStatement;
locationPlan?: GeoBoundary;
};

export interface DesignAndAccessStatement {
propertyDescription: string;
projectDescription: string;
accessAndLayout: string;
landscapingChanges: string;
}

export type HeritageStatementBase = {
designationDescription: string;
propertyDescription: string;
projectDescpription: string;
managedImpact: string;
improvements: string;
};

export interface HeritageStatement {
'designated.conservationArea'?: HeritageStatementBase;
listed?: HeritageStatementBase;
monument?: HeritageStatementBase;
'designated.WHS'?: HeritageStatementBase;
}
10 changes: 3 additions & 7 deletions types/schema/data/Property.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import {GeoJSON} from 'geojson';
import {PlanningDesignations} from '../../enums/PlanningConstraints';
import {PropertyTypes} from '../../enums/PropertyTypes';
import {Area, URL} from '../../utils';
import {Materials} from './shared';
import {URL} from '../../utils';
import {GeoBoundary, Materials} from './shared';

/**
* @id #Property
Expand Down Expand Up @@ -40,10 +39,7 @@ export interface UKProperty {
/**
* @description HM Land Registry Index polygon for this property, commonly referred to as the blue line boundary, sourced from planning.data.gov.uk/dataset/title-boundary
*/
boundary?: {
site: GeoJSON;
area: Area;
};
boundary?: GeoBoundary;
/**
* @description Planning constraints and policies that intersect with this site and may impact or restrict development
*/
Expand Down
8 changes: 2 additions & 6 deletions types/schema/data/Proposal.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import {GeoJSON} from 'geojson';
import {
OpenSpaceTypes,
OpenSpaceDesignations,
ProtectedSpaceDesignations,
} from '../../enums/Nature';
import {ProjectTypes} from '../../enums/ProjectTypes';
import {Area, Date} from '../../utils';
import {Materials} from './shared';
import {GeoBoundary, Materials} from './shared';

/**
* @id #Proposal
Expand All @@ -20,10 +19,7 @@ export interface BaseProposal {
/**
* @description Location plan boundary proposed by the user, commonly referred to as the red line boundary
*/
boundary?: {
site: GeoJSON;
area: Area;
};
boundary?: GeoBoundary;
date?: ProposalDates;
/**
* @description Proposed materials, if applicable to projectType
Expand Down
8 changes: 8 additions & 0 deletions types/schema/data/shared.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import {GeoJSON} from 'geojson';
import {Area} from '../../utils';

export type Materials = {
boundary?: string;
door?: string;
Expand All @@ -8,3 +11,8 @@ export type Materials = {
window?: string;
other?: string;
};

export type GeoBoundary = {
site: GeoJSON;
area: Area;
};

0 comments on commit f7b2f8d

Please sign in to comment.