Compare commits

..

No commits in common. '644d473ce713667b52910ef129653dbd99f5b9b2' and 'd15c4a3a3b81a5064df07b8618d31f118c3e795e' have entirely different histories.

  1. 20
      EPAServeur.Tests/Controllers/EpInformationApiTests.cs
  2. 31
      EPAServeur.Tests/Services/EpDetailsServiceTests.cs
  3. 45
      EPAServeur/Context/DataSeeder.cs
  4. 92
      EPAServeur/Controllers/EpApi.cs
  5. 12
      EPAServeur/IServices/IEpDetailsService.cs
  6. 6
      EPAServeur/IServices/ITransformDTO.cs
  7. 2
      EPAServeur/Properties/launchSettings.json
  8. 14
      EPAServeur/Services/EpDetailsService.cs
  9. 26
      EPAServeur/Services/TransformDTO.cs

@ -60,7 +60,7 @@ namespace EPAServeur.Tests.Controllers
[Test]
public async Task GetEpEnCours()
{
EpApiController epApiController = new EpApiController(epInformationService, logger, null);
EpApiController epApiController = new EpApiController(epInformationService, logger);
Task<IActionResult> task = epApiController.GetEPEnCours(new List<long?>() { 1, 2 }, true, 1, 15, "", true, "", null, null);
OkObjectResult result = task.Result as OkObjectResult;
Assert.AreEqual(200, result.StatusCode);
@ -70,7 +70,7 @@ namespace EPAServeur.Tests.Controllers
[Test]
public async Task GetEpEnCoursCount()
{
EpApiController epApiController = new EpApiController(epInformationService, logger, null);
EpApiController epApiController = new EpApiController(epInformationService, logger);
Task<IActionResult> task = epApiController.GetEPEnCoursCount(new List<long?>() { 1, 2 }, "", true, null, null);
OkObjectResult result = task.Result as OkObjectResult;
Assert.AreEqual(200, result.StatusCode);
@ -80,7 +80,7 @@ namespace EPAServeur.Tests.Controllers
[Test]
public async Task GetEpEnSignes()
{
EpApiController epApiController = new EpApiController(epInformationService, logger, null);
EpApiController epApiController = new EpApiController(epInformationService, logger);
Task<IActionResult> task = epApiController.GetEPSignes(new List<long?>() { 1, 2 }, true, 1, 15, "", "", null, null);
OkObjectResult result = task.Result as OkObjectResult;
Assert.AreEqual(200, result.StatusCode);
@ -91,7 +91,7 @@ namespace EPAServeur.Tests.Controllers
[Test]
public async Task GetEpEnSignesCount()
{
EpApiController epApiController = new EpApiController(epInformationService, logger, null);
EpApiController epApiController = new EpApiController(epInformationService, logger);
Task<IActionResult> task = epApiController.GetEPSignesCount(new List<long?>() { 1, 2 }, "", null, null);
OkObjectResult result = task.Result as OkObjectResult;
Assert.AreEqual(200, result.StatusCode);
@ -101,7 +101,7 @@ namespace EPAServeur.Tests.Controllers
[Test]
public async Task GetEPSignesCollaborateur()
{
EpApiController epApiController = new EpApiController(epInformationService, logger, null);
EpApiController epApiController = new EpApiController(epInformationService, logger);
Task<IActionResult> task = epApiController.GetEPSignesCollaborateur(new Guid("a0f40e2a-cc03-4032-a627-5389e1281c64"));
OkObjectResult result = task.Result as OkObjectResult;
Assert.AreEqual(200, result.StatusCode);
@ -111,7 +111,7 @@ namespace EPAServeur.Tests.Controllers
[Test]
public async Task GetProchainEPCollaborateur()
{
EpApiController epApiController = new EpApiController(epInformationService, logger, null);
EpApiController epApiController = new EpApiController(epInformationService, logger);
Task<IActionResult> task = epApiController.GetProchainEPCollaborateur(new Guid("a0f40e2a-cc03-4032-a627-5389e1281c64"));
OkObjectResult result = task.Result as OkObjectResult;
Assert.AreEqual(200, result.StatusCode);
@ -121,7 +121,7 @@ namespace EPAServeur.Tests.Controllers
[Test]
public async Task GetEPSignesReferent()
{
EpApiController epApiController = new EpApiController(epInformationService, logger, null);
EpApiController epApiController = new EpApiController(epInformationService, logger);
Task<IActionResult> task = epApiController.GetEPSignesReferent(new Guid("01ee85ff-d7f3-494b-b1de-26ced8fbfa0d"), true, 1, 15, "", "", null, null);
OkObjectResult result = task.Result as OkObjectResult;
Assert.AreEqual(200, result.StatusCode);
@ -131,7 +131,7 @@ namespace EPAServeur.Tests.Controllers
[Test]
public async Task GetEPSignesReferentCount()
{
EpApiController epApiController = new EpApiController(epInformationService, logger, null);
EpApiController epApiController = new EpApiController(epInformationService, logger);
Task<IActionResult> task = epApiController.GetEPSignesReferentCount(new Guid("01ee85ff-d7f3-494b-b1de-26ced8fbfa0d"), "", null, null);
OkObjectResult result = task.Result as OkObjectResult;
Assert.AreEqual(200, result.StatusCode);
@ -141,7 +141,7 @@ namespace EPAServeur.Tests.Controllers
[Test]
public async Task GetEPEnCoursReferent()
{
EpApiController epApiController = new EpApiController(epInformationService, logger, null);
EpApiController epApiController = new EpApiController(epInformationService, logger);
Task<IActionResult> task = epApiController.GetEPEnCoursReferent(new Guid("eb8b0f33-f529-4985-861e-1207f3312bb5"), true, 1, 15, "", "", null, null);
OkObjectResult result = task.Result as OkObjectResult;
Assert.AreEqual(200, result.StatusCode);
@ -151,7 +151,7 @@ namespace EPAServeur.Tests.Controllers
[Test]
public async Task GetEPEnCoursReferentCount()
{
EpApiController epApiController = new EpApiController(epInformationService, logger, null);
EpApiController epApiController = new EpApiController(epInformationService, logger);
Task<IActionResult> task = epApiController.GetEPEnCoursReferentCount(new Guid("eb8b0f33-f529-4985-861e-1207f3312bb5"), "", null, null);
OkObjectResult result = task.Result as OkObjectResult;
Assert.AreEqual(200, result.StatusCode);

@ -270,27 +270,18 @@ namespace EPAServeur.Tests.Services
#endregion
#region Récupérer EP avec demandes de formation
[TestCase(1,0)]
[TestCase(2,0)]
[TestCase(3,1)]
[TestCase(12,3)]
[TestCase(16,0)]
public async Task GetEp_GetpDemandesFormation(long idEp, int count)
{
IEpDetailsService epDetailsService = new EpDetailsService(context, transformDTO, collaborateurService);
EpDTO epDTO = await epDetailsService.GetEp(idEp);
Assert.IsNotNull(epDTO);
if(count == 0)
{
Assert.IsNull(epDTO.DemandesFormation);
}
else
{
Assert.IsNotNull(epDTO.DemandesFormation);
Assert.AreEqual(epDTO.DemandesFormation.Count, count);
}
}
#endregion
#region
#endregion
#region
#endregion
}
}

@ -106,8 +106,6 @@ namespace EPAServeur.Context
DemandeEPI demandeEPI1, demandeEPI2, demandeEPI3;
DemandeFormation demandeF1, demandeF2, demandeF3, demandeF4;
//Ep en cours
Ep epEnCours1, epEnCours2, epEnCours3, epEnCours4, epEnCours5, epEnCours6, epEnCours7, epEnCours8, epEnCours9;
@ -255,16 +253,8 @@ namespace EPAServeur.Context
epEnCours3.Objectifs = new List<Objectif>() { objectif1, objectif2, objectif3 };
epEnCours3.ObjectifsPrecedents = new List<ObjectifPrecedent>() { objectifPrecedent1, objectifPrecedent2, objectifPrecedent3 };
demandeF1 = new DemandeFormation()
{
DateDemande = new DateTime(),
Description = "Description",
DemandeRH = false,
Libelle = "Libellé",
Etat = EtatDemande.EnAttente,
Ep = epEnCours3,
};
epEnCours3.DemandesFormation = new List<DemandeFormation>() { demandeF1 };
epContext.Ep.Add(epEnCours3);
@ -578,37 +568,6 @@ namespace EPAServeur.Context
};
epSigne3.RdvEntretien = rdv3;
demandeF2 = new DemandeFormation()
{
DateDemande = new DateTime(),
Description = "Description 2",
DemandeRH = false,
Libelle = "Libellé 2",
Etat = EtatDemande.EnAttente,
Ep = epSigne3,
};
demandeF3 = new DemandeFormation()
{
DateDemande = new DateTime(),
Description = "Description 3",
DemandeRH = false,
Libelle = "Libellé 3",
Etat = EtatDemande.EnAttente,
Ep = epSigne3,
};
demandeF4 = new DemandeFormation()
{
DateDemande = new DateTime(),
Description = "Description 4",
DemandeRH = true,
Libelle = "Libellé 4",
Etat = EtatDemande.EnAttente,
Ep = epSigne3,
};
epSigne3.DemandesFormation = new List<DemandeFormation>() { demandeF2, demandeF3, demandeF4 };
epContext.Ep.Add(epSigne3);

File diff suppressed because one or more lines are too long

@ -9,13 +9,13 @@ namespace EPAServeur.IServices
public interface IEpDetailsService
{
void SupprimerDonneesEPCollaborateur(Guid? idCollaborateur);
Task<EpDTO> GetEp(long? id);
Task<EpDTO> UpdateEP(long? idEp, EpDTO ep);
void SupprimerEP(long? idEp);
void RappelSignature(long? idEp);
Task<EpDTO> UpdateSaisie(long? idEp, EpDTO ep);
Task<EpDTO> GetEp(long id);
Task<EpDTO> UpdateEP(long idEp, EpDTO ep);
void SupprimerEP(long idEp);
void RappelSignature(long idEp);
Task<EpDTO> UpdateSaisie(long idEp, EpDTO ep);
Task<EpDTO> SaisirEPCollaborateur(Guid? idCollaborateur);
Task<EpDTO> SaisirEPReferent(long? idEp);
Task<EpDTO> SaisirEPReferent(long idEp);
}
}

@ -79,8 +79,6 @@ namespace EPAServeur.IServices
List<CommentaireAssistantDTO> GetCommentaireAssistant(List<CommentaireAssistant> commentaireAssistant, IEnumerable<CollaborateurDTO> collaborateurDTOs);
DemandeDelegationDTO GetDemandeDelegationDTO(DemandeDelegation demandeDelegation, IEnumerable<CollaborateurDTO> collaborateurDTOs);
DemandeEPIDTO GetDemandeEPIDTO(DemandeEPI demande, IEnumerable<CollaborateurDTO> collaborateurDTOs);
DemandeFormationDTO GetDemandeFormationDTO(DemandeFormation demandeFormation);
List<DemandeFormationDTO> GetDemandeFormationDTOs(List<DemandeFormation> demandes);
AugmentationSalaireDTO GetAugmentationSalaireDTO(AugmentationSalaire augmentation);
RDVEntretienDTO GetRDVEntretienDTO(RdvEntretien rdvEntretien);
TypeEntretienDTO GetTypeEntretienDTO(TypeEntretien typeEntretien);
@ -89,6 +87,10 @@ namespace EPAServeur.IServices
DocumentDTO GetDocumentDTO(Document document);
List<ObjectifDTO> GetObjectifDTOs(List<Objectif> objectifs);
List<ObjectifPrecedentDTO> GetObjectifPrecedentDTO(List<ObjectifPrecedent> objectifsPrecedents);
#endregion
#region Demande Formation

@ -11,7 +11,7 @@
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": false,
"launchBrowser": true,
"launchUrl": "api/",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"

@ -24,7 +24,7 @@ namespace EPAServeur.Services
this.collaborateurService = collaborateurService;
}
public async Task<EpDTO> GetEp(long? id)
public async Task<EpDTO> GetEp(long id)
{
Ep ep = await context.Ep
.Include(ep => ep.Engagements)
@ -37,7 +37,6 @@ namespace EPAServeur.Services
.Include(ep => ep.Objectifs)
.Include(ep => ep.ObjectifsPrecedents)
.Include(ep => ep.DemandeEPI)
.Include(ep => ep.DemandesFormation)
.FirstOrDefaultAsync(ep => ep.IdEP.Equals(id));
if (ep == null)
throw new EpNotFoundException();
@ -58,7 +57,6 @@ namespace EPAServeur.Services
if (ep.DemandeEPI != null && ep.DemandeEPI.IdReferent != null)
guids.Add(ep.DemandeEPI.IdReferent);
IEnumerable<CollaborateurDTO> collaborateurDTOs = await collaborateurService.GetCollaborateurDTOsAsync(guids);
EpDTO epDTO = transformDTO.EpToEpDetails(ep, collaborateurDTOs);
@ -66,7 +64,7 @@ namespace EPAServeur.Services
return epDTO;
}
public void RappelSignature(long? idEp)
public void RappelSignature(long idEp)
{
throw new NotImplementedException();
}
@ -76,7 +74,7 @@ namespace EPAServeur.Services
throw new NotImplementedException();
}
public Task<EpDTO> SaisirEPReferent(long? idEp)
public Task<EpDTO> SaisirEPReferent(long idEp)
{
throw new NotImplementedException();
}
@ -86,17 +84,17 @@ namespace EPAServeur.Services
throw new NotImplementedException();
}
public void SupprimerEP(long? idEp)
public void SupprimerEP(long idEp)
{
throw new NotImplementedException();
}
public Task<EpDTO> UpdateEP(long? idEp, EpDTO ep)
public Task<EpDTO> UpdateEP(long idEp, EpDTO ep)
{
throw new NotImplementedException();
}
public Task<EpDTO> UpdateSaisie(long? idEp, EpDTO ep)
public Task<EpDTO> UpdateSaisie(long idEp, EpDTO ep)
{
throw new NotImplementedException();
}

@ -67,9 +67,7 @@ namespace EPAServeur.Services
ChoixTypeEntretien = GetTypeEntretienDTOs(ep.ChoixTypeEntretien),
Objectifs = GetObjectifDTOs(ep.Objectifs),
ObjectifsPrecedent = GetObjectifPrecedentDTO(ep.ObjectifsPrecedents),
DemandeEPI = GetDemandeEPIDTO(ep.DemandeEPI, collaborateurDTOs),
DemandesFormation = GetDemandeFormationDTOs(ep.DemandesFormation)
DemandeEPI = GetDemandeEPIDTO(ep.DemandeEPI, collaborateurDTOs)
};
}
@ -321,20 +319,9 @@ namespace EPAServeur.Services
}
public DemandeFormationDTO GetDemandeFormationDTO(DemandeFormation demandeFormation)
public DemandeFormationDTO GetDemandeFormationDTOEP(DemandeFormation demandeFormation)
{
if (demandeFormation == null)
return null;
return new DemandeFormationDTO()
{
CommentaireRefus = demandeFormation.CommentaireRefus,
DemandeRH = demandeFormation.DemandeRH,
Libelle = demandeFormation.Libelle,
EtatDemande = demandeFormation.Etat,
Description = demandeFormation.Description,
DateDemande = demandeFormation.DateDemande,
};
throw new NotImplementedException();
}
@ -1086,12 +1073,5 @@ namespace EPAServeur.Services
Commentaire = o.Commentaire
}).ToList();
}
public List<DemandeFormationDTO> GetDemandeFormationDTOs(List<DemandeFormation> demandes)
{
if (demandes == null || !demandes.Any())
return null;
return demandes.Select(d => GetDemandeFormationDTO(d)).ToList();
}
}
}

Loading…
Cancel
Save