Ajout d'un rôle d'un contact à une station hydro
================================================

Ce web-service permet d'ajouter un rôle à un contact sur une station hydro.

Paramètres HTTP
---------------

========= ====================
Paramètre Valeur
========= ====================
Route     contactstationhydro
Méthode   POST
Contenu   un rôle d'un contact
          sur un station hydro
========= ====================

Droit de gestion
----------------

Pour ajouter un rôle d'un contact, il faut être administrateur de la station hydro.

Règles techniques
-----------------

- Le site hydro et la station hydro doivent exister.
- la station hydro doit dépendre du site hydro
- Le contact à associer au site hydrologique doit exister et être actif
- Le rôle à ajouter doit appartenir à la liste suivante: ADM, POLE2, POLE3, POLE4, PREVI, VISU

Contenu de la requête HTTP
--------------------------

La requête HTTP doit contenir un json hydrométrie contenant un rôle d'un contact sur un station
hydro.

Json hydrométrie
^^^^^^^^^^^^^^^^

.. literalinclude:: ../../../jsonschema/ajouterContactStationHydro.json
   :caption: Schéma de validation
   :language: json

* Les attributs RefHyd (associé à l'objet Refhyd) et Scenario sont obligatoires;
* L'objet RefHyd ne doit contenir qu'un seul attribut SitesHydro associé à une liste non vide
  d'objets SiteHydro;
* L'objet SiteHydro doit contenir les attributs CdSiteHydro et StationsHydro;
* L'attribut StationsHydro doit être une liste contenant un unique objet StationHydro;
* L'objet StationHydro doit contenir uniquement les attributs CdStationHydro et RolsContactStationHydro;
* L'attribut RolsContactStationHydro doit être une liste non vide d'objets RolContactStationHydro;
* L'objet RolContactStationHydro doit contenir uniquement les attributs CdContact et RoleContactStationHydro.

Réponse du web-service
----------------------

En cas de succès, le web-service retournera un json hydrométrie contenant le rôle du contact ajouté.

Le web-service rajoutera les attributs DtDebutContactStationHydro et DtMajRoleContactStationHydro au
rôle du contact.
