Skip to content

Commit

Permalink
Merge pull request #6 from Keyclic/enhancement/notification
Browse files Browse the repository at this point in the history
Enhancement/notification
  • Loading branch information
kevin-lot committed Jun 14, 2019
2 parents 516207e + d12e989 commit 55d9216
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 94 deletions.
2 changes: 1 addition & 1 deletion feedbacks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ For more informations about places, see :ref:`organizations-places`.
Feedbacks by an agent
---------------------

Agents (:ref:`members-agent`) can post feedbacks the same way as every user. What's more, an agent can enter in "pro mode". To do so, just put in the body of the request, the "proMode" field with the value "true". Thus, his feedback will be treated differently:
An :ref:`members-agent` can post feedbacks the same way as every user. What's more, an agent can enter in "pro mode". To do so, just put in the body of the request, the "proMode" field with the value "true". Thus, his feedback will be treated differently:

- If his feedback is within a place of his organization, a report is created.

Expand Down
69 changes: 35 additions & 34 deletions members.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,31 +7,15 @@ When a user is part of an organization, he may receive from none to five roles,

These are five roles :

- No role - Member
- Administrator
- Agent
- Operator
- Analytic
- Export

A user may be part of several organizations, therefore his roles among the organizations may differ and are completely independent.

.. _members-no-roles:

No role - Member
----------------

A user who gets affiliated with an organization becomes a *member*. A *member* possesses the same basic functionalities as a simple user.

This role adds the following possibilities :

- Being listed by admins,
- Receive an assignment to an operation,
- Edit an operation (if assigned to said member) : change name, add pictures, change state, etc.

All members share those rights and other may stack if the member has more roles.

Note : A user can be member of several organizations and an organization can have several members.

.. _members-admin:

Administrator
Expand All @@ -41,10 +25,10 @@ Every user can create his own organization.

The user who created the organization becomes member and admin of that organization, his role is *Admin*.

The admin has the following permissions added to his membership privileges :
The admin has the following permissions and privileges :

- Add new members,
- Change the member's roles,
- Change members' roles,
- Manage the organization's categories,
- Manage the organization's places,
- Manage the organization's partners,
Expand All @@ -54,7 +38,7 @@ See : :ref:`organizations`

See : :ref:`reports`

Note : A user can be *Admin* of several organizations and an organization can have several *Admins*.
Note : A user can be *ORGANIZATION:ADMIN* of several organizations and an organization can have several *ORGANIZATION:ADMIN*.

.. _members-agent:

Expand All @@ -67,16 +51,31 @@ An agent has the possibility to :

- Activate Pro Mode (cf :ref:`feedbacks-agent`)

**Note : A user can only be an Agent of one organization but an organization can have several Agents.**
**Note : A user can only be an ORGANIZATION:AGENT of one organization but an organization can have several ORGANIZATION:AGENT.**

.. _members-stat:
.. _members-operator:

Analytic
Operator
--------

The role *Analytic* allows the member to access the organization statistics.
This role adds the following possibilities :

- Receive an assignment to an operation,
- Edit an operation (if assigned to that member) : change name, add pictures, change state, etc.

All members share those rights and other may stack if the member has more roles.

Note : An *ORGANIZATION:OPERATOR* can be member of several organizations and an organization can have several *ORGANIZATION:OPERATOR*.

Note : A user can have the role *Analytic* for several organizations and an organization can have several members with the role *Analytic*.

.. _members-analytics:

Analytics
---------

The role *Analytics* allows the member to access the organization statistics.

Note : A user can have the role *ORGANIZATION:ANALYTICS* for several organizations and an organization can have several members with the role *ORGANIZATION:ANALYTICS*.

.. _members-export:

Expand All @@ -85,7 +84,7 @@ Export

The role *Export* allows the member to export his organization's reports to the Excel format.

Note : A user can have the role *Export* for several organizations and an organization can have several members with the role *Export*.
Note : A user can have the role *ORGANIZATION:EXPORT* for several organizations and an organization can have several members with the role *ORGANIZATION:EXPORT*.

.. _members-retrieving:

Expand Down Expand Up @@ -114,7 +113,7 @@ To get members of an organization :

.. code-block:: bash
GET /people?organization={organization}
GET /organizations/{organization}/members
.. _members-example:

Expand Down Expand Up @@ -193,11 +192,13 @@ Retrieving a user resource will display information about his membership(s), lik
}
}
This shows :
This json shows the user :

