From 7b7bd77e6e71532e2237e69d3e26c84fe24c3876 Mon Sep 17 00:00:00 2001 From: Clement FERRERE Date: Mon, 22 Nov 2021 16:53:07 +0100 Subject: [PATCH] =?UTF-8?q?Cr=C3=A9ation=20des=20interfaces=20pour=20autre?= =?UTF-8?q?s=20repos.=20Agence=20incompl=C3=A8te,=20P=C3=A9riode=20Essai?= =?UTF-8?q?=20=C3=A0=20voir?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...CollaborateurEffectuePeriodeEssaiSqlDto.cs | 21 ------------------- .../CollaborateurEstFonctionSqlDto.cs | 2 +- .../PeriodeEssaiSqlDto.cs | 4 +++- .../SqlRepo/CollaborateurRepository.cs | 2 +- .../SqlRepo/Interface/IAgenceRepository.cs | 12 +++++++++++ .../Interface/IBusinessUnitRepository.cs | 12 +++++++++++ .../SqlRepo/Interface/IProjetRepository.cs | 13 ++++++++++++ .../Interface/IReferencementRepository.cs | 13 ++++++++++++ 8 files changed, 55 insertions(+), 24 deletions(-) delete mode 100644 Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurEffectuePeriodeEssaiSqlDto.cs create mode 100644 Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/IAgenceRepository.cs create mode 100644 Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/IBusinessUnitRepository.cs create mode 100644 Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/IProjetRepository.cs create mode 100644 Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/IReferencementRepository.cs diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurEffectuePeriodeEssaiSqlDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurEffectuePeriodeEssaiSqlDto.cs deleted file mode 100644 index bfe853b..0000000 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurEffectuePeriodeEssaiSqlDto.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Diagnostics.CodeAnalysis; - -namespace espacecollab.backend.infrastructure.sql.dtos.Associations -{ - public class CollaborateurEffectuePeriodeEssaiSqlDto - { - public Guid CollaborateurId { get; set; } - public Guid PeriodeEssaiId { get; set;} - - [ExcludeFromCodeCoverage] - private CollaborateurEffectuePeriodeEssaiSqlDto() - { - } - - public CollaborateurEffectuePeriodeEssaiSqlDto(Guid collaborateurId, Guid periodeEssaiId) - { - CollaborateurId = collaborateurId; - PeriodeEssaiId = periodeEssaiId; - } - } -} diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurEstFonctionSqlDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurEstFonctionSqlDto.cs index be2ecde..909ec84 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurEstFonctionSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurEstFonctionSqlDto.cs @@ -5,7 +5,7 @@ namespace espacecollab.backend.infrastructure.sql.dtos.Associations public class CollaborateurEstFonctionSqlDto { public Guid CollaborateurId { get; set; } - public Guid FonctionId { get; set;} + public Guid FonctionId { get; set; } [ExcludeFromCodeCoverage] private CollaborateurEstFonctionSqlDto() diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/PeriodeEssaiSqlDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/PeriodeEssaiSqlDto.cs index 118637a..ead65f7 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/PeriodeEssaiSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/PeriodeEssaiSqlDto.cs @@ -10,13 +10,14 @@ namespace espacecollab.backend.infrastructure.sql.dtos public DateTime RealEndingDate { get; set; } public string Comment { get; set; } public EnumIssue Issue { get; set; } + public Guid CollaborateurId { get; set; } [ExcludeFromCodeCoverage] private PeriodeEssaiSqlDto() { } - public PeriodeEssaiSqlDto(Guid id, DateTime startingDate, DateTime plannedEndingDate, DateTime realEndingDate, string comment, EnumIssue issue) + public PeriodeEssaiSqlDto(Guid id, DateTime startingDate, DateTime plannedEndingDate, DateTime realEndingDate, string comment, EnumIssue issue, Guid collaborateurId) { Id = id; StartingDate = startingDate; @@ -24,6 +25,7 @@ namespace espacecollab.backend.infrastructure.sql.dtos RealEndingDate = realEndingDate; Comment = comment; Issue = issue; + CollaborateurId = collaborateurId; } } } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/CollaborateurRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/CollaborateurRepository.cs index e0161ec..67ffd1b 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/CollaborateurRepository.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/CollaborateurRepository.cs @@ -19,7 +19,7 @@ namespace espacecollab.backend.infrastructure.sql.SqlRepo CollaborateurSqlDto? collaborateurAlreadyExists = Context.Collaborateur?.FirstOrDefault(c => c.Id == newCollaborateur.Id); if (collaborateurAlreadyExists != null) return null; - + Context.Set().Add(newCollaborateur); Context.SaveChanges(); diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/IAgenceRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/IAgenceRepository.cs new file mode 100644 index 0000000..f0470bc --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/IAgenceRepository.cs @@ -0,0 +1,12 @@ +using espacecollab.backend.infrastructure.sql.dtos; + +namespace espacecollab.backend.infrastructure.sql.SqlRepo.Interface +{ + public interface IAgenceRepository + { + AgenceSqlDto? AddAgence(AgenceSqlDto newAgence); + IList? GetAllAgences(); + AgenceSqlDto? GetAgenceById(AgenceSqlDto agence); + AgenceSqlDto UpdateAgence(AgenceSqlDto agence); + } +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/IBusinessUnitRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/IBusinessUnitRepository.cs new file mode 100644 index 0000000..3ccc5ea --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/IBusinessUnitRepository.cs @@ -0,0 +1,12 @@ +using espacecollab.backend.infrastructure.sql.dtos; + +namespace espacecollab.backend.infrastructure.sql.SqlRepo.Interface +{ + public interface IBusinessUnitRepository + { + BusinessUnitSqlDto? AddBusinessUnit(BusinessUnitSqlDto newBusinessUnit); + IList? GetAllBusinessUnits(); + BusinessUnitSqlDto? GetBusinessUnitById(BusinessUnitSqlDto BusinessUnit); + BusinessUnitSqlDto UpdateBusinessUnit(BusinessUnitSqlDto BusinessUnit); + } +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/IProjetRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/IProjetRepository.cs new file mode 100644 index 0000000..b2fa7a3 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/IProjetRepository.cs @@ -0,0 +1,13 @@ +using espacecollab.backend.infrastructure.sql.dtos; + +namespace espacecollab.backend.infrastructure.sql.SqlRepo.Interface +{ + public interface IProjetRepository + { + ProjetSqlDto? AddProjet(ProjetSqlDto newProjet); + IList? GetAllProjets(); + IList? GetProjetsByClient(string client); + ProjetSqlDto? GetProjetById(ProjetSqlDto projet); + ProjetSqlDto UpdateProjet(ProjetSqlDto projet); + } +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/IReferencementRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/IReferencementRepository.cs new file mode 100644 index 0000000..43810f3 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/IReferencementRepository.cs @@ -0,0 +1,13 @@ +using espacecollab.backend.infrastructure.sql.dtos; + +namespace espacecollab.backend.infrastructure.sql.SqlRepo.Interface +{ + public interface IReferencementRepository + { + IList? GetReferrersByCollaborateurId(Guid collaborateurId); + IList? GetReferrersByCollaborateurApsideMail(string apsideMail); + + //TODO Voir les attentes concernant "le référent ayant le plus suivi depuis une date" + + } +} \ No newline at end of file