diff --git a/schema/schema.json b/schema/schema.json index 9bfb8dc6..8392ee9d 100644 --- a/schema/schema.json +++ b/schema/schema.json @@ -2857,14 +2857,7 @@ "description": "Details of the digital planning service which sent the application", "properties": { "flowId": { - "anyOf": [ - { - "$ref": "#/definitions/UUID" - }, - { - "type": "string" - } - ] + "$ref": "#/definitions/UUID" }, "name": { "type": "string" @@ -2891,14 +2884,7 @@ "$ref": "#/definitions/DateTime" }, "id": { - "anyOf": [ - { - "$ref": "#/definitions/UUID" - }, - { - "type": "string" - } - ] + "$ref": "#/definitions/UUID" }, "source": { "const": "PlanX", @@ -17507,9 +17493,12 @@ "type": "string" }, "url": { - "type": "string" + "$ref": "#/definitions/URL" } }, + "required": [ + "text" + ], "type": "object" }, "type": "array" diff --git a/types/schema/Metadata.ts b/types/schema/Metadata.ts index 47b1813a..7c91c091 100644 --- a/types/schema/Metadata.ts +++ b/types/schema/Metadata.ts @@ -1,14 +1,14 @@ import {DateTime, URL, UUID} from './../utils'; +/** + * @id #DigitalPlanningMetadata + * @description Details of the digital planning service which sent the application + */ export interface Metadata { - /** - * @id #DigitalPlanningMetadata - * @description Details of the digital planning service which sent the application - */ service: { - flowId: UUID | string; // @todo temp fix for failing UUID validation, sort out and tighten + flowId: UUID; name: string; - owner: string; + organisation: string; url: URL; }; session: { @@ -16,7 +16,7 @@ export interface Metadata { * @default PlanX */ source: 'PlanX'; - id: UUID | string; + id: UUID; createdAt: DateTime; submittedAt?: DateTime; }; diff --git a/types/schema/Responses.ts b/types/schema/Responses.ts index 604f74e7..0ef5ed61 100644 --- a/types/schema/Responses.ts +++ b/types/schema/Responses.ts @@ -1,3 +1,5 @@ +import { URL } from './../utils'; + /** * @id #Responses * @description The ordered list of questions, answers, and their metadata for the application @@ -7,14 +9,14 @@ export type Responses = QuestionAndResponses[]; export interface QuestionMetaData { autoAnswered?: boolean; policyRefs?: Array<{ - url?: string; - text?: string; + text: string; + url?: URL; }>; sectionName?: string; } export interface ResponseMetaData { - flags?: Array; // @todo connect to result/flags enum + flags?: Array; // @todo connect to result/flags enum, is this actually a list? options?: Array | Array; }