[Backend] As a user, I can submit my survey response
suho opened this issue · comments
Why
At the final step, users must be able to submit their responses. The mobile app must show the Submit button instead of the Next button to inform users that the app will submit their response on the next action.
Acceptance Criteria
Call POST /api/v1/responses
endpoint with the following body:
{
"survey_id": "{{survey-id}}",
"questions": [
{{question-id-with-answers}},
...
]
}
For question-id-with-answers
, there are two possible types of this data structure:
- With ID
{
"id": "{{question-id}}",
"answers": [
{
"id": "{{answer-id}}"
}
]
}
- With ID and Answer
{
"id": "{{question-id}}",
"answers": [
{
"id": "{{answer-id}}",
"answer": "{{answer}}"
}
]
}