diff --git a/.gitignore b/.gitignore index ade385a..af8f539 100644 --- a/.gitignore +++ b/.gitignore @@ -387,4 +387,6 @@ FodyWeavers.xsd .idea/ *.sln.iml +appsettings.Development.json +*.Development *.Development.json \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/AgenceController.cs b/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/AgenceController.cs new file mode 100644 index 0000000..dc96075 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/AgenceController.cs @@ -0,0 +1,12 @@ +using espacecollab.backend.appservices; +using espacecollab.backend.appservices.dtos; + +namespace espacecollab.backend.api.Controllers +{ + public class AgenceController : BaseController + { + public AgenceController(AgenceService agenceService) : base(agenceService) + { + } + } +} diff --git a/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/BaseController.cs b/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/BaseController.cs new file mode 100644 index 0000000..0ec5b6c --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/BaseController.cs @@ -0,0 +1,68 @@ +using espacecollab.backend.appservices.dtos.Interfaces; +using espacecollab.backend.appservices.interfaces; +using Microsoft.AspNetCore.Mvc; + +namespace espacecollab.backend.api.Controllers +{ + [Route("api/[controller]")] + [ApiController] + public abstract class BaseController : Controller where TO : class, IGenericIdApiDto + { + protected IGenericsServices Services { get; } + + protected BaseController(IGenericsServices services) + { + Services = services; + } + + [HttpGet] + public ActionResult> GetAll() + { + return Ok(Services.GetAll()); + } + + [HttpGet("{id:int:min(1)}")] + public ActionResult GetById(uint id) + { + TO? apiDtos = Services.GetById(id); + if (apiDtos == null) + return NotFound(); + + return Ok(apiDtos); + } + + [HttpPost] + public ActionResult Add(TO apiDto) + { + TO? addedApiDto = Services.Add(apiDto); + if (addedApiDto == null) + return Problem(); + + return Ok(addedApiDto); + } + + [HttpDelete("{id:int:min(1)}")] + public ActionResult Delete(uint id) + { + bool isDeleted = Services.Delete(id); + if (!isDeleted) + return Problem(); + + return Ok(); + } + + [HttpPut("{collaborateurId:int:min(1)}")] + public ActionResult Update(uint id, TO apiDto) + { + if (apiDto.Id != id) + return Unauthorized(); + + TO? updatedApiDto = Services.Update(apiDto); + if (updatedApiDto == null) + return Problem(); + + return Ok(updatedApiDto); + + } + } +} diff --git a/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/CollaborateursController.cs b/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/CollaborateursController.cs new file mode 100644 index 0000000..d23bff9 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/CollaborateursController.cs @@ -0,0 +1,48 @@ +using espacecollab.backend.appservices; +using espacecollab.backend.appservices.dtos; +using Microsoft.AspNetCore.Mvc; + +namespace espacecollab.backend.api.Controllers +{ + //[Route("api/[controller]")] + //[ApiController] + public class CollaborateursController : BaseController + { + private CollaborateursServices CollaborateursServices { get; } + + public CollaborateursController(CollaborateursServices collaborateursServices) : base(collaborateursServices) + { + CollaborateursServices = collaborateursServices; + } + + [HttpGet("businessunit/{businessUnitId:int:min(1)}")] + public ActionResult> GetCollaborateursByBusinessUnit(uint businessUnitId) + { + IEnumerable collaborateurs = CollaborateursServices.GetCollaborateursByBusinessUnit(businessUnitId); + if (!collaborateurs.Any()) + return NotFound(); + + return Ok(collaborateurs); + } + + [HttpGet("referrer/{referrerId:int:min(1)}")] + public ActionResult> GetCollaborateursByReferrer(uint referrerId) + { + IEnumerable collaborateurs = CollaborateursServices.GetCollaborateursByReferrer(referrerId); + if (!collaborateurs.Any()) + return NotFound(); + + return Ok(collaborateurs); + } + + [HttpGet("apsidemail/{apsideMail:minlength(1):regex(^\\S.*)}")] + public ActionResult GetCollaborateurByApsideMail(string apsideMail) + { + CollaborateurApiDto? collaborateur = CollaborateursServices.GetCollaborateurByApsideMail(apsideMail); + if (collaborateur == null) + return NotFound(); + + return Ok(collaborateur); + } + } +} diff --git a/Collaborateur_Epa_Back/espacecollab.backend.api/Program.cs b/Collaborateur_Epa_Back/espacecollab.backend.api/Program.cs index 48863a6..edf6cfb 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.api/Program.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.api/Program.cs @@ -1,25 +1,17 @@ -var builder = WebApplication.CreateBuilder(args); - -// Add services to the container. - -builder.Services.AddControllers(); -// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle -builder.Services.AddEndpointsApiExplorer(); -builder.Services.AddSwaggerGen(); - -var app = builder.Build(); - -// Configure the HTTP request pipeline. -if (app.Environment.IsDevelopment()) +namespace espacecollab.backend.api { - app.UseSwagger(); - app.UseSwaggerUI(); + public static class Program + { + public static void Main(string[] args) + { + CreateHostBuilder(args).Build().Run(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); + } } - -app.UseHttpsRedirection(); - -app.UseAuthorization(); - -app.MapControllers(); - -app.Run(); diff --git a/Collaborateur_Epa_Back/espacecollab.backend.api/Register.cs b/Collaborateur_Epa_Back/espacecollab.backend.api/Register.cs new file mode 100644 index 0000000..603e14a --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.api/Register.cs @@ -0,0 +1,29 @@ +using espacecollab.backend.appservices; +using espacecollab.backend.infrastructure.fake; +using espacecollab.backend.infrastructure.interfaces; +using espacecollab.backend.infrastructure.sql; +using espacecollab.backend.infrastructure.sql.Options; +using espacecollab.backend.infrastructure.sql.Repository; + +namespace espacecollab.backend.api; + +internal static class Register +{ + public static void InjectDependencies(IServiceCollection services, SqlOption contextOptions) + { + services.AddScoped(); + services.AddScoped(); + + if (contextOptions.LoadFake) + { + services.AddSingleton(); + services.AddSingleton(); + } + else + { + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + } + } +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.api/Startup.cs b/Collaborateur_Epa_Back/espacecollab.backend.api/Startup.cs new file mode 100644 index 0000000..1231a37 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.api/Startup.cs @@ -0,0 +1,52 @@ +using espacecollab.backend.infrastructure.sql.Options; + +namespace espacecollab.backend.api +{ + public class Startup + { + public IConfiguration Configuration { get; } + public Startup(IConfiguration configuration) + { + Configuration = configuration; + } + + // 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 sqlOptions = sqlSection.Get(); + + services.AddControllers(); + services.AddRouting(options => options.LowercaseUrls = true); + + services.AddEndpointsApiExplorer(); + services.AddSwaggerGen(); + + Register.InjectDependencies(services, sqlOptions); + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + + app.UseSwagger(); + app.UseSwaggerUI(); + + app.UseHttpsRedirection(); + + app.UseRouting(); + + app.UseAuthorization(); + + app.UseEndpoints(endpoints => + { + endpoints.MapControllers(); + }); + } + } +} diff --git a/Collaborateur_Epa_Back/espacecollab.backend.api/appsettings.json b/Collaborateur_Epa_Back/espacecollab.backend.api/appsettings.json index 10f68b8..eb754e8 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.api/appsettings.json +++ b/Collaborateur_Epa_Back/espacecollab.backend.api/appsettings.json @@ -5,5 +5,9 @@ "Microsoft.AspNetCore": "Warning" } }, - "AllowedHosts": "*" + "AllowedHosts": "*", + "Sql": { + "LoadFake": true, + "ConnectionString": "server=127.0.0.1;uid=root;pwd=root;database=collaborateur_epa" + } } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.api/espacecollab.backend.api.csproj b/Collaborateur_Epa_Back/espacecollab.backend.api/espacecollab.backend.api.csproj index 14554a8..eacb4b7 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.api/espacecollab.backend.api.csproj +++ b/Collaborateur_Epa_Back/espacecollab.backend.api/espacecollab.backend.api.csproj @@ -11,7 +11,9 @@ - + + + diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/AgenceApiDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/AgenceApiDto.cs new file mode 100644 index 0000000..630761b --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/AgenceApiDto.cs @@ -0,0 +1,8 @@ +using espacecollab.backend.appservices.dtos.Interfaces; + +namespace espacecollab.backend.appservices.dtos; + +public record AgenceApiDto(uint Id, string Name) : IGenericIdApiDto +{ + public uint Id { get; set; } = Id; +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/CollaborateurApiDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/CollaborateurApiDto.cs new file mode 100644 index 0000000..ceb58c5 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/CollaborateurApiDto.cs @@ -0,0 +1,10 @@ +using espacecollab.backend.appservices.dtos.Interfaces; + +namespace espacecollab.backend.appservices.dtos +{ + public record CollaborateurApiDto(uint Id, string Name, string FirstName, DateTime BirthDate, EnumGenreApi Gender, EnumStatutApi Status, int ChildrenNumber, string Address, + string Telephone, string PersonalMail, string ApsideMail, DateTime ResignationDate, int ReferrerId, int BusinessUnitId) : IGenericIdApiDto + { + public uint Id { get; set; } = Id; + } +} diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/EnumGenreApi.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/EnumGenreApi.cs new file mode 100644 index 0000000..9414526 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/EnumGenreApi.cs @@ -0,0 +1,9 @@ +namespace espacecollab.backend.appservices.dtos +{ + public enum EnumGenreApi + { + MASCULIN, + FEMININ, + AUTRE + } +} diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/EnumStatutApi.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/EnumStatutApi.cs new file mode 100644 index 0000000..0cad417 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/EnumStatutApi.cs @@ -0,0 +1,10 @@ +namespace espacecollab.backend.appservices.dtos +{ + public enum EnumStatutApi + { + CADRE, + NONCADRE, + ALTERNANT, + STAGIAIRE + } +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Interfaces/IGenericIdSqlDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Interfaces/IGenericIdSqlDto.cs new file mode 100644 index 0000000..167465b --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Interfaces/IGenericIdSqlDto.cs @@ -0,0 +1,7 @@ +namespace espacecollab.backend.appservices.dtos.Interfaces +{ + public interface IGenericIdApiDto + { + public uint Id { get; set; } + } +} diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/AgenceMapper.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/AgenceMapper.cs new file mode 100644 index 0000000..bb078b5 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/AgenceMapper.cs @@ -0,0 +1,15 @@ +using espacecollab.backend.infrastructure.sql.dtos; + +namespace espacecollab.backend.appservices.dtos.Mappers; + +public static class AgenceMapper +{ + public static AgenceApiDto ToApi(this AgenceSqlDto agenceSqlDto) + { + return new AgenceApiDto((uint)agenceSqlDto.Id, agenceSqlDto.Name); + } + public static AgenceSqlDto ToSql(this AgenceApiDto agenceApiDto) + { + return new AgenceSqlDto((int)agenceApiDto.Id, agenceApiDto.Name); + } +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/CollaborateurApiDtoMapper.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/CollaborateurApiDtoMapper.cs new file mode 100644 index 0000000..b604f55 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/CollaborateurApiDtoMapper.cs @@ -0,0 +1,23 @@ +using espacecollab.backend.infrastructure.sql.dtos; + +namespace espacecollab.backend.appservices.dtos.Mappers +{ + public static class CollaborateurMapper + { + public static CollaborateurApiDto ToApi(this CollaborateurSqlDto collaborateurSql) + { + return new CollaborateurApiDto((uint)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((int)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 new file mode 100644 index 0000000..ff142fc --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/EnumGenreMapper.cs @@ -0,0 +1,29 @@ +using espacecollab.backend.infrastructure.sql.dtos.Values; + +namespace espacecollab.backend.appservices.dtos.Mappers +{ + public static class EnumGenreMapper + { + public static EnumGenreApi ToEnumGenreApi(this EnumGenreSql enumGenreSql) + { + return enumGenreSql switch + { + 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 new file mode 100644 index 0000000..85a6e5d --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/EnumStatutMapper.cs @@ -0,0 +1,31 @@ +using espacecollab.backend.infrastructure.sql.dtos.Values; + +namespace espacecollab.backend.appservices.dtos.Mappers +{ + public static class EnumStatutMapper + { + public static EnumStatutApi ToEnumStatutApi(this EnumStatutSql enumStatutSql) + { + return enumStatutSql switch + { + 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.dtos/espacecollab.backend.appservices.dtos.csproj b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/espacecollab.backend.appservices.dtos.csproj index 132c02c..26c891b 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/espacecollab.backend.appservices.dtos.csproj +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/espacecollab.backend.appservices.dtos.csproj @@ -1,4 +1,4 @@ - + net6.0 @@ -6,4 +6,8 @@ enable + + + + diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices.interfaces/IGenericsServices.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices.interfaces/IGenericsServices.cs new file mode 100644 index 0000000..eeeddae --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.interfaces/IGenericsServices.cs @@ -0,0 +1,17 @@ +using espacecollab.backend.appservices.dtos.Interfaces; + +namespace espacecollab.backend.appservices.interfaces +{ + public interface IGenericsServices where T : class, IGenericIdApiDto + { + T? Add(T apiDto); + + IEnumerable GetAll(); + + T? GetById(uint id); + + T? Update(T apiDto); + + bool Delete(uint apiDtoId); + } +} diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices.interfaces/espacecollab.backend.appservices.interfaces.csproj b/Collaborateur_Epa_Back/espacecollab.backend.appservices.interfaces/espacecollab.backend.appservices.interfaces.csproj new file mode 100644 index 0000000..9e0ac7e --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.interfaces/espacecollab.backend.appservices.interfaces.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + + + + + + + + diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices/AgenceService.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices/AgenceService.cs new file mode 100644 index 0000000..fb7bfef --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices/AgenceService.cs @@ -0,0 +1,14 @@ +using espacecollab.backend.appservices.dtos; +using espacecollab.backend.appservices.dtos.Mappers; +using espacecollab.backend.infrastructure.interfaces; +using espacecollab.backend.infrastructure.sql.dtos; + +namespace espacecollab.backend.appservices; + +public class AgenceService : GenericsServices +{ + public AgenceService(IAgenceRepository agenceRepository) + :base(agenceRepository, AgenceMapper.ToApi, AgenceMapper.ToSql) + { + } +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices/CollaborateursServices.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices/CollaborateursServices.cs new file mode 100644 index 0000000..f9039c7 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices/CollaborateursServices.cs @@ -0,0 +1,36 @@ +using espacecollab.backend.appservices.dtos; +using espacecollab.backend.appservices.dtos.Mappers; +using espacecollab.backend.infrastructure.interfaces; +using espacecollab.backend.infrastructure.sql.dtos; + +namespace espacecollab.backend.appservices +{ + public class CollaborateursServices : GenericsServices + { + private ICollaborateurRepository CollaborateurRepository { get; } + + public CollaborateursServices(ICollaborateurRepository collaborateurRepository) + : base(collaborateurRepository, CollaborateurMapper.ToApi, CollaborateurMapper.ToSql) + { + CollaborateurRepository = collaborateurRepository; + } + + public IEnumerable GetCollaborateursByBusinessUnit(uint businessUnitId) + { + return CollaborateurRepository.GetCollaborateursByBusinessUnit((int)businessUnitId).Select(collaborateurSql => collaborateurSql.ToApi()); + } + + public IEnumerable GetCollaborateursByReferrer(uint referrerId) + { + return CollaborateurRepository.GetCollaborateursByReferrer((int)referrerId).Select(collaborateurSql => collaborateurSql.ToApi()); + } + + public CollaborateurApiDto? GetCollaborateurByApsideMail(string apsideMail) + { + if (string.IsNullOrEmpty(apsideMail)) + return null; + + 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 new file mode 100644 index 0000000..d1c65c2 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices/GenericsServices.cs @@ -0,0 +1,68 @@ +using espacecollab.backend.appservices.dtos.Interfaces; +using espacecollab.backend.appservices.interfaces; +using espacecollab.backend.infrastructure.interfaces; +using espacecollab.backend.infrastructure.sql.dtos.Interfaces; + +namespace espacecollab.backend.appservices +{ + public abstract class GenericsServices : IGenericsServices where T : class, IGenericIdSqlDto + where TO : class, IGenericIdApiDto + { + private Func MapperToApiDto { get; } + private Func MapperToSqlDto { get; } + + private IGenericRepository GenericRepository { get; } + + protected GenericsServices(IGenericRepository genericRepository, Func mapperToApiDto, Func mapperToSqlDto) + { + GenericRepository = genericRepository; + MapperToApiDto = mapperToApiDto; + MapperToSqlDto = mapperToSqlDto; + } + + public IEnumerable GetAll() + { + return GenericRepository.GetAll().Select(entity => MapperToApiDto(entity)).ToList(); + } + + public TO? GetById(uint id) + { + T? entity = GenericRepository.GetById((int)id); + if (entity == null) + return null; + + return MapperToApiDto(entity); + } + + public TO? Add(TO apiDto) + { + T sqlDto = MapperToSqlDto(apiDto); + + T? entitySqlValidation = GenericRepository.Add(sqlDto); + if (entitySqlValidation == null) + return null; + + return MapperToApiDto(entitySqlValidation); + } + + public TO? Update(TO apiDto) + { + if (GetById(apiDto.Id) == null) + { + return null; + } + T sqlDto = MapperToSqlDto(apiDto); + T? sqlDtoValidation = GenericRepository.Update(sqlDto); + + if (sqlDtoValidation == null) + return null; + + return MapperToApiDto(sqlDtoValidation); + } + + public bool Delete(uint apiDtoId) + { + return GenericRepository.Delete((int)apiDtoId); + } + } +} diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices/espacecollab.backend.appservices.csproj b/Collaborateur_Epa_Back/espacecollab.backend.appservices/espacecollab.backend.appservices.csproj index 132c02c..098754d 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.appservices/espacecollab.backend.appservices.csproj +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices/espacecollab.backend.appservices.csproj @@ -6,4 +6,10 @@ enable + + + + + + diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.fake/FakeAgenceRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.fake/FakeAgenceRepository.cs new file mode 100644 index 0000000..5cdd3ad --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.fake/FakeAgenceRepository.cs @@ -0,0 +1,18 @@ +using espacecollab.backend.infrastructure.interfaces; +using espacecollab.backend.infrastructure.sql.dtos; + +namespace espacecollab.backend.infrastructure.fake +{ + public class FakeAgenceRepository : GenericFakeRepository, IAgenceRepository + { + public FakeAgenceRepository() + { + Context = new List + { + new(1, "Tours"), + + new(2, "Clermont-Ferrand") + }; + } + } +} diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.fake/FakeCollaborateurRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.fake/FakeCollaborateurRepository.cs new file mode 100644 index 0000000..d6aa6bc --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.fake/FakeCollaborateurRepository.cs @@ -0,0 +1,42 @@ +using espacecollab.backend.infrastructure.interfaces; +using espacecollab.backend.infrastructure.sql.dtos; +using espacecollab.backend.infrastructure.sql.dtos.Values; + +namespace espacecollab.backend.infrastructure.fake +{ + public class FakeCollaborateurRepository : GenericFakeRepository, ICollaborateurRepository + { + public FakeCollaborateurRepository() + { + Context = new List + { + new(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), 2, 1), + + new(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), 1, 1) + }; + } + + #region méthodes spécifiques à l'interface ICollaborateurRepository + + public IList GetCollaborateursByBusinessUnit(int businessUnitId) + { + return Context.Where(entity => entity.BusinessUnitId == businessUnitId).ToList(); + } + + public IList GetCollaborateursByReferrer(int referrerId) + { + return Context.Where(entity => entity.ReferrerId == referrerId).ToList(); + } + + public CollaborateurSqlDto GetCollaborateurByApsideMail(string apsideMail) + { + return Context.First(entity => entity.ApsideMail == apsideMail); + } + + #endregion + } +} diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.fake/GenericFakeRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.fake/GenericFakeRepository.cs new file mode 100644 index 0000000..f155d9c --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.fake/GenericFakeRepository.cs @@ -0,0 +1,49 @@ +using espacecollab.backend.infrastructure.interfaces; +using espacecollab.backend.infrastructure.sql.dtos.Interfaces; + +namespace espacecollab.backend.infrastructure.fake +{ + public class GenericFakeRepository : IGenericRepository where T : class, IGenericIdSqlDto + { + protected List Context { get; set; } + + public virtual T? Add(T entity) + { + int lastId = Context.Max(e => e.Id); + entity.Id = lastId + 1; + + Context.Add(entity); + + return entity; + } + + public virtual bool Delete(int entityId) + { + T? entity = GetById(entityId); + if (entity == null) return false; + return Context.Remove(entity); + } + + public virtual IEnumerable GetAll() + { + return Context.ToList(); + } + + public virtual T? GetById(int id) + { + return Context.FirstOrDefault(entity => entity.Id == id); + } + + public virtual T? Update(T entity) + { + T? oldEntity = GetById(entity.Id); + if (oldEntity == null) + return null; + + Context.Remove(oldEntity); + Context.Add(entity); + + return Context.FirstOrDefault(e => e.Id == entity.Id); + } + } +} diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.fake/espacecollab.backend.infrastructure.fake.csproj b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.fake/espacecollab.backend.infrastructure.fake.csproj new file mode 100644 index 0000000..2b4f8c9 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.fake/espacecollab.backend.infrastructure.fake.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + + + + + + + + diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/IAgenceRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/IAgenceRepository.cs new file mode 100644 index 0000000..1443cdd --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/IAgenceRepository.cs @@ -0,0 +1,8 @@ +using espacecollab.backend.infrastructure.sql.dtos; + +namespace espacecollab.backend.infrastructure.interfaces +{ + public interface IAgenceRepository : IGenericRepository + { + } +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/IBusinessUnitRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/IBusinessUnitRepository.cs new file mode 100644 index 0000000..42a10fd --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/IBusinessUnitRepository.cs @@ -0,0 +1,8 @@ +using espacecollab.backend.infrastructure.sql.dtos; + +namespace espacecollab.backend.infrastructure.interfaces +{ + public interface IBusinessUnitRepository : IGenericRepository + { + } +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/ICollaborateurRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/ICollaborateurRepository.cs new file mode 100644 index 0000000..f89aecb --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/ICollaborateurRepository.cs @@ -0,0 +1,11 @@ +using espacecollab.backend.infrastructure.sql.dtos; + +namespace espacecollab.backend.infrastructure.interfaces +{ + public interface ICollaborateurRepository : IGenericRepository + { + CollaborateurSqlDto? GetCollaborateurByApsideMail(string apsideMail); + IList GetCollaborateursByBusinessUnit(int businessUnitId); + IList GetCollaborateursByReferrer(int referrerId); + } +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/IGenericRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/IGenericRepository.cs new file mode 100644 index 0000000..a071958 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/IGenericRepository.cs @@ -0,0 +1,14 @@ +using espacecollab.backend.infrastructure.sql.dtos.Interfaces; + +namespace espacecollab.backend.infrastructure.interfaces +{ + public interface IGenericRepository where T : class, IGenericIdSqlDto + { + T? Add(T entity); + bool Delete(int entityId); + 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.interfaces/IPeriodeEssaiRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/IPeriodeEssaiRepository.cs new file mode 100644 index 0000000..64e08f1 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/IPeriodeEssaiRepository.cs @@ -0,0 +1,8 @@ +using espacecollab.backend.infrastructure.sql.dtos; + +namespace espacecollab.backend.infrastructure.interfaces +{ + public interface IPeriodeEssaiRepository : IGenericRepository + { + } +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/IProjetRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/IProjetRepository.cs new file mode 100644 index 0000000..8738106 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/IProjetRepository.cs @@ -0,0 +1,9 @@ +using espacecollab.backend.infrastructure.sql.dtos; + +namespace espacecollab.backend.infrastructure.interfaces +{ + public interface IProjetRepository : IGenericRepository + { + IList GetProjetsByClient(string client); + } +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/IReferencementRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/IReferencementRepository.cs new file mode 100644 index 0000000..4bb453e --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/IReferencementRepository.cs @@ -0,0 +1,10 @@ +using espacecollab.backend.infrastructure.sql.dtos; + +namespace espacecollab.backend.infrastructure.interfaces +{ + public interface IReferencementRepository : IGenericRepository + { + IList? GetReferrersByCollaborateurId(int collaborateurId); + IList? GetReferrersByCollaborateurApsideMail(string apsideMail); + } +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/espacecollab.backend.infrastructure.interfaces.csproj b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/espacecollab.backend.infrastructure.interfaces.csproj new file mode 100644 index 0000000..a18f76e --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/espacecollab.backend.infrastructure.interfaces.csproj @@ -0,0 +1,13 @@ + + + + net6.0 + enable + enable + + + + + + + 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..780ffaa 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/AgenceSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/AgenceSqlDto.cs @@ -1,10 +1,11 @@ using System.Diagnostics.CodeAnalysis; +using espacecollab.backend.infrastructure.sql.dtos.Interfaces; namespace espacecollab.backend.infrastructure.sql.dtos { - public class AgenceSqlDto + public class AgenceSqlDto : IGenericIdSqlDto { - public Guid Id { get; set; } + public int Id { get; set; } public string Name { get; set; } [ExcludeFromCodeCoverage] @@ -13,10 +14,11 @@ namespace espacecollab.backend.infrastructure.sql.dtos { } - public AgenceSqlDto(Guid id, string name) + public AgenceSqlDto(int id, string name) { 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..1a8029f 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/BusinessUnitSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/BusinessUnitSqlDto.cs @@ -1,12 +1,13 @@ using System.Diagnostics.CodeAnalysis; +using espacecollab.backend.infrastructure.sql.dtos.Interfaces; namespace espacecollab.backend.infrastructure.sql.dtos { - public class BusinessUnitSqlDto + public class BusinessUnitSqlDto : IGenericIdSqlDto { - public Guid Id { get; set; } + public int Id { get; set; } public string Name { get; set; } - public Guid AgenceId { get; set; } + public int AgenceId { get; set; } [ExcludeFromCodeCoverage] @@ -14,11 +15,13 @@ namespace espacecollab.backend.infrastructure.sql.dtos { } - public BusinessUnitSqlDto(Guid id, string name, Guid agenceId) + public BusinessUnitSqlDto(int id, string name, int agenceId) { Id = id; 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..03fc86a 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurAppartientBusinessUnitSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurAppartientBusinessUnitSqlDto.cs @@ -1,21 +1,24 @@ using System.Diagnostics.CodeAnalysis; -namespace espacecollab.backend.infrastructure.sql.dtos.Associations +namespace espacecollab.backend.infrastructure.sql.dtos { public class CollaborateurAppartientBusinessUnitSqlDto { - public Guid CollaborateurId { get; set; } - public Guid BusinessUnitId { get; set; } + public int CollaborateurId { get; set; } + public int BusinessUnitId { get; set; } + [ExcludeFromCodeCoverage] private CollaborateurAppartientBusinessUnitSqlDto() { } - public CollaborateurAppartientBusinessUnitSqlDto(Guid collaborateurId, Guid businessUnitId) + public CollaborateurAppartientBusinessUnitSqlDto(int collaborateurId, int businessUnitId) { 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..0c61504 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurCollaboreProjetSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurCollaboreProjetSqlDto.cs @@ -4,8 +4,8 @@ namespace espacecollab.backend.infrastructure.sql.dtos { public class CollaborateurCollaboreProjetSqlDto { - public Guid CollaborateurId { get; set; } - public Guid ProjetId { get; set; } + public int CollaborateurId { get; set; } + public int ProjetId { get; set; } public bool IsManager { get; set; } [ExcludeFromCodeCoverage] @@ -13,11 +13,12 @@ namespace espacecollab.backend.infrastructure.sql.dtos { } - public CollaborateurCollaboreProjetSqlDto(Guid collaborateurId, Guid projetId, bool isManager) + public CollaborateurCollaboreProjetSqlDto(int collaborateurId, int projetId, bool isManager) { CollaborateurId = collaborateurId; ProjetId = projetId; IsManager = isManager; } + } } 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..cf7fcde 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurEstFonctionSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurEstFonctionSqlDto.cs @@ -1,21 +1,23 @@ using System.Diagnostics.CodeAnalysis; -namespace espacecollab.backend.infrastructure.sql.dtos.Associations +namespace espacecollab.backend.infrastructure.sql.dtos { public class CollaborateurEstFonctionSqlDto { - public Guid CollaborateurId { get; set; } - public Guid FonctionId { get; set;} + public int CollaborateurId { get; set; } + public int FonctionId { get; set; } [ExcludeFromCodeCoverage] private CollaborateurEstFonctionSqlDto() { } - public CollaborateurEstFonctionSqlDto(Guid collaborateurId, Guid fonctionId) + public CollaborateurEstFonctionSqlDto(int collaborateurId, int fonctionId) { 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 b7917d2..e1adf0f 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurSqlDto.cs @@ -1,30 +1,38 @@ -using espacecollab.backend.infrastructure.sql.dtos.Enums; +using espacecollab.backend.infrastructure.sql.dtos.Values; using System.Diagnostics.CodeAnalysis; +using espacecollab.backend.infrastructure.sql.dtos.Interfaces; namespace espacecollab.backend.infrastructure.sql.dtos { - public class CollaborateurSqlDto + public class CollaborateurSqlDto : IGenericIdSqlDto { - public Guid Id { get; set; } + public int Id { get; set; } public string Name { get; set; } public string FirstName { get; set; } public DateTime BirthDate { get; set; } - public EnumGenre Gender { get; set; } - public EnumStatut Status { get; set; } + public EnumGenreSql Gender { get; set; } + public EnumStatutSql Status { get; set; } public int ChildrenNumber { get; set; } public string Address { get; set; } public string Telephone { get; set; } public string PersonalMail { get; set; } public string ApsideMail { get; set; } public DateTime ResignationDate { get; set; } - public Guid ReferrerId { get; set; } + public int ReferrerId { get; set; } + public int BusinessUnitId { get; set; } [ExcludeFromCodeCoverage] private CollaborateurSqlDto() { + Name = string.Empty; + FirstName = string.Empty; + Address = string.Empty; + Telephone = string.Empty; + PersonalMail = string.Empty; + ApsideMail = string.Empty; } - public CollaborateurSqlDto(Guid id, string name, string firstName, DateTime birthDate, EnumGenre gender, EnumStatut status, int childrenNumber, string address, string telephone, string personalMail, string apsideMail, DateTime resignationDate, Guid referrerId) + 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) { Id = id; Name = name; @@ -39,6 +47,8 @@ namespace espacecollab.backend.infrastructure.sql.dtos ApsideMail = apsideMail; ResignationDate = resignationDate; ReferrerId = referrerId; + BusinessUnitId = businessUnitId; } + } } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/EnumGenre.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/EnumGenre.cs deleted file mode 100644 index 83c9bef..0000000 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/EnumGenre.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace espacecollab.backend.infrastructure.sql.dtos.Enums -{ - public enum EnumGenre - { - MASCULIN, - FEMININ, - AUTRE - } -} diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/EnumStatut.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/EnumStatut.cs deleted file mode 100644 index 2db3de5..0000000 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/EnumStatut.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace espacecollab.backend.infrastructure.sql.dtos.Enums -{ - public enum EnumStatut - { - CADRE, - NONCADRE, - ALTERNANT, - STAGIAIRE - } -} 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..0d67697 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/FonctionSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/FonctionSqlDto.cs @@ -1,10 +1,11 @@ using System.Diagnostics.CodeAnalysis; +using espacecollab.backend.infrastructure.sql.dtos.Interfaces; namespace espacecollab.backend.infrastructure.sql.dtos { - public class FonctionSqlDto + public class FonctionSqlDto : IGenericIdSqlDto { - public Guid Id { get; set; } + public int Id { get; set; } public string Name { get; set; } [ExcludeFromCodeCoverage] @@ -12,10 +13,12 @@ namespace espacecollab.backend.infrastructure.sql.dtos { } - public FonctionSqlDto(Guid id, string name) + public FonctionSqlDto(int id, string name) { Id = id; Name = name; } + + } } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/Interfaces/IGenericIdSqlDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/Interfaces/IGenericIdSqlDto.cs new file mode 100644 index 0000000..ce4c282 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/Interfaces/IGenericIdSqlDto.cs @@ -0,0 +1,7 @@ +namespace espacecollab.backend.infrastructure.sql.dtos.Interfaces +{ + public interface IGenericIdSqlDto + { + public int 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 118637a..7379399 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/PeriodeEssaiSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/PeriodeEssaiSqlDto.cs @@ -1,22 +1,26 @@ -using System.Diagnostics.CodeAnalysis; +using espacecollab.backend.infrastructure.sql.dtos.Values; +using System.Diagnostics.CodeAnalysis; +using espacecollab.backend.infrastructure.sql.dtos.Interfaces; namespace espacecollab.backend.infrastructure.sql.dtos { - public class PeriodeEssaiSqlDto + public class PeriodeEssaiSqlDto : IGenericIdSqlDto { - public Guid Id { get; set; } + public int Id { get; set; } public DateTime StartingDate { get; set; } public DateTime PlannedEndingDate { get; set; } public DateTime RealEndingDate { get; set; } public string Comment { get; set; } - public EnumIssue Issue { get; set; } + public EnumIssueSql Issue { get; set; } + public int CollaborateurId { get; set; } [ExcludeFromCodeCoverage] private PeriodeEssaiSqlDto() { + Comment = string.Empty; } - public PeriodeEssaiSqlDto(Guid id, DateTime startingDate, DateTime plannedEndingDate, DateTime realEndingDate, string comment, EnumIssue issue) + public PeriodeEssaiSqlDto(int id, DateTime startingDate, DateTime plannedEndingDate, DateTime realEndingDate, string comment, EnumIssueSql issue, int collaborateurId) { Id = id; StartingDate = startingDate; @@ -24,6 +28,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.dtos/ProjetSqlDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ProjetSqlDto.cs index 11080af..62df00f 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ProjetSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ProjetSqlDto.cs @@ -1,10 +1,11 @@ using System.Diagnostics.CodeAnalysis; +using espacecollab.backend.infrastructure.sql.dtos.Interfaces; namespace espacecollab.backend.infrastructure.sql.dtos { - public class ProjetSqlDto + public class ProjetSqlDto : IGenericIdSqlDto { - public Guid Id { get; set; } + public int Id { get; set; } public string Name { get; set; } public string Client { get; set; } public string Description { get; set; } @@ -16,7 +17,7 @@ namespace espacecollab.backend.infrastructure.sql.dtos { } - public ProjetSqlDto(Guid id, string name, string client, string description, DateTime startingDate, DateTime endingDate) + public ProjetSqlDto(int id, string name, string client, string description, DateTime startingDate, DateTime endingDate) { Id = id; Name = name; 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..bf47a6a 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ProjetUtiliseTechnologieSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ProjetUtiliseTechnologieSqlDto.cs @@ -4,15 +4,15 @@ namespace espacecollab.backend.infrastructure.sql.dtos { public class ProjetUtiliseTechnologieSqlDto { - public Guid ProjetId { get; set; } - public Guid TechnologieId { get; set; } + public int ProjetId { get; set; } + public int TechnologieId { get; set; } [ExcludeFromCodeCoverage] private ProjetUtiliseTechnologieSqlDto() { } - public ProjetUtiliseTechnologieSqlDto(Guid projetId, Guid technologieId) + public ProjetUtiliseTechnologieSqlDto(int projetId, int technologieId) { 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..8bd980a 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ReferencementSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ReferencementSqlDto.cs @@ -1,21 +1,22 @@ using System.Diagnostics.CodeAnalysis; +using espacecollab.backend.infrastructure.sql.dtos.Interfaces; namespace espacecollab.backend.infrastructure.sql.dtos { - public class ReferencementSqlDto + public class ReferencementSqlDto : IGenericIdSqlDto { - public Guid Id { get; set; } + public int Id { get; set; } public DateTime StartingDate { get; set; } public DateTime EndingDate { get; set; } - public Guid ReferredId { get; set; } - public Guid ReferrerId { get; set; } + public int ReferredId { get; set; } + public int ReferrerId { get; set; } [ExcludeFromCodeCoverage] private ReferencementSqlDto() { } - public ReferencementSqlDto(Guid id, DateTime startingDate, DateTime endingDate, Guid referredId, Guid referrerId) + public ReferencementSqlDto(int id, DateTime startingDate, DateTime endingDate, int referredId, int referrerId) { Id = id; StartingDate = startingDate; 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..8cc3395 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/SiteDeveloppeProjetSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/SiteDeveloppeProjetSqlDto.cs @@ -4,18 +4,21 @@ namespace espacecollab.backend.infrastructure.sql.dtos { public class SiteDeveloppeProjetSqlDto { - public Guid SiteId { get; set; } - public Guid ProjetId { get; set; } + public int SiteId { get; set; } + public int ProjetId { get; set; } [ExcludeFromCodeCoverage] private SiteDeveloppeProjetSqlDto() { } - public SiteDeveloppeProjetSqlDto(Guid siteId, Guid projetId) + public SiteDeveloppeProjetSqlDto(int siteId, int projetId) { 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..216ca5d 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/SiteSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/SiteSqlDto.cs @@ -1,25 +1,29 @@ using System.Diagnostics.CodeAnalysis; +using espacecollab.backend.infrastructure.sql.dtos.Interfaces; namespace espacecollab.backend.infrastructure.sql.dtos { - public class SiteSqlDto + public class SiteSqlDto : IGenericIdSqlDto { - public Guid Id { get; set; } + public int Id { get; set; } public string Name { get; set; } public string Address { get; set; } - public Guid BusinessUnitId { get; set; } + public int BusinessUnitId { get; set; } [ExcludeFromCodeCoverage] private SiteSqlDto() { } - public SiteSqlDto(Guid id, string name, string address, Guid businessUnitId) + public SiteSqlDto(int id, string name, string address, int businessUnitId) { Id = id; Name = name; 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 73f5028..cf53ce5 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/TechnologieSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/TechnologieSqlDto.cs @@ -1,8 +1,11 @@ -namespace espacecollab.backend.infrastructure.sql.dtos +using System.Diagnostics.CodeAnalysis; +using espacecollab.backend.infrastructure.sql.dtos.Interfaces; + +namespace espacecollab.backend.infrastructure.sql.dtos { - public class TechnologieSqlDto + public class TechnologieSqlDto : IGenericIdSqlDto { - public Guid Id { get; set; } + public int Id { get; set; } public string Name { get; set; } [ExcludeFromCodeCoverage] @@ -10,10 +13,11 @@ { } - public TechnologieSqlDto(Guid id, string name) + public TechnologieSqlDto(int id, string name) { Id = id; Name = name; } + } } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/Values/EnumGenreSql.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/Values/EnumGenreSql.cs new file mode 100644 index 0000000..f3298bc --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/Values/EnumGenreSql.cs @@ -0,0 +1,9 @@ +namespace espacecollab.backend.infrastructure.sql.dtos.Values +{ + public enum EnumGenreSql + { + MASCULIN, + FEMININ, + AUTRE + } +} diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/EnumIssue.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/Values/EnumIssueSql.cs similarity index 58% rename from Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/EnumIssue.cs rename to Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/Values/EnumIssueSql.cs index faf7bd1..63e990c 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/EnumIssue.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/Values/EnumIssueSql.cs @@ -1,6 +1,6 @@ -namespace espacecollab.backend.infrastructure.sql.dtos +namespace espacecollab.backend.infrastructure.sql.dtos.Values { - public enum EnumIssue + public enum EnumIssueSql { VALIDEE, PROLONGEE_COLLAB, diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/Values/EnumStatutSql.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/Values/EnumStatutSql.cs new file mode 100644 index 0000000..d0284a3 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/Values/EnumStatutSql.cs @@ -0,0 +1,10 @@ +namespace espacecollab.backend.infrastructure.sql.dtos.Values +{ + public enum EnumStatutSql + { + CADRE, + NONCADRE, + ALTERNANT, + STAGIAIRE + } +} diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/MainDbContext.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/MainDbContext.cs new file mode 100644 index 0000000..8642097 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/MainDbContext.cs @@ -0,0 +1,23 @@ +using espacecollab.backend.infrastructure.sql.Options; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Options; +namespace espacecollab.backend.infrastructure.sql +{ + public class MainDbContext : DbContext + { + private IOptions SqlSettings { get; } + + public MainDbContext(IOptions sqlSettings) + { + SqlSettings = sqlSettings; + } + + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + optionsBuilder.UseSqlServer(SqlSettings.Value.ConnectionString, builder => + { + builder.EnableRetryOnFailure(5, TimeSpan.FromSeconds(10), null); + }); + } + } +} diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Options/SqlOption.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Options/SqlOption.cs new file mode 100644 index 0000000..f741343 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Options/SqlOption.cs @@ -0,0 +1,14 @@ +namespace espacecollab.backend.infrastructure.sql.Options +{ + public class SqlOption + { + public static string Key => "Sql"; + public bool LoadFake { get; set; } + public string ConnectionString { get; set; } + + public SqlOption() + { + ConnectionString = string.Empty; + } + } +} diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Repository/AgenceSqlRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Repository/AgenceSqlRepository.cs new file mode 100644 index 0000000..a5f569b --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Repository/AgenceSqlRepository.cs @@ -0,0 +1,11 @@ +using espacecollab.backend.infrastructure.interfaces; +using espacecollab.backend.infrastructure.sql.dtos; + +namespace espacecollab.backend.infrastructure.sql.Repository; + +public class AgenceSqlRepository : GenericSqlRepository, IAgenceRepository +{ + public AgenceSqlRepository(MainDbContext context) : base(context) + { + } +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Repository/CollaborateurSqlRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Repository/CollaborateurSqlRepository.cs new file mode 100644 index 0000000..f24bf5f --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Repository/CollaborateurSqlRepository.cs @@ -0,0 +1,22 @@ +using espacecollab.backend.infrastructure.interfaces; +using espacecollab.backend.infrastructure.sql.dtos; + +namespace espacecollab.backend.infrastructure.sql.Repository +{ + public class CollaborateurSqlRepository : GenericSqlRepository, ICollaborateurRepository + { + public CollaborateurSqlRepository(MainDbContext context) : base(context) + { + Context = context; + } + + public IList GetCollaborateursByBusinessUnit(int businessUnitId) + => Context.Set().Where(collaborateur => collaborateur.BusinessUnitId == businessUnitId).ToList(); + + public IList GetCollaborateursByReferrer(int referrerId) + => Context.Set().Where(collaborateur => collaborateur.ReferrerId == referrerId).ToList(); + + public CollaborateurSqlDto? GetCollaborateurByApsideMail(string apsideMail) + => Context?.Set().SingleOrDefault(collaborateur => collaborateur.ApsideMail == apsideMail); + } +} diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Repository/GenericSqlRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Repository/GenericSqlRepository.cs new file mode 100644 index 0000000..f1986bf --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Repository/GenericSqlRepository.cs @@ -0,0 +1,47 @@ +using espacecollab.backend.infrastructure.interfaces; +using espacecollab.backend.infrastructure.sql.dtos.Interfaces; + +namespace espacecollab.backend.infrastructure.sql.Repository +{ + public class GenericSqlRepository : IGenericRepository where T : class, IGenericIdSqlDto + { + protected MainDbContext Context { get; set; } + + public GenericSqlRepository(MainDbContext context) + { + Context = context; + } + + public virtual T? Add(T entity) + { + return Context.Set().Add(entity) as T; + } + + public virtual bool Delete(int entityId) + { + T? entity = GetById(entityId); + if (entity == null) return false; + Context.Set().Remove(entity); + + return Context.SaveChanges() == 1; + } + + public virtual IEnumerable GetAll() + { + return Context.Set().ToList(); + } + + public virtual T? GetById(int id) + { + return Context.Set().FirstOrDefault(entity => entity.Id == id); + } + + 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/db/db_1_0_0.sql b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/db/db_1_0_0.sql index 344c6bd..aa2f461 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/db/db_1_0_0.sql +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/db/db_1_0_0.sql @@ -46,19 +46,6 @@ CREATE TABLE IF NOT EXISTS Technologie( PRIMARY KEY (Id) ); - - -DROP TABLE IF EXISTS PeriodeEssai; -CREATE TABLE IF NOT EXISTS PeriodeEssai( - Id int NOT NULL AUTO_INCREMENT, - StartingDate date NOT NULL, - PlannedEndingDate date NOT NULL, - RealEndingDate date NOT NULL, - Comment varchar(100) NOT NULL, - Issue ENUM('VALIDEE','PROLONGEE_COLLAB','PROLONGEE_APSIDE','ARRETEE_COLLAB','ARRETEE_APSIDE') NOT NULL, - PRIMARY KEY (Id) -); - DROP TABLE IF EXISTS Fonction; CREATE TABLE IF NOT EXISTS Fonction( Id int NOT NULL UNIQUE, @@ -69,7 +56,7 @@ CREATE TABLE IF NOT EXISTS Fonction( DROP TABLE IF EXISTS Collaborateur; CREATE TABLE IF NOT EXISTS Collaborateur( Id int NOT NULL AUTO_INCREMENT, - Name varchar(100) NOT NULL UNIQUE, + Name varchar(100) NOT NULL, FirstName varchar(100) NOT NULL, BirthDate date NOT NULL, Gender ENUM('MASCULIN','FEMININ','AUTRE') NOT NULL, @@ -85,6 +72,19 @@ CREATE TABLE IF NOT EXISTS Collaborateur( PRIMARY KEY (Id) ); +DROP TABLE IF EXISTS PeriodeEssai; +CREATE TABLE IF NOT EXISTS PeriodeEssai( + Id int NOT NULL AUTO_INCREMENT, + StartingDate date NOT NULL, + PlannedEndingDate date NOT NULL, + RealEndingDate date NOT NULL, + Comment varchar(100) NOT NULL, + Issue ENUM('VALIDEE','PROLONGEE_COLLAB','PROLONGEE_APSIDE','ARRETEE_COLLAB','ARRETEE_APSIDE') NOT NULL, + CollaborateurId int NOT NULL, + CONSTRAINT FK_COLLABORATEUR_PERIODEESSAI FOREIGN KEY (CollaborateurId) REFERENCES Collaborateur(Id), + PRIMARY KEY (Id) +); + DROP TABLE IF EXISTS Referencement; CREATE TABLE IF NOT EXISTS Referencement( Id int NOT NULL AUTO_INCREMENT, diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/espacecollab.backend.infrastructure.sql.csproj b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/espacecollab.backend.infrastructure.sql.csproj index 132c02c..66c4cb9 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/espacecollab.backend.infrastructure.sql.csproj +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/espacecollab.backend.infrastructure.sql.csproj @@ -1,4 +1,4 @@ - + net6.0 @@ -6,4 +6,19 @@ enable + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + + diff --git a/Collaborateur_Epa_Back/espacecollab.backend.sln b/Collaborateur_Epa_Back/espacecollab.backend.sln index 26e96a6..0569be5 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.sln +++ b/Collaborateur_Epa_Back/espacecollab.backend.sln @@ -3,15 +3,27 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.31912.275 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "espacecollab.backend.api", "espacecollab.backend.api\espacecollab.backend.api.csproj", "{A8DEB005-D7E2-4A96-B004-A66BBF12AC54}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "espacecollab.backend.api", "espacecollab.backend.api\espacecollab.backend.api.csproj", "{A8DEB005-D7E2-4A96-B004-A66BBF12AC54}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "espacecollab.backend.appservices", "espacecollab.backend.appservices\espacecollab.backend.appservices.csproj", "{70F1BE1C-87C1-4CCF-A7E8-2A36F3F16D9E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "espacecollab.backend.appservices", "espacecollab.backend.appservices\espacecollab.backend.appservices.csproj", "{70F1BE1C-87C1-4CCF-A7E8-2A36F3F16D9E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "espacecollab.backend.appservices.dtos", "espacecollab.backend.appservices.dtos\espacecollab.backend.appservices.dtos.csproj", "{CB0CB8FC-0E53-4205-AAA3-4176211C922B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "espacecollab.backend.appservices.dtos", "espacecollab.backend.appservices.dtos\espacecollab.backend.appservices.dtos.csproj", "{CB0CB8FC-0E53-4205-AAA3-4176211C922B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "espacecollab.backend.infrastructure.sql", "espacecollab.backend.infrastructure.sql\espacecollab.backend.infrastructure.sql.csproj", "{590FF09D-0DF3-4881-8D86-E4FDAAC75FDC}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "espacecollab.backend.infrastructure.sql", "espacecollab.backend.infrastructure.sql\espacecollab.backend.infrastructure.sql.csproj", "{590FF09D-0DF3-4881-8D86-E4FDAAC75FDC}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "espacecollab.backend.infrastructure.sql.dtos", "espacecollab.backend.infrastructure.sql.dtos\espacecollab.backend.infrastructure.sql.dtos.csproj", "{26C08CE0-E6E5-4E03-8AEA-233F93218A3B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "espacecollab.backend.infrastructure.sql.dtos", "espacecollab.backend.infrastructure.sql.dtos\espacecollab.backend.infrastructure.sql.dtos.csproj", "{26C08CE0-E6E5-4E03-8AEA-233F93218A3B}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "1 Host", "1 Host", "{19237F76-6CA9-47DF-87F8-8027C78070C9}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "2 ApplicationsServices", "2 ApplicationsServices", "{CE5199B3-E423-46C1-B141-18C46473D964}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "4 Infrastructure", "4 Infrastructure", "{E29F5CA9-ABAF-4437-8633-49FF27110E6D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "espacecollab.backend.infrastructure.interfaces", "espacecollab.backend.infrastructure.interfaces\espacecollab.backend.infrastructure.interfaces.csproj", "{3E9E4801-D686-4581-8051-E0E1B036AC70}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "espacecollab.backend.infrastructure.fake", "espacecollab.backend.infrastructure.fake\espacecollab.backend.infrastructure.fake.csproj", "{48253B9B-9B42-48CF-A95F-358171BABA74}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "espacecollab.backend.appservices.interfaces", "espacecollab.backend.appservices.interfaces\espacecollab.backend.appservices.interfaces.csproj", "{7872657E-46E2-44A1-AFA6-0D3B9E45084A}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -39,10 +51,32 @@ Global {26C08CE0-E6E5-4E03-8AEA-233F93218A3B}.Debug|Any CPU.Build.0 = Debug|Any CPU {26C08CE0-E6E5-4E03-8AEA-233F93218A3B}.Release|Any CPU.ActiveCfg = Release|Any CPU {26C08CE0-E6E5-4E03-8AEA-233F93218A3B}.Release|Any CPU.Build.0 = Release|Any CPU + {3E9E4801-D686-4581-8051-E0E1B036AC70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3E9E4801-D686-4581-8051-E0E1B036AC70}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3E9E4801-D686-4581-8051-E0E1B036AC70}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3E9E4801-D686-4581-8051-E0E1B036AC70}.Release|Any CPU.Build.0 = Release|Any CPU + {48253B9B-9B42-48CF-A95F-358171BABA74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {48253B9B-9B42-48CF-A95F-358171BABA74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {48253B9B-9B42-48CF-A95F-358171BABA74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {48253B9B-9B42-48CF-A95F-358171BABA74}.Release|Any CPU.Build.0 = Release|Any CPU + {7872657E-46E2-44A1-AFA6-0D3B9E45084A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7872657E-46E2-44A1-AFA6-0D3B9E45084A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7872657E-46E2-44A1-AFA6-0D3B9E45084A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7872657E-46E2-44A1-AFA6-0D3B9E45084A}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {A8DEB005-D7E2-4A96-B004-A66BBF12AC54} = {19237F76-6CA9-47DF-87F8-8027C78070C9} + {70F1BE1C-87C1-4CCF-A7E8-2A36F3F16D9E} = {CE5199B3-E423-46C1-B141-18C46473D964} + {CB0CB8FC-0E53-4205-AAA3-4176211C922B} = {CE5199B3-E423-46C1-B141-18C46473D964} + {590FF09D-0DF3-4881-8D86-E4FDAAC75FDC} = {E29F5CA9-ABAF-4437-8633-49FF27110E6D} + {26C08CE0-E6E5-4E03-8AEA-233F93218A3B} = {E29F5CA9-ABAF-4437-8633-49FF27110E6D} + {3E9E4801-D686-4581-8051-E0E1B036AC70} = {E29F5CA9-ABAF-4437-8633-49FF27110E6D} + {48253B9B-9B42-48CF-A95F-358171BABA74} = {E29F5CA9-ABAF-4437-8633-49FF27110E6D} + {7872657E-46E2-44A1-AFA6-0D3B9E45084A} = {CE5199B3-E423-46C1-B141-18C46473D964} + EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {0A56A44C-135E-4CE4-834B-8DFDF69DC415} EndGlobalSection