added completion info to client api
This commit is contained in:
@ -176,8 +176,20 @@ Success:
|
||||
"ok": true,
|
||||
"data": {
|
||||
"clients": [
|
||||
"CLIENT-001",
|
||||
"CLIENT-002"
|
||||
{
|
||||
"clientCode": "CLIENT-001",
|
||||
"completedQuestionnaires": [
|
||||
{
|
||||
"questionnaireID": "questionnaire_1_demographic_information",
|
||||
"sumPoints": 42,
|
||||
"completedAt": 1714471800
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"clientCode": "CLIENT-002",
|
||||
"completedQuestionnaires": []
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -185,7 +197,12 @@ Success:
|
||||
|
||||
Fields:
|
||||
|
||||
- `clients`: array of client code strings assigned to the coach, ordered alphabetically.
|
||||
- `clients`: array of client objects assigned to the coach, ordered alphabetically by `clientCode`.
|
||||
- `clients[].clientCode`: the client's code string.
|
||||
- `clients[].completedQuestionnaires`: array of questionnaires already completed by this client. Empty array if none.
|
||||
- `clients[].completedQuestionnaires[].questionnaireID`: the questionnaire ID, matching the IDs from the questionnaire list endpoint.
|
||||
- `clients[].completedQuestionnaires[].sumPoints`: total points from the last upload for this questionnaire.
|
||||
- `clients[].completedQuestionnaires[].completedAt`: Unix timestamp (seconds) of when the questionnaire was completed, or `null` if not recorded.
|
||||
|
||||
Common failures:
|
||||
|
||||
@ -411,7 +428,18 @@ data class SubmitQuestionnaireResponse(
|
||||
)
|
||||
|
||||
data class ClientsResponse(
|
||||
val clients: List<String>
|
||||
val clients: List<ClientInfo>
|
||||
)
|
||||
|
||||
data class ClientInfo(
|
||||
val clientCode: String,
|
||||
val completedQuestionnaires: List<CompletedQuestionnaire> = emptyList()
|
||||
)
|
||||
|
||||
data class CompletedQuestionnaire(
|
||||
val questionnaireID: String,
|
||||
val sumPoints: Int,
|
||||
val completedAt: Long?
|
||||
)
|
||||
```
|
||||
|
||||
@ -453,4 +481,4 @@ interface QuestionnaireApi {
|
||||
}
|
||||
```
|
||||
|
||||
Pass the token as `Bearer $token`.
|
||||
Pass the token as `Bearer $token`.
|
||||
Reference in New Issue
Block a user