Implémentation de la récupération des choix de type d'entretien

develop
Yanaël GRETTE 4 years ago
parent 6197d6d0a6
commit b59e2d9617
  1. 24
      EPAServeur.Tests/Services/EpDetailsServiceTests.cs
  2. 58
      EPAServeur/Context/DataSeeder.cs
  3. 4
      EPAServeur/Context/EpContext.cs
  4. 110
      EPAServeur/DTO/EpDTO.cs
  5. 5
      EPAServeur/IServices/ITransformDTO.cs
  6. 4
      EPAServeur/Models/EP/ChoixTypeEntretien.cs
  7. 1
      EPAServeur/Services/EpDetailsService.cs
  8. 32
      EPAServeur/Services/TransformDTO.cs

@ -205,6 +205,28 @@ namespace EPAServeur.Tests.Services
#endregion #endregion
#region Récupérer EP avec choix type entretien #region Récupérer EP avec choix 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
@ -217,7 +239,7 @@ namespace EPAServeur.Tests.Services
#region #region Demande EPI
#endregion #endregion
#region #region

@ -98,6 +98,8 @@ namespace EPAServeur.Context
RdvEntretien proposition1, proposition2, proposition3; RdvEntretien proposition1, proposition2, proposition3;
ChoixTypeEntretien choix1, choix2, choix3, choix4, choix5, choix6, choix7;
//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;
@ -177,6 +179,34 @@ namespace EPAServeur.Context
TypeEntretien = typeVisio TypeEntretien = typeVisio
}; };
epEnCours2.PropositionsRDV = new List<RdvEntretien>(new[] { rdv1, proposition1, proposition2 }); 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);
@ -233,6 +263,16 @@ namespace EPAServeur.Context
RaisonDemande = "Raison quelconque 2" RaisonDemande = "Raison quelconque 2"
}; };
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()
@ -271,7 +311,7 @@ namespace EPAServeur.Context
DateEntretien = new DateTime(), DateEntretien = new DateTime(),
EpProposition = epEnCours5, EpProposition = epEnCours5,
IdRdvEntretien = 5, IdRdvEntretien = 5,
TypeEntretien = typeSite TypeEntretien = typeVisio
}; };
@ -279,6 +319,22 @@ namespace EPAServeur.Context
epEnCours5.PropositionsRDV = new List<RdvEntretien>(new[] { rdv2, proposition3 }); epEnCours5.PropositionsRDV = new List<RdvEntretien>(new[] { rdv2, proposition3 });
epEnCours5.RdvEntretien = rdv2; 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()

