CrumpetDev / crumpet

GNU Affero General Public License v3.0
18 stars 1 forks source link

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

Open tomtitherington opened 4 months ago

tomtitherington commented 4 months ago

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*

Implementation Details*

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

*required field.