You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Digitalisation_EPA_Serveur/Controllers/DemandesFormationApi.cs

249 lines
23 KiB

/*
* API du serveur de l'application de digitalisation des EP
*
* API qui sra utilisée afin de faire communiquer le client et le serveur ainsi que le serveur et la boîte noire.
*
* OpenAPI spec version: 1.3.2
*
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*/
using System;
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc;
using Swashbuckle.AspNetCore.Annotations;
using Swashbuckle.AspNetCore.SwaggerGen;
using Newtonsoft.Json;
using System.ComponentModel.DataAnnotations;
using IO.Swagger.Attributes;
using IO.Swagger.Security;
using Microsoft.AspNetCore.Authorization;
using IO.Swagger.DTO;
namespace IO.Swagger.Controllers
{
/// <summary>
///
/// </summary>
[ApiController]
public class DemandesFormationApiController : ControllerBase
{
/// <summary>
///
/// </summary>
/// <remarks>Créer une demande de formation pour un collaborateur</remarks>
/// <param name="body"></param>
/// <response code="201">Demande formation créée</response>
/// <response code="403">Acces interdit</response>
[HttpPost]
[Route("/api/demandeformation")]
[Authorize(AuthenticationSchemes = BearerAuthenticationHandler.SchemeName)]
[ValidateModelState]
[SwaggerOperation("CreerDemandeFormation")]
[SwaggerResponse(statusCode: 403, type: typeof(ErreurDTO), description: "Acces interdit")]
public virtual IActionResult CreerDemandeFormation([FromBody]CreationDemandeFormationDTO body)
{
//TODO: Uncomment the next line to return response 201 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(201);
//TODO: Uncomment the next line to return response 403 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(403, default(ErreurDTO));
throw new NotImplementedException();
}
/// <summary>
///
/// </summary>
/// <remarks>Récupérer la liste des demandes de formations</remarks>
/// <param name="asc">Préciser si les données sont dans l&#x27;ordre (true) ou dans l&#x27;ordre inverse (false)</param>
/// <param name="numPage">Numéro de la page du tableau qui affiche les données</param>
/// <param name="parPAge">Nombre d&#x27;éléments affiché sur chaque page du tableau</param>
/// <param name="idAgence">id de l&#x27;agence à laquelle sont rattachées les données à récupérer</param>
/// <param name="texte">Texte permettant d&#x27;identifier l&#x27;objet rechercher</param>
/// <param name="theme">Thème des demandes de formation à récupérer</param>
/// <param name="tri">Colonne du tableau sur lequel le tri s&#x27;effectue</param>
/// <response code="200">OK</response>
/// <response code="403">Acces interdit</response>
[HttpGet]
[Route("/api/demandeformation")]
[Authorize(AuthenticationSchemes = BearerAuthenticationHandler.SchemeName)]
[ValidateModelState]
[SwaggerOperation("GetDemandesFormation")]
[SwaggerResponse(statusCode: 200, type: typeof(List<DemandeFormationDTO>), description: "OK")]
[SwaggerResponse(statusCode: 403, type: typeof(ErreurDTO), description: "Acces interdit")]
public virtual IActionResult GetDemandesFormation([FromQuery][Required()]bool? asc, [FromQuery][Required()]int? numPage, [FromQuery][Required()]int? parPAge, [FromQuery]int? idAgence, [FromQuery]string texte, [FromQuery]int? theme, [FromQuery]string tri)
{
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(200, default(List<DemandeFormationDTO>));
//TODO: Uncomment the next line to return response 403 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(403, default(ErreurDTO));
string exampleJson = null;
exampleJson = "[ {\n \"reponse\" : true,\n \"commentaireRefus\" : \"commentaireRefus\",\n \"libelle\" : \"libelle\",\n \"description\" : \"description\",\n \"dateDerniereReponse\" : \"2000-01-23T04:56:07.000+00:00\",\n \"theme\" : {\n \"id\" : 9,\n \"demandesFormation\" : [ null, null ],\n \"nom\" : \"nom\"\n },\n \"id\" : 7,\n \"ep\" : {\n \"obligatoire\" : true,\n \"dateDisponibilite\" : \"2000-01-23T04:56:07.000+00:00\",\n \"id\" : 0.8008281904610115,\n \"datePrevisionnelle\" : \"2000-01-23T04:56:07.000+00:00\",\n \"type\" : 6,\n \"collaborateur\" : {\n \"businessUnit\" : {\n \"agence\" : {\n \"bu\" : [ null, null ],\n \"id\" : 6.027456183070403,\n \"nom\" : \"nom\"\n },\n \"id\" : 0.8008281904610115,\n \"nom\" : \"nom\"\n },\n \"referent\" : {\n \"mailApside\" : \"\",\n \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"nom\" : \"nom\",\n \"prenom\" : \"prenom\",\n \"collaborateurs\" : [ null, null ]\n },\n \"mailApside\" : \"\",\n \"dateArrivee\" : \"2000-01-23T04:56:07.000+00:00\",\n \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"dateDepart\" : \"2000-01-23T04:56:07.000+00:00\",\n \"nom\" : \"nom\",\n \"prenom\" : \"prenom\"\n },\n \"statut\" : 1.4658129805029452\n },\n \"demandeRH\" : false,\n \"dateDemande\" : \"2000-01-23T04:56:07.000+00:00\"\n}, {\n \"reponse\" : true,\n \"commentaireRefus\" : \"commentaireRefus\",\n \"libelle\" : \"libelle\",\n \"description\" : \"description\",\n \"dateDerniereReponse\" : \"2000-01-23T04:56:07.000+00:00\",\n \"theme\" : {\n \"id\" : 9,\n \"demandesFormation\" : [ null, null ],\n \"nom\" : \"nom\"\n },\n \"id\" : 7,\n \"ep\" : {\n \"obligatoire\" : true,\n \"dateDisponibilite\" : \"2000-01-23T04:56:07.000+00:00\",\n \"id\" : 0.8008281904610115,\n \"datePrevisionnelle\" : \"2000-01-23T04:56:07.000+00:00\",\n \"type\" : 6,\n \"collaborateur\" : {\n \"businessUnit\" : {\n \"agence\" : {\n \"bu\" : [ null, null ],\n \"id\" : 6.027456183070403,\n \"nom\" : \"nom\"\n },\n \"id\" : 0.8008281904610115,\n \"nom\" : \"nom\"\n },\n \"referent\" : {\n \"mailApside\" : \"\",\n \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"nom\" : \"nom\",\n \"prenom\" : \"prenom\",\n \"collaborateurs\" : [ null, null ]\n },\n \"mailApside\" : \"\",\n \"dateArrivee\" : \"2000-01-23T04:56:07.000+00:00\",\n \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"dateDepart\" : \"2000-01-23T04:56:07.000+00:00\",\n \"nom\" : \"nom\",\n \"prenom\" : \"prenom\"\n },\n \"statut\" : 1.4658129805029452\n },\n \"demandeRH\" : false,\n \"dateDemande\" : \"2000-01-23T04:56:07.000+00:00\"\n} ]";
var example = exampleJson != null
? JsonConvert.DeserializeObject<List<DemandeFormationDTO>>(exampleJson)
: default(List<DemandeFormationDTO>); //TODO: Change the data returned
return new ObjectResult(example);
}
/// <summary>
///
/// </summary>
/// <remarks>Récupérer la liste des demandes de formations en attente d&#x27;une réponse</remarks>
/// <param name="asc">Préciser si les données sont dans l&#x27;ordre (true) ou dans l&#x27;ordre inverse (false)</param>
/// <param name="numPage">Numéro de la page du tableau qui affiche les données</param>
/// <param name="parPAge">Nombre d&#x27;éléments affiché sur chaque page du tableau</param>
/// <param name="idAgence">id de l&#x27;agence à laquelle sont rattachées les données à récupérer</param>
/// <param name="texte">Texte permettant d&#x27;identifier l&#x27;objet rechercher</param>
/// <param name="theme">Thème des demandes de formation à récupérer</param>
/// <param name="tri">Colonne du tableau sur lequel le tri s&#x27;effectue</param>
/// <response code="200">OK</response>
/// <response code="403">Acces interdit</response>
[HttpGet]
[Route("/api/demandeformation/enattente")]
[Authorize(AuthenticationSchemes = BearerAuthenticationHandler.SchemeName)]
[ValidateModelState]
[SwaggerOperation("GetDemandesFormationEnAttente")]
[SwaggerResponse(statusCode: 200, type: typeof(List<DemandeFormationDTO>), description: "OK")]
[SwaggerResponse(statusCode: 403, type: typeof(ErreurDTO), description: "Acces interdit")]
public virtual IActionResult GetDemandesFormationEnAttente([FromQuery][Required()]bool? asc, [FromQuery][Required()]int? numPage, [FromQuery][Required()]int? parPAge, [FromQuery]int? idAgence, [FromQuery]string texte, [FromQuery]int? theme, [FromQuery]string tri)
{
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(200, default(List<DemandeFormationDTO>));
//TODO: Uncomment the next line to return response 403 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(403, default(ErreurDTO));
string exampleJson = null;
exampleJson = "[ {\n \"reponse\" : true,\n \"commentaireRefus\" : \"commentaireRefus\",\n \"libelle\" : \"libelle\",\n \"description\" : \"description\",\n \"dateDerniereReponse\" : \"2000-01-23T04:56:07.000+00:00\",\n \"theme\" : {\n \"id\" : 9,\n \"demandesFormation\" : [ null, null ],\n \"nom\" : \"nom\"\n },\n \"id\" : 7,\n \"ep\" : {\n \"obligatoire\" : true,\n \"dateDisponibilite\" : \"2000-01-23T04:56:07.000+00:00\",\n \"id\" : 0.8008281904610115,\n \"datePrevisionnelle\" : \"2000-01-23T04:56:07.000+00:00\",\n \"type\" : 6,\n \"collaborateur\" : {\n \"businessUnit\" : {\n \"agence\" : {\n \"bu\" : [ null, null ],\n \"id\" : 6.027456183070403,\n \"nom\" : \"nom\"\n },\n \"id\" : 0.8008281904610115,\n \"nom\" : \"nom\"\n },\n \"referent\" : {\n \"mailApside\" : \"\",\n \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"nom\" : \"nom\",\n \"prenom\" : \"prenom\",\n \"collaborateurs\" : [ null, null ]\n },\n \"mailApside\" : \"\",\n \"dateArrivee\" : \"2000-01-23T04:56:07.000+00:00\",\n \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"dateDepart\" : \"2000-01-23T04:56:07.000+00:00\",\n \"nom\" : \"nom\",\n \"prenom\" : \"prenom\"\n },\n \"statut\" : 1.4658129805029452\n },\n \"demandeRH\" : false,\n \"dateDemande\" : \"2000-01-23T04:56:07.000+00:00\"\n}, {\n \"reponse\" : true,\n \"commentaireRefus\" : \"commentaireRefus\",\n \"libelle\" : \"libelle\",\n \"description\" : \"description\",\n \"dateDerniereReponse\" : \"2000-01-23T04:56:07.000+00:00\",\n \"theme\" : {\n \"id\" : 9,\n \"demandesFormation\" : [ null, null ],\n \"nom\" : \"nom\"\n },\n \"id\" : 7,\n \"ep\" : {\n \"obligatoire\" : true,\n \"dateDisponibilite\" : \"2000-01-23T04:56:07.000+00:00\",\n \"id\" : 0.8008281904610115,\n \"datePrevisionnelle\" : \"2000-01-23T04:56:07.000+00:00\",\n \"type\" : 6,\n \"collaborateur\" : {\n \"businessUnit\" : {\n \"agence\" : {\n \"bu\" : [ null, null ],\n \"id\" : 6.027456183070403,\n \"nom\" : \"nom\"\n },\n \"id\" : 0.8008281904610115,\n \"nom\" : \"nom\"\n },\n \"referent\" : {\n \"mailApside\" : \"\",\n \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"nom\" : \"nom\",\n \"prenom\" : \"prenom\",\n \"collaborateurs\" : [ null, null ]\n },\n \"mailApside\" : \"\",\n \"dateArrivee\" : \"2000-01-23T04:56:07.000+00:00\",\n \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"dateDepart\" : \"2000-01-23T04:56:07.000+00:00\",\n \"nom\" : \"nom\",\n \"prenom\" : \"prenom\"\n },\n \"statut\" : 1.4658129805029452\n },\n \"demandeRH\" : false,\n \"dateDemande\" : \"2000-01-23T04:56:07.000+00:00\"\n} ]";
var example = exampleJson != null
? JsonConvert.DeserializeObject<List<DemandeFormationDTO>>(exampleJson)
: default(List<DemandeFormationDTO>); //TODO: Change the data returned
return new ObjectResult(example);
}
/// <summary>
///
/// </summary>
/// <remarks>Récupérer la liste des demandes de formations ayant reçu une réponse</remarks>
/// <param name="asc">Préciser si les données sont dans l&#x27;ordre (true) ou dans l&#x27;ordre inverse (false)</param>
/// <param name="numPage">Numéro de la page du tableau qui affiche les données</param>
/// <param name="parPAge">Nombre d&#x27;éléments affiché sur chaque page du tableau</param>
/// <param name="idAgence">id de l&#x27;agence à laquelle sont rattachées les données à récupérer</param>
/// <param name="texte">Texte permettant d&#x27;identifier l&#x27;objet rechercher</param>
/// <param name="theme">Thème des demandes de formation à récupérer</param>
/// <param name="tri">Colonne du tableau sur lequel le tri s&#x27;effectue</param>
/// <response code="200">OK</response>
/// <response code="403">Acces interdit</response>
[HttpGet]
[Route("/api/demandeformation/repondus")]
[Authorize(AuthenticationSchemes = BearerAuthenticationHandler.SchemeName)]
[ValidateModelState]
[SwaggerOperation("GetDemandesFormationRepondues")]
[SwaggerResponse(statusCode: 200, type: typeof(List<DemandeFormationDTO>), description: "OK")]
[SwaggerResponse(statusCode: 403, type: typeof(ErreurDTO), description: "Acces interdit")]
public virtual IActionResult GetDemandesFormationRepondues([FromQuery][Required()]bool? asc, [FromQuery][Required()]int? numPage, [FromQuery][Required()]int? parPAge, [FromQuery]int? idAgence, [FromQuery]string texte, [FromQuery]int? theme, [FromQuery]string tri)
{
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(200, default(List<DemandeFormationDTO>));
//TODO: Uncomment the next line to return response 403 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(403, default(ErreurDTO));
string exampleJson = null;
exampleJson = "[ {\n \"reponse\" : true,\n \"commentaireRefus\" : \"commentaireRefus\",\n \"libelle\" : \"libelle\",\n \"description\" : \"description\",\n \"dateDerniereReponse\" : \"2000-01-23T04:56:07.000+00:00\",\n \"theme\" : {\n \"id\" : 9,\n \"demandesFormation\" : [ null, null ],\n \"nom\" : \"nom\"\n },\n \"id\" : 7,\n \"ep\" : {\n \"obligatoire\" : true,\n \"dateDisponibilite\" : \"2000-01-23T04:56:07.000+00:00\",\n \"id\" : 0.8008281904610115,\n \"datePrevisionnelle\" : \"2000-01-23T04:56:07.000+00:00\",\n \"type\" : 6,\n \"collaborateur\" : {\n \"businessUnit\" : {\n \"agence\" : {\n \"bu\" : [ null, null ],\n \"id\" : 6.027456183070403,\n \"nom\" : \"nom\"\n },\n \"id\" : 0.8008281904610115,\n \"nom\" : \"nom\"\n },\n \"referent\" : {\n \"mailApside\" : \"\",\n \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"nom\" : \"nom\",\n \"prenom\" : \"prenom\",\n \"collaborateurs\" : [ null, null ]\n },\n \"mailApside\" : \"\",\n \"dateArrivee\" : \"2000-01-23T04:56:07.000+00:00\",\n \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"dateDepart\" : \"2000-01-23T04:56:07.000+00:00\",\n \"nom\" : \"nom\",\n \"prenom\" : \"prenom\"\n },\n \"statut\" : 1.4658129805029452\n },\n \"demandeRH\" : false,\n \"dateDemande\" : \"2000-01-23T04:56:07.000+00:00\"\n}, {\n \"reponse\" : true,\n \"commentaireRefus\" : \"commentaireRefus\",\n \"libelle\" : \"libelle\",\n \"description\" : \"description\",\n \"dateDerniereReponse\" : \"2000-01-23T04:56:07.000+00:00\",\n \"theme\" : {\n \"id\" : 9,\n \"demandesFormation\" : [ null, null ],\n \"nom\" : \"nom\"\n },\n \"id\" : 7,\n \"ep\" : {\n \"obligatoire\" : true,\n \"dateDisponibilite\" : \"2000-01-23T04:56:07.000+00:00\",\n \"id\" : 0.8008281904610115,\n \"datePrevisionnelle\" : \"2000-01-23T04:56:07.000+00:00\",\n \"type\" : 6,\n \"collaborateur\" : {\n \"businessUnit\" : {\n \"agence\" : {\n \"bu\" : [ null, null ],\n \"id\" : 6.027456183070403,\n \"nom\" : \"nom\"\n },\n \"id\" : 0.8008281904610115,\n \"nom\" : \"nom\"\n },\n \"referent\" : {\n \"mailApside\" : \"\",\n \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"nom\" : \"nom\",\n \"prenom\" : \"prenom\",\n \"collaborateurs\" : [ null, null ]\n },\n \"mailApside\" : \"\",\n \"dateArrivee\" : \"2000-01-23T04:56:07.000+00:00\",\n \"id\" : \"046b6c7f-0b8a-43b9-b35d-6489e6daee91\",\n \"dateDepart\" : \"2000-01-23T04:56:07.000+00:00\",\n \"nom\" : \"nom\",\n \"prenom\" : \"prenom\"\n },\n \"statut\" : 1.4658129805029452\n },\n \"demandeRH\" : false,\n \"dateDemande\" : \"2000-01-23T04:56:07.000+00:00\"\n} ]";
var example = exampleJson != null
? JsonConvert.DeserializeObject<List<DemandeFormationDTO>>(exampleJson)
: default(List<DemandeFormationDTO>); //TODO: Change the data returned
return new ObjectResult(example);
}
/// <summary>
///
/// </summary>
/// <remarks>Récupérer la liste des origines des demandes de formation</remarks>
/// <response code="200">OK</response>
/// <response code="403">Acces interdit</response>
[HttpGet]
[Route("/api/originesdemandesformation")]
[Authorize(AuthenticationSchemes = BearerAuthenticationHandler.SchemeName)]
[ValidateModelState]
[SwaggerOperation("GetOriginesDemandesFormation")]
[SwaggerResponse(statusCode: 200, type: typeof(List<OrigineDemandeFormationDTO>), description: "OK")]
[SwaggerResponse(statusCode: 403, type: typeof(ErreurDTO), description: "Acces interdit")]
public virtual IActionResult GetOriginesDemandesFormation()
{
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(200, default(List<OrigineDemandeFormationDTO>));
//TODO: Uncomment the next line to return response 403 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(403, default(ErreurDTO));
string exampleJson = null;
exampleJson = "[ {\n \"libelle\" : \"libelle\",\n \"id\" : 0\n}, {\n \"libelle\" : \"libelle\",\n \"id\" : 0\n} ]";
var example = exampleJson != null
? JsonConvert.DeserializeObject<List<OrigineDemandeFormationDTO>>(exampleJson)
: default(List<OrigineDemandeFormationDTO>); //TODO: Change the data returned
return new ObjectResult(example);
}
/// <summary>
///
/// </summary>
/// <remarks>Récupérer la liste des thèmes des demandes de formation</remarks>
/// <response code="200">OK</response>
/// <response code="403">Acces interdit</response>
[HttpGet]
[Route("/api/themes")]
[Authorize(AuthenticationSchemes = BearerAuthenticationHandler.SchemeName)]
[ValidateModelState]
[SwaggerOperation("GetThemes")]
[SwaggerResponse(statusCode: 200, type: typeof(List<ThemeDTO>), description: "OK")]
[SwaggerResponse(statusCode: 403, type: typeof(ErreurDTO), description: "Acces interdit")]
public virtual IActionResult GetThemes()
{
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(200, default(List<ThemeDTO>));
//TODO: Uncomment the next line to return response 403 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(403, default(ErreurDTO));
string exampleJson = null;
exampleJson = "[ {\n \"id\" : 9,\n \"demandesFormation\" : [ null, null ],\n \"nom\" : \"nom\"\n}, {\n \"id\" : 9,\n \"demandesFormation\" : [ null, null ],\n \"nom\" : \"nom\"\n} ]";
var example = exampleJson != null
? JsonConvert.DeserializeObject<List<ThemeDTO>>(exampleJson)
: default(List<ThemeDTO>); //TODO: Change the data returned
return new ObjectResult(example);
}
/// <summary>
///
/// </summary>
/// <remarks>Répondre a une demande de formation et la mettre à jour</remarks>
/// <param name="body"></param>
/// <param name="idDemandeFormation">id demande formation</param>
/// <response code="200">demande formation mise à jour</response>
/// <response code="201">Demande formation créée</response>
/// <response code="403">Acces interdit</response>
[HttpPut]
[Route("/api/demandeformation/{idDemandeFormation}/repondre")]
[Authorize(AuthenticationSchemes = BearerAuthenticationHandler.SchemeName)]
[ValidateModelState]
[SwaggerOperation("RepondreDemandeFormation")]
[SwaggerResponse(statusCode: 403, type: typeof(ErreurDTO), description: "Acces interdit")]
public virtual IActionResult RepondreDemandeFormation([FromBody]DemandeFormationDTO body, [FromRoute][Required]int? idDemandeFormation)
{
//TODO: Uncomment the next line to return response 200 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(200);
//TODO: Uncomment the next line to return response 201 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(201);
//TODO: Uncomment the next line to return response 403 or use other options such as return this.NotFound(), return this.BadRequest(..), ...
// return StatusCode(403, default(ErreurDTO));
throw new NotImplementedException();
}
}
}