Skip to content

Commit 91fb8ec

Browse files
feat: update answer models to include DateAnswer in request and response structures
1 parent a0fcc9e commit 91fb8ec

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/form/answer/models.tsp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ namespace CoreSystem.Responses {
9191
})
9292
model AnswersRequest {
9393
@doc("The answers to be saved. Can contain a partial subset for drafts or the full set for submission.")
94-
answers: (StringAnswer | StringArrayAnswer | ScaleAnswer)[];
94+
answers: (StringAnswer | StringArrayAnswer | ScaleAnswer | DateAnswer)[];
9595
}
9696

9797
@doc("Request model for uploading files as answers to a specific question in a response.")
@@ -118,7 +118,7 @@ namespace CoreSystem.Responses {
118118
displayValue: string;
119119

120120
@doc("The structured answer data for submission. Null if not answered yet.")
121-
answerData?: StringArrayAnswer | ScaleAnswer | OauthAnswer;
121+
answerData?: StringAnswer | StringArrayAnswer | ScaleAnswer | DateAnswer | OauthAnswer;
122122
}
123123

124124
@example(#{
@@ -131,11 +131,11 @@ namespace CoreSystem.Responses {
131131
})
132132
@doc("Response model for getting an answer of a specific question.")
133133
model GetQuestionResponse {
134-
@doc("The response's unique identifier.")
134+
@doc("Response ID that this question answer belongs to.")
135135
id: uuid;
136136

137137
@doc("A question with its answer for this response..")
138-
questionAnswerPair: StringArrayAnswer;
138+
questionAnswerPair: StringAnswer | StringArrayAnswer | ScaleAnswer | DateAnswer | OauthAnswer;
139139
}
140140

141141
@doc("Response model for a single answer in question answers view")
@@ -150,7 +150,7 @@ namespace CoreSystem.Responses {
150150
submittedBy: uuid;
151151

152152
@doc("The answer data. Type depends on the question type.")
153-
answer: StringArrayAnswer | ScaleAnswer | OauthAnswer;
153+
answer: StringAnswer | StringArrayAnswer | ScaleAnswer | DateAnswer | OauthAnswer;
154154

155155
@doc("The creation timestamp of the answer.")
156156
createdAt: utcDateTime;

src/form/response/models.tsp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ namespace CoreSystem.Responses {
1616
updatedAt: utcDateTime;
1717

1818
@doc("The updated answer data.")
19-
answers: (StringArrayAnswer | ScaleAnswer | OauthAnswer)[];
19+
answers: (StringAnswer | StringArrayAnswer | ScaleAnswer | DateAnswer)[];
2020
}
2121

2222
@doc("Response model for a single response in list view")
23-
model ResponseJSON {
23+
model Response {
2424
@doc("The response's unique identifier.")
2525
id: uuid;
2626

@@ -40,7 +40,7 @@ namespace CoreSystem.Responses {
4040
formId: uuid;
4141

4242
@doc("All responses for this form.")
43-
responses: ResponseJSON[];
43+
responses: Response[];
4444
}
4545

4646
@doc("Model for a single section in preview view")

0 commit comments

Comments
 (0)