@ -107,6 +107,7 @@ 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 =>
@ -116,7 +117,7 @@ namespace EPAServeur.Context
modelBuilder.Entity<ChoixTypeEntretien>(entity => modelBuilder.Entity<ChoixTypeEntretien>(entity =>
{ {
entity.HasKey(e => e.Ordre); entity.HasKey(e => e.IdChoixTypeEntretien);
}); });
@ -141,6 +142,7 @@ 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.6 * OpenAPI spec version: 1.3.7
* *
* Generated by: https://github.com/swagger-api/swagger-codegen.git * Generated by: https://github.com/swagger-api/swagger-codegen.git
*/ */
@ -32,14 +32,14 @@ namespace IO.Swagger.DTO
/// </summary> /// </summary>
/// <value>Id de l’EP</value> /// <value>Id de l’EP</value>
[Required] [Required]
[DataMember(Name="id")] [DataMember(Name = "id")]
public long? Id { get; set; } public long? Id { get; set; }
/// <summary> /// <summary>
/// Gets or Sets Type /// Gets or Sets Type
/// </summary> /// </summary>
[Required] [Required]
[DataMember(Name="type")] [DataMember(Name = "type")]
public TypeEp Type { get; set; } public TypeEp Type { get; set; }
/// <summary> /// <summary>
@ -47,7 +47,7 @@ namespace IO.Swagger.DTO
/// </summary> /// </summary>
/// <value>Date à partir de laquelle l&#x27;EP peut être saisi</value> /// <value>Date à partir de laquelle l&#x27;EP peut être saisi</value>
[Required] [Required]
[DataMember(Name="dateDisponibilite")] [DataMember(Name = "dateDisponibilite")]
public DateTime? DateDisponibilite { get; set; } public DateTime? DateDisponibilite { get; set; }
/// <summary> /// <summary>
@ -55,35 +55,35 @@ namespace IO.Swagger.DTO
/// </summary> /// </summary>
/// <value>Date à laquelle l&#x27;EP est prévu, la date par défaut est celle de l&#x27;anniversaire du collaborateur (+6 mois pour EPS)</value> /// <value>Date à laquelle l&#x27;EP est prévu, la date par défaut est celle de l&#x27;anniversaire du collaborateur (+6 mois pour EPS)</value>
[Required] [Required]
[DataMember(Name="datePrevisionnelle")] [DataMember(Name = "datePrevisionnelle")]
public DateTime? DatePrevisionnelle { get; set; } public DateTime? DatePrevisionnelle { get; set; }
/// <summary> /// <summary>
/// Date à laquelle le collaborateur a signé l&#x27;EP /// Date à laquelle le collaborateur a signé l&#x27;EP
/// </summary> /// </summary>
/// <value>Date à laquelle le collaborateur a signé l&#x27;EP</value> /// <value>Date à laquelle le collaborateur a signé l&#x27;EP</value>
[DataMember(Name="dateSignatureCollaborateur")] [DataMember(Name = "dateSignatureCollaborateur")]
public DateTime? DateSignatureCollaborateur { get; set; } public DateTime? DateSignatureCollaborateur { get; set; }
/// <summary> /// <summary>
/// Date à laquelle le référent a signé l&#x27;EP /// Date à laquelle le référent a signé l&#x27;EP
/// </summary> /// </summary>
/// <value>Date à laquelle le référent a signé l&#x27;EP</value> /// <value>Date à laquelle le référent a signé l&#x27;EP</value>
[DataMember(Name="dateSignatureReferent")] [DataMember(Name = "dateSignatureReferent")]
public DateTime? DateSignatureReferent { get; set; } public DateTime? DateSignatureReferent { get; set; }
/// <summary> /// <summary>
/// Date à laquelle l’EP a été saisi par le collaborateur /// Date à laquelle l’EP a été saisi par le collaborateur
/// </summary> /// </summary>
/// <value>Date à laquelle l’EP a été saisi par le collaborateur</value> /// <value>Date à laquelle l’EP a été saisi par le collaborateur</value>
[DataMember(Name="dateSaisie")] [DataMember(Name = "dateSaisie")]
public DateTime? DateSaisie { get; set; } public DateTime? DateSaisie { get; set; }
/// <summary> /// <summary>
/// Gets or Sets Statut /// Gets or Sets Statut
/// </summary> /// </summary>
[Required] [Required]
[DataMember(Name="statut")] [DataMember(Name = "statut")]
public StatutEp Statut { get; set; } public StatutEp Statut { get; set; }
/// <summary> /// <summary>
@ -91,107 +91,107 @@ namespace IO.Swagger.DTO
/// </summary> /// </summary>
/// <value>Nom du CV Apside du collaborateur</value> /// <value>Nom du CV Apside du collaborateur</value>
[Required] [Required]
[DataMember(Name="cv")] [DataMember(Name = "cv")]
public string Cv { get; set; } public string Cv { get; set; }
/// <summary> /// <summary>
/// Gets or Sets PropositionsEntretien /// Gets or Sets PropositionsEntretien
/// </summary> /// </summary>
[DataMember(Name="propositionsEntretien")] [DataMember(Name = "propositionsEntretien")]
public List<RDVEntretienDTO> PropositionsEntretien { get; set; } public List<RDVEntretienDTO> PropositionsEntretien { get; set; }
/// <summary> /// <summary>
/// Gets or Sets RdvEntretien /// Gets or Sets RdvEntretien
/// </summary> /// </summary>
[DataMember(Name="rdvEntretien")] [DataMember(Name = "rdvEntretien")]
public RDVEntretienDTO RdvEntretien { get; set; } public RDVEntretienDTO RdvEntretien { get; set; }
/// <summary> /// <summary>
/// Gets or Sets ChoixTypeEntretien /// Gets or Sets ChoixTypeEntretien
/// </summary> /// </summary>
[DataMember(Name="choixTypeEntretien")] [DataMember(Name = "choixTypeEntretien")]
public TypeEntretienDTO ChoixTypeEntretien { get; set; } public List<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é
/// </summary> /// </summary>
/// <value>Indique si oui ou non l&#x27;EP doit obligatoirement être effectué</value> /// <value>Indique si oui ou non l&#x27;EP doit obligatoirement être effectué</value>
[Required] [Required]
[DataMember(Name="obligatoire")] [DataMember(Name = "obligatoire")]
public bool? Obligatoire { get; set; } public bool? Obligatoire { get; set; }
/// <summary> /// <summary>
/// Gets or Sets Objectifs /// Gets or Sets Objectifs
/// </summary> /// </summary>
[Required] [Required]
[DataMember(Name="objectifs")] [DataMember(Name = "objectifs")]
public List<ObjectifDTO> Objectifs { get; set; } public List<ObjectifDTO> Objectifs { get; set; }
/// <summary> /// <summary>
/// Gets or Sets ObjectifsPrecedent /// Gets or Sets ObjectifsPrecedent
/// </summary> /// </summary>
[DataMember(Name="objectifsPrecedent")] [DataMember(Name = "objectifsPrecedent")]
public List<ObjectifPrecedentDTO> ObjectifsPrecedent { get; set; } public List<ObjectifPrecedentDTO> ObjectifsPrecedent { get; set; }
/// <summary> /// <summary>
/// Gets or Sets Collaborateur /// Gets or Sets Collaborateur
/// </summary> /// </summary>
[DataMember(Name="collaborateur")] [DataMember(Name = "collaborateur")]
public CollaborateurDTO Collaborateur { get; set; } public CollaborateurDTO Collaborateur { get; set; }
/// <summary> /// <summary>
/// Gets or Sets Referent /// Gets or Sets Referent
/// </summary> /// </summary>
[DataMember(Name="referent")] [DataMember(Name = "referent")]
public CollaborateurDTO Referent { get; set; } public CollaborateurDTO Referent { get; set; }
/// <summary> /// <summary>
/// Gets or Sets DemandesFormation /// Gets or Sets DemandesFormation
/// </summary> /// </summary>
[DataMember(Name="demandesFormation")] [DataMember(Name = "demandesFormation")]
public List<DemandeFormationDTO> DemandesFormation { get; set; } public List<DemandeFormationDTO> DemandesFormation { get; set; }
/// <summary> /// <summary>
/// Gets or Sets Participants /// Gets or Sets Participants
/// </summary> /// </summary>
[DataMember(Name="participants")] [DataMember(Name = "participants")]
public List<ParticipationEPDTO> Participants { get; set; } public List<ParticipationEPDTO> Participants { get; set; }
/// <summary> /// <summary>
/// Gets or Sets Engagements /// Gets or Sets Engagements
/// </summary> /// </summary>
[DataMember(Name="engagements")] [DataMember(Name = "engagements")]
public List<EngagementDTO> Engagements { get; set; } public List<EngagementDTO> Engagements { get; set; }
/// <summary> /// <summary>
/// Gets or Sets AugmentationSalaire /// Gets or Sets AugmentationSalaire
/// </summary> /// </summary>
[DataMember(Name="augmentationSalaire")] [DataMember(Name = "augmentationSalaire")]
public AugmentationSalaireDTO AugmentationSalaire { get; set; } public AugmentationSalaireDTO AugmentationSalaire { get; set; }
/// <summary> /// <summary>
/// Gets or Sets DemandesDelegation /// Gets or Sets DemandesDelegation
/// </summary> /// </summary>
[DataMember(Name="demandesDelegation")] [DataMember(Name = "demandesDelegation")]
public DemandeDelegationDTO DemandesDelegation { get; set; } public DemandeDelegationDTO DemandesDelegation { get; set; }
/// <summary> /// <summary>
/// Gets or Sets DemandeEPI /// Gets or Sets DemandeEPI
/// </summary> /// </summary>
[DataMember(Name="demandeEPI")] [DataMember(Name = "demandeEPI")]
public DemandeEPIDTO DemandeEPI { get; set; } public DemandeEPIDTO DemandeEPI { get; set; }
/// <summary> /// <summary>
/// Gets or Sets Documents /// Gets or Sets Documents
/// </summary> /// </summary>
[Required] [Required]
[DataMember(Name="documents")] [DataMember(Name = "documents")]
public List<DocumentDTO> Documents { get; set; } public List<DocumentDTO> Documents { get; set; }
/// <summary> /// <summary>
/// Gets or Sets CommentairesAssistant /// Gets or Sets CommentairesAssistant
/// </summary> /// </summary>
[DataMember(Name="commentairesAssistant")] [DataMember(Name = "commentairesAssistant")]
public List<CommentaireAssistantDTO> CommentairesAssistant { get; set; } public List<CommentaireAssistantDTO> CommentairesAssistant { get; set; }
/// <summary> /// <summary>
@ -321,7 +321,7 @@ namespace IO.Swagger.DTO
( (
ChoixTypeEntretien == other.ChoixTypeEntretien || ChoixTypeEntretien == other.ChoixTypeEntretien ||
ChoixTypeEntretien != null && ChoixTypeEntretien != null &&
ChoixTypeEntretien.Equals(other.ChoixTypeEntretien) ChoixTypeEntretien.SequenceEqual(other.ChoixTypeEntretien)
) && ) &&
( (
Obligatoire == other.Obligatoire || Obligatoire == other.Obligatoire ||
@ -400,62 +400,62 @@ namespace IO.Swagger.DTO
{ {
var hashCode = 41; var hashCode = 41;
// 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 (Type != null) if (Type != null)
hashCode = hashCode * 59 + Type.GetHashCode(); hashCode = hashCode * 59 + Type.GetHashCode();
if (DateDisponibilite != null) if (DateDisponibilite != null)
hashCode = hashCode * 59 + DateDisponibilite.GetHashCode(); hashCode = hashCode * 59 + DateDisponibilite.GetHashCode();
if (DatePrevisionnelle != null) if (DatePrevisionnelle != null)
hashCode = hashCode * 59 + DatePrevisionnelle.GetHashCode(); hashCode = hashCode * 59 + DatePrevisionnelle.GetHashCode();
if (DateSignatureCollaborateur != null) if (DateSignatureCollaborateur != null)
hashCode = hashCode * 59 + DateSignatureCollaborateur.GetHashCode(); hashCode = hashCode * 59 + DateSignatureCollaborateur.GetHashCode();
if (DateSignatureReferent != null) if (DateSignatureReferent != null)
hashCode = hashCode * 59 + DateSignatureReferent.GetHashCode(); hashCode = hashCode * 59 + DateSignatureReferent.GetHashCode();
if (DateSaisie != null) if (DateSaisie != null)
hashCode = hashCode * 59 + DateSaisie.GetHashCode(); hashCode = hashCode * 59 + DateSaisie.GetHashCode();
if (Statut != null) if (Statut != null)
hashCode = hashCode * 59 + Statut.GetHashCode(); hashCode = hashCode * 59 + Statut.GetHashCode();
if (Cv != null) if (Cv != null)
hashCode = hashCode * 59 + Cv.GetHashCode(); hashCode = hashCode * 59 + Cv.GetHashCode();
if (PropositionsEntretien != null) if (PropositionsEntretien != null)
hashCode = hashCode * 59 + PropositionsEntretien.GetHashCode(); hashCode = hashCode * 59 + PropositionsEntretien.GetHashCode();
if (RdvEntretien != null) if (RdvEntretien != null)
hashCode = hashCode * 59 + RdvEntretien.GetHashCode(); hashCode = hashCode * 59 + RdvEntretien.GetHashCode();
if (ChoixTypeEntretien != null) if (ChoixTypeEntretien != null)
hashCode = hashCode * 59 + ChoixTypeEntretien.GetHashCode(); hashCode = hashCode * 59 + ChoixTypeEntretien.GetHashCode();
if (Obligatoire != null) if (Obligatoire != null)
hashCode = hashCode * 59 + Obligatoire.GetHashCode(); hashCode = hashCode * 59 + Obligatoire.GetHashCode();
if (Objectifs != null) if (Objectifs != null)
hashCode = hashCode * 59 + Objectifs.GetHashCode(); hashCode = hashCode * 59 + Objectifs.GetHashCode();
if (ObjectifsPrecedent != null) if (ObjectifsPrecedent != null)
hashCode = hashCode * 59 + ObjectifsPrecedent.GetHashCode(); hashCode = hashCode * 59 + ObjectifsPrecedent.GetHashCode();
if (Collaborateur != null) if (Collaborateur != null)
hashCode = hashCode * 59 + Collaborateur.GetHashCode(); hashCode = hashCode * 59 + Collaborateur.GetHashCode();
if (Referent != null) if (Referent != null)
hashCode = hashCode * 59 + Referent.GetHashCode(); hashCode = hashCode * 59 + Referent.GetHashCode();
if (DemandesFormation != null) if (DemandesFormation != null)
hashCode = hashCode * 59 + DemandesFormation.GetHashCode(); hashCode = hashCode * 59 + DemandesFormation.GetHashCode();
if (Participants != null) if (Participants != null)
hashCode = hashCode * 59 + Participants.GetHashCode(); hashCode = hashCode * 59 + Participants.GetHashCode();
if (Engagements != null) if (Engagements != null)
hashCode = hashCode * 59 + Engagements.GetHashCode(); hashCode = hashCode * 59 + Engagements.GetHashCode();
if (AugmentationSalaire != null) if (AugmentationSalaire != null)
hashCode = hashCode * 59 + AugmentationSalaire.GetHashCode(); hashCode = hashCode * 59 + AugmentationSalaire.GetHashCode();
if (DemandesDelegation != null) if (DemandesDelegation != null)
hashCode = hashCode * 59 + DemandesDelegation.GetHashCode(); hashCode = hashCode * 59 + DemandesDelegation.GetHashCode();
if (DemandeEPI != null) if (DemandeEPI != null)
hashCode = hashCode * 59 + DemandeEPI.GetHashCode(); hashCode = hashCode * 59 + DemandeEPI.GetHashCode();
if (Documents != null) if (Documents != null)
hashCode = hashCode * 59 + Documents.GetHashCode(); hashCode = hashCode * 59 + Documents.GetHashCode();
if (CommentairesAssistant != null) if (CommentairesAssistant != null)
hashCode = hashCode * 59 + CommentairesAssistant.GetHashCode(); hashCode = hashCode * 59 + CommentairesAssistant.GetHashCode();
return hashCode; return hashCode;
} }
} }
#region Operators #region Operators
#pragma warning disable 1591 #pragma warning disable 1591
public static bool operator ==(EpDTO left, EpDTO right) public static bool operator ==(EpDTO left, EpDTO right)
{ {
@ -467,7 +467,7 @@ namespace IO.Swagger.DTO
return !Equals(left, right); return !Equals(left, right);
} }
#pragma warning restore 1591 #pragma warning restore 1591
#endregion Operators #endregion Operators
} }
} }