- is a member of an organization whose id is 84d36093-b8bc-47ad-bc8a-a043b3e301a9
- has the role ORGANIZATION:ADMIN : he is an admin of the organization 84d36093-b8bc-47ad-bc8a-a043b3e301a9
- has the role ORGANIZATION:AGENT : he is an agent of the organization 84d36093-b8bc-47ad-bc8a-a043b3e301a9
- is part of only one organization
- joined the organization February 27, 2018

1. He is a member of an organization whose id is 84d36093-b8bc-47ad-bc8a-a043b3e301a9
2. He has the role ORGANIZATION:ADMIN : he is an admin of the organization 84d36093-b8bc-47ad-bc8a-a043b3e301a9
3. He has the role ORGANIZATION:AGENT : he is an agent of the organization 84d36093-b8bc-47ad-bc8a-a043b3e301a9
4. The user id (5020c6ea-ca07-42d1-994f-d90b86703b1a) is not the same as the member id (b0e7e28f-5b91-4c73-875e-8f34aa03553a)
5. He is part of only one organization
6. He joined the organization February 27, 2018
CAUTION: The user id (5020c6ea-ca07-42d1-994f-d90b86703b1a) is not the same as the member id (b0e7e28f-5b91-4c73-875e-8f34aa03553a).
The API identifies a member and a user as two differents entities.
83 changes: 44 additions & 39 deletions notifications.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,43 +10,48 @@ The Keyclic service can notify users when some actions are made.
Notifications sent by action
----------------------------

+--------------------------------+-------------------------+------------------------------------------------------------------------+
| Action | Notification Type | Target |
+================================+=========================+========================================================================+
| Feedback is commented | Push smartphone | The user who made the feedback |
| | | |
| | | Users who commented or supported to the feedback |
+--------------------------------+-------------------------+------------------------------------------------------------------------+
| Report is created | Email + Push smartphone | Administrators |
+--------------------------------+-------------------------+------------------------------------------------------------------------+
| Report is accepted | Push smartphone | The user who made the feedback |
| | | |
| | | Users who commented or supported to the feedback |
+--------------------------------+-------------------------+------------------------------------------------------------------------+
| Report is closed | Push smartphone | The user who made the feedback |
| | | |
| | | Users who commented or supported to the feedback |
+--------------------------------+-------------------------+------------------------------------------------------------------------+
| Report is refused | Push smartphone | The user who made the feedback |
| | | |
| | | Users who commented or supported to the feedback |
+--------------------------------+-------------------------+------------------------------------------------------------------------+
| Delegated report is accepted | Push smartphone | Administrators of parent report |
+--------------------------------+-------------------------+------------------------------------------------------------------------+
| Delegated report is closed | Push smartphone | Administrators of parent report |
+--------------------------------+-------------------------+------------------------------------------------------------------------+
| Delegated report is refused | Push smartphone | Administrators of parent report |
+--------------------------------+-------------------------+------------------------------------------------------------------------+
| Operation assigned | Push smartphone | Member assigned to the operation |
+--------------------------------+-------------------------+------------------------------------------------------------------------+
| Operation resolved | Push smartphone | Administrators |
+--------------------------------+-------------------------+------------------------------------------------------------------------+
| Operation is commented | Push smartphone | Member assigned to the operation |
| | | |
| | | Members who commented the operation |
+--------------------------------+-------------------------+------------------------------------------------------------------------+
| Feedback to review | Push smartphone | Reviewer |
+--------------------------------+-------------------------+------------------------------------------------------------------------+
| Report(s) exported | Email | Administrator who sent the request |
+--------------------------------+-------------------------+------------------------------------------------------------------------+
+--------------------------------+---------------------------------------------------------+-------+-------+-------+
| Action | Target | Push | Wall | Mail |
+================================+=========================================================+=======+=======+=======+
| User register | The user | N | N | Y |
+--------------------------------+---------------------------------------------------------+-------+-------+-------+
| Password change request | The user | N | N | Y |
+--------------------------------+---------------------------------------------------------+-------+-------+-------+
| Feedback is commented | The user who made the feedback | Y | Y | N |
| | | | | |
| | Users who commented or supported to the feedback | | | |
+--------------------------------+---------------------------------------------------------+-------+-------+-------+
| Report is created | Administrators | Y | Y | Y |
+--------------------------------+---------------------------------------------------------+-------+-------+-------+
| Report is accepted | The user who made the feedback | Y | Y | N |
| | | | | |
| | Users who commented or supported to the feedback | | | |
+--------------------------------+---------------------------------------------------------+-------+-------+-------+
| Report is closed | The user who made the feedback | Y | Y | N |
| | | | | |
| | Users who commented or supported to the feedback | | | |
+--------------------------------+---------------------------------------------------------+-------+-------+-------+
| Report is refused | The user who made the feedback | Y | Y | N |
| | | | | |
| | Users who commented or supported to the feedback | | | |
+--------------------------------+---------------------------------------------------------+-------+-------+-------+
| Report is delegated | Administrators | Y | Y | Y |
+--------------------------------+---------------------------------------------------------+-------+-------+-------+
| Add document to report | Administrators | Y | Y | N |
+--------------------------------+---------------------------------------------------------+-------+-------+-------+
| Operation assigned | Member assigned to the operation | Y | Y | Y |
+--------------------------------+---------------------------------------------------------+-------+-------+-------+
| Operation resolved | Administrator who created the operation | Y | Y | N |
+--------------------------------+---------------------------------------------------------+-------+-------+-------+
| Intervention remind | Administrators | Y | Y | N |
+--------------------------------+---------------------------------------------------------+-------+-------+-------+
| Operation is commented | Member assigned to the operation | Y | Y | N |
| | Administrator who created the operation | | | |
| | | | | |
| | Members who commented the operation | | | |
+--------------------------------+---------------------------------------------------------+-------+-------+-------+
| Feedback to review | Reviewer | Y | Y | N |
+--------------------------------+---------------------------------------------------------+-------+-------+-------+

