Skip to content

Commit

Permalink
feat: Add RequestedFiles (v1) (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr authored Feb 8, 2024
1 parent 28972f6 commit a7b58bf
Show file tree
Hide file tree
Showing 6 changed files with 175 additions and 1 deletion.
35 changes: 35 additions & 0 deletions examples/data/ldcE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
38 changes: 38 additions & 0 deletions examples/data/ldcP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
39 changes: 39 additions & 0 deletions examples/data/planningPermission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
15 changes: 15 additions & 0 deletions examples/data/priorApproval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
37 changes: 36 additions & 1 deletion schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4381,6 +4381,9 @@
"service": {
"additionalProperties": false,
"properties": {
"files": {
"$ref": "#/definitions/RequestedFiles"
},
"flowId": {
"$ref": "#/definitions/UUID"
},
Expand All @@ -4390,7 +4393,8 @@
},
"required": [
"flowId",
"url"
"url",
"files"
],
"type": "object"
},
Expand Down Expand Up @@ -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": {
Expand Down
12 changes: 12 additions & 0 deletions types/schema/Metadata.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {DateTime, URL, UUID} from './../utils';
import {FileType} from './File';

/**
* @id #DigitalPlanningMetadata
Expand All @@ -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
Expand All @@ -33,5 +44,6 @@ export interface PlanXMetadata extends BaseMetadata {
service: {
flowId: UUID;
url: URL;
files: RequestedFiles;
};
}

0 comments on commit a7b58bf

Please sign in to comment.