suho / kmm-ic

KMM Project with SwiftUI + Jetpack Compose

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Backend] As a user, I can submit my survey response

suho opened this issue · comments

commented

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:

  1. With ID
{
"id": "{{question-id}}",
"answers": [
 {
   "id": "{{answer-id}}"
 }
]
}
  1. With ID and Answer
{
"id": "{{question-id}}",
"answers": [
 {
   "id": "{{answer-id}}",
   "answer": "{{answer}}"
 }
]
}

Resources

Postman - Nimble Survey API