Skip to content

Commit

Permalink
chore: update PreApplication enums to objects like Application (#289
Browse files Browse the repository at this point in the history
)
  • Loading branch information
jessicamcinchak authored Jan 16, 2025
1 parent 5ddbba6 commit bbd352a
Show file tree
Hide file tree
Showing 18 changed files with 485 additions and 399 deletions.
52 changes: 40 additions & 12 deletions examples/preApplication/data/preApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import {PreApplication} from '../../../types/schemas/preApplication';
const version = process.env['VERSION'] || '@next';

export const preApplication: PreApplication = {
applicationType: 'preApp',
data: {
user: {
role: 'applicant',
Expand Down Expand Up @@ -46,7 +45,10 @@ export const preApplication: PreApplication = {
},
localAuthorityDistrict: ['Doncaster'],
region: 'Yorkshire and The Humber',
type: 'residential.dwelling.house.detached',
type: {
value: 'residential.dwelling.house.detached',
description: 'Detached',
},
planning: {
sources: [
'https://api.editor.planx.dev/gis/doncaster?geom=MULTIPOLYGON+%28%28%28-1.0206931342729486+53.50213165258532%2C+-1.020646+53.502065000000016%2C+-1.020719+53.502047000000005%2C+-1.0206422209739665+53.50198572771234%2C+-1.020557+53.501923000000005%2C+-1.020433+53.50195500000001%2C+-1.0205027461051923+53.50206709121434%2C+-1.020549684762953+53.50215722902928%2C+-1.0206931342729486+53.50213165258532%29%29%29&analytics=false&sessionId=1a768034-c07a-4cd5-92b6-fc4a1fd0abd4',
Expand Down Expand Up @@ -202,6 +204,10 @@ export const preApplication: PreApplication = {
},
},
application: {
type: {
value: 'preApp',
description: 'Pre-application',
},
fee: {
payable: 450,
reference: {
Expand Down Expand Up @@ -565,11 +571,25 @@ export const preApplication: PreApplication = {
files: [
{
name: 'https://api.editor.planx.dev/file/private/fomris6d/correspondence.pdf',
type: ['otherSupporting'],
type: [
{
value: 'otherSupporting',
description: 'Other - supporting document',
},
],
},
{
name: 'https://api.editor.planx.dev/file/private/7xsm1un0/myPlans.pdf',
type: ['sitePlan.existing', 'sitePlan.proposed'],
type: [
{
value: 'sitePlan.existing',
description: 'Site plan - existing',
},
{
value: 'sitePlan.proposed',
description: 'Site plan - proposed',
},
],
},
],
metadata: {
Expand All @@ -581,15 +601,23 @@ export const preApplication: PreApplication = {
flowId: '426494e7-34a2-4a94-a554-8ecc5e20e3ef',
url: 'https://editor.planx.uk/doncaster/pre-application-advice/published',
files: {
required: ['sitePlan.proposed'],
required: [
{value: 'sitePlan.proposed', description: 'Site plan - proposed'},
],
recommended: [
'sitePlan.existing',
'elevations.existing',
'elevations.proposed',
'floorPlan.existing',
'floorPlan.proposed',
'photographs.existing',
'otherSupporting',
{value: 'sitePlan.existing', description: 'Site plan - existing'},
{value: 'elevations.existing', description: 'Elevations - existing'},
{value: 'elevations.proposed', description: 'Elevations - proposed'},
{value: 'floorPlan.existing', description: 'Floor plan - existing'},
{value: 'floorPlan.proposed', description: 'Floor plan - proposed'},
{
value: 'photographs.existing',
description: 'Photographs - existing',
},
{
value: 'otherSupporting',
description: 'Other - supporting document',
},
],
optional: [],
},
Expand Down
65 changes: 52 additions & 13 deletions examples/preApplication/preApp.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"applicationType": "preApp",
"data": {
"user": {
"role": "applicant"
Expand Down Expand Up @@ -44,7 +43,10 @@
"Doncaster"
],
"region": "Yorkshire and The Humber",
"type": "residential.dwelling.house.detached",
"type": {
"value": "residential.dwelling.house.detached",
"description": "Detached"
},
"planning": {
"sources": [
"https://api.editor.planx.dev/gis/doncaster?geom=MULTIPOLYGON+%28%28%28-1.0206931342729486+53.50213165258532%2C+-1.020646+53.502065000000016%2C+-1.020719+53.502047000000005%2C+-1.0206422209739665+53.50198572771234%2C+-1.020557+53.501923000000005%2C+-1.020433+53.50195500000001%2C+-1.0205027461051923+53.50206709121434%2C+-1.020549684762953+53.50215722902928%2C+-1.0206931342729486+53.50213165258532%29%29%29&analytics=false&sessionId=1a768034-c07a-4cd5-92b6-fc4a1fd0abd4",
Expand Down Expand Up @@ -221,6 +223,10 @@
}
},
"application": {
"type": {
"value": "preApp",
"description": "Pre-application"
},
"fee": {
"payable": 450,
"reference": {
Expand Down Expand Up @@ -607,14 +613,23 @@
{
"name": "https://api.editor.planx.dev/file/private/fomris6d/correspondence.pdf",
"type": [
"otherSupporting"
{
"value": "otherSupporting",
"description": "Other - supporting document"
}
]
},
{
"name": "https://api.editor.planx.dev/file/private/7xsm1un0/myPlans.pdf",
"type": [
"sitePlan.existing",
"sitePlan.proposed"
{
"value": "sitePlan.existing",
"description": "Site plan - existing"
},
{
"value": "sitePlan.proposed",
"description": "Site plan - proposed"
}
]
}
],
Expand All @@ -628,16 +643,40 @@
"url": "https://editor.planx.uk/doncaster/pre-application-advice/published",
"files": {
"required": [
"sitePlan.proposed"
{
"value": "sitePlan.proposed",
"description": "Site plan - proposed"
}
],
"recommended": [
"sitePlan.existing",
"elevations.existing",
"elevations.proposed",
"floorPlan.existing",
"floorPlan.proposed",
"photographs.existing",
"otherSupporting"
{
"value": "sitePlan.existing",
"description": "Site plan - existing"
},
{
"value": "elevations.existing",
"description": "Elevations - existing"
},
{
"value": "elevations.proposed",
"description": "Elevations - proposed"
},
{
"value": "floorPlan.existing",
"description": "Floor plan - existing"
},
{
"value": "floorPlan.proposed",
"description": "Floor plan - proposed"
},
{
"value": "photographs.existing",
"description": "Photographs - existing"
},
{
"value": "otherSupporting",
"description": "Other - supporting document"
}
],
"optional": []
},
Expand Down
26 changes: 22 additions & 4 deletions schemas/application.json
Original file line number Diff line number Diff line change
Expand Up @@ -4513,6 +4513,24 @@
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
"description": {
"const": "Other - supporting document",
"type": "string"
},
"value": {
"const": "otherSupporting",
"type": "string"
}
},
"required": [
"value",
"description"
],
"type": "object"
},
{
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -24981,7 +24999,6 @@
"description": "The result of a single flagset"
},
"SiteContact": {
"$id": "#SiteContact",
"anyOf": [
{
"additionalProperties": false,
Expand All @@ -25004,10 +25021,10 @@
"$ref": "#/definitions/SiteContactOther"
}
],
"description": "Contact information for the site visit"
"description": "Contact information for the site visit",
"title": "#SiteContact"
},
"SiteContactOther": {
"$id": "#SiteContactOther",
"additionalProperties": false,
"description": "Contact information for the site visit when the SiteContact's role is 'other'",
"properties": {
Expand All @@ -25031,6 +25048,7 @@
"email",
"phone"
],
"title": "#SiteContactOther",
"type": "object"
},
"UKProperty": {
Expand Down Expand Up @@ -25431,7 +25449,6 @@
"type": "string"
},
"User": {
"$id": "User",
"additionalProperties": false,
"description": "The role of the user who completed the application",
"properties": {
Expand All @@ -25447,6 +25464,7 @@
"required": [
"role"
],
"title": "User",
"type": "object"
},
"UserAddress": {
Expand Down
Loading

0 comments on commit bbd352a

Please sign in to comment.