Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A client should be able to retrieve the status of a flow and step for a specific person #69

Open
Tracked by #58
tomtitherington opened this issue Feb 25, 2024 · 0 comments
Labels
blocked: conflict/dependency Something else is blocking this. scope: backend Work involving the backend / Django REST project. scope: tests Work relating to tests. size: hours This should take less than a day.

Comments

@tomtitherington
Copy link
Contributor

tomtitherington commented Feb 25, 2024

Background & Context*

Once a client has a valid Websocket connection to the server, they should be able to retrieve details of a flow and step for a person.

Goal*

  • A client should be able to provide a Person.id and a FlowInstance.id or FlowInstance.identifier and will receive a response that indicates the state of the flow for that person.
  • A client should be able to provide a Person.id and a StepSchema.identifier and will receive a response that indicates the state of the step for that person.

Implementation Details*

Calls to this endpoint should be idempotent. Calling this endpoint multiple times with the same parameters should always result in the same outcome.

// Example request when requesting the state of a flow
{
    "action" "flow_status",
    "request_id" : Date.now(),
    "data": {
        "person_id": "string",
        "flow_schema_identifier": "string",
        "flow_instance_id": "string"
    }
}

// Example response when requesting the state of a flow
{
  "request_id": 1519211809934,
  "errors": [],
  "status": 200,
  "data": {
    "flow_instance_id": "string",
    "flow_schema_identifier": "string",
    "state": "string (active, inactive, completed, exited)",
    "active_steps": [
      {
        "step_instance_id": "string",
        "step_schema_identifier": "string",
        "state": "string (active, inactive, completed)"
      }
    ]
}

// Example request when requesting the state of a step
{
    "action": "step_status",
    "request_id" : Date.now(),
    "data": {
        "person_id": "string",
        "flow_instance_id": "string",
        "step_schema_identifier": "string"
    }
}

// Example response when requesting the state of a step
{
  "request_id": 1519211809934,
  "errors": [],
  "status": 200,
  "data": {
    "step_instance_id": "string",
    "step_schema_identifier": "string",
    "state": "string (active, inactive, completed)"
  }
}

Acceptance Criteria*

Test cases that

  • Assert that given a valid Person.id and a FlowInstance.id or FlowInstance.identifier the server will respond with a 200 / status OK.
  • Assert that given a valid Person.id and a FlowInstance.id or FlowInstance.identifier the server will provide a JSON response in the format and structure defined above.
  • Assert that given a invalid Person.id or a FlowInstance.id or FlowInstance.identifier the server will indicate that these were invalid.
  • Assert that given a valid Person.id and a StepSchema.identifier the server will respond with a 200 / status OK.
  • Assert that given a valid Person.id and a StepSchema.identifier the server will provide a JSON response in the format and structure defined above.

Dependencies

Blockers:

Additional Details

Subscribing to flow / step state changes are not covered by this issue. A client will need to send another request type to subscribe to these changes.

*required field.

This was referenced Feb 25, 2024
@tomtitherington tomtitherington added size: hours This should take less than a day. blocked: conflict/dependency Something else is blocking this. scope: backend Work involving the backend / Django REST project. scope: tests Work relating to tests. labels Feb 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked: conflict/dependency Something else is blocking this. scope: backend Work involving the backend / Django REST project. scope: tests Work relating to tests. size: hours This should take less than a day.
Projects
Status: 🔖 Planned
Development

No branches or pull requests

1 participant