diff --git a/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/CollaborateursControllerTestGeneric.cs b/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/CollaborateursControllerTestGeneric.cs new file mode 100644 index 0000000..b926d16 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/CollaborateursControllerTestGeneric.cs @@ -0,0 +1,26 @@ +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/Controllers/GenericsController.cs b/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/GenericsController.cs deleted file mode 100644 index 2502c62..0000000 --- a/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/GenericsController.cs +++ /dev/null @@ -1,43 +0,0 @@ -using espacecollab.backend.appservices; -using espacecollab.backend.appservices.dtos; -using espacecollab.backend.infrastructure.sql.SqlRepo; -using Microsoft.AspNetCore.Mvc; - -namespace espacecollab.backend.api.Controllers -{ - [Route("api/[controller]")] - [ApiController] - public class GenericsController : ControllerBase - { - private GenericsServices GenericsServices { get; } - - public GenericsController(GenericsServices genericsServices) - { - GenericsServices = genericsServices; - } - - [HttpGet] - public IEnumerable GetAll() where T : class - { - return GenericsServices.GetAll(); - } - - [HttpGet] - public T? GetById(Guid id) where T : class, IGenericEntity - { - return GenericsServices.GetById(id); - } - - [HttpPost] - public T? Update(T entity) where T : class, IGenericEntity - { - return GenericsServices.Update(entity); - } - - [HttpPost] - public T? Add(T entity) where T : class - { - return GenericsServices.Add(entity); - } - } -} diff --git a/Collaborateur_Epa_Back/espacecollab.backend.api/Startup.cs b/Collaborateur_Epa_Back/espacecollab.backend.api/Startup.cs index 91d17f2..cc606b5 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.api/Startup.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.api/Startup.cs @@ -1,5 +1,7 @@ using espacecollab.backend.appservices; using espacecollab.backend.infrastructure.sql; +using espacecollab.backend.infrastructure.sql.dtos; +using espacecollab.backend.infrastructure.sql.FakeRepo; using espacecollab.backend.infrastructure.sql.Options; using espacecollab.backend.infrastructure.sql.SqlRepo; using espacecollab.backend.infrastructure.sql.SqlRepo.Interface; @@ -26,11 +28,20 @@ namespace Api services.AddControllers(); services.AddRouting(options => options.LowercaseUrls = true); - - services.AddScoped(); - services.AddScoped(); - + if (contextOptions.LoadFake) + { + + + } + else + { + //services.AddScoped(); + } + //services.AddScoped, GenericRepository>(); + //services.AddScoped, FakeCollaborateurRepository>(); + services.AddScoped(); services.AddScoped(); + services.AddScoped(); diff --git a/Collaborateur_Epa_Back/espacecollab.backend.api/appsettings.json b/Collaborateur_Epa_Back/espacecollab.backend.api/appsettings.json index 4a29edc..eb754e8 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.api/appsettings.json +++ b/Collaborateur_Epa_Back/espacecollab.backend.api/appsettings.json @@ -7,7 +7,7 @@ }, "AllowedHosts": "*", "Sql": { - "LoadFake": false, + "LoadFake": true, "ConnectionString": "server=127.0.0.1;uid=root;pwd=root;database=collaborateur_epa" } } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/CollaborateurApiDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/CollaborateurApiDto.cs index 6bbbb9d..eae4f66 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/CollaborateurApiDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/CollaborateurApiDto.cs @@ -1,4 +1,7 @@ -namespace espacecollab.backend.appservices.dtos +using espacecollab.backend.appservices.dtos.Mappers; +using espacecollab.backend.infrastructure.sql.dtos; + +namespace espacecollab.backend.appservices.dtos { public class CollaborateurApiDto { @@ -17,8 +20,9 @@ public Guid ReferrerId { get; set; } public Guid BusinessUnitId { get; set; } - private CollaborateurApiDto() + public CollaborateurApiDto() { + } public CollaborateurApiDto(Guid id, string name, string firstName, DateTime birthDate, EnumGenreApi gender, EnumStatutApi status, int childrenNumber, string address, string telephone, string personalMail, string apsideMail, DateTime resignationDate, Guid referrerId, Guid businessUnitId) @@ -38,5 +42,20 @@ ReferrerId = referrerId; BusinessUnitId = businessUnitId; } + + public CollaborateurApiDto(CollaborateurSqlDto entity) + { + } + + //public override CollaborateurSqlDto ToEntity() + //{ + // return new CollaborateurSqlDto(Id, Name, FirstName, BirthDate, Gender.ToEnumGenreSql(), Status.ToEnumStatutSql(), ChildrenNumber, + // Address, Telephone, PersonalMail, ApsideMail, ResignationDate, ReferrerId, BusinessUnitId); + //} + + //public override CollaborateurApiDto FromEntity(CollaborateurSqlDto entity) + //{ + // return this; + //} } } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/GenericApiDtoBase.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/GenericApiDtoBase.cs new file mode 100644 index 0000000..6f54298 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/GenericApiDtoBase.cs @@ -0,0 +1,17 @@ +using espacecollab.backend.infrastructure.sql.dtos; + +namespace espacecollab.backend.appservices.dtos +{ + public abstract class GenericApiDtoBase where T : class, IGenericSqlDto + where To : GenericApiDtoBase + { + public abstract T ToEntity(); + + public abstract To FromEntity(T entity); + + public GenericApiDtoBase(T entity) + { + FromEntity(entity); + } + } +} diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/CollaborateurApiDtoMapper.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/CollaborateurApiDtoMapper.cs index 715bc1d..7a72dab 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/CollaborateurApiDtoMapper.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/CollaborateurApiDtoMapper.cs @@ -2,14 +2,22 @@ namespace espacecollab.backend.appservices.dtos.Mappers { - public static class CollaborateurApiDtoMapper + public static class CollaborateurMapper { - public static CollaborateurApiDto ToCollaborateurApi(this CollaborateurSqlDto collaborateurSql) + public static CollaborateurApiDto ToApi(this CollaborateurSqlDto collaborateurSql) { return new CollaborateurApiDto(collaborateurSql.Id, collaborateurSql.Name, collaborateurSql.FirstName, collaborateurSql.BirthDate, collaborateurSql.Gender.ToEnumGenreApi(), collaborateurSql.Status.ToEnumStatutApi(), collaborateurSql.ChildrenNumber, collaborateurSql.Address, collaborateurSql.Telephone, collaborateurSql.PersonalMail, collaborateurSql.ApsideMail, collaborateurSql.ResignationDate, collaborateurSql.ReferrerId, collaborateurSql.BusinessUnitId); } + + public static CollaborateurSqlDto ToSql(this CollaborateurApiDto collaborateurApi) + { + return new CollaborateurSqlDto(collaborateurApi.Id, collaborateurApi.Name, collaborateurApi.FirstName, + collaborateurApi.BirthDate, collaborateurApi.Gender.ToEnumGenreSql(), collaborateurApi.Status.ToEnumStatutSql(), collaborateurApi.ChildrenNumber, + collaborateurApi.Address, collaborateurApi.Telephone, collaborateurApi.PersonalMail, collaborateurApi.ApsideMail, + collaborateurApi.ResignationDate, collaborateurApi.ReferrerId, collaborateurApi.BusinessUnitId); + } } } 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 9fb595c..b7eb349 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/EnumGenreMapper.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/EnumGenreMapper.cs @@ -6,18 +6,24 @@ namespace espacecollab.backend.appservices.dtos.Mappers { public static EnumGenreApi ToEnumGenreApi(this EnumGenreSql enumGenreSql) { - switch (enumGenreSql) + return enumGenreSql switch { - case EnumGenreSql.MASCULIN: - return EnumGenreApi.MASCULIN; - case EnumGenreSql.FEMININ: - return EnumGenreApi.FEMININ; - case EnumGenreSql.AUTRE: - return EnumGenreApi.AUTRE; - default: - return EnumGenreApi.AUTRE; - } + EnumGenreSql.MASCULIN => EnumGenreApi.MASCULIN, + EnumGenreSql.FEMININ => EnumGenreApi.FEMININ, + EnumGenreSql.AUTRE => EnumGenreApi.AUTRE, + _ => EnumGenreApi.AUTRE, + }; + } + public static EnumGenreSql ToEnumGenreSql(this EnumGenreApi enumGenreApi) + { + return enumGenreApi switch + { + EnumGenreApi.MASCULIN => EnumGenreSql.MASCULIN, + EnumGenreApi.FEMININ => EnumGenreSql.FEMININ, + EnumGenreApi.AUTRE => EnumGenreSql.AUTRE, + _ => EnumGenreSql.AUTRE, + }; } } } 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 c940f38..cde5356 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/EnumStatutMapper.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/EnumStatutMapper.cs @@ -6,19 +6,26 @@ namespace espacecollab.backend.appservices.dtos.Mappers { public static EnumStatutApi ToEnumStatutApi(this EnumStatutSql enumStatutSql) { - switch (enumStatutSql) + return enumStatutSql switch { - case EnumStatutSql.STAGIAIRE: - return EnumStatutApi.STAGIAIRE; - case EnumStatutSql.NONCADRE: - return EnumStatutApi.NONCADRE; - case EnumStatutSql.CADRE: - return EnumStatutApi.CADRE; - case EnumStatutSql.ALTERNANT: - return EnumStatutApi.ALTERNANT; - default: return EnumStatutApi.NONCADRE; - } + EnumStatutSql.STAGIAIRE => EnumStatutApi.STAGIAIRE, + EnumStatutSql.NONCADRE => EnumStatutApi.NONCADRE, + EnumStatutSql.CADRE => EnumStatutApi.CADRE, + EnumStatutSql.ALTERNANT => EnumStatutApi.ALTERNANT, + _ => EnumStatutApi.NONCADRE, + }; + } + public static EnumStatutSql ToEnumStatutSql(this EnumStatutApi enumStatutApi) + { + return enumStatutApi switch + { + EnumStatutApi.STAGIAIRE => EnumStatutSql.STAGIAIRE, + EnumStatutApi.NONCADRE => EnumStatutSql.NONCADRE, + EnumStatutApi.CADRE => EnumStatutSql.CADRE, + EnumStatutApi.ALTERNANT => EnumStatutSql.ALTERNANT, + _ => EnumStatutSql.NONCADRE, + }; } } } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices/CollaborateursServices.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices/CollaborateursServices.cs index 24d92c9..df4d4b3 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.appservices/CollaborateursServices.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices/CollaborateursServices.cs @@ -1,5 +1,8 @@ using espacecollab.backend.appservices.dtos; using espacecollab.backend.appservices.dtos.Mappers; +using espacecollab.backend.infrastructure.sql.dtos; +using espacecollab.backend.infrastructure.sql.FakeRepo; +using espacecollab.backend.infrastructure.sql.SqlRepo; using espacecollab.backend.infrastructure.sql.SqlRepo.Interface; namespace espacecollab.backend.appservices @@ -8,14 +11,78 @@ namespace espacecollab.backend.appservices { private ICollaborateurRepository CollaborateurRepository { get; } - public CollaborateursServices(ICollaborateurRepository collaborateurRepository) + public CollaborateursServices(ICollaborateurRepository collaborateur) { - CollaborateurRepository = collaborateurRepository; + CollaborateurRepository = collaborateur; } public IEnumerable GetCollaborateurs() { - return CollaborateurRepository.GetAllCollaborateurs().Select(collaborateurSql => collaborateurSql.ToCollaborateurApi()); + return CollaborateurRepository.GetAll().Select(collaborateurSql => collaborateurSql.ToApi()); } + + public CollaborateurApiDto? GetCollaborateurById(Guid id) + { + return CollaborateurRepository.GetById(id)?.ToApi(); + } + + public CollaborateurApiDto? AddCollaborateur(CollaborateurApiDto collaborateurApi) + { + CollaborateurSqlDto collaborateurSql = collaborateurApi.ToSql(); + if (collaborateurSql == null) + return null; + CollaborateurRepository.Add(collaborateurSql); + return collaborateurApi; + } + + public CollaborateurApiDto? DeleteCollaborateur(CollaborateurApiDto collaborateurApi) + { + CollaborateurSqlDto collaborateurSql = collaborateurApi.ToSql(); + if (collaborateurSql == null) + return null; + CollaborateurRepository.Delete(collaborateurSql); + return collaborateurApi; + } + + //public new CollaborateurSqlDto? Delete(CollaborateurSqlDto entity) + //{ + // Collaborateurs.Remove(entity); + // return entity; + //} + + //public new IEnumerable GetAll() + //{ + // return Collaborateurs; + //} + + //public new CollaborateurSqlDto? Update(CollaborateurSqlDto collaborateur) + //{ + // CollaborateurSqlDto? oldCollab = Collaborateurs.FirstOrDefault(entity => entity.Id == collaborateur.Id); + // if (oldCollab == null) + // { + // Collaborateurs.Add(collaborateur); + // return collaborateur; + // } + // Collaborateurs.Remove(oldCollab); + // Collaborateurs.Add(collaborateur); + // return collaborateur; + //} + + ////méthodes spécifiques à l'interface ICollaborateurRepository + //public IList? GetCollaborateursByBusinessUnit(Guid businessUnitId) + //{ + // return Collaborateurs.Where(entity => entity.BusinessUnitId == businessUnitId).ToList(); + //} + + + //public IList? GetCollaborateursByReferrer(Guid referrerId) + //{ + // return Collaborateurs.Where(entity => entity.ReferrerId == referrerId).ToList(); + //} + + //public CollaborateurSqlDto? GetCollaborateurByApsideMail(string apsideMail) + //{ + // return Collaborateurs.FirstOrDefault(entity => entity.ApsideMail == apsideMail); + //} } } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices/GenericsServices.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices/GenericsServices.cs index c17df44..494ce31 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.appservices/GenericsServices.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices/GenericsServices.cs @@ -1,42 +1,49 @@ -using espacecollab.backend.infrastructure.sql.SqlRepo; +using espacecollab.backend.appservices.dtos; +using espacecollab.backend.infrastructure.sql.dtos; using espacecollab.backend.infrastructure.sql.SqlRepo.Interface; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace espacecollab.backend.appservices { - public class GenericsServices - { - private IGenericRepository genericRepository { get; } - - public GenericsServices(IGenericRepository genericRepository) - { - this.genericRepository = genericRepository; - } - - public T? Add(T entity) where T : class - { - return genericRepository.Add(entity); - } - - public IEnumerable GetAll() where T : class - { - return genericRepository.GetAll(); - } - - public T? GetById(Guid id) where T : class, IGenericEntity - { - return genericRepository.GetById(id); - } - - public T? Update(T entity) where T : class, IGenericEntity - { - return genericRepository.Update(entity); - } - - - } + //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(Guid 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); + // } + //} } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices/IGenericsServices.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices/IGenericsServices.cs new file mode 100644 index 0000000..90cff2b --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices/IGenericsServices.cs @@ -0,0 +1,15 @@ +using espacecollab.backend.infrastructure.sql.dtos; + +namespace espacecollab.backend.appservices +{ + public interface IGenericsServices where T : class, IGenericSqlDto + { + To? Add(T entity); + + IEnumerable GetAll(); + + To? GetById(Guid id); + + To? Update(T entity); + } +} diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/AgenceSqlDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/AgenceSqlDto.cs index 7914345..42de69b 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/AgenceSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/AgenceSqlDto.cs @@ -2,7 +2,7 @@ namespace espacecollab.backend.infrastructure.sql.dtos { - public class AgenceSqlDto + public class AgenceSqlDto : IGenericSqlDto { public Guid Id { get; set; } public string Name { get; set; } @@ -18,5 +18,6 @@ namespace espacecollab.backend.infrastructure.sql.dtos Id = id; Name = name; } + } } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/BusinessUnitSqlDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/BusinessUnitSqlDto.cs index 04b205b..0b055ff 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/BusinessUnitSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/BusinessUnitSqlDto.cs @@ -2,7 +2,7 @@ namespace espacecollab.backend.infrastructure.sql.dtos { - public class BusinessUnitSqlDto + public class BusinessUnitSqlDto : IGenericSqlDto { public Guid Id { get; set; } public string Name { get; set; } @@ -20,5 +20,7 @@ namespace espacecollab.backend.infrastructure.sql.dtos Name = name; AgenceId = agenceId; } + + } } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurAppartientBusinessUnitSqlDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurAppartientBusinessUnitSqlDto.cs index c9858c5..ff4beed 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurAppartientBusinessUnitSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurAppartientBusinessUnitSqlDto.cs @@ -7,6 +7,7 @@ namespace espacecollab.backend.infrastructure.sql.dtos.Associations public Guid CollaborateurId { get; set; } public Guid BusinessUnitId { get; set; } + [ExcludeFromCodeCoverage] private CollaborateurAppartientBusinessUnitSqlDto() { @@ -17,5 +18,7 @@ namespace espacecollab.backend.infrastructure.sql.dtos.Associations CollaborateurId = collaborateurId; BusinessUnitId = businessUnitId; } + + } } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurCollaboreProjetSqlDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurCollaboreProjetSqlDto.cs index ad03f99..2f9d323 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurCollaboreProjetSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurCollaboreProjetSqlDto.cs @@ -19,5 +19,6 @@ namespace espacecollab.backend.infrastructure.sql.dtos ProjetId = projetId; IsManager = isManager; } + } } 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 909ec84..705427d 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurEstFonctionSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurEstFonctionSqlDto.cs @@ -2,7 +2,7 @@ namespace espacecollab.backend.infrastructure.sql.dtos.Associations { - public class CollaborateurEstFonctionSqlDto + public class CollaborateurEstFonctionSqlDto { public Guid CollaborateurId { get; set; } public Guid FonctionId { get; set; } @@ -17,5 +17,7 @@ namespace espacecollab.backend.infrastructure.sql.dtos.Associations CollaborateurId = collaborateurId; FonctionId = fonctionId; } + + } } 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 89d774d..04dd16c 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurSqlDto.cs @@ -2,7 +2,7 @@ namespace espacecollab.backend.infrastructure.sql.dtos { - public class CollaborateurSqlDto + public class CollaborateurSqlDto : IGenericSqlDto { public Guid Id { get; set; } public string Name { get; set; } @@ -41,5 +41,6 @@ namespace espacecollab.backend.infrastructure.sql.dtos ReferrerId = referrerId; BusinessUnitId = businessUnitId; } + } } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/FonctionSqlDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/FonctionSqlDto.cs index 748ad5f..066eafe 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/FonctionSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/FonctionSqlDto.cs @@ -2,7 +2,7 @@ namespace espacecollab.backend.infrastructure.sql.dtos { - public class FonctionSqlDto + public class FonctionSqlDto : IGenericSqlDto { public Guid Id { get; set; } public string Name { get; set; } @@ -17,5 +17,7 @@ namespace espacecollab.backend.infrastructure.sql.dtos Id = id; Name = name; } + + } } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/IGenericSqlDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/IGenericSqlDto.cs new file mode 100644 index 0000000..6d34bb2 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/IGenericSqlDto.cs @@ -0,0 +1,8 @@ +namespace espacecollab.backend.infrastructure.sql.dtos +{ + public interface IGenericSqlDto + { + public Guid Id { get; set; } + + } +} 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 5d9a9e5..7d0482a 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/PeriodeEssaiSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/PeriodeEssaiSqlDto.cs @@ -2,7 +2,7 @@ namespace espacecollab.backend.infrastructure.sql.dtos { - public class PeriodeEssaiSqlDto + public class PeriodeEssaiSqlDto : IGenericSqlDto { public Guid Id { get; set; } public DateTime StartingDate { get; set; } @@ -27,5 +27,7 @@ namespace espacecollab.backend.infrastructure.sql.dtos Issue = issue; CollaborateurId = collaborateurId; } + + } } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ProjetSqlDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ProjetSqlDto.cs index 11080af..2ba06aa 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ProjetSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ProjetSqlDto.cs @@ -2,7 +2,7 @@ namespace espacecollab.backend.infrastructure.sql.dtos { - public class ProjetSqlDto + public class ProjetSqlDto : IGenericSqlDto { public Guid Id { get; set; } public string Name { get; set; } @@ -25,5 +25,6 @@ namespace espacecollab.backend.infrastructure.sql.dtos StartingDate = startingDate; EndingDate = endingDate; } + } } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ProjetUtiliseTechnologieSqlDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ProjetUtiliseTechnologieSqlDto.cs index e8bd1d6..513ce2d 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ProjetUtiliseTechnologieSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ProjetUtiliseTechnologieSqlDto.cs @@ -17,5 +17,6 @@ namespace espacecollab.backend.infrastructure.sql.dtos ProjetId = projetId; TechnologieId = technologieId; } + } } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ReferencementSqlDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ReferencementSqlDto.cs index 06e3253..a6fb391 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ReferencementSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ReferencementSqlDto.cs @@ -2,7 +2,7 @@ namespace espacecollab.backend.infrastructure.sql.dtos { - public class ReferencementSqlDto + public class ReferencementSqlDto : IGenericSqlDto { public Guid Id { get; set; } public DateTime StartingDate { get; set; } @@ -23,5 +23,7 @@ namespace espacecollab.backend.infrastructure.sql.dtos ReferredId = referredId; ReferrerId = referrerId; } + + } } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/SiteDeveloppeProjetSqlDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/SiteDeveloppeProjetSqlDto.cs index 4d03c62..1fe9942 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/SiteDeveloppeProjetSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/SiteDeveloppeProjetSqlDto.cs @@ -17,5 +17,8 @@ namespace espacecollab.backend.infrastructure.sql.dtos SiteId = siteId; ProjetId = projetId; } + + + } } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/SiteSqlDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/SiteSqlDto.cs index 2962b45..08088fc 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/SiteSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/SiteSqlDto.cs @@ -2,7 +2,7 @@ namespace espacecollab.backend.infrastructure.sql.dtos { - public class SiteSqlDto + public class SiteSqlDto : IGenericSqlDto { public Guid Id { get; set; } public string Name { get; set; } @@ -21,5 +21,8 @@ namespace espacecollab.backend.infrastructure.sql.dtos Address = address; BusinessUnitId = businessUnitId; } + + + } } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/TechnologieSqlDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/TechnologieSqlDto.cs index 21fa7e5..e37f529 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/TechnologieSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/TechnologieSqlDto.cs @@ -2,7 +2,7 @@ namespace espacecollab.backend.infrastructure.sql.dtos { - public class TechnologieSqlDto + public class TechnologieSqlDto : IGenericSqlDto { public Guid Id { get; set; } public string Name { get; set; } @@ -17,5 +17,6 @@ namespace espacecollab.backend.infrastructure.sql.dtos Id = id; Name = name; } + } } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/FakeRepo/FakeCollaborateurRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/FakeRepo/FakeCollaborateurRepository.cs new file mode 100644 index 0000000..99edec0 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/FakeRepo/FakeCollaborateurRepository.cs @@ -0,0 +1,81 @@ +using espacecollab.backend.infrastructure.sql.dtos; +using espacecollab.backend.infrastructure.sql.SqlRepo; +using espacecollab.backend.infrastructure.sql.SqlRepo.Interface; + +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 + { + new CollaborateurSqlDto(new Guid(), "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 Guid(), new Guid()), + new CollaborateurSqlDto(new Guid(), "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 Guid(), new Guid()) + }; + } + + //redéfinition des méthodes du GenericRepository pour fonctionner avec Fake + public new CollaborateurSqlDto? GetById(Guid id) + { + return Collaborateurs.FirstOrDefault(entity => entity.Id == id); + } + + public new CollaborateurSqlDto? Add(CollaborateurSqlDto entity) + { + Collaborateurs.Add(entity); + return entity; + } + + public new CollaborateurSqlDto? Delete(CollaborateurSqlDto entity) + { + Collaborateurs.Remove(entity); + return entity; + } + + public new IEnumerable GetAll() + { + return Collaborateurs; + } + + public new CollaborateurSqlDto? Update(CollaborateurSqlDto collaborateur) + { + CollaborateurSqlDto? oldCollab = Collaborateurs.FirstOrDefault(entity => entity.Id == collaborateur.Id); + if (oldCollab == null) + { + Collaborateurs.Add(collaborateur); + return collaborateur; + } + Collaborateurs.Remove(oldCollab); + Collaborateurs.Add(collaborateur); + return collaborateur; + } + + //méthodes spécifiques à l'interface ICollaborateurRepository + public IList? GetCollaborateursByBusinessUnit(Guid businessUnitId) + { + return Collaborateurs.Where(entity => entity.BusinessUnitId == businessUnitId).ToList(); + } + + + public IList? GetCollaborateursByReferrer(Guid referrerId) + { + return Collaborateurs.Where(entity => entity.ReferrerId == referrerId).ToList(); + } + + public CollaborateurSqlDto? GetCollaborateurByApsideMail(string apsideMail) + { + return Collaborateurs.FirstOrDefault(entity => entity.ApsideMail == apsideMail); + } + } +} 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 67ffd1b..2221b72 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/CollaborateurRepository.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/CollaborateurRepository.cs @@ -3,50 +3,22 @@ using espacecollab.backend.infrastructure.sql.SqlRepo.Interface; namespace espacecollab.backend.infrastructure.sql.SqlRepo { - public class CollaborateurRepository : ICollaborateurRepository - { + public class CollaborateurRepository : GenericRepository,ICollaborateurRepository + { private MainDbContext Context { get; } - public CollaborateurRepository(MainDbContext context) + public CollaborateurRepository(MainDbContext context) : base(context) { Context = context; } - /* TODO Récupération des collaborateurs par agence directement dans le service Collaborateur */ - - public CollaborateurSqlDto? AddCollaborateur(CollaborateurSqlDto newCollaborateur) - { - CollaborateurSqlDto? collaborateurAlreadyExists = Context.Collaborateur?.FirstOrDefault(c => c.Id == newCollaborateur.Id); - if (collaborateurAlreadyExists != null) - return null; - - Context.Set().Add(newCollaborateur); - Context.SaveChanges(); - - return Context.Set().FirstOrDefault(c => c.Id == newCollaborateur.Id); - } - - public IList? GetAllCollaborateurs() - => Context.Set().ToList(); - public IList? GetCollaborateursByBusinessUnit(Guid businessUnitId) => Context.Set().Where(collaborateur => collaborateur.BusinessUnitId == businessUnitId).ToList(); public IList? GetCollaborateursByReferrer(Guid referrerId) => Context.Set().Where(collaborateur => collaborateur.ReferrerId == referrerId).ToList(); - public CollaborateurSqlDto? GetCollaborateurById(Guid id) - => Context?.Set().SingleOrDefault(collaborateur => collaborateur.Id == id); - public CollaborateurSqlDto? GetCollaborateurByApsideMail(string apsideMail) => Context?.Set().SingleOrDefault(collaborateur => collaborateur.ApsideMail == apsideMail); - - public CollaborateurSqlDto? UpdateCollaborateur(CollaborateurSqlDto newCollaborateur) - { - Context.Set().Update(newCollaborateur); - Context.SaveChanges(); - - return Context.Set().FirstOrDefault(c => c.Id == newCollaborateur.Id); - } } } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/GenericRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/GenericRepository.cs index 57d7d78..3ecb794 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/GenericRepository.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/GenericRepository.cs @@ -1,36 +1,48 @@ -using espacecollab.backend.infrastructure.sql.SqlRepo.Interface; +using espacecollab.backend.infrastructure.sql.dtos; +using espacecollab.backend.infrastructure.sql.SqlRepo.Interface; namespace espacecollab.backend.infrastructure.sql.SqlRepo { - public class GenericRepository : IGenericRepository + public class GenericRepository : IGenericRepository where T : class, IGenericSqlDto { private MainDbContext Context { get; } + public GenericRepository() + { + + } + public GenericRepository(MainDbContext context) { Context = context; } - public T? Add(T entity) where T : class + public virtual T? Add(T entity) { return Context.Set().Add(entity) as T; } - public IList GetAll() where T : class + public virtual T? Delete(T entity) + { + return Context.Set().Remove(entity) as T; + } + + public virtual IEnumerable GetAll() { return Context.Set().ToList(); } - public T? GetById(Guid id) where T : class,IGenericEntity + public virtual T? GetById(Guid id) { return Context.Set().FirstOrDefault(entity => entity.Id == id); } - public T? Update(T entity) where T : class, IGenericEntity + public virtual T? Update(T entity) { Context.Set().Update(entity); Context.SaveChanges(); return Context.Set().FirstOrDefault(e => e.Id == entity.Id); } + } } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/IGenericEntity.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/IGenericEntity.cs deleted file mode 100644 index 3c43b76..0000000 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/IGenericEntity.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace espacecollab.backend.infrastructure.sql.SqlRepo -{ - public interface IGenericEntity - { - public Guid Id { get; set; } - } -} 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 f0470bc..fa96d0b 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 @@ -4,6 +4,7 @@ namespace espacecollab.backend.infrastructure.sql.SqlRepo.Interface { public interface IAgenceRepository { + //inutile ! AgenceSqlDto? AddAgence(AgenceSqlDto newAgence); IList? GetAllAgences(); AgenceSqlDto? GetAgenceById(AgenceSqlDto agence); 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 db3600b..2912591 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 @@ -4,6 +4,7 @@ namespace espacecollab.backend.infrastructure.sql.SqlRepo.Interface { public interface IBusinessUnitRepository { + //inutile ! BusinessUnitSqlDto? AddBusinessUnit(BusinessUnitSqlDto newBusinessUnit); IList? GetAllBusinessUnits(); BusinessUnitSqlDto? GetBusinessUnitById(BusinessUnitSqlDto businessUnit); 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 7271a87..e3b0a26 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 @@ -2,14 +2,10 @@ namespace espacecollab.backend.infrastructure.sql.SqlRepo.Interface { - public interface ICollaborateurRepository + public interface ICollaborateurRepository : IGenericRepository { - CollaborateurSqlDto? AddCollaborateur(CollaborateurSqlDto newCollaborateur); - IList? GetAllCollaborateurs(); CollaborateurSqlDto? GetCollaborateurByApsideMail(string apsideMail); - CollaborateurSqlDto? GetCollaborateurById(Guid id); IList? GetCollaborateursByBusinessUnit(Guid businessUnitId); IList? GetCollaborateursByReferrer(Guid referrerId); - CollaborateurSqlDto? UpdateCollaborateur(CollaborateurSqlDto newCollaborateur); } } \ No newline at end of file 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 e9a8feb..56c76e1 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 @@ -1,11 +1,14 @@ -namespace espacecollab.backend.infrastructure.sql.SqlRepo.Interface +using espacecollab.backend.infrastructure.sql.dtos; + +namespace espacecollab.backend.infrastructure.sql.SqlRepo.Interface { - public interface IGenericRepository + public interface IGenericRepository where T : class, IGenericSqlDto { - T? Add(T entity) where T : class; - IList GetAll() where T : class; - T? GetById(Guid id) where T : class, IGenericEntity; - T? Update(T entity) where T : class, IGenericEntity; + T? Add(T entity); + T? Delete(T entity); + IEnumerable GetAll(); + T? GetById(Guid id); + T? Update(T entity); diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/INotGenericRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/INotGenericRepository.cs deleted file mode 100644 index c816bd1..0000000 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/SqlRepo/Interface/INotGenericRepository.cs +++ /dev/null @@ -1,11 +0,0 @@ -using espacecollab.backend.infrastructure.sql.dtos; - -namespace espacecollab.backend.infrastructure.sql.SqlRepo.Interface -{ - public interface INotGenericRepository - { - CollaborateurSqlDto? GetCollaborateurByApsideMail(string apsideMail); - IList? GetCollaborateursByBusinessUnit(Guid businessUnitId); - IList? GetCollaborateursByReferrer(Guid referrerId); - } -} \ 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 4b63c0a..88aa3e1 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 @@ -4,6 +4,7 @@ namespace espacecollab.backend.infrastructure.sql.SqlRepo.Interface { public interface IPeriodeEssaiRepository { + //inutile ! PeriodeEssaiSqlDto? AddPeriodeEssai(PeriodeEssaiSqlDto newPeriodeEssai); IList? GetAllPeriodeEssais(); PeriodeEssaiSqlDto? GetPeriodeEssaiById(PeriodeEssaiSqlDto periodeEssai); 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 b2fa7a3..4378232 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 @@ -4,10 +4,6 @@ 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