@ -79,10 +79,9 @@ 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 GetEntretienDTO(ChoixTypeEntretien choixTypeEntretien); TypeEntretienDTO GetTypeEntretienDTO(TypeEntretien typeEntretien);
TypeEntretienDTO GetEntretienDTO(TypeEntretien typeEntretien);
List<RDVEntretienDTO> GetRDVEntretienDTOs(List<RdvEntretien> rdvEntretiens); List<RDVEntretienDTO> GetRDVEntretienDTOs(List<RdvEntretien> rdvEntretiens);
DemandeFormationDTO GetDemandeFormationDTOEP(DemandeFormation demandeFormation); List<TypeEntretienDTO> GetTypeEntretienDTOs(List<ChoixTypeEntretien> choixTypeEntretiens);
DocumentDTO GetDocumentDTO(Document document); DocumentDTO GetDocumentDTO(Document document);
ObjectifDTO GetObjectifDTO(Objectif objectif); ObjectifDTO GetObjectifDTO(Objectif objectif);
ObjectifPrecedentDTO GetObjectifPrecedentDTO(ObjectifPrecedent objectifPrecedent); ObjectifPrecedentDTO GetObjectifPrecedentDTO(ObjectifPrecedent objectifPrecedent);

@ -10,6 +10,10 @@ 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>

