crumpet icon indicating copy to clipboard operation
crumpet copied to clipboard

A client should be able to update the properties of a person

Open tomtitherington opened this issue 1 year ago • 0 comments

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 Person record.

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_flows flag is included and set to True then the response should be as outlined in the example above.
  • Asserts when the include_flows flag is included and set to False then the response should be as outlined in the example above.
  • Asserts when the include_flows flag is omitted then the response should be as outlined in the example above.

*required field.

tomtitherington avatar Feb 25 '24 15:02 tomtitherington