Skip to content

Commit

Permalink
tidy up responses type
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicamcinchak committed Nov 7, 2023
1 parent e4ecadc commit 3667259
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 27 deletions.
23 changes: 6 additions & 17 deletions schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -2891,14 +2884,7 @@
"$ref": "#/definitions/DateTime"
},
"id": {
"anyOf": [
{
"$ref": "#/definitions/UUID"
},
{
"type": "string"
}
]
"$ref": "#/definitions/UUID"
},
"source": {
"const": "PlanX",
Expand Down Expand Up @@ -17507,9 +17493,12 @@
"type": "string"
},
"url": {
"type": "string"
"$ref": "#/definitions/URL"
}
},
"required": [
"text"
],
"type": "object"
},
"type": "array"
Expand Down
14 changes: 7 additions & 7 deletions types/schema/Metadata.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
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: {
/**
* @default PlanX
*/
source: 'PlanX';
id: UUID | string;
id: UUID;
createdAt: DateTime;
submittedAt?: DateTime;
};
Expand Down
8 changes: 5 additions & 3 deletions types/schema/Responses.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { URL } from './../utils';

/**
* @id #Responses
* @description The ordered list of questions, answers, and their metadata for the application
Expand All @@ -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<string>; // @todo connect to result/flags enum
flags?: Array<string>; // @todo connect to result/flags enum, is this actually a list?
options?: Array<string> | Array<Response>;
}

Expand Down

0 comments on commit 3667259

Please sign in to comment.