Compare commits

..

No commits in common. '73e9a0315cfd1879a93da0ea9cc2d61ef3218d30' and '72153decaff524aca3c4532aa5dcccde91319a6f' have entirely different histories.

  1. 103
      EPAServeur.Tests/Services/EpDetailsServiceTests.cs
  2. 206
      EPAServeur/Context/DataSeeder.cs
  3. 4
      EPAServeur/Context/EpContext.cs
  4. 33
      EPAServeur/DTO/CommentaireAssistantDTO.cs
  5. 6
      EPAServeur/DTO/EpDTO.cs
  6. 2
      EPAServeur/DTO/TypeEntretienDTO.cs
  7. 9
      EPAServeur/IServices/ITransformDTO.cs
  8. 4
      EPAServeur/Models/EP/ChoixTypeEntretien.cs
  9. 14
      EPAServeur/Services/EpDetailsService.cs
  10. 87
      EPAServeur/Services/TransformDTO.cs

@ -37,7 +37,7 @@ namespace EPAServeur.Tests.Services
context.Database.EnsureDeleted(); context.Database.EnsureDeleted();
context.Database.EnsureCreated(); context.Database.EnsureCreated();
context.SaveChanges(); context.SaveChanges();
DataSeeder.AddTypesEntretien(context);
DataSeeder.AddEp(context); DataSeeder.AddEp(context);
foreach (var entity in context.ChangeTracker.Entries()) foreach (var entity in context.ChangeTracker.Entries())
@ -167,106 +167,12 @@ namespace EPAServeur.Tests.Services
#endregion #endregion
#region Récupérer EP avec RDV entretiens #region Récupérer EP avec RDV entretiens
[TestCase(2)]
[TestCase(5)]
[TestCase(12)]
public async Task GetEp_GetRDVEntretien(long idEp)
{
IEpDetailsService epDetailsService = new EpDetailsService(context, transformDTO, collaborateurService);
EpDTO epDTO = await epDetailsService.GetEp(idEp);
Assert.IsNotNull(epDTO);
Assert.IsNotNull(epDTO.RdvEntretien);
Assert.IsNotNull(epDTO.RdvEntretien.DateEntretien);
}
[TestCase(1, 0)]
[TestCase(2, 3)]
[TestCase(5, 2)]
[TestCase(11, 0)]
[TestCase(13, 0)]
public async Task GetEp_GetPropositionRDVEntretien(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.PropositionsEntretien);
}
else
{
Assert.IsNotNull(epDTO.PropositionsEntretien);
Assert.AreEqual(epDTO.PropositionsEntretien.Count, count);
Assert.IsTrue(epDTO.PropositionsEntretien.Count <= 3);
Assert.IsTrue(epDTO.PropositionsEntretien.Count > 0);
Assert.Less(epDTO.Statut, StatutEp.Effectue);
}
}
#endregion #endregion
#region Récupérer EP avec choix type entretien #region Récupérer EP avec type entretien
[TestCase(1, 0)]
[TestCase(2, 4)]
[TestCase(4, 1)]
[TestCase(5, 2)]
[TestCase(10, 0)]
[TestCase(12, 0)]
public async Task GetEp_GetChoixTypeEntretien(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.ChoixTypeEntretien);
}
else
{
Assert.IsNotNull(epDTO.ChoixTypeEntretien);
Assert.AreEqual(epDTO.ChoixTypeEntretien.Count, count);
Assert.Less(epDTO.Statut, StatutEp.Effectue);
}
}
#endregion #endregion
#region Objectifs
[TestCase(3, true)]
[TestCase(7, false)]
[TestCase(10, true)]
public async Task GetEp_Objectifs_ObjectifsPrecedents(long idEp, bool possedeObjectifsPref)
{
IEpDetailsService epDetailsService = new EpDetailsService(context, transformDTO, collaborateurService);
EpDTO epDTO = await epDetailsService.GetEp(idEp);
Assert.IsNotNull(epDTO);
Assert.IsNotNull(epDTO.Objectifs);
Assert.AreEqual(3, epDTO.Objectifs.Count);
if (possedeObjectifsPref)
{
Assert.IsNotNull(epDTO.ObjectifsPrecedent);
Assert.AreEqual(3, epDTO.ObjectifsPrecedent.Count);
}else
{
Assert.IsNull(epDTO.ObjectifsPrecedent);
}
}
#endregion
#region Demande EPI
[TestCase(4)]
[TestCase(8)]
[TestCase(13)]
public async Task GetEp_GetDemandeEPI(long idEp)
{
IEpDetailsService epDetailsService = new EpDetailsService(context, transformDTO, collaborateurService);
EpDTO epDTO = await epDetailsService.GetEp(idEp);
Assert.IsNotNull(epDTO);
Assert.IsNotNull(epDTO.DemandeEPI);
Assert.IsTrue(epDTO.Collaborateur.Id.Equals(epDTO.DemandeEPI.Collaborateur.Id));
Assert.AreEqual(epDTO.DemandeEPI.EtatDemande, EtatDemande.Validee);
}
#endregion
#region Récupérer EP avec demandes de formation #region Récupérer EP avec demandes de formation
#endregion #endregion
@ -276,6 +182,11 @@ namespace EPAServeur.Tests.Services
#region
#endregion
#region
#endregion
#region #region
#endregion #endregion

