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: better type for Responses policyRef #67

Merged
merged 2 commits into from
Nov 8, 2023
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
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
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
Loading