@ -33,6 +33,7 @@ namespace EPAServeur.Services
.Include(ep => ep.DemandeDelegation) .Include(ep => ep.DemandeDelegation)
.Include(ep => ep.RdvEntretien).ThenInclude(rdv => rdv.TypeEntretien) .Include(ep => ep.RdvEntretien).ThenInclude(rdv => rdv.TypeEntretien)
.Include(ep => ep.PropositionsRDV).ThenInclude(rdv => rdv.TypeEntretien) .Include(ep => ep.PropositionsRDV).ThenInclude(rdv => rdv.TypeEntretien)
.Include(ep => ep.ChoixTypeEntretien).ThenInclude( c => c.TypeEntretien)
.FirstOrDefaultAsync(ep => ep.IdEP.Equals(id)); .FirstOrDefaultAsync(ep => ep.IdEP.Equals(id));
if (ep == null) if (ep == null)
throw new EpNotFoundException(); throw new EpNotFoundException();

@ -66,7 +66,8 @@ namespace EPAServeur.Services
CommentairesAssistant = GetCommentaireAssistant(ep.CommentairesAssistant, collaborateurDTOs), CommentairesAssistant = GetCommentaireAssistant(ep.CommentairesAssistant, collaborateurDTOs),
DemandesDelegation = GetDemandeDelegationDTO(ep.DemandeDelegation, collaborateurDTOs), DemandesDelegation = GetDemandeDelegationDTO(ep.DemandeDelegation, collaborateurDTOs),
RdvEntretien = GetRDVEntretienDTO(ep.RdvEntretien), RdvEntretien = GetRDVEntretienDTO(ep.RdvEntretien),
PropositionsEntretien = GetRDVEntretienDTOs(ep.PropositionsRDV) PropositionsEntretien = GetRDVEntretienDTOs(ep.PropositionsRDV),
ChoixTypeEntretien = GetTypeEntretienDTOs(ep.ChoixTypeEntretien)
}; };
} }
@ -336,12 +337,7 @@ namespace EPAServeur.Services
return engagements.Select(engagment => GetEngagementDTO(engagment, null, false)).ToList(); return engagements.Select(engagment => GetEngagementDTO(engagment, null, false)).ToList();
} }
public TypeEntretienDTO GetEntretienDTO(ChoixTypeEntretien choixTypeEntretien) public TypeEntretienDTO GetTypeEntretienDTO(TypeEntretien typeEntretien)
{
throw new NotImplementedException();
}
public TypeEntretienDTO GetEntretienDTO(TypeEntretien typeEntretien)
{ {
return new TypeEntretienDTO() return new TypeEntretienDTO()
{ {
@ -661,7 +657,7 @@ namespace EPAServeur.Services
{ {
Id = rdvEntretien.IdRdvEntretien, Id = rdvEntretien.IdRdvEntretien,
DateEntretien = rdvEntretien.DateEntretien, DateEntretien = rdvEntretien.DateEntretien,
TypeEntretien = GetEntretienDTO(rdvEntretien.TypeEntretien) TypeEntretien = GetTypeEntretienDTO(rdvEntretien.TypeEntretien)
}; };
} }
@ -754,12 +750,20 @@ namespace EPAServeur.Services
return statutFormationDTO; return statutFormationDTO;
} }
/// <summary> public List<TypeEntretienDTO> GetTypeEntretienDTOs(List<ChoixTypeEntretien> choixTypeEntretiens)
/// Transformer un objet TypeFormationDTO en objet TypeFormation. {
/// </summary> if (choixTypeEntretiens == null || !choixTypeEntretiens.Any())
/// <param name="typeFormationDTO"></param> return null;
/// <returns></returns> return choixTypeEntretiens.OrderBy(c => c.Ordre).Select(c => GetTypeEntretienDTO(c.TypeEntretien)).ToList();
public TypeFormation GetTypeFormation(TypeFormationDTO typeFormationDTO)
}
/// <summary>
/// Transformer un objet TypeFormationDTO en objet TypeFormation.
/// </summary>
/// <param name="typeFormationDTO"></param>
/// <returns></returns>
public TypeFormation GetTypeFormation(TypeFormationDTO typeFormationDTO)
{ {
if (typeFormationDTO == null) if (typeFormationDTO == null)
return null; return null;

Loading…
Cancel
Save