crumpet
crumpet copied to clipboard
A client should be able to update the properties of a person
Background & Context*
Once a valid Websocket connection has been established, the client should be able to provide person properties which will update the Person.data field.
Current Behaviour
A client can call the identify action on the socket with person data and this will return the state of all flows for the person identified.
Goal*
- This work item will extend #66 allowing a client to specify whether or not they want the flow state to be retrieved.
- This will improve response times since the server does not need to query flow states but only update the
Personrecord.
Implementation Details*
- List any technical requirements or constraints. Please list them as a task list or bullets.
- Use code snippets where applicable.
Modify the response to allow for an extra flag, indicating the type of response that the server needs to provide.
// Example request
{
"action": "identify",
"request_id" : Date.now(),
"data": {
"include_flows": boolean
"person_key": "string",
"properties": "object"
}
}
// Example response include_flows == True
{
"request_id": 1519211809934,
"errors": [],
"status": 200,
"data": {
"person_id": "string",
"flows": [
{
"flow_instance_id": "string",
"flow_schema_identifier": "string",
"state": "string (active, inactive, completed, exited)"
}
]
}
}
// Example response include_flows == False
{
"request_id": 1519211809934,
"errors": [],
"status": 200,
"data": {}
}
Acceptance Criteria*
Test cases that
- Asserts when the
include_flowsflag is included and set toTruethen the response should be as outlined in the example above. - Asserts when the
include_flowsflag is included and set toFalsethen the response should be as outlined in the example above. - Asserts when the
include_flowsflag is omitted then the response should be as outlined in the example above.
*required field.