From 2a94e0056a31f2aecdb8ad78bb05b43e5bf9fc30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yana=C3=ABl=20GRETTE?= Date: Fri, 4 Dec 2020 10:36:32 +0100 Subject: [PATCH] =?UTF-8?q?MAJ=20des=20urls=20pour=20la=20partie=20formati?= =?UTF-8?q?on=20en=20fonction=20des=20sp=C3=A9cifications=20techniques?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- openapi.yaml | 28 ++++----- parameters/query/dateDebut.yaml | 2 +- parameters/query/dateFin.yaml | 2 +- parameters/query/idStatuts.yaml | 9 +++ paths/formation/formationId.yaml | 73 ++++++++++++++++++++++ paths/formation/formationbyid.yaml | 16 ----- paths/formation/formations.yaml | 23 ++++++- paths/formation/formationsAnnulees.yaml | 21 ------- paths/formation/formationsCount.yaml | 27 ++++++++ paths/formation/formationsRealisees.yaml | 21 ------- paths/formation/prochainesformations.yaml | 21 ------- paths/formation/supprimerFormation.yaml | 13 ---- paths/formation/updateFormation.yaml | 18 ------ responses/formation/getcountformation.yaml | 7 +++ 14 files changed, 149 insertions(+), 132 deletions(-) create mode 100644 parameters/query/idStatuts.yaml create mode 100644 paths/formation/formationId.yaml delete mode 100644 paths/formation/formationbyid.yaml delete mode 100644 paths/formation/formationsAnnulees.yaml create mode 100644 paths/formation/formationsCount.yaml delete mode 100644 paths/formation/formationsRealisees.yaml delete mode 100644 paths/formation/prochainesformations.yaml delete mode 100644 paths/formation/supprimerFormation.yaml delete mode 100644 paths/formation/updateFormation.yaml create mode 100644 responses/formation/getcountformation.yaml diff --git a/openapi.yaml b/openapi.yaml index d9d02ca..15db804 100644 --- a/openapi.yaml +++ b/openapi.yaml @@ -134,37 +134,31 @@ paths: # $ref: ./paths/demandeformation/themes.yaml #Formation - /formations: + /formation: $ref: ./paths/formation/formations.yaml - /formations/{idFormation}: - $ref: ./paths/formation/formationById.yaml - /formations/{idFormation}/update: - $ref: ./paths/formation/updateFormation.yaml - /formations/{idFormation}/supprimer: - $ref: ./paths/formation/supprimerFormation.yaml - /formations/prochaines: - $ref: ./paths/formation/prochainesFormations.yaml - /formations/realisees: - $ref: ./paths/formation/formationsRealisees.yaml - /formations/annulees: - $ref: ./paths/formation/formationsAnnulees.yaml + /formation/count: + $ref: ./paths/formation/formationsCount.yaml + /formation/{idFormation}: + $ref: ./paths/formation/formationId.yaml + #OrigineFormation - /originesFormation: + /originesformation: $ref: ./paths/formation/originesFormation.yaml #StatutFormation - /statutsFormation: + /statutsformation: $ref: ./paths/formation/statutsFormation.yaml #ModeFormation - /modesFormation: + /modesformation: $ref: ./paths/formation/modesFormation.yaml #TypeFormation - /typesFormation: + /typesformation: $ref: ./paths/formation/typesFormation.yaml + #ParticipationFormation et évaluation /participations/{idCollaborateur}: $ref: ./paths/participationformation/participationsCollaborateur.yaml diff --git a/parameters/query/dateDebut.yaml b/parameters/query/dateDebut.yaml index c19215a..1b2e939 100644 --- a/parameters/query/dateDebut.yaml +++ b/parameters/query/dateDebut.yaml @@ -4,5 +4,5 @@ schema: type: string format: date-time default: null -description: Date permettant de filtrer par date de début +description: Date à partir de laquelle les données son récupérées required: false \ No newline at end of file diff --git a/parameters/query/dateFin.yaml b/parameters/query/dateFin.yaml index 38d4ee0..153b07d 100644 --- a/parameters/query/dateFin.yaml +++ b/parameters/query/dateFin.yaml @@ -4,5 +4,5 @@ schema: type: string format: date-time default: null -description: Date permettant de filtrer par date de fin +description: Date jusqu'à laquelle les données sont récupérées required: false \ No newline at end of file diff --git a/parameters/query/idStatuts.yaml b/parameters/query/idStatuts.yaml new file mode 100644 index 0000000..d621c3b --- /dev/null +++ b/parameters/query/idStatuts.yaml @@ -0,0 +1,9 @@ +in: query +name: idStatuts +schema: + type: array + items: + type: integer + default: null +required: false +description: liste des ids des statuts des formations à récupérer \ No newline at end of file diff --git a/paths/formation/formationId.yaml b/paths/formation/formationId.yaml new file mode 100644 index 0000000..7b8838f --- /dev/null +++ b/paths/formation/formationId.yaml @@ -0,0 +1,73 @@ +get: + tags: + - formations + operationId: getFormationById + description: Récupérer une formation par son id + parameters: + - $ref: ../../parameters/path/idFormation.yaml + responses: + '200': + $ref: ../../responses/formation/getFormation.yaml + + '401': + $ref: ../../responses/erreur/unauthorized.yaml + + '403': + $ref: ../../responses/erreur/forbidden.yaml + + '404': + $ref: ../../responses/erreur/notFound.yaml + + '500': + $ref: ../../responses/erreur/internalServerError.yaml + +put: + tags: + - formations + operationId: updateFormation + description: Mettre à jour une formation + parameters: + - $ref: ../../parameters/path/idFormation.yaml + requestBody: + $ref: ../../requestbodies/formation.yaml + responses: + '200': + $ref: ../../responses/formation/updateFormation.yaml + + '401': + $ref: ../../responses/erreur/unauthorized.yaml + + '403': + $ref: ../../responses/erreur/forbidden.yaml + + '404': + $ref: ../../responses/erreur/notFound.yaml + + '415': + $ref: ../../responses/erreur/unsupportedMediaType.yaml + + '500': + $ref: ../../responses/erreur/internalServerError.yaml + +delete: + tags: + - formations + operationId: deleteFormation + description: Supprimer une formation + parameters: + - $ref: ../../parameters/path/idFormation.yaml + responses: + '204': + $ref: ../../responses/formation/formationSupprimee.yaml + + '401': + $ref: ../../responses/erreur/unauthorized.yaml + + '403': + $ref: ../../responses/erreur/forbidden.yaml + + '404': + $ref: ../../responses/erreur/notFound.yaml + + '500': + $ref: ../../responses/erreur/internalServerError.yaml \ No newline at end of file diff --git a/paths/formation/formationbyid.yaml b/paths/formation/formationbyid.yaml deleted file mode 100644 index 7cf3d04..0000000 --- a/paths/formation/formationbyid.yaml +++ /dev/null @@ -1,16 +0,0 @@ -get: - tags: - - formations - operationId: getFormationById - description: Récupérer une formation par son id - parameters: - - $ref: ../../parameters/path/idFormation.yaml - responses: - '200': - $ref: ../../responses/formation/getFormation.yaml - - '403': - $ref: ../../responses/erreur/forbidden.yaml - - '404': - $ref: ../../responses/erreur/notFound.yaml \ No newline at end of file diff --git a/paths/formation/formations.yaml b/paths/formation/formations.yaml index 8e994ce..da006c9 100644 --- a/paths/formation/formations.yaml +++ b/paths/formation/formations.yaml @@ -4,20 +4,28 @@ get: operationId: getFormations description: Récupérer la liste des formations parameters: - - $ref: ../../parameters/query/asc.yaml - $ref: ../../parameters/query/idAgence.yaml + - $ref: ../../parameters/query/idStatuts.yaml + - $ref: ../../parameters/query/asc.yaml - $ref: ../../parameters/query/numPage.yaml - $ref: ../../parameters/query/parPage.yaml - - $ref: ../../parameters/query/statutformation.yaml - $ref: ../../parameters/query/texte.yaml - $ref: ../../parameters/query/tri.yaml + - $ref: ../../parameters/query/dateDebut.yaml + - $ref: ../../parameters/query/dateFin.yaml responses: '200': $ref: ../../responses/formation/getListeFormations.yaml + '401': + $ref: ../../responses/erreur/unauthorized.yaml + '403': $ref: ../../responses/erreur/forbidden.yaml + '500': + $ref: ../../responses/erreur/internalServerError.yaml + post: tags: - formations @@ -29,5 +37,14 @@ post: '201': $ref: ../../responses/formation/formationCreee.yaml + '401': + $ref: ../../responses/erreur/unauthorized.yaml + '403': - $ref: ../../responses/erreur/forbidden.yaml \ No newline at end of file + $ref: ../../responses/erreur/forbidden.yaml + + '415': + $ref: ../../responses/erreur/unsupportedMediaType.yaml + + '500': + $ref: ../../responses/erreur/internalServerError.yaml \ No newline at end of file diff --git a/paths/formation/formationsAnnulees.yaml b/paths/formation/formationsAnnulees.yaml deleted file mode 100644 index b26f715..0000000 --- a/paths/formation/formationsAnnulees.yaml +++ /dev/null @@ -1,21 +0,0 @@ -get: - tags: - - formations - operationId: getFormationAnnulees - description: Récupérer les formations annulées - parameters: - - $ref: ../../parameters/query/asc.yaml - - $ref: ../../parameters/query/idAgence.yaml - - $ref: ../../parameters/query/numPage.yaml - - $ref: ../../parameters/query/parPage.yaml - - $ref: ../../parameters/query/texte.yaml - - $ref: ../../parameters/query/tri.yaml - responses: - '200': - $ref: ../../responses/formation/getListeFormations.yaml - - '403': - $ref: ../../responses/erreur/forbidden.yaml - - '404': - $ref: ../../responses/erreur/notFound.yaml \ No newline at end of file diff --git a/paths/formation/formationsCount.yaml b/paths/formation/formationsCount.yaml new file mode 100644 index 0000000..41553d2 --- /dev/null +++ b/paths/formation/formationsCount.yaml @@ -0,0 +1,27 @@ +get: + tags: + - formations + operationId: getFormationsCount + description: Récupérer le nombre total de formations + parameters: + - $ref: ../../parameters/query/idAgence.yaml + - $ref: ../../parameters/query/idStatuts.yaml + - $ref: ../../parameters/query/asc.yaml + - $ref: ../../parameters/query/numPage.yaml + - $ref: ../../parameters/query/parPage.yaml + - $ref: ../../parameters/query/texte.yaml + - $ref: ../../parameters/query/tri.yaml + - $ref: ../../parameters/query/dateDebut.yaml + - $ref: ../../parameters/query/dateFin.yaml + responses: + '200': + $ref: ../../responses/formation/getcountformation.yaml + + '401': + $ref: ../../responses/erreur/unauthorized.yaml + + '403': + $ref: ../../responses/erreur/forbidden.yaml + + '500': + $ref: ../../responses/erreur/internalServerError.yaml \ No newline at end of file diff --git a/paths/formation/formationsRealisees.yaml b/paths/formation/formationsRealisees.yaml deleted file mode 100644 index 2051c85..0000000 --- a/paths/formation/formationsRealisees.yaml +++ /dev/null @@ -1,21 +0,0 @@ -get: - tags: - - formations - operationId: getFormationRealisee - description: Récupérer les formations réalisées - parameters: - - $ref: ../../parameters/query/asc.yaml - - $ref: ../../parameters/query/idAgence.yaml - - $ref: ../../parameters/query/numPage.yaml - - $ref: ../../parameters/query/parPage.yaml - - $ref: ../../parameters/query/texte.yaml - - $ref: ../../parameters/query/tri.yaml - responses: - '200': - $ref: ../../responses/formation/getListeFormations.yaml - - '403': - $ref: ../../responses/erreur/forbidden.yaml - - '404': - $ref: ../../responses/erreur/notFound.yaml \ No newline at end of file diff --git a/paths/formation/prochainesformations.yaml b/paths/formation/prochainesformations.yaml deleted file mode 100644 index aa7422f..0000000 --- a/paths/formation/prochainesformations.yaml +++ /dev/null @@ -1,21 +0,0 @@ -get: - tags: - - formations - operationId: getProchainesFormation - description: Récupérer les formations plannifié et replannifié - parameters: - - $ref: ../../parameters/query/asc.yaml - - $ref: ../../parameters/query/idAgence.yaml - - $ref: ../../parameters/query/numPage.yaml - - $ref: ../../parameters/query/parPage.yaml - - $ref: ../../parameters/query/texte.yaml - - $ref: ../../parameters/query/tri.yaml - responses: - '200': - $ref: ../../responses/formation/getListeFormations.yaml - - '403': - $ref: ../../responses/erreur/forbidden.yaml - - '404': - $ref: ../../responses/erreur/notFound.yaml \ No newline at end of file diff --git a/paths/formation/supprimerFormation.yaml b/paths/formation/supprimerFormation.yaml deleted file mode 100644 index ad8484e..0000000 --- a/paths/formation/supprimerFormation.yaml +++ /dev/null @@ -1,13 +0,0 @@ -delete: - tags: - - formations - operationId: deleteFormation - description: Supprimer une formation - parameters: - - $ref: ../../parameters/path/idFormation.yaml - responses: - '204': - $ref: ../../responses/formation/formationSupprimee.yaml - - '403': - $ref: ../../responses/erreur/forbidden.yaml \ No newline at end of file diff --git a/paths/formation/updateFormation.yaml b/paths/formation/updateFormation.yaml deleted file mode 100644 index e6e03c5..0000000 --- a/paths/formation/updateFormation.yaml +++ /dev/null @@ -1,18 +0,0 @@ -put: - tags: - - formations - operationId: updateFormation - description: Mettre à jour une formation - parameters: - - $ref: ../../parameters/path/idFormation.yaml - requestBody: - $ref: ../../requestbodies/formation.yaml - responses: - '200': - $ref: ../../responses/formation/updateFormation.yaml - - '201': - $ref: ../../responses/formation/formationCreee.yaml - - '403': - $ref: ../../responses/erreur/forbidden.yaml \ No newline at end of file diff --git a/responses/formation/getcountformation.yaml b/responses/formation/getcountformation.yaml new file mode 100644 index 0000000..009de28 --- /dev/null +++ b/responses/formation/getcountformation.yaml @@ -0,0 +1,7 @@ +description: OK +content: + application/json: + schema: + type: integer + format: int64 + description: Nombre total de formations \ No newline at end of file