Skip to content

Commit

Permalink
IVIS-46: - Update API chapter (issues).
Browse files Browse the repository at this point in the history
  • Loading branch information
RuslanPopenko committed Oct 26, 2016
1 parent 7970def commit ae64355
Showing 1 changed file with 115 additions and 123 deletions.
238 changes: 115 additions & 123 deletions docs/api/issues.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ Issues

``(implementation of Issue entity)``

Provides following methods for `API <index.html>`_ calls:
Provides following method for `API <index.html>`_ calls:

* `Get issue`_
* `Get issues`_
* `Get issues list`_ (by some criteria)
* `Save issue`_
* `Save issues`_
* `Update issue`_
* `Delete issue`_
* `Get issue list`_ by some criteria

.. _`Get issue`:

Expand All @@ -34,45 +35,83 @@ Parameters response:
*Object*

*With properties:*
#. id (Number)
#. title (String)
#. description (String)
#. categories (Array)
#. status (Object)
#. responsible_person (Object)
#. authorized_persons (Array)
#. incidents (Array)
#. activities (Array)
#. priority (Object)
#. pupils (Object)

.. note::

responsible_person and authorized_persons link with Person entity

pupils property links with Pupil entity
#. id(NUMBER)
#. title(STRING)
#. description(STRING)
#. status(OBJECT)
type of `Status <http://docs.ivis.se/en/latest/api/status.html>`_
#. responsible_person(OBJECT)
type of `Person <http://docs.ivis.se/en/latest/api/person.html>`_
#. authorized_persons(ARRAY)
type of `Person <http://docs.ivis.se/en/latest/api/person.html>`_
#. incidents(ARRAY)
type of `Incident <http://docs.ivis.se/en/latest/api/incident.html>`_
#. reported_date(NUMBER)
#. reported_by(OBJECT)
type of `Person <http://docs.ivis.se/en/latest/api/person.html>`_
#. modified_by(OBJECT)
type of `Person <http://docs.ivis.se/en/latest/api/person.html>`_
#. modified_date(NUMBER)
#. activities(ARRAY)
type of `Activity <http://docs.ivis.se/en/latest/api/activity.html>`_
#. categories(ARRAY)
type of `Category <http://docs.ivis.se/en/latest/api/category.html>`_
#. priority(OBJECT)
type of `Priority <http://docs.ivis.se/en/latest/api/priority.html>`_
#. pupils(ARRAY)
type of `Pupil <http://docs.ivis.se/en/latest/api/pupil.html>`_

Example of response:
~~~~~~~~~~~~~~~~~~~~

.. code-block:: json
{
"id":1,
"title":"Test",
"description":"Test",
"status":{},
"incidents":[],
"activities":[],
"categories":[],
"priority":{},
"pupils":[],
"responsible_person":{},
"authorized_persons":[],
"reported_date":1465828993000,
"reported_by":{},
"modified_by":{},
"modified_date":1465828993000
"id" : 0,
"title" : "",
"description" : "",
"status" : {
"id" : null,
"name" : null
},
"responsible_person" : {
"id" : null,
"personal_id" : null,
"first_name" : null,
"last_name" : null,
"addresses" : { },
"emails" : { },
"phones" : { }
},
"authorized_persons" : [ ],
"incidents" : [ ],
"reported_date" : 1477474353104,
"reported_by" : {
"id" : null,
"personal_id" : null,
"first_name" : null,
"last_name" : null,
"addresses" : { },
"emails" : { },
"phones" : { }
},
"modified_by" : {
"id" : null,
"personal_id" : null,
"first_name" : null,
"last_name" : null,
"addresses" : { },
"emails" : { },
"phones" : { }
},
"modified_date" : 1477474353104,
"activities" : [ ],
"categories" : [ ],
"priority" : {
"id" : null,
"name" : null
},
"pupils" : [ ]
}
.. _`Get issues`:
Expand All @@ -97,52 +136,34 @@ Parameters response:
*Array*

.. seealso::
Array consists of objects from `Get issue`_ method

Example of response:
~~~~~~~~~~~~~~~~~~~~

.. code-block:: json
[
{},
{},
...
{}
]

.. _`Get issues list`:
Array consists of objects from `Get issue`_ method

Get issues list
---------------
Save issue
----------

URL:
~~~~
*/issues*

Method:
~~~~~~~
*GET*
*POST*

Parameters request:
~~~~~~~~~~~~~~~~~~~
* *search_text*
* *order_by*

.. note::
Now required for order_by only "title" and search criteria also title in Issue
*OBJECT(Issue)*

Parameters response:
~~~~~~~~~~~~~~~~~~~~
*Array*
*OBJECT(Issue)*

.. note::
Array structure the same as `Get issues`_
Null properties:
~~~~~~~~~~~~~~~~
*id*

.. _`Save incident`:

Save issue
----------
Save issues
-----------

URL:
~~~~
Expand All @@ -154,61 +175,14 @@ Method:

Parameters request:
~~~~~~~~~~~~~~~~~~~
*Object*

*With properties:*
#. title (String)
#. description (String)
#. status (Object)
#. responsible_person (Object)
#. authorized_persons (Array)
#. activities (Array)
#. categories (Array)
#. pupils (Array)
#. priority (Object)
#. incidents (Array)

.. note::
You can update properties of exists incidents by appropriate property
*Array(Issue)*

Parameters response:
~~~~~~~~~~~~~~~~~~~~
*Object*

*On server fill properties*
#. id (Number)
#. reported_date (Number)
#. reported_by (Object)

.. note::
You retrieve whole object just like in `Get issue`_

Example of request:
~~~~~~~~~~~~~~~~~~~

.. code-block:: json
{
"title" : "Test",
"description" : "Test",
"status" : { id : 1 },
"responsible_person" : { id : 1 },
"authorized_persons" : [ {id : 1}, {id : 2}, ... {id : n} ],
"activities" : [ {id : 1}, {id : 2}, ... {id : n} ],
"categories" : [ {id : 1}, {id : 2}, ... {id : n} ],
"priority" : { id : 1 },
"pupils" : [ {id : 1}, {id : 2}, ... {id : n} ],
"incidents" : [
{
"id" : 1,
"assigned_date" : 1465828993000,
"assigned_by" : { id : 1 },
"archived_date" : 1465828993000,
"archived_by" : { id : 1 }
},
...
]
}
*Array(Issue)*
Null properties of every object in array:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*id*

.. _`Update issue`:

Expand All @@ -225,16 +199,15 @@ Method:

Parameters request:
~~~~~~~~~~~~~~~~~~~
*Object*

*With properties what you want to update, except id*

.. seealso::
Whole properties list you can see at `Get issue`_
*OBJECT(Issue)*

Parameters response:
~~~~~~~~~~~~~~~~~~~~
*Object*
*OBJECT(Issue)*

.. note::

property will be updated, if you don't want update property it need set null

.. _`Delete issue`:

Expand All @@ -255,10 +228,29 @@ Parameters request:

Parameters response:
~~~~~~~~~~~~~~~~~~~~
*Object*
*OBJECT(Issue)*

.. note::

you receive deleted object

.. _`Get issues list`:

Get issues list
---------------

URL:
~~~~
*/issues*

Method:
~~~~~~~
*GET*

Parameters request:
~~~~~~~~~~~~~~~~~~~
* *search_text*
* *order_by*

.. note::
Now required for order_by only "title" and search criteria also title in Issue

0 comments on commit ae64355

Please sign in to comment.