When a user makes an action which triggers a notification where it would be targeted. This user doesn't receive a notification.
For example, if a member assigned to an operation leaves a comment on the operation, it doesn't receive a notification saying it commented the operation.
21 changes: 11 additions & 10 deletions organizations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@ Organizations

In the Keyclic app, an organization is an entity such as a company, a corporation, an association, a school, etc. to which feedbacks can be sent to be treated.

A :ref:`members-no-roles` is a user affiliated with an organization. One or more members can be administrators of that organization (see : :ref:`members-admin`). An organization has at least one administrator.
One or more members can be :ref:`members-admin` of that organization. An organization has at least one administrator.

An :ref:`members-admin` can manage the scope of operation of the organization by creating categories and places.
When a user creates a feedback, geographic coordinates of that feedback are always automatically given. Thus, the app can display all organizations and their category in that place.
Then the user can choose which organization he wants to take care of the problem.
When a user creates a feedback, geographic coordinates of that feedback are always automatically transmitted.
Thus, the app can display all organizations in that place.
Then the user has acces to information helping it choose the most fitting organization.

.. _organizations-creation:

Expand Down Expand Up @@ -61,28 +62,26 @@ To add a new member to the organization :
"person":"63d07fc5-f4e6-471c-a8cc-3c3f227c8c2d"
}
This endpoint is reserved to a user who is ORGANIZATION:ADMIN and member of the organization {organization}.
This endpoint is reserved to a user who is :ref:`members-admin` and member of the organization {organization}.

To get organization's members :

.. code-block:: bash
GET /people?organization={organization}
GET /organizations/{organization}/members
To remove a member from the organization, an admin will request :

.. code-block:: bash
DELETE /organizations/{organization}/members/{member}
For more informations on the role ORGANIZATION:ADMIN and its privileges, see :ref:`members-admin`.

.. _organizations-places:

Manage places
-------------

An admin can create places, corresponding to areas where the organization can take actions :
An :ref:`members-admin` can create places, corresponding to areas where the organization can take actions :

.. code-block:: bash
Expand Down Expand Up @@ -147,7 +146,8 @@ This request may be filtered by organization and/or geographic points :
Manage categories
-----------------

Categories are the business sectors of an organization. An admin can create a new category with a name, a color and an icon. The icon is chosen from `Font Awesome <http://fontawesome.io/icons/>`_.
Categories are the business sectors of an organization. An :ref:`members-admin` can create a new category with a name, a color and an icon.
The icon is chosen from `Font Awesome <http://fontawesome.io/icons/>`_.

.. code-block:: bash
Expand Down Expand Up @@ -183,7 +183,8 @@ Manage partnership
An organization can have partners, i.e organizations affiliated with it. This relationship is one-sided :
an organization A is a partner of organization B, but B is not necessarily one of B.

The partnership means that an admin can delegate a report to a partner organization. In the previous example, A can delegate a report to B, but B cannot delegate to A.
The partnership means that an :ref:`members-admin` can delegate a report to a partner organization.
In the previous example, A can delegate a report to B, but B cannot delegate to A.

To add a new partner to the organization, an admin will send the request :

Expand Down

0 comments on commit 55d9216

Please sign in to comment.