Reports

When a feedback is delivered (see : Life cycle overview), a report is created.

An admin gets all his organization’s reports with :

GET /organizations/{organization}/reports

And a specific report with :

GET /reports/{report}

Life cycle

When a new report is generated by a feedback, its state is NEW.

Below is a representation of each possible state for a report and the actions on that report leading to this state.

_images/report_workflow.png

There is a unique endpoint to change a report’s state :

PATCH /reports/{report}/state

For example, to change the report’s state from NEW to ACCEPTED, the admin will send the previous request with the following body :

{
    "transition": "accept"
}

A report can only be closed (state CLOSED) if :

  • Every operation linked to this report has been either resolved or refused (see paragraph below Operations).
  • Every report delegated to a partner organization from the original report must be closed (see paragraph below Delegation).

Operations

An operation is an action assigned to a member of the organization in relation with a report.

This endpoint sends back all operations resulting from a report :

GET /reports/{report}/operations

Creation and modification of an operation

An admin creates an operation on a report with this request :

POST /operations
{
    "description":"operation's description",
    "name":"operation's name",
    "report":"cb7118b5-a821-4cf2-9475-0c0d0efdb8d0"
}

A newly created operation has the state NEW.

One or more images can be added to an operation :

POST /operations/{operation}/images
{
    "image":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAIAAAACDbGyAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QIVDRUfvq7u+AAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAAUSURBVAjXY3wrIcGABJgYUAGpfABZiwEnbOeFrwAAAABJRU5ErkJggg=="
}

The description of an operation can be modified with the request :

PATCH /operations/{operation}
{
    "description": "New description"
}

Assignment

To assign an operation to a member, the admin sends the following request :

POST /operations/{operation}/assign
{
    "member": "{member}",
}

where {member} is the member’s id the operation is assigned to.

In progress and closing operation

After being assigned, the operation will be changed to “in progress” then “resolved”, either by the assigned member or the admin.

Life cycle of an operation

_images/operation_workflow.png

Comments

It’s possible to comment an operation :

POST /operations/{operation}/comments
{
    "text":"My comment"
}

To get all comments on an operation :

GET /operations/{operation}/comments

Logs of an operation

An admin can see the history of an operation :

GET /operations/{operation}/logs

Delegation

An admin can delegate a report to a partner organization.

See : Manage partnership

To delegate a report, an admin sends the following request :

POST /organizations/{organization}/delegates
{
    "report":"cb7118b5-a821-4cf2-9475-0c0d0efdb8d0",
    "organization":"a31d9ab7-9476-45f2-8cc7-033bf40bbcfa"
}

where {organization} is the organization’s id delegating the report. And a31d9ab7-9476-45f2-8cc7-033bf40bbcfa is the receiving organization’s id.

Delegating a report doesn’t mean this report is transfered, the initial report isn’t modified but a new “child” report is created and attributed to the partner organization. This new report will be treated by the partner organization the same way every other report is: state change, operations, assignments, etc, until it is closed.

The partner organization may itself delegate this report to one of its partners and so on. For the initial report to be closed, the child must be closed.

Export

An admin can export every report from his organization to the Excel format:

POST /organizations/{organization}/reports/exports

An archive containing the Excel file listing all reports and the associated images will be emailed to the authenticated admin.