@ -63,16 +63,16 @@ namespace EPAServeur.Context
//TypeEntretien //TypeEntretien
TypeEntretien typeSite, typeClient, typeVisio, typeTelephone; TypeEntretien typeSite, typeClient, typeVisio, typeTelephone;
typeSite = new TypeEntretien { IdTypeEntretien = 1, Libelle = "Sur site" }; typeSite = new TypeEntretien { Libelle = "Sur site" };
epContext.TypeEntretien.Add(typeSite); epContext.TypeEntretien.Add(typeSite);
typeClient = new TypeEntretien { IdTypeEntretien = 2, Libelle = "Chez le client" }; typeClient = new TypeEntretien { Libelle = "Chez le client" };
epContext.TypeEntretien.Add(typeClient); epContext.TypeEntretien.Add(typeClient);
typeVisio = new TypeEntretien { IdTypeEntretien = 3, Libelle = "Visioconférence" }; typeVisio = new TypeEntretien { Libelle = "Visioconférence" };
epContext.TypeEntretien.Add(typeVisio); epContext.TypeEntretien.Add(typeVisio);
typeTelephone = new TypeEntretien { IdTypeEntretien = 4, Libelle = "Téléphonique" }; typeTelephone = new TypeEntretien { Libelle = "Téléphonique" };
epContext.TypeEntretien.Add(typeTelephone); epContext.TypeEntretien.Add(typeTelephone);
epContext.SaveChanges(); epContext.SaveChanges();
@ -84,28 +84,10 @@ namespace EPAServeur.Context
/// <param name="epContext"></param> /// <param name="epContext"></param>
public static void AddEp(EpContext epContext) public static void AddEp(EpContext epContext)
{ {
TypeEntretien typeSite, typeClient, typeVisio, typeTelephone;
typeSite = epContext.TypeEntretien.Find((long)1);
typeClient = epContext.TypeEntretien.Find((long)2);
typeVisio = epContext.TypeEntretien.Find((long)3);
typeTelephone = epContext.TypeEntretien.Find((long)4);
Engagement eg1, eg2, eg3, eg4; Engagement eg1, eg2, eg3, eg4;
ParticipationEP p1, p2, p3, p4, p5; ParticipationEP p1, p2, p3, p4, p5;
CommentaireAssistant ca1, ca2, ca3; CommentaireAssistant ca1, ca2, ca3;
DemandeDelegation dm1, dm2, dm3; DemandeDelegation dm1, dm2, dm3;
RdvEntretien rdv1, rdv2, rdv3;
RdvEntretien proposition1, proposition2, proposition3;
ChoixTypeEntretien choix1, choix2, choix3, choix4, choix5, choix6, choix7;
Objectif objectif1, objectif2, objectif3, objectif4, objectif5, objectif6, objectif7, objectif8, objectif9;
ObjectifPrecedent objectifPrecedent1, objectifPrecedent2, objectifPrecedent3, objectifPrecedent4, objectifPrecedent5, objectifPrecedent6;
DemandeEPI demandeEPI1, demandeEPI2, demandeEPI3;
//Ep en cours //Ep en cours
Ep epEnCours1, epEnCours2, epEnCours3, epEnCours4, epEnCours5, epEnCours6, epEnCours7, epEnCours8, epEnCours9; Ep epEnCours1, epEnCours2, epEnCours3, epEnCours4, epEnCours5, epEnCours6, epEnCours7, epEnCours8, epEnCours9;
@ -159,60 +141,6 @@ namespace EPAServeur.Context
RaisonDemande = "Raison quelconque 1" RaisonDemande = "Raison quelconque 1"
}; };
epEnCours2.DemandeDelegation = dm1; epEnCours2.DemandeDelegation = dm1;
rdv1 = new RdvEntretien()
{
IdRdvEntretien = 1,
DateEntretien = new DateTime(),
EpChoixRDV = epEnCours2,
TypeEntretien = typeClient,
EpProposition = epEnCours2
};
epEnCours2.RdvEntretien = rdv1;
proposition1 = new RdvEntretien()
{
DateEntretien = new DateTime(),
EpProposition = epEnCours2,
IdRdvEntretien = 2,
TypeEntretien = typeSite
};
proposition2 = new RdvEntretien()
{
DateEntretien = new DateTime(),
EpProposition = epEnCours2,
IdRdvEntretien = 3,
TypeEntretien = typeVisio
};
epEnCours2.PropositionsRDV = new List<RdvEntretien>(new[] { rdv1, proposition1, proposition2 });
choix1 = new ChoixTypeEntretien()
{
Ep = epEnCours2,
Ordre = 0,
TypeEntretien = typeClient
};
choix2 = new ChoixTypeEntretien()
{
Ep = epEnCours2,
Ordre = 1,
TypeEntretien = typeSite
};
choix3 = new ChoixTypeEntretien()
{
Ep = epEnCours2,
Ordre = 2,
TypeEntretien = typeVisio
};
choix4 = new ChoixTypeEntretien()
{
Ep = epEnCours2,
Ordre = 3,
TypeEntretien = typeTelephone
};
epEnCours2.ChoixTypeEntretien = new List<ChoixTypeEntretien>() { choix1, choix2, choix3, choix4 };
epContext.Ep.Add(epEnCours2); epContext.Ep.Add(epEnCours2);
@ -243,19 +171,6 @@ namespace EPAServeur.Context
}; };
epEnCours3.Participants = new List<ParticipationEP>(new[] { p1, p2 }); epEnCours3.Participants = new List<ParticipationEP>(new[] { p1, p2 });
objectif1 = new Objectif() { Ep = epEnCours3, Libelle = "Objectif1" };
objectif2 = new Objectif() { Ep = epEnCours3, Libelle = "Objectif2" };
objectif3 = new Objectif() { Ep = epEnCours3, Libelle = "Objectif3" };
objectifPrecedent1 = new ObjectifPrecedent() { Ep = epEnCours3, Libelle = "ObjectifPrec1", Commentaire = "Commentaire", StatutObjectif = StatutObjectif.Atteint };
objectifPrecedent2 = new ObjectifPrecedent() { Ep = epEnCours3, Libelle = "ObjectifPrec2", Commentaire = "Commentaire", StatutObjectif = StatutObjectif.Partiel };
objectifPrecedent3 = new ObjectifPrecedent() { Ep = epEnCours3, Libelle = "ObjectifPrec3", Commentaire = "Commentaire", StatutObjectif = StatutObjectif.Partiel };
epEnCours3.Objectifs = new List<Objectif>() { objectif1, objectif2, objectif3 };
epEnCours3.ObjectifsPrecedents = new List<ObjectifPrecedent>() { objectifPrecedent1, objectifPrecedent2, objectifPrecedent3 };
epContext.Ep.Add(epEnCours3); epContext.Ep.Add(epEnCours3);
epEnCours4 = new Ep() epEnCours4 = new Ep()
@ -278,28 +193,7 @@ namespace EPAServeur.Context
EtatDemande = EtatDemande.EnAttente, EtatDemande = EtatDemande.EnAttente,
RaisonDemande = "Raison quelconque 2" RaisonDemande = "Raison quelconque 2"
}; };
demandeEPI1 = new DemandeEPI()
{
IdReferent = new Guid("eb8b0f33-f529-4985-861e-1207f3312bb5"),
Ep = epEnCours4,
DateDemande = new DateTime(),
DateReponse = new DateTime(),
EtatDemande = EtatDemande.Validee,
IdCollaborateur = new Guid("a0f40e2a-cc03-4032-a627-5389e1281c64")
};
epEnCours4.DemandeEPI = demandeEPI1;
epEnCours4.DemandeDelegation = dm2; epEnCours4.DemandeDelegation = dm2;
choix5 = new ChoixTypeEntretien()
{
Ep = epEnCours4,
Ordre = 0,
TypeEntretien = typeSite
};
epEnCours4.ChoixTypeEntretien = new List<ChoixTypeEntretien>() { choix5 };
epContext.Ep.Add(epEnCours4); epContext.Ep.Add(epEnCours4);
epEnCours5 = new Ep() epEnCours5 = new Ep()
@ -314,8 +208,6 @@ namespace EPAServeur.Context
IdCollaborateur = new Guid("17b87130-0e9d-4b78-b0e3-a11e5f70318d"), IdCollaborateur = new Guid("17b87130-0e9d-4b78-b0e3-a11e5f70318d"),
Obligatoire = true, Obligatoire = true,
}; };
p3 = new ParticipationEP() p3 = new ParticipationEP()
{ {
Ep = epEnCours5, Ep = epEnCours5,
@ -323,45 +215,6 @@ namespace EPAServeur.Context
EstPermanente = false EstPermanente = false
}; };
epEnCours5.Participants = new List<ParticipationEP>(new[] { p3 }); epEnCours5.Participants = new List<ParticipationEP>(new[] { p3 });
rdv2 = new RdvEntretien()
{
DateEntretien = new DateTime(),
EpProposition = epEnCours5,
IdRdvEntretien = 4,
TypeEntretien = typeSite,
EpChoixRDV = epEnCours5
};
proposition3 = new RdvEntretien()
{
DateEntretien = new DateTime(),
EpProposition = epEnCours5,
IdRdvEntretien = 5,
TypeEntretien = typeVisio
};
epEnCours5.PropositionsRDV = new List<RdvEntretien>(new[] { rdv2, proposition3 });
epEnCours5.RdvEntretien = rdv2;
choix6 = new ChoixTypeEntretien()
{
Ep = epEnCours5,
Ordre = 0,
TypeEntretien = typeSite
};
choix7 = new ChoixTypeEntretien()
{
Ep = epEnCours5,
Ordre = 1,
TypeEntretien = typeVisio
};
epEnCours5.ChoixTypeEntretien = new List<ChoixTypeEntretien>() { choix6, choix7 };
epContext.Ep.Add(epEnCours5); epContext.Ep.Add(epEnCours5);
epEnCours6 = new Ep() epEnCours6 = new Ep()
@ -421,11 +274,6 @@ namespace EPAServeur.Context
IdCollaborateur = new Guid("4f3fcd23-a1e4-4c9e-afa2-d06ca9216491"), IdCollaborateur = new Guid("4f3fcd23-a1e4-4c9e-afa2-d06ca9216491"),
Obligatoire = false, Obligatoire = false,
}; };
objectif4 = new Objectif() { Ep = epEnCours7, Libelle = "Objectif4" };
objectif5 = new Objectif() { Ep = epEnCours7, Libelle = "Objectif5" };
objectif6 = new Objectif() { Ep = epEnCours7, Libelle = "Objectif6" };
epEnCours7.Objectifs = new List<Objectif>() { objectif4, objectif5, objectif6 };
epContext.Ep.Add(epEnCours7); epContext.Ep.Add(epEnCours7);
epEnCours8 = new Ep() epEnCours8 = new Ep()
@ -451,17 +299,6 @@ namespace EPAServeur.Context
}; };
epEnCours8.DemandeDelegation = dm3; epEnCours8.DemandeDelegation = dm3;
demandeEPI2 = new DemandeEPI()
{
IdReferent = new Guid("ea027734-ff0f-4308-8879-133a09fb3c46"),
Ep = epEnCours8,
DateDemande = new DateTime(),
DateReponse = new DateTime(),
EtatDemande = EtatDemande.Validee,
IdCollaborateur = new Guid("0968ccd3-1ef5-4041-83f3-1c76afb02bbf"),
};
epEnCours8.DemandeEPI = demandeEPI2;
epEnCours9 = new Ep() epEnCours9 = new Ep()
{ {
DateDisponibilite = new DateTime(2021, 2, 13), DateDisponibilite = new DateTime(2021, 2, 13),
@ -505,17 +342,6 @@ namespace EPAServeur.Context
}; };
epSigne1.Engagements = new List<Engagement>(); epSigne1.Engagements = new List<Engagement>();
epSigne1.Engagements.Add(eg4); epSigne1.Engagements.Add(eg4);
objectif7 = new Objectif() { Ep = epSigne1, Libelle = "Objectif7" };
objectif8 = new Objectif() { Ep = epSigne1, Libelle = "Objectif8" };
objectif9 = new Objectif() { Ep = epSigne1, Libelle = "Objectif9" };
objectifPrecedent4 = new ObjectifPrecedent() { Ep = epSigne1, Libelle = "ObjectifPrec4", Commentaire = "Commentaire", StatutObjectif = StatutObjectif.NonAtteint };
objectifPrecedent5 = new ObjectifPrecedent() { Ep = epSigne1, Libelle = "ObjectifPrec5", Commentaire = "Commentaire", StatutObjectif = StatutObjectif.NonAtteint };
objectifPrecedent6 = new ObjectifPrecedent() { Ep = epSigne1, Libelle = "ObjectifPrec6", Commentaire = "Commentaire", StatutObjectif = StatutObjectif.Atteint };
epSigne1.Objectifs = new List<Objectif>() { objectif7, objectif8, objectif9 };
epSigne1.ObjectifsPrecedents = new List<ObjectifPrecedent>() { objectifPrecedent4, objectifPrecedent6, objectifPrecedent5 };
epContext.Ep.Add(epSigne1); epContext.Ep.Add(epSigne1);
epSigne2 = new Ep() epSigne2 = new Ep()
@ -558,21 +384,8 @@ namespace EPAServeur.Context
IdCollaborateur = new Guid("b5254c6c-7caa-435f-a4bb-e0cf92559832"), IdCollaborateur = new Guid("b5254c6c-7caa-435f-a4bb-e0cf92559832"),
Obligatoire = false, Obligatoire = false,
}; };
rdv3 = new RdvEntretien()
{
IdRdvEntretien = 6,
TypeEntretien = typeVisio,
DateEntretien = new DateTime(),
EpChoixRDV = epSigne3
};
epSigne3.RdvEntretien = rdv3;
epContext.Ep.Add(epSigne3); epContext.Ep.Add(epSigne3);
epSigne4 = new Ep() epSigne4 = new Ep()
{ {
DateDisponibilite = new DateTime(2017, 1, 20), DateDisponibilite = new DateTime(2017, 1, 20),
@ -585,17 +398,6 @@ namespace EPAServeur.Context
IdCollaborateur = new Guid("a0f40e2a-cc03-4032-a627-5389e1281c64"), IdCollaborateur = new Guid("a0f40e2a-cc03-4032-a627-5389e1281c64"),
Obligatoire = false, Obligatoire = false,
}; };
demandeEPI3 = new DemandeEPI()
{
IdReferent = new Guid("eb8b0f33-f529-4985-861e-1207f3312bb5"),
IdCollaborateur = new Guid("a0f40e2a-cc03-4032-a627-5389e1281c64"),
DateDemande = new DateTime(),
EtatDemande = EtatDemande.Validee,
DateReponse = new DateTime(),
Ep = epSigne4
};
epSigne4.DemandeEPI = demandeEPI3;
epContext.Ep.Add(epSigne4); epContext.Ep.Add(epSigne4);
epSigne5 = new Ep() epSigne5 = new Ep()

