Skip to content

Commit

Permalink
simplify to submittedAt only
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicamcinchak committed Nov 8, 2023
1 parent dd26f60 commit 8d72e69
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 78 deletions.
3 changes: 1 addition & 2 deletions examples/data/ldcE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1596,14 +1596,13 @@ export const validLDCE: Schema = {
},
],
metadata: {
source: 'PlanX',
organisation: 'Buckinghamshire',
id: '95f90e21-93f5-4761-90b3-815c673e041f',
source: 'PlanX',
service: {
flowId: '824628b2-deeb-48b0-92b1-2ca7f3b17163',
url: 'https://www.editor.planx.dev/buckinghamshire/apply-for-a-lawful-development-certificate/preview',
},
createdAt: '2023-10-01 00:00:00',
submittedAt: '2023-10-02 00:00:00',
schema:
'https://theopensystemslab.github.io/digital-planning-data-schemas/v0.0.1/schema.json',
Expand Down
3 changes: 1 addition & 2 deletions examples/data/ldcP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1112,14 +1112,13 @@ export const validLDCP: Schema = {
},
],
metadata: {
source: 'PlanX',
organisation: 'Buckinghamshire',
id: '8da51c5b-a2a0-4386-a15d-29d66f9c121c',
source: 'PlanX',
service: {
flowId: '824628b2-deeb-48b0-92b1-2ca7f3b17163',
url: 'https://www.editor.planx.dev/buckinghamshire/apply-for-a-lawful-development-certificate/preview',
},
createdAt: '2023-10-01 00:00:00',
submittedAt: '2023-10-02 00:00:00',
schema:
'https://theopensystemslab.github.io/digital-planning-data-schemas/v0.0.1/schema.json',
Expand Down
3 changes: 1 addition & 2 deletions examples/data/planningPermission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1690,14 +1690,13 @@ export const validPlanningPermission: Schema = {
},
],
metadata: {
source: 'PlanX',
organisation: 'Lambeth',
id: '81bcaa0f-baf5-4573-ba0a-ea868c573faf',
source: 'PlanX',
service: {
flowId: '01e38c5d-e701-4e44-acdc-4d6b5cc3b854',
url: 'https://www.editor.planx.dev/lambeth/apply-for-planning-permission/preview',
},
createdAt: '2023-10-01 00:00:00',
submittedAt: '2023-10-02 00:00:00',
schema:
'https://theopensystemslab.github.io/digital-planning-data-schemas/v0.0.1/schema.json',
Expand Down
3 changes: 1 addition & 2 deletions examples/data/priorApproval.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1028,14 +1028,13 @@ export const validPriorApproval: Schema = {
},
],
metadata: {
source: 'PlanX',
organisation: 'Southwark',
id: 'b18c301b-9d44-4c6c-8d27-5b5bf33c570b',
source: 'PlanX',
service: {
flowId: 'c6628103-c648-4663-81e1-bfa0a1a18340',
url: 'https://www.editor.planx.dev/southwark/apply-for-prior-approval/preview',
},
createdAt: '2023-10-01 00:00:00',
submittedAt: '2023-10-02 00:00:00',
schema:
'https://theopensystemslab.github.io/digital-planning-data-schemas/v0.0.1/schema.json',
Expand Down
118 changes: 55 additions & 63 deletions schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -1162,30 +1162,25 @@
"additionalProperties": false,
"description": "Minimum metadata expected for any application",
"properties": {
"createdAt": {
"$ref": "#/definitions/DateTime"
},
"id": {
"$ref": "#/definitions/UUID",
"description": "Unique identifier for this application"
},
"organisation": {
"description": "UK Local Authority that this application is being submitted to",
"type": "string"
},
"schema": {
"$ref": "#/definitions/URL"
},
"source": {
"const": "PlanX",
"default": "PlanX",
"type": "string"
"submittedAt": {
"$ref": "#/definitions/DateTime"
}
},
"required": [
"source",
"organisation",
"id",
"createdAt",
"submittedAt",
"schema"
],
"type": "object"
Expand Down Expand Up @@ -2876,7 +2871,7 @@
"$ref": "#/definitions/BaseMetadata"
},
{
"$ref": "#/definitions/PlanxMetadata"
"$ref": "#/definitions/PlanXMetadata"
}
],
"description": "Details of the digital planning service which sent this application"
Expand Down Expand Up @@ -3094,6 +3089,56 @@
],
"type": "object"
},
"PlanXMetadata": {
"$id": "#PlanXMetadata",
"additionalProperties": false,
"description": "Additional metadata associated with applications submitted via PlanX",
"properties": {
"id": {
"$ref": "#/definitions/UUID",
"description": "Unique identifier for this application"
},
"organisation": {
"description": "UK Local Authority that this application is being submitted to",
"type": "string"
},
"schema": {
"$ref": "#/definitions/URL"
},
"service": {
"additionalProperties": false,
"properties": {
"flowId": {
"$ref": "#/definitions/UUID"
},
"url": {
"$ref": "#/definitions/URL"
}
},
"required": [
"flowId",
"url"
],
"type": "object"
},
"source": {
"const": "PlanX",
"type": "string"
},
"submittedAt": {
"$ref": "#/definitions/DateTime"
}
},
"required": [
"id",
"organisation",
"schema",
"service",
"source",
"submittedAt"
],
"type": "object"
},
"PlanningConstraint": {
"$id": "#PlanningConstraint",
"anyOf": [
Expand Down Expand Up @@ -5234,59 +5279,6 @@
],
"description": "Planning constraints that overlap with the property site boundary determined by spatial queries against Planning Data (planning.data.gov.uk) and Ordnance Survey"
},
"PlanxMetadata": {
"$id": "#PlanxMetadata",
"additionalProperties": false,
"description": "Additional metadata associated with applications submitted via PlanX",
"properties": {
"createdAt": {
"$ref": "#/definitions/DateTime"
},
"id": {
"$ref": "#/definitions/UUID",
"description": "Unique identifier for this application"
},
"organisation": {
"type": "string"
},
"schema": {
"$ref": "#/definitions/URL"
},
"service": {
"additionalProperties": false,
"properties": {
"flowId": {
"$ref": "#/definitions/UUID"
},
"url": {
"$ref": "#/definitions/URL"
}
},
"required": [
"flowId",
"url"
],
"type": "object"
},
"source": {
"const": "PlanX",
"default": "PlanX",
"type": "string"
},
"submittedAt": {
"$ref": "#/definitions/DateTime"
}
},
"required": [
"createdAt",
"id",
"organisation",
"schema",
"service",
"source"
],
"type": "object"
},
"Point": {
"additionalProperties": false,
"description": "Point geometry object. https://tools.ietf.org/html/rfc7946#section-3.1.2",
Expand Down
13 changes: 6 additions & 7 deletions types/schema/Metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,33 @@ import {DateTime, URL, UUID} from './../utils';
* @id #DigitalPlanningMetadata
* @description Details of the digital planning service which sent this application
*/
export type Metadata = BaseMetadata | PlanxMetadata;
export type Metadata = BaseMetadata | PlanXMetadata;

/**
* @id #BaseMetadata
* @description Minimum metadata expected for any application
*/
export interface BaseMetadata {
/**
* @default PlanX
* @description UK Local Authority that this application is being submitted to
*/
source: 'PlanX';
organisation: string; // @todo align to DLUHC Planning Application API curie
/**
* @description Unique identifier for this application
*/
id: UUID; // @todo align to DLUHC Planning Application API reference
createdAt: DateTime;
submittedAt: DateTime;
schema: URL;
}

/**
* @id #PlanxMetadata
* @id #PlanXMetadata
* @description Additional metadata associated with applications submitted via PlanX
*/
export interface PlanxMetadata extends BaseMetadata {
export interface PlanXMetadata extends BaseMetadata {
source: 'PlanX';
service: {
flowId: UUID;
url: URL;
};
submittedAt?: DateTime;
}

0 comments on commit 8d72e69

Please sign in to comment.