Skip to content

Commit

Permalink
fix: require metadata.source for any provider (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicamcinchak authored Feb 13, 2024
1 parent 1fb9bf2 commit 3a2211d
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 31 deletions.
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

0 comments on commit 3a2211d

Please sign in to comment.