Skip to content

Commit

Permalink
IVIS-46: - Update API chapter (pupils).
Browse files Browse the repository at this point in the history
  • Loading branch information
RuslanPopenko committed Oct 26, 2016
1 parent 57f2c9d commit da0cc26
Show file tree
Hide file tree
Showing 2 changed files with 176 additions and 28 deletions.
20 changes: 20 additions & 0 deletions docs/api/pupil.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,23 @@ List of properties from Pupil
type of `AfterSchoolCenterSection <http://docs.ivis.se/en/latest/api/afterschoolcentersection.html>`_
#. school_center_schema(ARRAY)
type of `AfterSchoolCenterSchema <http://docs.ivis.se/en/latest/api/afterschoolcenterschema.html>`_

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

.. code-block:: json
{
"id":10,
"person":{ },
"contact_person":{ },
"class_placement_from":null,
"class_placement_to":null,
"school_class":{ },
"school":null,
"academic_year":null,
"guardians":[ ],
"truancies":[ ],
"after_school_center_section":{ },
"school_center_schema":[ ]
}
184 changes: 156 additions & 28 deletions docs/api/pupils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@ Pupils

``(implementation of Pupil entity)``

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

* `Get pupil`_
* `Get pupils`_
* `Save pupil`_
* `Save pupils`_
* `Update pupil`_
* `Delete pupil`_
* `Get pupil or pupils by personal id`_

.. _`Get pupil`:

Expand All @@ -30,34 +35,49 @@ Parameters response:
*Object*

*With properties:*

#. id (Number)
#. person (Object)
#. school (Object)
#. guardians (Array)
Other properties aren't necessary.
#. id(NUMBER)
#. person(OBJECT)
type of `Person <http://docs.ivis.se/en/latest/api/person.html>`_
#. contact_person(OBJECT)
type of `Person <http://docs.ivis.se/en/latest/api/person.html>`_
#. class_placement_from(NUMBER)
#. class_placement_to(NUMBER)
#. school_class(OBJECT)
type of `SchoolClass <http://docs.ivis.se/en/latest/api/schoolclass.html>`_
#. school
type of `School <http://docs.ivis.se/en/latest/api/school.html>`_
#. academic_year(OBJECT)
type of `AcademicYear <http://docs.ivis.se/en/latest/api/academicyear.html>`_
#. guardians(ARRAY)
type of `Guardian <http://docs.ivis.se/en/latest/api/guardian.html>`_
#. truancies(ARRAY)
type of `Truancy <http://docs.ivis.se/en/latest/api/truancy.html>`_
#. after_school_center_section(OBJECT)
type of `AfterSchoolCenterSection <http://docs.ivis.se/en/latest/api/afterschoolcentersection.html>`_
#. school_center_schema(ARRAY)
type of `AfterSchoolCenterSchema <http://docs.ivis.se/en/latest/api/afterschoolcenterschema.html>`_

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

.. code-block:: json
{
"id":1,
"person":{},
"contactPerson":{},
"classPlacementFrom":{},
"classPlacementTo":{},
"schoolClass":[],
"school":{},
"academicYear":{},
"guardians":[],
"truancies":[],
"afterSchoolCenterSection":{},
"schoolCenterSchema":[]
"id":10,
"person":{ },
"contact_person":{ },
"class_placement_from":null,
"class_placement_to":null,
"school_class":{ },
"school":null,
"academic_year":null,
"guardians":[ ],
"truancies":[ ],
"after_school_center_section":{ },
"school_center_schema":[ ]
}
.. _`Get pupils`:
.. _`Get persons`:

Get pupils
----------
Expand All @@ -79,17 +99,125 @@ Parameters response:
*Array*

.. seealso::

Array consists of objects from `Get pupil`_ method

Example of response:
Save pupil
----------

URL:
~~~~
*/pupils*

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

Parameters request:
~~~~~~~~~~~~~~~~~~~
*OBJECT(Pupil)*

Parameters response:
~~~~~~~~~~~~~~~~~~~~
*OBJECT(Pupil)*

.. code-block:: json
Null properties:
~~~~~~~~~~~~~~~~
*id*

Save pupils
-----------

URL:
~~~~
*/pupils*

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

Parameters request:
~~~~~~~~~~~~~~~~~~~
*Array(Pupil)*

Parameters response:
~~~~~~~~~~~~~~~~~~~~
*Array(Pupil)*

Null properties of every object in array:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*id*

.. _`Update pupil`:

Update pupil
------------

URL:
~~~~
*/pupils/{id}*

Method:
~~~~~~~
*PUT*

Parameters request:
~~~~~~~~~~~~~~~~~~~
*OBJECT(Pupil)*

Parameters response:
~~~~~~~~~~~~~~~~~~~~
*OBJECT(Pupil)*

.. note::

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

.. _`Delete pupil`:

Delete pupil
------------

URL:
~~~~
*/pupils/{id}*

Method:
~~~~~~~
*DELETE*

Parameters request:
~~~~~~~~~~~~~~~~~~~
*null*

Parameters response:
~~~~~~~~~~~~~~~~~~~~
*OBJECT(Pupil)*

.. note::

you receive deleted object

.. _`Get pupil or pupils by personal id`:

Get pupil or pupils by personal id
----------------------------------

URL:
~~~~
*/pupils*

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

Parameters request:
~~~~~~~~~~~~~~~~~~~
*personalId(STRING)*
and optional *first(BOOLEAN)*

Parameters response:
~~~~~~~~~~~~~~~~~~~~
*ARRAY or OBJECT (Person)*

[
{},
{},
...
{}
]

0 comments on commit da0cc26

Please sign in to comment.