@ -107,7 +107,6 @@ namespace EPAServeur.Context
{ {
entity.HasKey(e => e.IdRdvEntretien); entity.HasKey(e => e.IdRdvEntretien);
entity.Property(e => e.IdRdvEntretien).ValueGeneratedOnAdd(); entity.Property(e => e.IdRdvEntretien).ValueGeneratedOnAdd();
entity.HasOne(e => e.TypeEntretien).WithMany(t => t.RdvEntretiens);
}); });
modelBuilder.Entity<ReferentEP>(entity => modelBuilder.Entity<ReferentEP>(entity =>
@ -117,7 +116,7 @@ namespace EPAServeur.Context
modelBuilder.Entity<ChoixTypeEntretien>(entity => modelBuilder.Entity<ChoixTypeEntretien>(entity =>
{ {
entity.HasKey(e => e.IdChoixTypeEntretien); entity.HasKey(e => e.Ordre);
}); });
@ -142,7 +141,6 @@ namespace EPAServeur.Context
{ {
entity.HasKey(e => e.IdTypeEntretien); entity.HasKey(e => e.IdTypeEntretien);
entity.HasIndex(e => e.Libelle).IsUnique(); entity.HasIndex(e => e.Libelle).IsUnique();
entity.HasMany<ChoixTypeEntretien>(e => e.ChoixTypeEntretien).WithOne(c => c.TypeEntretien);
}); });
modelBuilder.Entity<CommentaireAssistant>(entity => modelBuilder.Entity<CommentaireAssistant>(entity =>

@ -3,7 +3,7 @@
* *
* API qui sra utilisée afin de faire communiquer le client et le serveur ainsi que le serveur et la boîte noire. * 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.7 * OpenAPI spec version: 1.3.6
* *
* Generated by: https://github.com/swagger-api/swagger-codegen.git * Generated by: https://github.com/swagger-api/swagger-codegen.git
*/ */
@ -37,15 +37,8 @@ namespace IO.Swagger.DTO
/// Id de l&#x27;assistant qui a écrit le commentaire /// Id de l&#x27;assistant qui a écrit le commentaire
/// </summary> /// </summary>
/// <value>Id de l&#x27;assistant qui a écrit le commentaire</value> /// <value>Id de l&#x27;assistant qui a écrit le commentaire</value>
[Required] [DataMember(Name="idAssistante")]
[DataMember(Name = "idAssistant")] public Guid? IdAssistante { get; set; }
public Guid? IdAssistant { get; set; }
/// <summary>
/// Gets or Sets Assistant
/// </summary>
[DataMember(Name = "assistant")]
public string Assistant { get; set; }
/// <summary> /// <summary>
/// Le commentaire de l’assistant /// Le commentaire de l’assistant
@ -64,8 +57,7 @@ namespace IO.Swagger.DTO
var sb = new StringBuilder(); var sb = new StringBuilder();
sb.Append("class CommentaireAssistantDTO {\n"); sb.Append("class CommentaireAssistantDTO {\n");
sb.Append(" Id: ").Append(Id).Append("\n"); sb.Append(" Id: ").Append(Id).Append("\n");
sb.Append(" IdAssistant: ").Append(IdAssistant).Append("\n"); sb.Append(" IdAssistante: ").Append(IdAssistante).Append("\n");
sb.Append(" Assistant: ").Append(Assistant).Append("\n");
sb.Append(" Commentaire: ").Append(Commentaire).Append("\n"); sb.Append(" Commentaire: ").Append(Commentaire).Append("\n");
sb.Append("}\n"); sb.Append("}\n");
return sb.ToString(); return sb.ToString();
@ -109,14 +101,9 @@ namespace IO.Swagger.DTO
Id.Equals(other.Id) Id.Equals(other.Id)
) && ) &&
( (
IdAssistant == other.IdAssistant || IdAssistante == other.IdAssistante ||
IdAssistant != null && IdAssistante != null &&
IdAssistant.Equals(other.IdAssistant) IdAssistante.Equals(other.IdAssistante)
) &&
(
Assistant == other.Assistant ||
Assistant != null &&
Assistant.Equals(other.Assistant)
) && ) &&
( (
Commentaire == other.Commentaire || Commentaire == other.Commentaire ||
@ -137,10 +124,8 @@ namespace IO.Swagger.DTO
// Suitable nullity checks etc, of course :) // Suitable nullity checks etc, of course :)
if (Id != null) if (Id != null)
hashCode = hashCode * 59 + Id.GetHashCode(); hashCode = hashCode * 59 + Id.GetHashCode();
if (IdAssistant != null) if (IdAssistante != null)
hashCode = hashCode * 59 + IdAssistant.GetHashCode(); hashCode = hashCode * 59 + IdAssistante.GetHashCode();
if (Assistant != null)
hashCode = hashCode * 59 + Assistant.GetHashCode();
if (Commentaire != null) if (Commentaire != null)
hashCode = hashCode * 59 + Commentaire.GetHashCode(); hashCode = hashCode * 59 + Commentaire.GetHashCode();
return hashCode; return hashCode;

@ -3,7 +3,7 @@
* *
* API qui sra utilisée afin de faire communiquer le client et le serveur ainsi que le serveur et la boîte noire. * 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.7 * OpenAPI spec version: 1.3.6
* *
* Generated by: https://github.com/swagger-api/swagger-codegen.git * Generated by: https://github.com/swagger-api/swagger-codegen.git
*/ */
@ -110,7 +110,7 @@ namespace IO.Swagger.DTO
/// Gets or Sets ChoixTypeEntretien /// Gets or Sets ChoixTypeEntretien
/// </summary> /// </summary>
[DataMember(Name="choixTypeEntretien")] [DataMember(Name="choixTypeEntretien")]
public List<TypeEntretienDTO> ChoixTypeEntretien { get; set; } public TypeEntretienDTO ChoixTypeEntretien { get; set; }
/// <summary> /// <summary>
/// Indique si oui ou non l&#x27;EP doit obligatoirement être effectué /// Indique si oui ou non l&#x27;EP doit obligatoirement être effectué
@ -321,7 +321,7 @@ namespace IO.Swagger.DTO
( (
ChoixTypeEntretien == other.ChoixTypeEntretien || ChoixTypeEntretien == other.ChoixTypeEntretien ||
ChoixTypeEntretien != null && ChoixTypeEntretien != null &&
ChoixTypeEntretien.SequenceEqual(other.ChoixTypeEntretien) ChoixTypeEntretien.Equals(other.ChoixTypeEntretien)
) && ) &&
( (
Obligatoire == other.Obligatoire || Obligatoire == other.Obligatoire ||

@ -32,7 +32,7 @@ namespace IO.Swagger.DTO
/// <value>Id du type de l&#x27;entretien</value> /// <value>Id du type de l&#x27;entretien</value>
[Required] [Required]
[DataMember(Name="id")] [DataMember(Name="id")]
public long? Id { get; set; } public int? Id { get; set; }
/// <summary> /// <summary>
/// Texte du type de l&#x27;entretien /// Texte du type de l&#x27;entretien

@ -79,12 +79,11 @@ namespace EPAServeur.IServices
DemandeEPIDTO GetDemandeEPIDTO(DemandeEPI demande, IEnumerable<CollaborateurDTO> collaborateurDTOs); DemandeEPIDTO GetDemandeEPIDTO(DemandeEPI demande, IEnumerable<CollaborateurDTO> collaborateurDTOs);
AugmentationSalaireDTO GetAugmentationSalaireDTO(AugmentationSalaire augmentation); AugmentationSalaireDTO GetAugmentationSalaireDTO(AugmentationSalaire augmentation);
RDVEntretienDTO GetRDVEntretienDTO(RdvEntretien rdvEntretien); RDVEntretienDTO GetRDVEntretienDTO(RdvEntretien rdvEntretien);
TypeEntretienDTO GetTypeEntretienDTO(TypeEntretien typeEntretien); TypeEntretienDTO GetEntretienDTO(ChoixTypeEntretien choixTypeEntretien);
List<RDVEntretienDTO> GetRDVEntretienDTOs(List<RdvEntretien> rdvEntretiens); DemandeFormationDTO GetDemandeFormationDTOEP(DemandeFormation demandeFormation);
List<TypeEntretienDTO> GetTypeEntretienDTOs(List<ChoixTypeEntretien> choixTypeEntretiens);
DocumentDTO GetDocumentDTO(Document document); DocumentDTO GetDocumentDTO(Document document);
List<ObjectifDTO> GetObjectifDTOs(List<Objectif> objectifs); ObjectifDTO GetObjectifDTO(Objectif objectif);
List<ObjectifPrecedentDTO> GetObjectifPrecedentDTO(List<ObjectifPrecedent> objectifsPrecedents); ObjectifPrecedentDTO GetObjectifPrecedentDTO(ObjectifPrecedent objectifPrecedent);

@ -10,10 +10,6 @@ namespace EPAServeur.Models.EP
/// </summary> /// </summary>
public class ChoixTypeEntretien public class ChoixTypeEntretien
{ {
/// <summary>
/// Id
/// </summary>
public long IdChoixTypeEntretien { get; internal set; }
/// <summary> /// <summary>
/// Numéro d’ordre de préférence /// Numéro d’ordre de préférence
/// </summary> /// </summary>

@ -31,21 +31,13 @@ namespace EPAServeur.Services
.Include(ep => ep.Participants) .Include(ep => ep.Participants)
.Include(ep => ep.CommentairesAssistant) .Include(ep => ep.CommentairesAssistant)
.Include(ep => ep.DemandeDelegation) .Include(ep => ep.DemandeDelegation)
.Include(ep => ep.RdvEntretien).ThenInclude(rdv => rdv.TypeEntretien)
.Include(ep => ep.PropositionsRDV).ThenInclude(rdv => rdv.TypeEntretien)
.Include(ep => ep.ChoixTypeEntretien).ThenInclude( c => c.TypeEntretien)
.Include(ep => ep.Objectifs)
.Include(ep => ep.ObjectifsPrecedents)
.Include(ep => ep.DemandeEPI)
.FirstOrDefaultAsync(ep => ep.IdEP.Equals(id)); .FirstOrDefaultAsync(ep => ep.IdEP.Equals(id));
if (ep == null) if (ep == null)
throw new EpNotFoundException(); throw new EpNotFoundException();
//ajouter tous les guids liés à l'EP et aux attributs de l'EP //ajouter tous les guids liés à l'EP et aux attributs de l'EP
List<Guid?> guids = new List<Guid?> List<Guid?> guids = new List<Guid?>();
{ guids.Add(ep.IdCollaborateur);
ep.IdCollaborateur
};
if (ep.IdReferent.HasValue) if (ep.IdReferent.HasValue)
guids.Add(ep.IdCollaborateur); guids.Add(ep.IdCollaborateur);
if (ep.Participants != null && ep.Participants.Any()) if (ep.Participants != null && ep.Participants.Any())
@ -54,8 +46,6 @@ namespace EPAServeur.Services
guids.AddRange(ep.CommentairesAssistant.SelectMany(p => new[] { (Guid?)p.IdAssistant })); guids.AddRange(ep.CommentairesAssistant.SelectMany(p => new[] { (Guid?)p.IdAssistant }));
if (ep.DemandeDelegation != null) if (ep.DemandeDelegation != null)
guids.Add(ep.DemandeDelegation.IdReferent); guids.Add(ep.DemandeDelegation.IdReferent);
if (ep.DemandeEPI != null && ep.DemandeEPI.IdReferent != null)
guids.Add(ep.DemandeEPI.IdReferent);
IEnumerable<CollaborateurDTO> collaborateurDTOs = await collaborateurService.GetCollaborateurDTOsAsync(guids); IEnumerable<CollaborateurDTO> collaborateurDTOs = await collaborateurService.GetCollaborateurDTOsAsync(guids);

@ -65,12 +65,6 @@ namespace EPAServeur.Services
Participants = GetParticipantsDTO(ep.Participants, collaborateurDTOs), Participants = GetParticipantsDTO(ep.Participants, collaborateurDTOs),
CommentairesAssistant = GetCommentaireAssistant(ep.CommentairesAssistant, collaborateurDTOs), CommentairesAssistant = GetCommentaireAssistant(ep.CommentairesAssistant, collaborateurDTOs),
DemandesDelegation = GetDemandeDelegationDTO(ep.DemandeDelegation, collaborateurDTOs), DemandesDelegation = GetDemandeDelegationDTO(ep.DemandeDelegation, collaborateurDTOs),
RdvEntretien = GetRDVEntretienDTO(ep.RdvEntretien),
PropositionsEntretien = GetRDVEntretienDTOs(ep.PropositionsRDV),
ChoixTypeEntretien = GetTypeEntretienDTOs(ep.ChoixTypeEntretien),
Objectifs = GetObjectifDTOs(ep.Objectifs),
ObjectifsPrecedent = GetObjectifPrecedentDTO(ep.ObjectifsPrecedents),
DemandeEPI = GetDemandeEPIDTO(ep.DemandeEPI, collaborateurDTOs)
}; };
} }
@ -229,8 +223,7 @@ namespace EPAServeur.Services
{ {
Commentaire = ca.Commentaire, Commentaire = ca.Commentaire,
Id = ca.IdCommentaireAssistant, Id = ca.IdCommentaireAssistant,
IdAssistant = ca.IdAssistant, IdAssistante = ca.IdAssistant
Assistant = c.Nom + " " + c.Prenom
}); });
} }
} }
@ -291,18 +284,7 @@ namespace EPAServeur.Services
/// <returns></returns> /// <returns></returns>
public DemandeEPIDTO GetDemandeEPIDTO(DemandeEPI demande, IEnumerable<CollaborateurDTO> collaborateurDTOs) public DemandeEPIDTO GetDemandeEPIDTO(DemandeEPI demande, IEnumerable<CollaborateurDTO> collaborateurDTOs)
{ {
if (demande == null) throw new NotImplementedException();
return null;
return new DemandeEPIDTO()
{
Collaborateur = collaborateurDTOs.FirstOrDefault(c => c.Id.Equals(demande.IdCollaborateur)),
Id = demande.IdDemandeEPI,
DateDemande = demande.DateDemande,
DateReponse = demande.DateReponse,
EtatDemande = demande.EtatDemande,
RaisonRefus = demande.RaisonRefus,
Referent = collaborateurDTOs.FirstOrDefault(c => c.Id.Equals(demande.IdReferent))
};
} }
@ -351,13 +333,9 @@ namespace EPAServeur.Services
return engagements.Select(engagment => GetEngagementDTO(engagment, null, false)).ToList(); return engagements.Select(engagment => GetEngagementDTO(engagment, null, false)).ToList();
} }
public TypeEntretienDTO GetTypeEntretienDTO(TypeEntretien typeEntretien) public TypeEntretienDTO GetEntretienDTO(ChoixTypeEntretien choixTypeEntretien)
{ {
return new TypeEntretienDTO() throw new NotImplementedException();
{
Id = typeEntretien.IdTypeEntretien,
Libelle = typeEntretien.Libelle
};
} }
/// <summary> /// <summary>
@ -544,6 +522,15 @@ namespace EPAServeur.Services
return modeFormationDTO; return modeFormationDTO;
} }
public ObjectifDTO GetObjectifDTO(Objectif objectif)
{
throw new NotImplementedException();
}
public ObjectifPrecedentDTO GetObjectifPrecedentDTO(ObjectifPrecedent objectifPrecedent)
{
throw new NotImplementedException();
}
/// <summary> /// <summary>
/// Transformer un objet OrigineFormationDTO en objet OrigineFormation. /// Transformer un objet OrigineFormationDTO en objet OrigineFormation.
@ -656,21 +643,7 @@ namespace EPAServeur.Services
public RDVEntretienDTO GetRDVEntretienDTO(RdvEntretien rdvEntretien) public RDVEntretienDTO GetRDVEntretienDTO(RdvEntretien rdvEntretien)
{ {
if (rdvEntretien == null) throw new NotImplementedException();
return null;
return new RDVEntretienDTO()
{
Id = rdvEntretien.IdRdvEntretien,
DateEntretien = rdvEntretien.DateEntretien,
TypeEntretien = GetTypeEntretienDTO(rdvEntretien.TypeEntretien)
};
}
public List<RDVEntretienDTO> GetRDVEntretienDTOs(List<RdvEntretien> rdvEntretiens)
{
if (rdvEntretiens == null || !rdvEntretiens.Any())
return null;
return rdvEntretiens.Select(rdv => GetRDVEntretienDTO(rdv)).ToList();
} }
@ -753,14 +726,6 @@ namespace EPAServeur.Services
}; };
return statutFormationDTO; return statutFormationDTO;
}
public List<TypeEntretienDTO> GetTypeEntretienDTOs(List<ChoixTypeEntretien> choixTypeEntretiens)
{
if (choixTypeEntretiens == null || !choixTypeEntretiens.Any())
return null;
return choixTypeEntretiens.OrderBy(c => c.Ordre).Select(c => GetTypeEntretienDTO(c.TypeEntretien)).ToList();
} }
/// <summary> /// <summary>
@ -905,29 +870,5 @@ namespace EPAServeur.Services
return engagement; return engagement;
} }
public List<ObjectifDTO> GetObjectifDTOs(List<Objectif> objectifs)
{
if (objectifs == null || !objectifs.Any())
return null;
return objectifs.Select(o => new ObjectifDTO()
{
Id = o.IdObjectif,
Libelle = o.Libelle
}).ToList();
}
public List<ObjectifPrecedentDTO> GetObjectifPrecedentDTO(List<ObjectifPrecedent> objectifsPrecedents)
{
if (objectifsPrecedents == null || !objectifsPrecedents.Any())
return null;
return objectifsPrecedents.Select(o => new ObjectifPrecedentDTO()
{
Id = o.IdObjectif,
Libelle = o.Libelle,
StatutObjectif = o.StatutObjectif,
Commentaire = o.Commentaire
}).ToList();
}
} }
} }

Loading…
Cancel
Save