adding client notes
Some checks failed
PHPUnit / test (push) Has been cancelled

This commit is contained in:
2026-07-17 17:10:04 +02:00
parent feae470fba
commit 6b3cd0da17
8 changed files with 178 additions and 7 deletions

View File

@ -309,6 +309,7 @@ Success:
"clients": [
{
"clientCode": "CLIENT-001",
"note": "Call back next week",
"completedQuestionnaires": [
{
"questionnaireID": "questionnaire_1_demographic_information",
@ -319,6 +320,7 @@ Success:
},
{
"clientCode": "CLIENT-002",
"note": "",
"completedQuestionnaires": []
}
]
@ -330,6 +332,7 @@ Fields:
- `clients`: array of client objects assigned to the coach, ordered alphabetically by `clientCode`.
- `clients[].clientCode`: the client's code string.
- `clients[].note`: counselor follow-up note for this client (max 200 characters; empty string when none).
- `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.
@ -444,6 +447,24 @@ Allowed roles: `admin`, `supervisor`, `coach`.
The authenticated user must be authorized for the submitted `clientCode`. A coach can upload for their own clients. A supervisor can upload for clients of their coaches. An admin can upload for any client.
### Set client note
Encrypted body action (coach only):
```json
{
"action": "setClientNote",
"clientCode": "CLIENT-001",
"note": "Call back next week"
}
```
- `note` is optional; omit or send `""` to clear. Max **200** characters after sanitization (same free-text rules as interview answers).
- Response `data` is an encrypted envelope containing `{ "clientCode", "note" }`.
- Notes are stored in `client_followup_note` (shared with the web Insights follow-up list).
### Submit questionnaire answers
Request:
```json