Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: require metadata.source for any provider, not only Planx #119

Merged
merged 2 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 35 additions & 30 deletions schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,40 @@
],
"type": "object"
},
"AnyProviderMetadata": {
"$id": "#AnyProviderMetadata",
"additionalProperties": false,
"description": "Base metadata associated with applications submitted via any provider",
"properties": {
"id": {
"$ref": "#/definitions/UUID",
"description": "Unique identifier for this application"
},
"organisation": {
"description": "The reference code for the organisation responsible for processing this planning application, sourced from planning.data.gov.uk/dataset/local-authority",
"maxLength": 4,
"type": "string"
},
"schema": {
"$ref": "#/definitions/URL"
},
"source": {
"const": "Any",
"type": "string"
},
"submittedAt": {
"$ref": "#/definitions/DateTime"
}
},
"required": [
"id",
"organisation",
"schema",
"source",
"submittedAt"
],
"type": "object"
},
"Applicant": {
"$id": "#Applicant",
"anyOf": [
Expand Down Expand Up @@ -1571,35 +1605,6 @@
},
"type": "object"
},
"BaseMetadata": {
"$id": "#BaseMetadata",
"additionalProperties": false,
"description": "Minimum metadata expected for any application",
"properties": {
"id": {
"$ref": "#/definitions/UUID",
"description": "Unique identifier for this application"
},
"organisation": {
"description": "The reference code for the organisation responsible for processing this planning application, sourced from planning.data.gov.uk/dataset/local-authority",
"maxLength": 4,
"type": "string"
},
"schema": {
"$ref": "#/definitions/URL"
},
"submittedAt": {
"$ref": "#/definitions/DateTime"
}
},
"required": [
"organisation",
"id",
"submittedAt",
"schema"
],
"type": "object"
},
"Date": {
"format": "date",
"type": "string"
Expand Down Expand Up @@ -4173,7 +4178,7 @@
"$id": "#DigitalPlanningMetadata",
"anyOf": [
{
"$ref": "#/definitions/BaseMetadata"
"$ref": "#/definitions/AnyProviderMetadata"
},
{
"$ref": "#/definitions/PlanXMetadata"
Expand Down
10 changes: 9 additions & 1 deletion types/schema/Metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {FileType} from './File';
* @id #DigitalPlanningMetadata
* @description Details of the digital planning service which sent this application
*/
export type Metadata = BaseMetadata | PlanXMetadata;
export type Metadata = AnyProviderMetadata | PlanXMetadata;

/**
* @id #BaseMetadata
Expand All @@ -25,6 +25,14 @@ export interface BaseMetadata {
schema: URL;
}

/**
* @id #AnyProviderMetadata
* @description Base metadata associated with applications submitted via any provider
*/
export interface AnyProviderMetadata extends BaseMetadata {
source: 'Any';
}

/**
* @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.
Expand Down
Loading