Skip to content
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
10 changes: 5 additions & 5 deletions src/form/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ namespace CoreSystem.Forms {
}

@doc("Response after uploading a cover image.")
@example(#{ imageUrl: "https://example.com/images/form-cover-123.webp" })
model FormCoverUploadResponse {
@doc("The temporary full URL of the uploaded image.")
imageUrl: string;
}
@example(#{ imageUrl: "https://example.com/images/form-cover-123.webp" })
model FormCoverUploadResponse {
@doc("The temporary full URL of the uploaded image.")
imageUrl: string;
}

@doc("The request body for creating/updating a form.")
@example(#{
Expand Down
25 changes: 25 additions & 0 deletions src/form/response/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,31 @@ namespace CoreSystem.Responses {
questionIds: uuid[];
}

@doc("Response model after successfully submitting a form response.")
@example(#{
id: "a12b3c4d-5e6f-7a8b-9c0d-e1f2a3b4c5d6",
formId: "9a843aa0-8451-4e3b-b6a0-8c0e994e9040",
createdAt: utcDateTime.fromISO("2026-08-03T10:00:00Z"),
submittedAt: utcDateTime.fromISO("2026-08-03T10:30:00Z"),
progress: ResponseProgress.submitted,
})
model SubmitResponse {
@doc("The response's unique identifier.")
id: uuid;

@doc("The form that this response belongs to.")
formId: uuid;

@doc("The creation timestamp of the response.")
createdAt: utcDateTime;

@doc("The submission timestamp of the response.")
submittedAt: utcDateTime;

@doc("The current progress of the response.")
progress: ResponseProgress;
}

@doc("A single answer option selected by the user")
model QueryFilterAnswerItem {
@doc("The raw value used for backend querying and matching.")
Expand Down
1 change: 1 addition & 0 deletions src/form/response/operations.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ namespace CoreSystem.Responses {
@post
op submitFormResponse(@path responseId: uuid, @body req: AnswersRequest): {
@statusCode statusCode: 200;
@body response: SubmitResponse;
} | {
@statusCode statusCode: 404;
@body error: NotFound;
Expand Down
Loading