diff --git a/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/CollaborateursController.cs b/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/CollaborateursController.cs index a5a0caf..b5ccfb9 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/CollaborateursController.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/CollaborateursController.cs @@ -19,20 +19,16 @@ namespace espacecollab.backend.api.Controllers [HttpGet] public ActionResult> GetCollaborateurs() { - IEnumerable collaborateurs = CollaborateursServices.GetCollaborateurs(); - if (!collaborateurs.Any()) - { - return NotFound(); - } - return Ok(collaborateurs); + return Ok(CollaborateursServices.GetAll()); } [HttpGet("{collaborateurId}")] public ActionResult GetCollaborateurById(int collaborateurId) { - CollaborateurApiDto? collaborateur = CollaborateursServices.GetCollaborateurById(collaborateurId); + CollaborateurApiDto? collaborateur = CollaborateursServices.GetById(collaborateurId); if (collaborateur == null) return NotFound(); + return Ok(collaborateur); } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/CollaborateursControllerTestGeneric.cs b/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/CollaborateursControllerTestGeneric.cs deleted file mode 100644 index b926d16..0000000 --- a/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/CollaborateursControllerTestGeneric.cs +++ /dev/null @@ -1,26 +0,0 @@ -using espacecollab.backend.appservices; -using espacecollab.backend.appservices.dtos; -using Microsoft.AspNetCore.Mvc; - -namespace espacecollab.backend.api.Controllers -{ - [Route("api/[controller]")] - [ApiController] - public class CollaborateursControllerTestGeneric : ControllerBase - { - private CollaborateursServices CollaborateursServices { get; } - - public CollaborateursControllerTestGeneric(CollaborateursServices collaborateursServices) - { - CollaborateursServices = collaborateursServices; - } - - // GET: api/collaborateurs - //[HttpGet] - //public ActionResult> GetCollaborateurs() - //{ - // return CollaborateursServices.GetAll(); - - //} - } -} diff --git a/Collaborateur_Epa_Back/espacecollab.backend.api/Startup.cs b/Collaborateur_Epa_Back/espacecollab.backend.api/Startup.cs index cc606b5..ad7b864 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.api/Startup.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.api/Startup.cs @@ -19,8 +19,6 @@ namespace Api // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { - - IConfigurationSection sqlSection = Configuration.GetSection(SqlOption.Key); services.Configure(sqlSection); SqlOption contextOptions = sqlSection.Get(); @@ -30,21 +28,17 @@ namespace Api if (contextOptions.LoadFake) { - - + services.AddScoped(); } else { - //services.AddScoped(); + services.AddScoped(); } - //services.AddScoped, GenericRepository>(); - //services.AddScoped, FakeCollaborateurRepository>(); - services.AddScoped(); + services.AddScoped(); - services.AddScoped(); - + services.AddEndpointsApiExplorer(); services.AddSwaggerGen(); } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/EnumGenreMapper.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/EnumGenreMapper.cs index b7eb349..ff142fc 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/EnumGenreMapper.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/EnumGenreMapper.cs @@ -1,4 +1,4 @@ -using espacecollab.backend.infrastructure.sql.dtos; +using espacecollab.backend.infrastructure.sql.dtos.Values; namespace espacecollab.backend.appservices.dtos.Mappers { diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/EnumStatutMapper.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/EnumStatutMapper.cs index cde5356..85a6e5d 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/EnumStatutMapper.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/EnumStatutMapper.cs @@ -1,4 +1,4 @@ -using espacecollab.backend.infrastructure.sql.dtos; +using espacecollab.backend.infrastructure.sql.dtos.Values; namespace espacecollab.backend.appservices.dtos.Mappers { diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices/CollaborateursServices.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices/CollaborateursServices.cs index 3eff512..a5e442d 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.appservices/CollaborateursServices.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices/CollaborateursServices.cs @@ -7,28 +7,19 @@ using espacecollab.backend.infrastructure.sql.SqlRepo.Interface; namespace espacecollab.backend.appservices { - public class CollaborateursServices + public class CollaborateursServices : GenericsServices { private ICollaborateurRepository CollaborateurRepository { get; } - public CollaborateursServices(ICollaborateurRepository collaborateur) + public CollaborateursServices(ICollaborateurRepository collaborateurRepository) + :base(collaborateurRepository, CollaborateurMapper.ToApi, CollaborateurMapper.ToSql) { - CollaborateurRepository = collaborateur; - } - - public IEnumerable GetCollaborateurs() - { - return CollaborateurRepository.GetAll().Select(collaborateurSql => collaborateurSql.ToApi()); - } - - public CollaborateurApiDto? GetCollaborateurById(int id) - { - return CollaborateurRepository.GetById(id)?.ToApi(); + CollaborateurRepository = collaborateurRepository; } public CollaborateurApiDto? AddCollaborateur(CollaborateurApiDto collaborateurApi) { - CollaborateurSqlDto collaborateurSql = collaborateurApi.ToSql(); + CollaborateurSqlDto collaborateurSql = collaborateurApi.ToSql(); if (collaborateurSql == null) return null; CollaborateurRepository.Add(collaborateurSql); @@ -67,7 +58,8 @@ namespace espacecollab.backend.appservices { if (string.IsNullOrEmpty(apsideMail)) return null; - return CollaborateurRepository.GetCollaborateurByApsideMail(apsideMail).ToApi(); + + return CollaborateurRepository.GetCollaborateurByApsideMail(apsideMail)?.ToApi(); } } } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices/GenericsServices.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices/GenericsServices.cs index 99a4385..09778e9 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.appservices/GenericsServices.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices/GenericsServices.cs @@ -1,49 +1,53 @@ -using espacecollab.backend.appservices.dtos; -using espacecollab.backend.infrastructure.sql.dtos; +using espacecollab.backend.infrastructure.sql.dtos; using espacecollab.backend.infrastructure.sql.SqlRepo.Interface; namespace espacecollab.backend.appservices { - //public abstract class GenericsServices where T : class, IGenericSqlDto - // where To : GenericApiDtoBase, new() - //{ - // private IGenericRepository GenericRepository { get; } - - // public GenericsServices(IGenericRepository genericRepository) - // { - // GenericRepository = genericRepository; - // } - - // public To? Add(To apiDto) - // { - // T? entity = GenericRepository.Add(apiDto.ToEntity()); - // if (entity == null) - // return null; - - // return new To().FromEntity(entity); - // } - - // public IEnumerable GetAll() where T : class, IGenericSqlDto - // { - // return GenericRepository.GetAll(); - // } - - // public To? GetById(int id) where T : class, IGenericSqlDto - // { - // T? entity = GenericRepository.GetById(id); - // if (entity == null) - // return null; - - // return new To().FromEntity(entity); - // } - - // public To? Update(To apiDto) - // { - // T? entity = GenericRepository.Update(apiDto.ToEntity()); - // if (entity == null) - // return null; - - // return new To().FromEntity(entity); - // } - //} + public abstract class GenericsServices where T : class, IGenericSqlDto + where To : class + { + Func MapperToApiDto { get; } + Func MapperToSqlDto { get; } + + private IGenericRepository GenericRepository { get; } + + public GenericsServices(IGenericRepository genericRepository, Func mapperToApiDto, Func mapperToSqlDto) + { + GenericRepository = genericRepository; + MapperToApiDto = mapperToApiDto; + MapperToSqlDto = mapperToSqlDto; + } + + //public To? Add(To apiDto) + //{ + // T? entity = GenericRepository.Add(apiDto.ToEntity()); + // if (entity == null) + // return null; + + // return new To().FromEntity(entity); + //} + + public IEnumerable GetAll() + { + return GenericRepository.GetAll().Select(entity => MapperToApiDto(entity)).ToList(); + } + + public To? GetById(int id) + { + T? entity = GenericRepository.GetById(id); + if (entity == null) + return null; + + return MapperToApiDto(entity); + } + + //public To? Update(To apiDto) + //{ + // T? entity = GenericRepository.Update(apiDto.ToEntity()); + // if (entity == null) + // return null; + + // return new To().FromEntity(entity); + //} + } } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurSqlDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurSqlDto.cs index 1ecd821..137764e 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurSqlDto.cs @@ -1,4 +1,5 @@ -using System.Diagnostics.CodeAnalysis; +using espacecollab.backend.infrastructure.sql.dtos.Values; +using System.Diagnostics.CodeAnalysis; namespace espacecollab.backend.infrastructure.sql.dtos { @@ -22,6 +23,12 @@ namespace espacecollab.backend.infrastructure.sql.dtos [ExcludeFromCodeCoverage] private CollaborateurSqlDto() { + Name = string.Empty; + FirstName = string.Empty; + Address = string.Empty; + Telephone = string.Empty; + PersonalMail = string.Empty; + ApsideMail = string.Empty; } public CollaborateurSqlDto(int id, string name, string firstName, DateTime birthDate, EnumGenreSql gender, EnumStatutSql status, int childrenNumber, string address, string telephone, string personalMail, string apsideMail, DateTime resignationDate, int referrerId, int businessUnitId) 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 110ccf7..bcc3d5e 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/PeriodeEssaiSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/PeriodeEssaiSqlDto.cs @@ -1,4 +1,5 @@ -using System.Diagnostics.CodeAnalysis; +using espacecollab.backend.infrastructure.sql.dtos.Values; +using System.Diagnostics.CodeAnalysis; namespace espacecollab.backend.infrastructure.sql.dtos { @@ -15,6 +16,7 @@ namespace espacecollab.backend.infrastructure.sql.dtos [ExcludeFromCodeCoverage] private PeriodeEssaiSqlDto() { + Comment = string.Empty; } public PeriodeEssaiSqlDto(int id, DateTime startingDate, DateTime plannedEndingDate, DateTime realEndingDate, string comment, EnumIssueSql issue, int collaborateurId) diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/EnumGenreSql.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/Values/EnumGenreSql.cs similarity index 59% rename from Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/EnumGenreSql.cs rename to Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/Values/EnumGenreSql.cs index 0fc889b..f3298bc 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/EnumGenreSql.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/Values/EnumGenreSql.cs @@ -1,4 +1,4 @@ -namespace espacecollab.backend.infrastructure.sql.dtos +namespace espacecollab.backend.infrastructure.sql.dtos.Values { public enum EnumGenreSql { diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/EnumIssueSql.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/Values/EnumIssueSql.cs similarity index 71% rename from Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/EnumIssueSql.cs rename to Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/Values/EnumIssueSql.cs index 2945779..63e990c 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/EnumIssueSql.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/Values/EnumIssueSql.cs @@ -1,4 +1,4 @@ -namespace espacecollab.backend.infrastructure.sql.dtos +namespace espacecollab.backend.infrastructure.sql.dtos.Values { public enum EnumIssueSql { diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/EnumStatutSql.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/Values/EnumStatutSql.cs similarity index 64% rename from Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/EnumStatutSql.cs rename to Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/Values/EnumStatutSql.cs index 9e57875..d0284a3 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/EnumStatutSql.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/Values/EnumStatutSql.cs @@ -1,4 +1,4 @@ -namespace espacecollab.backend.infrastructure.sql.dtos +namespace espacecollab.backend.infrastructure.sql.dtos.Values { public enum EnumStatutSql { diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/FakeRepo/FakeCollaborateurRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/FakeRepo/FakeCollaborateurRepository.cs index 2a67ee1..cc89025 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/FakeRepo/FakeCollaborateurRepository.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/FakeRepo/FakeCollaborateurRepository.cs @@ -1,4 +1,5 @@ using espacecollab.backend.infrastructure.sql.dtos; +using espacecollab.backend.infrastructure.sql.dtos.Values; using espacecollab.backend.infrastructure.sql.SqlRepo; using espacecollab.backend.infrastructure.sql.SqlRepo.Interface; @@ -7,30 +8,28 @@ namespace espacecollab.backend.infrastructure.sql.FakeRepo public class FakeCollaborateurRepository : GenericRepository, ICollaborateurRepository { - private List Collaborateurs { get; set; } - - - //Context obligatoire car le Generic Repository en a un. - public FakeCollaborateurRepository() - { - - Collaborateurs = new List + private IList Collaborateurs { get; } = new List { - new CollaborateurSqlDto(new int(), "Dupont", "Jean", new DateTime(1980, 12, 10), + new CollaborateurSqlDto(1, "Dupont", "Jean", new DateTime(1980, 12, 10), EnumGenreSql.MASCULIN, EnumStatutSql.NONCADRE, 0, "1 rue du Louvre, 63000, Clermont-Ferrand", "0660258644", - "jean.dupont@gmail.com", "jean.dupont@apside-groupe.com", new DateTime(2023, 12, 17), new int(), new int()), - new CollaborateurSqlDto(new int(), "Michel", "Laura", new DateTime(1985, 08, 12), + "jean.dupont@gmail.com", "jean.dupont@apside-groupe.com", new DateTime(2023, 12, 17), 2, 1), + + new CollaborateurSqlDto(2, "Michel", "Laura", new DateTime(1985, 08, 12), EnumGenreSql.FEMININ, EnumStatutSql.NONCADRE, 0, "5 rue du Louvre, 63000, Clermont-Ferrand", "0660258644", - "laura.michel@gmail.com", "laura.michel@apside-groupe.com", new DateTime(2023, 12, 17), new int(), new int()) + "laura.michel@gmail.com", "laura.michel@apside-groupe.com", new DateTime(2023, 12, 17), 1, 1) }; + + public FakeCollaborateurRepository() + { } - //redéfinition des méthodes du GenericRepository pour fonctionner avec Fake + #region redéfinition des méthodes du GenericRepository pour fonctionner avec Fake + public new CollaborateurSqlDto? GetById(int id) { return Collaborateurs.FirstOrDefault(entity => entity.Id == id); } - + public new CollaborateurSqlDto? Add(CollaborateurSqlDto entity) { Collaborateurs.Add(entity); @@ -61,13 +60,15 @@ namespace espacecollab.backend.infrastructure.sql.FakeRepo return collaborateur; } - //méthodes spécifiques à l'interface ICollaborateurRepository + #endregion + + #region méthodes spécifiques à l'interface ICollaborateurRepository + public IList GetCollaborateursByBusinessUnit(int businessUnitId) { return Collaborateurs.Where(entity => entity.BusinessUnitId == businessUnitId).ToList(); } - public IList GetCollaborateursByReferrer(int referrerId) { return Collaborateurs.Where(entity => entity.ReferrerId == referrerId).ToList(); @@ -77,5 +78,7 @@ namespace espacecollab.backend.infrastructure.sql.FakeRepo { return Collaborateurs.First(entity => entity.ApsideMail == apsideMail); } + + #endregion } } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/CollaborateurRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/CollaborateurSqlRepository.cs similarity index 83% rename from Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/CollaborateurRepository.cs rename to Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/CollaborateurSqlRepository.cs index 6c3f20f..6903f92 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/CollaborateurRepository.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/CollaborateurSqlRepository.cs @@ -3,11 +3,11 @@ using espacecollab.backend.infrastructure.sql.SqlRepo.Interface; namespace espacecollab.backend.infrastructure.sql.SqlRepo { - public class CollaborateurRepository : GenericRepository,ICollaborateurRepository + public class CollaborateurSqlRepository : GenericRepository,ICollaborateurRepository { private MainDbContext Context { get; } - public CollaborateurRepository(MainDbContext context) : base(context) + public CollaborateurSqlRepository(MainDbContext context) : base(context) { Context = context; } 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 index fa96d0b..15f90be 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/IAgenceRepository.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/IAgenceRepository.cs @@ -2,12 +2,7 @@ namespace espacecollab.backend.infrastructure.sql.SqlRepo.Interface { - public interface IAgenceRepository + public interface IAgenceRepository : IGenericRepository { - //inutile ! - 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 index 2912591..0aadfc4 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/IBusinessUnitRepository.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/IBusinessUnitRepository.cs @@ -2,12 +2,7 @@ namespace espacecollab.backend.infrastructure.sql.SqlRepo.Interface { - public interface IBusinessUnitRepository + public interface IBusinessUnitRepository : IGenericRepository { - //inutile ! - 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/ICollaborateurRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/ICollaborateurRepository.cs index 3fef7b3..6eef355 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/ICollaborateurRepository.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/ICollaborateurRepository.cs @@ -4,7 +4,7 @@ namespace espacecollab.backend.infrastructure.sql.SqlRepo.Interface { public interface ICollaborateurRepository : IGenericRepository { - CollaborateurSqlDto GetCollaborateurByApsideMail(string apsideMail); + CollaborateurSqlDto? GetCollaborateurByApsideMail(string apsideMail); IList GetCollaborateursByBusinessUnit(int businessUnitId); IList GetCollaborateursByReferrer(int referrerId); } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/IGenericRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/IGenericRepository.cs index d97622c..13a2f9a 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/IGenericRepository.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/IGenericRepository.cs @@ -9,10 +9,6 @@ namespace espacecollab.backend.infrastructure.sql.SqlRepo.Interface IEnumerable GetAll(); T? GetById(int id); T? Update(T entity); - - - - - + //void GetAll() where T : class, IGenericSqlDto; } } \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/IPeriodeEssaiRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/IPeriodeEssaiRepository.cs index 88aa3e1..43b4c25 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/IPeriodeEssaiRepository.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/IPeriodeEssaiRepository.cs @@ -2,12 +2,7 @@ namespace espacecollab.backend.infrastructure.sql.SqlRepo.Interface { - public interface IPeriodeEssaiRepository + public interface IPeriodeEssaiRepository : IGenericRepository { - //inutile ! - PeriodeEssaiSqlDto? AddPeriodeEssai(PeriodeEssaiSqlDto newPeriodeEssai); - IList? GetAllPeriodeEssais(); - PeriodeEssaiSqlDto? GetPeriodeEssaiById(PeriodeEssaiSqlDto periodeEssai); - PeriodeEssaiSqlDto UpdatePeriodeEssai(PeriodeEssaiSqlDto periodeEssai); } } \ 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 index 4378232..2dfb773 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/IProjetRepository.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/IProjetRepository.cs @@ -2,8 +2,8 @@ namespace espacecollab.backend.infrastructure.sql.SqlRepo.Interface { - public interface IProjetRepository + public interface IProjetRepository : IGenericRepository { - IList? GetProjetsByClient(string client); + IList GetProjetsByClient(string client); } } \ 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 index 28926ce..b6f6f75 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/IReferencementRepository.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/IReferencementRepository.cs @@ -2,12 +2,11 @@ namespace espacecollab.backend.infrastructure.sql.SqlRepo.Interface { - public interface IReferencementRepository + public interface IReferencementRepository : IGenericRepository { IList? GetReferrersByCollaborateurId(int 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