diff --git a/Collaborateur_Epa_Back/espacecollab.backend.api.tests/BaseControllerTest.cs b/Collaborateur_Epa_Back/espacecollab.backend.api.tests/BaseControllerTest.cs new file mode 100644 index 0000000..e4c609a --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.api.tests/BaseControllerTest.cs @@ -0,0 +1,64 @@ +using System.Collections.Generic; +using espacecollab.backend.api.Controllers; +using espacecollab.backend.appservices.dtos.Interfaces; +using FluentAssertions; +using Microsoft.AspNetCore.Mvc; +using Xunit; + +namespace espacecollab.backend.api.tests; + +public abstract class BaseControllerTest where T : IBaseController + where TO : class, IGenericIdApiDto +{ + protected T Controller { get; set; } + protected TO NewApiDo { get; set; } + protected TO UpdateApiDo { get; set; } + + [Fact] + public void GetAllTest() + { + ActionResult> actionResult = Controller.GetAll(); + + OkObjectResult result = actionResult.Result.Should().BeOfType().Subject; + result.Value.Should().BeOfType>(); + } + + [Fact] + public void GetByIdTest() + { + uint id = 1; + + ActionResult actionResult = Controller.GetById(id); + + OkObjectResult result = actionResult.Result.Should().BeOfType().Subject; + result.Value.Should().BeOfType(); + } + + [Fact] + public void AddTest() + { + ActionResult actionResult = Controller.Add(NewApiDo); + + OkObjectResult result = actionResult.Result.Should().BeOfType().Subject; + result.Value.Should().BeOfType().Subject.Id.Should().NotBe(0); + } + + [Fact] + public void DeleteTest() + { + uint id = 1; + + ActionResult actionResult = Controller.Delete(id); + + actionResult.Result.Should().BeOfType(); + } + + [Fact] + public void UpdateTest() + { + ActionResult actionResult = Controller.Update(UpdateApiDo.Id, UpdateApiDo); + + OkObjectResult result = actionResult.Result.Should().BeOfType().Subject; + result.Value.Should().BeOfType().Subject.Id.Should().Be(UpdateApiDo.Id); + } +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.api.tests/CollaborateursControllerTest.cs b/Collaborateur_Epa_Back/espacecollab.backend.api.tests/CollaborateursControllerTest.cs new file mode 100644 index 0000000..0a02142 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.api.tests/CollaborateursControllerTest.cs @@ -0,0 +1,24 @@ +using espacecollab.backend.api.Controllers; +using espacecollab.backend.appservices; +using espacecollab.backend.appservices.dtos; +using espacecollab.backend.appservices.dtos.Values; +using espacecollab.backend.infrastructure.fake; +using System; + +namespace espacecollab.backend.api.tests; + +public class CollaborateursControllerTest : BaseControllerTest +{ + public CollaborateursControllerTest() + { + Controller = new CollaborateursController(new CollaborateursService(new FakeCollaborateurRepository())); + + NewApiDo = new CollaborateurApiDto(0, "Dupont", "Jean", new DateTime(1980, 12, 10), + EnumGenreApi.MASCULIN, EnumStatutApi.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); + + UpdateApiDo = new CollaborateurApiDto(1, "Dupont 2", "Jean", new DateTime(1980, 12, 10), + EnumGenreApi.MASCULIN, EnumStatutApi.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); + } +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.api.tests/espacecollab.backend.api.tests.csproj b/Collaborateur_Epa_Back/espacecollab.backend.api.tests/espacecollab.backend.api.tests.csproj new file mode 100644 index 0000000..0bdabab --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.api.tests/espacecollab.backend.api.tests.csproj @@ -0,0 +1,28 @@ + + + + net6.0 + enable + + false + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + diff --git a/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/AgencesController.cs b/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/AgencesController.cs new file mode 100644 index 0000000..d609273 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/AgencesController.cs @@ -0,0 +1,11 @@ +using espacecollab.backend.appservices; +using espacecollab.backend.appservices.dtos; + +namespace espacecollab.backend.api.Controllers; + +public class AgenceController : BaseController +{ + public AgenceController(AgenceService agenceService) : base(agenceService) + { + } +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/BaseController.cs b/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/BaseController.cs index 9fcc857..1a1589b 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/BaseController.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/BaseController.cs @@ -6,7 +6,7 @@ namespace espacecollab.backend.api.Controllers { [Route("api/[controller]")] [ApiController] - public abstract class BaseController : Controller where TO : class, IGenericIdApiDto + public abstract class BaseController : Controller, IBaseController where TO : class, IGenericIdApiDto { protected IGenericsServices Services { get; } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/BusinessUnitController.cs b/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/BusinessUnitController.cs new file mode 100644 index 0000000..26f5d2d --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/BusinessUnitController.cs @@ -0,0 +1,11 @@ +using espacecollab.backend.appservices; +using espacecollab.backend.appservices.dtos; + +namespace espacecollab.backend.api.Controllers; + +public class BusinessUnitController : BaseController +{ + public BusinessUnitController(BusinessUnitService businessUnitService) : base(businessUnitService) + { + } +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/BusinessUnitsController.cs b/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/BusinessUnitsController.cs new file mode 100644 index 0000000..6dd0b39 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/BusinessUnitsController.cs @@ -0,0 +1,28 @@ +using espacecollab.backend.appservices; +using espacecollab.backend.appservices.dtos; +using Microsoft.AspNetCore.Mvc; + +namespace espacecollab.backend.api.Controllers +{ + //[Route("api/[controller]")] + //[ApiController] + public class BusinessUnitsController : BaseController + { + private BusinessUnitService BusinessUnitServices { get; } + + public BusinessUnitsController(BusinessUnitService businessUnitServices) : base(businessUnitServices) + { + BusinessUnitServices = businessUnitServices; + } + + [HttpGet("agence/{agenceId:int:min(1)}")] + public ActionResult> GetBusinessUnitsByAgence(uint agenceId) + { + IEnumerable businessUnits = BusinessUnitServices.GetBusinessUnitsByAgence(agenceId); + if (!businessUnits.Any()) + return NotFound(); + + return Ok(businessUnits); + } + } +} diff --git a/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/CollaborateursController.cs b/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/CollaborateursController.cs index d23bff9..3b8af84 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/CollaborateursController.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/CollaborateursController.cs @@ -2,47 +2,44 @@ using espacecollab.backend.appservices.dtos; using Microsoft.AspNetCore.Mvc; -namespace espacecollab.backend.api.Controllers +namespace espacecollab.backend.api.Controllers; + +public class CollaborateursController : BaseController { - //[Route("api/[controller]")] - //[ApiController] - public class CollaborateursController : BaseController + private CollaborateursService CollaborateursServices { get; } + + public CollaborateursController(CollaborateursService 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) { - 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); - } + 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); } -} +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/FonctionController.cs b/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/FonctionController.cs new file mode 100644 index 0000000..1395011 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/FonctionController.cs @@ -0,0 +1,11 @@ +using espacecollab.backend.appservices; +using espacecollab.backend.appservices.dtos; + +namespace espacecollab.backend.api.Controllers; + +public class FonctionController : BaseController +{ + public FonctionController(FonctionService fonctionService) : base(fonctionService) + { + } +} \ 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/FonctionsController.cs similarity index 51% rename from Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/AgenceController.cs rename to Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/FonctionsController.cs index dc96075..81b0cf7 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/AgenceController.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/FonctionsController.cs @@ -3,9 +3,9 @@ using espacecollab.backend.appservices.dtos; namespace espacecollab.backend.api.Controllers { - public class AgenceController : BaseController + public class FonctionsController : BaseController { - public AgenceController(AgenceService agenceService) : base(agenceService) + public FonctionsController(FonctionService fonctionService) : base(fonctionService) { } } diff --git a/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/IBaseController.cs b/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/IBaseController.cs new file mode 100644 index 0000000..9a25f4b --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/IBaseController.cs @@ -0,0 +1,17 @@ +using espacecollab.backend.appservices.dtos.Interfaces; +using Microsoft.AspNetCore.Mvc; + +namespace espacecollab.backend.api.Controllers; + +public interface IBaseController where TO : class, IGenericIdApiDto +{ + ActionResult> GetAll(); + + ActionResult GetById(uint id); + + ActionResult Add(TO apiDto); + + ActionResult Delete(uint id); + + ActionResult Update(uint id, TO apiDto); +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/PeriodeEssaiController.cs b/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/PeriodeEssaiController.cs new file mode 100644 index 0000000..2247308 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/PeriodeEssaiController.cs @@ -0,0 +1,11 @@ +using espacecollab.backend.appservices; +using espacecollab.backend.appservices.dtos; + +namespace espacecollab.backend.api.Controllers; + +public class PeriodeEssaiController : BaseController +{ + public PeriodeEssaiController(PeriodeEssaiService periodeEssaiService) : base(periodeEssaiService) + { + } +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/TechnologiesController.cs b/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/TechnologiesController.cs new file mode 100644 index 0000000..cfd482e --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.api/Controllers/TechnologiesController.cs @@ -0,0 +1,12 @@ +using espacecollab.backend.appservices; +using espacecollab.backend.appservices.dtos; + +namespace espacecollab.backend.api.Controllers +{ + public class TechnologiesController : BaseController + { + public TechnologiesController(TechnologieServices technologieServices) : base(technologieServices) + { + } + } +} diff --git a/Collaborateur_Epa_Back/espacecollab.backend.api/Program.cs b/Collaborateur_Epa_Back/espacecollab.backend.api/Program.cs index edf6cfb..22a4ebb 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.api/Program.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.api/Program.cs @@ -1,17 +1,16 @@ -namespace espacecollab.backend.api +namespace espacecollab.backend.api; + +public static class Program { - public static class Program + public static void Main(string[] args) { - public static void Main(string[] args) - { - CreateHostBuilder(args).Build().Run(); - } - - public static IHostBuilder CreateHostBuilder(string[] args) => - Host.CreateDefaultBuilder(args) - .ConfigureWebHostDefaults(webBuilder => - { - webBuilder.UseStartup(); - }); + CreateHostBuilder(args).Build().Run(); } -} + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.api/Register.cs b/Collaborateur_Epa_Back/espacecollab.backend.api/Register.cs index 4616de7..088cd8e 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.api/Register.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.api/Register.cs @@ -12,19 +12,29 @@ internal static class Register public static void InjectDependencies(IServiceCollection services, SqlOption contextOptions) { services.AddCors(); - services.AddScoped(); + services.AddScoped(); services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); if (contextOptions.LoadFake) { services.AddSingleton(); services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); } else { services.AddScoped(); services.AddScoped(); services.AddScoped(); + services.AddScoped(); + 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 index e7ee256..8c6f9da 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.api/Startup.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.api/Startup.cs @@ -1,58 +1,57 @@ using espacecollab.backend.infrastructure.sql.Options; using System.Text.Json.Serialization; -namespace espacecollab.backend.api +namespace espacecollab.backend.api; + +public class Startup { - public class Startup + public IConfiguration Configuration { get; } + public Startup(IConfiguration configuration) { - public IConfiguration Configuration { get; } - public Startup(IConfiguration configuration) - { - Configuration = configuration; - } + Configuration = configuration; + } - // This method gets called by the runtime. Use this method to add services to the container. - public void ConfigureServices(IServiceCollection services) + // 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().AddJsonOptions(opt => { - IConfigurationSection sqlSection = Configuration.GetSection(SqlOption.Key); - services.Configure(sqlSection); - SqlOption sqlOptions = sqlSection.Get(); + opt.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter()); + }); ; + services.AddRouting(options => options.LowercaseUrls = true); - services.AddControllers().AddJsonOptions(opt => - { - opt.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter()); - }); ; - services.AddRouting(options => options.LowercaseUrls = true); + services.AddEndpointsApiExplorer(); + services.AddSwaggerGen(); - services.AddEndpointsApiExplorer(); - services.AddSwaggerGen(); + Register.InjectDependencies(services, sqlOptions); + } - 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.UseCors( + options => options.WithOrigins("http://localhost:4200").AllowAnyMethod().AllowAnyHeader() + ); + app.UseSwagger(); + app.UseSwaggerUI(); + + app.UseHttpsRedirection(); - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + app.UseRouting(); + + app.UseAuthorization(); + + app.UseEndpoints(endpoints => { - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - } - app.UseCors( - options => options.WithOrigins("http://localhost:4200").AllowAnyMethod().AllowAnyHeader() - ); - app.UseSwagger(); - app.UseSwaggerUI(); - - app.UseHttpsRedirection(); - - app.UseRouting(); - - app.UseAuthorization(); - - app.UseEndpoints(endpoints => - { - endpoints.MapControllers(); - }); - } + endpoints.MapControllers(); + }); } -} +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/BusinessUnitApiDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/BusinessUnitApiDto.cs new file mode 100644 index 0000000..64a1ddf --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/BusinessUnitApiDto.cs @@ -0,0 +1,8 @@ +using espacecollab.backend.appservices.dtos.Interfaces; + +namespace espacecollab.backend.appservices.dtos; + +public record BusinessUnitApiDto(uint Id, string Name, uint AgenceId) : 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 index 914f775..4c432fd 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/CollaborateurApiDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/CollaborateurApiDto.cs @@ -1,10 +1,10 @@ using espacecollab.backend.appservices.dtos.Interfaces; +using espacecollab.backend.appservices.dtos.Values; -namespace espacecollab.backend.appservices.dtos +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 record CollaborateurApiDto(uint Id, string Name, string FirstName, string BirthDate, EnumGenreApi Gender, EnumStatutApi Status, int ChildrenNumber, string Address, - string Telephone, string PersonalMail, string ApsideMail, string ResignationDate, int ReferrerId, int BusinessUnitId) : IGenericIdApiDto - { - public uint Id { get; set; } = Id; - } -} + public uint Id { get; set; } = Id; +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/EnumGenreApi.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/EnumGenreApi.cs deleted file mode 100644 index 9414526..0000000 --- a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/EnumGenreApi.cs +++ /dev/null @@ -1,9 +0,0 @@ -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 deleted file mode 100644 index 0cad417..0000000 --- a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/EnumStatutApi.cs +++ /dev/null @@ -1,10 +0,0 @@ -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/FonctionApiDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/FonctionApiDto.cs new file mode 100644 index 0000000..a839b9e --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/FonctionApiDto.cs @@ -0,0 +1,8 @@ +using espacecollab.backend.appservices.dtos.Interfaces; + +namespace espacecollab.backend.appservices.dtos; + +public record FonctionApiDto(uint Id, string Intitule) : IGenericIdApiDto +{ + public uint Id { get; set; } = Id; +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Interfaces/IGenericIdApiDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Interfaces/IGenericIdApiDto.cs new file mode 100644 index 0000000..c07391f --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Interfaces/IGenericIdApiDto.cs @@ -0,0 +1,6 @@ +namespace espacecollab.backend.appservices.dtos.Interfaces; + +public interface IGenericIdApiDto +{ + public uint Id { get; set; } +} \ 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 deleted file mode 100644 index 167465b..0000000 --- a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Interfaces/IGenericIdSqlDto.cs +++ /dev/null @@ -1,7 +0,0 @@ -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/BusinessUnitMapper.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/BusinessUnitMapper.cs new file mode 100644 index 0000000..983558a --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/BusinessUnitMapper.cs @@ -0,0 +1,15 @@ +using espacecollab.backend.infrastructure.sql.dtos; + +namespace espacecollab.backend.appservices.dtos.Mappers; + +public static class BusinessUnitMapper +{ + public static BusinessUnitApiDto ToApi(this BusinessUnitSqlDto businessUnitSqlDto) + { + return new BusinessUnitApiDto((uint)businessUnitSqlDto.Id, businessUnitSqlDto.Name, (uint)businessUnitSqlDto.AgenceId); + } + public static BusinessUnitSqlDto ToSql(this BusinessUnitApiDto businessUnitApiDto) + { + return new BusinessUnitSqlDto((int)businessUnitApiDto.Id, businessUnitApiDto.Name, (int)businessUnitApiDto.AgenceId); + } +} \ 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 index 11ab39e..8672269 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/CollaborateurApiDtoMapper.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/CollaborateurApiDtoMapper.cs @@ -1,24 +1,22 @@ using espacecollab.backend.infrastructure.sql.dtos; -using System.Globalization; -namespace espacecollab.backend.appservices.dtos.Mappers +namespace espacecollab.backend.appservices.dtos.Mappers; + +public static class CollaborateurMapper { - public static class CollaborateurMapper + public static CollaborateurApiDto ToApi(this CollaborateurSqlDto collaborateurSql) { - public static CollaborateurApiDto ToApi(this CollaborateurSqlDto collaborateurSql) - { - return new CollaborateurApiDto((uint)collaborateurSql.Id, collaborateurSql.Name, collaborateurSql.FirstName, - collaborateurSql.BirthDate.ToShortDateString(), collaborateurSql.Gender.ToEnumGenreApi(), collaborateurSql.Status.ToEnumStatutApi(), collaborateurSql.ChildrenNumber, - collaborateurSql.Address, collaborateurSql.Telephone, collaborateurSql.PersonalMail, collaborateurSql.ApsideMail, - collaborateurSql.ResignationDate.ToShortDateString(), collaborateurSql.ReferrerId, collaborateurSql.BusinessUnitId); - } + 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, - DateTime.ParseExact(collaborateurApi.BirthDate,"dd/MM/yyyy",CultureInfo.InvariantCulture), collaborateurApi.Gender.ToEnumGenreSql(), collaborateurApi.Status.ToEnumStatutSql(), collaborateurApi.ChildrenNumber, - collaborateurApi.Address, collaborateurApi.Telephone, collaborateurApi.PersonalMail, collaborateurApi.ApsideMail, - DateTime.ParseExact(collaborateurApi.ResignationDate, "dd/MM/yyyy", CultureInfo.InvariantCulture), collaborateurApi.ReferrerId, collaborateurApi.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); } -} +} \ No newline at end of file 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 ff142fc..1dc7c58 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/EnumGenreMapper.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/EnumGenreMapper.cs @@ -1,29 +1,29 @@ -using espacecollab.backend.infrastructure.sql.dtos.Values; +using espacecollab.backend.appservices.dtos.Values; +using espacecollab.backend.infrastructure.sql.dtos.Values; -namespace espacecollab.backend.appservices.dtos.Mappers +namespace espacecollab.backend.appservices.dtos.Mappers; + +public static class EnumGenreMapper { - public static class EnumGenreMapper + public static EnumGenreApi ToEnumGenreApi(this EnumGenreSql enumGenreSql) { - public static EnumGenreApi ToEnumGenreApi(this EnumGenreSql enumGenreSql) + return enumGenreSql switch { - return enumGenreSql switch - { - EnumGenreSql.MASCULIN => EnumGenreApi.MASCULIN, - EnumGenreSql.FEMININ => EnumGenreApi.FEMININ, - EnumGenreSql.AUTRE => EnumGenreApi.AUTRE, - _ => EnumGenreApi.AUTRE, - }; - } + EnumGenreSql.MASCULIN => EnumGenreApi.MASCULIN, + EnumGenreSql.FEMININ => EnumGenreApi.FEMININ, + EnumGenreSql.AUTRE => EnumGenreApi.AUTRE, + _ => EnumGenreApi.AUTRE, + }; + } - public static EnumGenreSql ToEnumGenreSql(this EnumGenreApi enumGenreApi) + public static EnumGenreSql ToEnumGenreSql(this EnumGenreApi enumGenreApi) + { + return enumGenreApi switch { - return enumGenreApi switch - { - EnumGenreApi.MASCULIN => EnumGenreSql.MASCULIN, - EnumGenreApi.FEMININ => EnumGenreSql.FEMININ, - EnumGenreApi.AUTRE => EnumGenreSql.AUTRE, - _ => EnumGenreSql.AUTRE, - }; - } + EnumGenreApi.MASCULIN => EnumGenreSql.MASCULIN, + EnumGenreApi.FEMININ => EnumGenreSql.FEMININ, + EnumGenreApi.AUTRE => EnumGenreSql.AUTRE, + _ => EnumGenreSql.AUTRE, + }; } -} +} \ No newline at end of file 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 85a6e5d..a7d1ed7 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/EnumStatutMapper.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/EnumStatutMapper.cs @@ -1,31 +1,31 @@ -using espacecollab.backend.infrastructure.sql.dtos.Values; +using espacecollab.backend.appservices.dtos.Values; +using espacecollab.backend.infrastructure.sql.dtos.Values; -namespace espacecollab.backend.appservices.dtos.Mappers +namespace espacecollab.backend.appservices.dtos.Mappers; + +public static class EnumStatutMapper { - public static class EnumStatutMapper + public static EnumStatutApi ToEnumStatutApi(this EnumStatutSql enumStatutSql) { - public static EnumStatutApi ToEnumStatutApi(this EnumStatutSql enumStatutSql) + return enumStatutSql switch { - return enumStatutSql switch - { - EnumStatutSql.STAGIAIRE => EnumStatutApi.STAGIAIRE, - EnumStatutSql.NONCADRE => EnumStatutApi.NONCADRE, - EnumStatutSql.CADRE => EnumStatutApi.CADRE, - EnumStatutSql.ALTERNANT => EnumStatutApi.ALTERNANT, - _ => 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) + public static EnumStatutSql ToEnumStatutSql(this EnumStatutApi enumStatutApi) + { + return enumStatutApi switch { - return enumStatutApi switch - { - EnumStatutApi.STAGIAIRE => EnumStatutSql.STAGIAIRE, - EnumStatutApi.NONCADRE => EnumStatutSql.NONCADRE, - EnumStatutApi.CADRE => EnumStatutSql.CADRE, - EnumStatutApi.ALTERNANT => EnumStatutSql.ALTERNANT, - _ => EnumStatutSql.NONCADRE, - }; - } + EnumStatutApi.STAGIAIRE => EnumStatutSql.STAGIAIRE, + EnumStatutApi.NONCADRE => EnumStatutSql.NONCADRE, + EnumStatutApi.CADRE => EnumStatutSql.CADRE, + EnumStatutApi.ALTERNANT => EnumStatutSql.ALTERNANT, + _ => EnumStatutSql.NONCADRE, + }; } -} +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/FonctionMapper.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/FonctionMapper.cs new file mode 100644 index 0000000..1084d60 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/FonctionMapper.cs @@ -0,0 +1,15 @@ +using espacecollab.backend.infrastructure.sql.dtos; + +namespace espacecollab.backend.appservices.dtos.Mappers; + +public static class FonctionMapper +{ + public static FonctionApiDto ToApi(this FonctionSqlDto fonctionSqlDto) + { + return new FonctionApiDto((uint)fonctionSqlDto.Id, fonctionSqlDto.Intitule); + } + public static FonctionSqlDto ToSql(this FonctionApiDto fonctionApiDto) + { + return new FonctionSqlDto((int)fonctionApiDto.Id, fonctionApiDto.Intitule); + } +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/PeriodeEssaiMapper.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/PeriodeEssaiMapper.cs new file mode 100644 index 0000000..0773314 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/PeriodeEssaiMapper.cs @@ -0,0 +1,22 @@ +using espacecollab.backend.appservices.dtos.Values; +using espacecollab.backend.infrastructure.sql.dtos; +using espacecollab.backend.infrastructure.sql.dtos.Values; + +namespace espacecollab.backend.appservices.dtos.Mappers; + +public static class PeriodeEssaiMapper +{ + public static PeriodeEssaiApiDto ToApi(this PeriodeEssaiSqlDto periodeEssaiSqlDto) + { + return new PeriodeEssaiApiDto((uint)periodeEssaiSqlDto.Id, periodeEssaiSqlDto.StartingDate, + periodeEssaiSqlDto.PlannedEndingDate, periodeEssaiSqlDto.RealEndingDate, periodeEssaiSqlDto.Comment, + (EnumIssueApi)periodeEssaiSqlDto.Issue, (uint)periodeEssaiSqlDto.CollaborateurId); + } + + public static PeriodeEssaiSqlDto ToSql(this PeriodeEssaiApiDto periodeEssaiApiDto) + { + return new PeriodeEssaiSqlDto((int)periodeEssaiApiDto.Id, periodeEssaiApiDto.StartingDate, + periodeEssaiApiDto.PlannedEndingDate, periodeEssaiApiDto.RealEndingDate, periodeEssaiApiDto.Comment, + (EnumIssueSql)periodeEssaiApiDto.Issue, (int)periodeEssaiApiDto.CollaborateurId); + } +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/TechnologieMapper.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/TechnologieMapper.cs new file mode 100644 index 0000000..333fbdf --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/TechnologieMapper.cs @@ -0,0 +1,15 @@ +using espacecollab.backend.infrastructure.sql.dtos; + +namespace espacecollab.backend.appservices.dtos.Mappers; + +public static class TechnologieMapper +{ + public static TechnologieApiDto ToApi(this TechnologieSqlDto technologieSqlDto) + { + return new TechnologieApiDto((uint)technologieSqlDto.Id, technologieSqlDto.Name); + } + public static TechnologieSqlDto ToSql(this TechnologieApiDto technologieApiDto) + { + return new TechnologieSqlDto((int)technologieApiDto.Id, technologieApiDto.Name); + } +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/PeriodeEssaiApiDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/PeriodeEssaiApiDto.cs new file mode 100644 index 0000000..f243bb8 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/PeriodeEssaiApiDto.cs @@ -0,0 +1,9 @@ +using espacecollab.backend.appservices.dtos.Interfaces; +using espacecollab.backend.appservices.dtos.Values; + +namespace espacecollab.backend.appservices.dtos; + +public record PeriodeEssaiApiDto(uint Id, DateTime StartingDate, DateTime PlannedEndingDate, DateTime RealEndingDate, string Comment, EnumIssueApi Issue, uint CollaborateurId) : IGenericIdApiDto +{ + public uint Id { get; set; } = Id; +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/TechnologieApiDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/TechnologieApiDto.cs new file mode 100644 index 0000000..812cfe2 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/TechnologieApiDto.cs @@ -0,0 +1,8 @@ +using espacecollab.backend.appservices.dtos.Interfaces; + +namespace espacecollab.backend.appservices.dtos; + +public record TechnologieApiDto(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/Values/EnumGenreApi.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Values/EnumGenreApi.cs new file mode 100644 index 0000000..4a4aee0 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Values/EnumGenreApi.cs @@ -0,0 +1,8 @@ +namespace espacecollab.backend.appservices.dtos.Values; + +public enum EnumGenreApi +{ + MASCULIN, + FEMININ, + AUTRE +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Values/EnumIssueApi.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Values/EnumIssueApi.cs new file mode 100644 index 0000000..c36160e --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Values/EnumIssueApi.cs @@ -0,0 +1,10 @@ +namespace espacecollab.backend.appservices.dtos.Values; + +public enum EnumIssueApi +{ + VALIDEE, + PROLONGEE_COLLAB, + PROLONGEE_APSIDE, + ARRETEE_COLLAB, + ARRETEE_APSIDE +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Values/EnumStatutApi.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Values/EnumStatutApi.cs new file mode 100644 index 0000000..14ae974 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Values/EnumStatutApi.cs @@ -0,0 +1,9 @@ +namespace espacecollab.backend.appservices.dtos.Values; + +public enum EnumStatutApi +{ + CADRE, + NONCADRE, + ALTERNANT, + STAGIAIRE +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices.interfaces/IGenericsServices.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices.interfaces/IGenericsServices.cs index eeeddae..ecb6c12 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.appservices.interfaces/IGenericsServices.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.interfaces/IGenericsServices.cs @@ -1,17 +1,16 @@ using espacecollab.backend.appservices.dtos.Interfaces; -namespace espacecollab.backend.appservices.interfaces +namespace espacecollab.backend.appservices.interfaces; + +public interface IGenericsServices where T : class, IGenericIdApiDto { - public interface IGenericsServices where T : class, IGenericIdApiDto - { - T? Add(T apiDto); + T? Add(T apiDto); - IEnumerable GetAll(); + IEnumerable GetAll(); - T? GetById(uint id); + T? GetById(uint id); - T? Update(T apiDto); + T? Update(T apiDto); - bool Delete(uint apiDtoId); - } -} + bool Delete(uint apiDtoId); +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices/AgenceService.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices/AgenceService.cs index fb7bfef..e081882 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.appservices/AgenceService.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices/AgenceService.cs @@ -8,7 +8,7 @@ namespace espacecollab.backend.appservices; public class AgenceService : GenericsServices { public AgenceService(IAgenceRepository agenceRepository) - :base(agenceRepository, AgenceMapper.ToApi, AgenceMapper.ToSql) + : base(agenceRepository, AgenceMapper.ToApi, AgenceMapper.ToSql) { } } \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices/BusinessUnitService.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices/BusinessUnitService.cs new file mode 100644 index 0000000..fd306c0 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices/BusinessUnitService.cs @@ -0,0 +1,20 @@ +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 BusinessUnitService : GenericsServices +{ + private IBusinessUnitRepository BusinessUnitRepository { get; } + + public BusinessUnitService(IBusinessUnitRepository businessUnitRepository) + :base(businessUnitRepository, BusinessUnitMapper.ToApi, BusinessUnitMapper.ToSql) + {} + + public IEnumerable GetBusinessUnitsByAgence(uint agenceId) + { + return BusinessUnitRepository.GetBusinessUnitsByAgence((int)agenceId).Select(bu => bu.ToApi()); + } +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices/CollaborateursService.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices/CollaborateursService.cs new file mode 100644 index 0000000..81796f9 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices/CollaborateursService.cs @@ -0,0 +1,35 @@ +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 CollaborateursService : GenericsServices +{ + private ICollaborateurRepository CollaborateurRepository { get; } + + public CollaborateursService(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(); + } +} \ 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 deleted file mode 100644 index f9039c7..0000000 --- a/Collaborateur_Epa_Back/espacecollab.backend.appservices/CollaborateursServices.cs +++ /dev/null @@ -1,36 +0,0 @@ -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/FonctionService.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices/FonctionService.cs new file mode 100644 index 0000000..b76d769 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices/FonctionService.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 FonctionService : GenericsServices +{ + public FonctionService(IFonctionRepository fonctionRepository) + :base(fonctionRepository, FonctionMapper.ToApi, FonctionMapper.ToSql) + { + } +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices/GenericsServices.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices/GenericsServices.cs index 9a0e774..72d8693 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.appservices/GenericsServices.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices/GenericsServices.cs @@ -3,62 +3,64 @@ using espacecollab.backend.appservices.interfaces; using espacecollab.backend.infrastructure.interfaces; using espacecollab.backend.infrastructure.sql.dtos.Interfaces; -namespace espacecollab.backend.appservices +namespace espacecollab.backend.appservices; + +public abstract class GenericsServices : IGenericsServices where T : class, IGenericIdSqlDto + where TO : class, IGenericIdApiDto { - 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) { - private Func MapperToApiDto { get; } - private Func MapperToSqlDto { get; } - - private IGenericRepository GenericRepository { get; } + GenericRepository = genericRepository; + MapperToApiDto = mapperToApiDto; + MapperToSqlDto = mapperToSqlDto; + } - 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 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; - public TO? GetById(uint id) - { - T? entity = GenericRepository.GetById((int)id); - if (entity == null) - return null; + return MapperToApiDto(entity); + } - return MapperToApiDto(entity); - } + public TO? Add(TO apiDto) + { + T sqlDto = MapperToSqlDto(apiDto); - public TO? Add(TO apiDto) - { - T sqlDto = MapperToSqlDto(apiDto); + T? entitySqlValidation = GenericRepository.Add(sqlDto); + if (entitySqlValidation == null) + return null; - T? entitySqlValidation = GenericRepository.Add(sqlDto); - if (entitySqlValidation == null) - return null; + return MapperToApiDto(entitySqlValidation); + } - return MapperToApiDto(entitySqlValidation); - } + public TO? Update(TO apiDto) + { + if (GetById(apiDto.Id) == null) + return null; - public TO? Update(TO apiDto) - { - T sqlDto = MapperToSqlDto(apiDto); - T? sqlDtoValidation = GenericRepository.Update(sqlDto); + T sqlDto = MapperToSqlDto(apiDto); + T? sqlDtoValidation = GenericRepository.Update(sqlDto); - if (sqlDtoValidation == null) - return null; + if (sqlDtoValidation == null) + return null; - return MapperToApiDto(sqlDtoValidation); - } + return MapperToApiDto(sqlDtoValidation); + } - public bool Delete(uint apiDtoId) - { - return GenericRepository.Delete((int)apiDtoId); - } + public bool Delete(uint apiDtoId) + { + return GenericRepository.Delete((int)apiDtoId); } -} +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices/PeriodeEssaiService.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices/PeriodeEssaiService.cs new file mode 100644 index 0000000..64c3424 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices/PeriodeEssaiService.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 PeriodeEssaiService : GenericsServices +{ + public PeriodeEssaiService(IPeriodeEssaiRepository agenceRepository) + : base(agenceRepository, PeriodeEssaiMapper.ToApi, PeriodeEssaiMapper.ToSql) + { + } +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices/TechnologieServices.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices/TechnologieServices.cs new file mode 100644 index 0000000..4c32415 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices/TechnologieServices.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 TechnologieServices : GenericsServices +{ + public TechnologieServices(ITechnologieRepository technologieRepository) + :base(technologieRepository, TechnologieMapper.ToApi, TechnologieMapper.ToSql) + { + } +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.fake/FakeAgenceRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.fake/FakeAgenceRepository.cs index 5cdd3ad..a13a56d 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.fake/FakeAgenceRepository.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.fake/FakeAgenceRepository.cs @@ -1,18 +1,16 @@ using espacecollab.backend.infrastructure.interfaces; using espacecollab.backend.infrastructure.sql.dtos; -namespace espacecollab.backend.infrastructure.fake +namespace espacecollab.backend.infrastructure.fake; + +public class FakeAgenceRepository : GenericFakeRepository, IAgenceRepository { - public class FakeAgenceRepository : GenericFakeRepository, IAgenceRepository + public FakeAgenceRepository() { - public FakeAgenceRepository() + Context = new List { - Context = new List - { - new(1, "Tours"), - - new(2, "Clermont-Ferrand") - }; - } + new(1, "Tours"), + new(2, "Clermont-Ferrand") + }; } -} +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.fake/FakeBusinessUnitRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.fake/FakeBusinessUnitRepository.cs new file mode 100644 index 0000000..fcd8637 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.fake/FakeBusinessUnitRepository.cs @@ -0,0 +1,21 @@ +using espacecollab.backend.infrastructure.interfaces; +using espacecollab.backend.infrastructure.sql.dtos; + +namespace espacecollab.backend.infrastructure.fake; + +public class FakeBusinessUnitRepository : GenericFakeRepository, IBusinessUnitRepository +{ + public FakeBusinessUnitRepository() + { + Context = new List + { + new(1, "BU 1", 1), + new(2, "BU 2", 1) + }; + } + + public IList GetBusinessUnitsByAgence(int agenceId) + { + return Context.Where(c => c.AgenceId == agenceId).ToList(); + } +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.fake/FakeCollaborateurRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.fake/FakeCollaborateurRepository.cs index d6aa6bc..f1a956c 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.fake/FakeCollaborateurRepository.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.fake/FakeCollaborateurRepository.cs @@ -2,41 +2,39 @@ using espacecollab.backend.infrastructure.sql.dtos; using espacecollab.backend.infrastructure.sql.dtos.Values; -namespace espacecollab.backend.infrastructure.fake +namespace espacecollab.backend.infrastructure.fake; + +public class FakeCollaborateurRepository : GenericFakeRepository, ICollaborateurRepository { - public class FakeCollaborateurRepository : GenericFakeRepository, ICollaborateurRepository + public FakeCollaborateurRepository() { - public FakeCollaborateurRepository() + Context = new List { - 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) - }; - } + 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 + #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 IList GetCollaborateursByBusinessUnit(int businessUnitId) + { + return Context.Where(entity => entity.BusinessUnitId == businessUnitId).ToList(); + } - public CollaborateurSqlDto GetCollaborateurByApsideMail(string apsideMail) - { - return Context.First(entity => entity.ApsideMail == apsideMail); - } + public IList GetCollaborateursByReferrer(int referrerId) + { + return Context.Where(entity => entity.ReferrerId == referrerId).ToList(); + } - #endregion + public CollaborateurSqlDto GetCollaborateurByApsideMail(string apsideMail) + { + return Context.First(entity => entity.ApsideMail == apsideMail); } -} + + #endregion +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.fake/FakeFonctionRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.fake/FakeFonctionRepository.cs new file mode 100644 index 0000000..f33f212 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.fake/FakeFonctionRepository.cs @@ -0,0 +1,16 @@ +using espacecollab.backend.infrastructure.interfaces; +using espacecollab.backend.infrastructure.sql.dtos; + +namespace espacecollab.backend.infrastructure.fake; + +public class FakeFonctionRepository : GenericFakeRepository, IFonctionRepository +{ + public FakeFonctionRepository() + { + Context = new List + { + new(1, "Fonction 1"), + new(2, "Fonction 2") + }; + } +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.fake/FakePeriodeEssaiRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.fake/FakePeriodeEssaiRepository.cs new file mode 100644 index 0000000..cda3af7 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.fake/FakePeriodeEssaiRepository.cs @@ -0,0 +1,17 @@ +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 FakePeriodeEssaiRepository : GenericFakeRepository, IPeriodeEssaiRepository +{ + public FakePeriodeEssaiRepository() + { + Context = new List + { + new(1, new DateTime(2021, 10, 1), new DateTime(2021, 12, 1), new DateTime(2022, 1, 1), "A voir", EnumIssueSql.VALIDEE, 1), + new(2, new DateTime(2021, 10, 1), new DateTime(2021, 12, 1), new DateTime(2022, 1, 1), "Ne pas donner suite", EnumIssueSql.ARRETEE_APSIDE, 2) + }; + } +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.fake/GenericFakeRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.fake/GenericFakeRepository.cs index f155d9c..34c6125 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.fake/GenericFakeRepository.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.fake/GenericFakeRepository.cs @@ -1,49 +1,48 @@ using espacecollab.backend.infrastructure.interfaces; using espacecollab.backend.infrastructure.sql.dtos.Interfaces; -namespace espacecollab.backend.infrastructure.fake +namespace espacecollab.backend.infrastructure.fake; + +public class GenericFakeRepository : IGenericRepository where T : class, IGenericIdSqlDto { - public class GenericFakeRepository : IGenericRepository where T : class, IGenericIdSqlDto + protected List Context { get; set; } = new(); + + 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() { - 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); - } + 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); } -} +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/IAgenceRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/IAgenceRepository.cs index 1443cdd..e93c032 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/IAgenceRepository.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/IAgenceRepository.cs @@ -1,8 +1,7 @@ using espacecollab.backend.infrastructure.sql.dtos; -namespace espacecollab.backend.infrastructure.interfaces +namespace espacecollab.backend.infrastructure.interfaces; + +public interface IAgenceRepository : IGenericRepository { - 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 index 42a10fd..0689055 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/IBusinessUnitRepository.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/IBusinessUnitRepository.cs @@ -1,8 +1,8 @@ using espacecollab.backend.infrastructure.sql.dtos; -namespace espacecollab.backend.infrastructure.interfaces +namespace espacecollab.backend.infrastructure.interfaces; + +public interface IBusinessUnitRepository : IGenericRepository { - public interface IBusinessUnitRepository : IGenericRepository - { - } + public IList GetBusinessUnitsByAgence(int agenceId); } \ 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 index f89aecb..35f8866 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/ICollaborateurRepository.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/ICollaborateurRepository.cs @@ -1,11 +1,10 @@ using espacecollab.backend.infrastructure.sql.dtos; -namespace espacecollab.backend.infrastructure.interfaces +namespace espacecollab.backend.infrastructure.interfaces; + +public interface ICollaborateurRepository : IGenericRepository { - public interface ICollaborateurRepository : IGenericRepository - { - CollaborateurSqlDto? GetCollaborateurByApsideMail(string apsideMail); - IList GetCollaborateursByBusinessUnit(int businessUnitId); - IList GetCollaborateursByReferrer(int referrerId); - } + 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/IFonctionRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/IFonctionRepository.cs new file mode 100644 index 0000000..0c87258 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/IFonctionRepository.cs @@ -0,0 +1,8 @@ +using espacecollab.backend.infrastructure.sql.dtos; + +namespace espacecollab.backend.infrastructure.interfaces; + + public interface IFonctionRepository : IGenericRepository + { + +} \ 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 index a071958..9554d2b 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/IGenericRepository.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/IGenericRepository.cs @@ -1,14 +1,12 @@ using espacecollab.backend.infrastructure.sql.dtos.Interfaces; -namespace espacecollab.backend.infrastructure.interfaces +namespace espacecollab.backend.infrastructure.interfaces; + +public interface IGenericRepository where T : class, IGenericIdSqlDto { - 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; - } + T? Add(T entity); + bool Delete(int entityId); + IEnumerable GetAll(); + T? GetById(int id); + T? Update(T entity); } \ 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 index 64e08f1..e40664b 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/IPeriodeEssaiRepository.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/IPeriodeEssaiRepository.cs @@ -1,8 +1,7 @@ using espacecollab.backend.infrastructure.sql.dtos; -namespace espacecollab.backend.infrastructure.interfaces +namespace espacecollab.backend.infrastructure.interfaces; + +public interface IPeriodeEssaiRepository : IGenericRepository { - 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 index 8738106..adb65e2 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/IProjetRepository.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/IProjetRepository.cs @@ -1,9 +1,8 @@ using espacecollab.backend.infrastructure.sql.dtos; -namespace espacecollab.backend.infrastructure.interfaces +namespace espacecollab.backend.infrastructure.interfaces; + +public interface IProjetRepository : IGenericRepository { - public interface IProjetRepository : IGenericRepository - { - IList GetProjetsByClient(string client); - } + IList GetProjetsByClient(string client); } \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/IReferencementRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/IReferencementRepository.cs index 4bb453e..c12b65f 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/IReferencementRepository.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/IReferencementRepository.cs @@ -1,10 +1,9 @@ using espacecollab.backend.infrastructure.sql.dtos; -namespace espacecollab.backend.infrastructure.interfaces +namespace espacecollab.backend.infrastructure.interfaces; + +public interface IReferencementRepository : IGenericRepository { - public interface IReferencementRepository : IGenericRepository - { - IList? GetReferrersByCollaborateurId(int collaborateurId); - IList? GetReferrersByCollaborateurApsideMail(string apsideMail); - } + IList? GetReferrersByCollaborateurId(int collaborateurId); + IList? GetReferrersByCollaborateurApsideMail(string apsideMail); } \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/ITechnologieRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/ITechnologieRepository.cs new file mode 100644 index 0000000..1424cce --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.interfaces/ITechnologieRepository.cs @@ -0,0 +1,8 @@ +using espacecollab.backend.infrastructure.sql.dtos; + +namespace espacecollab.backend.infrastructure.interfaces +{ + public interface ITechnologieRepository : IGenericRepository + { + } +} \ No newline at end of file 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 780ffaa..8680156 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/AgenceSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/AgenceSqlDto.cs @@ -1,24 +1,22 @@ using System.Diagnostics.CodeAnalysis; using espacecollab.backend.infrastructure.sql.dtos.Interfaces; -namespace espacecollab.backend.infrastructure.sql.dtos -{ - public class AgenceSqlDto : IGenericIdSqlDto - { - public int Id { get; set; } - public string Name { get; set; } +namespace espacecollab.backend.infrastructure.sql.dtos; - [ExcludeFromCodeCoverage] +public class AgenceSqlDto : IGenericIdSqlDto +{ + public int Id { get; set; } + public string Name { get; set; } - private AgenceSqlDto() - { - } + [ExcludeFromCodeCoverage] - public AgenceSqlDto(int id, string name) - { - Id = id; - Name = name; - } + private AgenceSqlDto() + { + } + public AgenceSqlDto(int id, string name) + { + Id = id; + Name = name; } -} +} \ No newline at end of file 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 1a8029f..c311787 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/BusinessUnitSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/BusinessUnitSqlDto.cs @@ -1,27 +1,24 @@ using System.Diagnostics.CodeAnalysis; using espacecollab.backend.infrastructure.sql.dtos.Interfaces; -namespace espacecollab.backend.infrastructure.sql.dtos -{ - public class BusinessUnitSqlDto : IGenericIdSqlDto - { - public int Id { get; set; } - public string Name { get; set; } - public int AgenceId { get; set; } +namespace espacecollab.backend.infrastructure.sql.dtos; +public class BusinessUnitSqlDto : IGenericIdSqlDto +{ + public int Id { get; set; } + public string Name { get; set; } + public int AgenceId { get; set; } - [ExcludeFromCodeCoverage] - private BusinessUnitSqlDto() - { - } - - public BusinessUnitSqlDto(int id, string name, int agenceId) - { - Id = id; - Name = name; - AgenceId = agenceId; - } + [ExcludeFromCodeCoverage] + private BusinessUnitSqlDto() + { + } + public BusinessUnitSqlDto(int id, string name, int agenceId) + { + Id = id; + Name = name; + AgenceId = agenceId; } -} +} \ No newline at end of file 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 03fc86a..cc67f52 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurAppartientBusinessUnitSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurAppartientBusinessUnitSqlDto.cs @@ -1,24 +1,21 @@ using System.Diagnostics.CodeAnalysis; -namespace espacecollab.backend.infrastructure.sql.dtos -{ - public class CollaborateurAppartientBusinessUnitSqlDto - { - public int CollaborateurId { get; set; } - public int BusinessUnitId { get; set; } +namespace espacecollab.backend.infrastructure.sql.dtos; +public class CollaborateurAppartientBusinessUnitSqlDto +{ + public int CollaborateurId { get; set; } + public int BusinessUnitId { get; set; } - [ExcludeFromCodeCoverage] - private CollaborateurAppartientBusinessUnitSqlDto() - { - } - - public CollaborateurAppartientBusinessUnitSqlDto(int collaborateurId, int businessUnitId) - { - CollaborateurId = collaborateurId; - BusinessUnitId = businessUnitId; - } + [ExcludeFromCodeCoverage] + private CollaborateurAppartientBusinessUnitSqlDto() + { + } + public CollaborateurAppartientBusinessUnitSqlDto(int collaborateurId, int businessUnitId) + { + CollaborateurId = collaborateurId; + BusinessUnitId = businessUnitId; } -} +} \ No newline at end of file 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 0c61504..c57fa0a 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurCollaboreProjetSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurCollaboreProjetSqlDto.cs @@ -1,24 +1,22 @@ using System.Diagnostics.CodeAnalysis; -namespace espacecollab.backend.infrastructure.sql.dtos -{ - public class CollaborateurCollaboreProjetSqlDto - { - public int CollaborateurId { get; set; } - public int ProjetId { get; set; } - public bool IsManager { get; set; } +namespace espacecollab.backend.infrastructure.sql.dtos; - [ExcludeFromCodeCoverage] - private CollaborateurCollaboreProjetSqlDto() - { - } +public class CollaborateurCollaboreProjetSqlDto +{ + public int CollaborateurId { get; set; } + public int ProjetId { get; set; } + public bool IsManager { get; set; } - public CollaborateurCollaboreProjetSqlDto(int collaborateurId, int projetId, bool isManager) - { - CollaborateurId = collaborateurId; - ProjetId = projetId; - IsManager = isManager; - } + [ExcludeFromCodeCoverage] + private CollaborateurCollaboreProjetSqlDto() + { + } + public CollaborateurCollaboreProjetSqlDto(int collaborateurId, int projetId, bool isManager) + { + CollaborateurId = collaborateurId; + ProjetId = projetId; + IsManager = isManager; } -} +} \ No newline at end of file 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 cf7fcde..70da704 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurEstFonctionSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurEstFonctionSqlDto.cs @@ -1,23 +1,20 @@ using System.Diagnostics.CodeAnalysis; -namespace espacecollab.backend.infrastructure.sql.dtos -{ - public class CollaborateurEstFonctionSqlDto - { - public int CollaborateurId { get; set; } - public int FonctionId { get; set; } +namespace espacecollab.backend.infrastructure.sql.dtos; - [ExcludeFromCodeCoverage] - private CollaborateurEstFonctionSqlDto() - { - } - - public CollaborateurEstFonctionSqlDto(int collaborateurId, int fonctionId) - { - CollaborateurId = collaborateurId; - FonctionId = fonctionId; - } +public class CollaborateurEstFonctionSqlDto +{ + public int CollaborateurId { get; set; } + public int FonctionId { get; set; } + [ExcludeFromCodeCoverage] + private CollaborateurEstFonctionSqlDto() + { + } + public CollaborateurEstFonctionSqlDto(int collaborateurId, int fonctionId) + { + CollaborateurId = collaborateurId; + FonctionId = fonctionId; } -} +} \ No newline at end of file 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 9226760..b01751e 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/CollaborateurSqlDto.cs @@ -3,54 +3,52 @@ using System.Diagnostics.CodeAnalysis; using espacecollab.backend.infrastructure.sql.dtos.Interfaces; using System.ComponentModel.DataAnnotations; -namespace espacecollab.backend.infrastructure.sql.dtos -{ - public class CollaborateurSqlDto : IGenericIdSqlDto - { - [Key] - public int Id { get; set; } - public string Name { get; set; } - public string FirstName { get; set; } - public DateTime BirthDate { 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 int ReferrerId { get; set; } - public int BusinessUnitId { get; set; } +namespace espacecollab.backend.infrastructure.sql.dtos; - [ExcludeFromCodeCoverage] - private CollaborateurSqlDto() - { - Name = string.Empty; - FirstName = string.Empty; - Address = string.Empty; - Telephone = string.Empty; - PersonalMail = string.Empty; - ApsideMail = string.Empty; - } +public class CollaborateurSqlDto : IGenericIdSqlDto +{ + [Key] + public int Id { get; set; } + public string Name { get; set; } + public string FirstName { get; set; } + public DateTime BirthDate { 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 int ReferrerId { get; set; } + public int BusinessUnitId { get; set; } - 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; - FirstName = firstName; - BirthDate = birthDate; - Gender = gender; - Status = status; - ChildrenNumber = childrenNumber; - Address = address; - Telephone = telephone; - PersonalMail = personalMail; - ApsideMail = apsideMail; - ResignationDate = resignationDate; - ReferrerId = referrerId; - BusinessUnitId = businessUnitId; - } + [ExcludeFromCodeCoverage] + private CollaborateurSqlDto() + { + Name = string.Empty; + FirstName = string.Empty; + Address = string.Empty; + Telephone = string.Empty; + PersonalMail = string.Empty; + ApsideMail = string.Empty; + } + public CollaborateurSqlDto(int id, string name, string firstName, DateTime birthDate, EnumGenreSql gender, EnumStatutSql status, int childrenNumber, string address, string telephone, string personalMail, string apsideMail, DateTime resignationDate, int referrerId, int businessUnitId) + { + Id = id; + Name = name; + FirstName = firstName; + BirthDate = birthDate; + Gender = gender; + Status = status; + ChildrenNumber = childrenNumber; + Address = address; + Telephone = telephone; + PersonalMail = personalMail; + ApsideMail = apsideMail; + ResignationDate = resignationDate; + ReferrerId = referrerId; + BusinessUnitId = businessUnitId; } -} +} \ No newline at end of file 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 0d67697..0246266 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/FonctionSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/FonctionSqlDto.cs @@ -6,17 +6,17 @@ namespace espacecollab.backend.infrastructure.sql.dtos public class FonctionSqlDto : IGenericIdSqlDto { public int Id { get; set; } - public string Name { get; set; } + public string Intitule { get; set; } - [ExcludeFromCodeCoverage] - private FonctionSqlDto() - { - } + [ExcludeFromCodeCoverage] + private FonctionSqlDto() + { + } - public FonctionSqlDto(int id, string name) + public FonctionSqlDto(int id, string intitule) { Id = id; - Name = name; + Intitule = intitule; } 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 index ce4c282..dc326e5 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/Interfaces/IGenericIdSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/Interfaces/IGenericIdSqlDto.cs @@ -1,7 +1,6 @@ -namespace espacecollab.backend.infrastructure.sql.dtos.Interfaces +namespace espacecollab.backend.infrastructure.sql.dtos.Interfaces; + +public interface IGenericIdSqlDto { - public interface IGenericIdSqlDto - { - public int Id { get; set; } - } -} + public int Id { get; set; } +} \ No newline at end of file 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 7379399..8d361de 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/PeriodeEssaiSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/PeriodeEssaiSqlDto.cs @@ -2,33 +2,32 @@ using System.Diagnostics.CodeAnalysis; using espacecollab.backend.infrastructure.sql.dtos.Interfaces; -namespace espacecollab.backend.infrastructure.sql.dtos +namespace espacecollab.backend.infrastructure.sql.dtos; + +public class PeriodeEssaiSqlDto : IGenericIdSqlDto { - public class PeriodeEssaiSqlDto : IGenericIdSqlDto - { - 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 EnumIssueSql Issue { get; set; } - public int CollaborateurId { 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 EnumIssueSql Issue { get; set; } + public int CollaborateurId { get; set; } - [ExcludeFromCodeCoverage] - private PeriodeEssaiSqlDto() - { - Comment = string.Empty; - } + [ExcludeFromCodeCoverage] + private PeriodeEssaiSqlDto() + { + Comment = string.Empty; + } - public PeriodeEssaiSqlDto(int id, DateTime startingDate, DateTime plannedEndingDate, DateTime realEndingDate, string comment, EnumIssueSql issue, int collaborateurId) - { - Id = id; - StartingDate = startingDate; - PlannedEndingDate = plannedEndingDate; - RealEndingDate = realEndingDate; - Comment = comment; - Issue = issue; - CollaborateurId = collaborateurId; - } + public PeriodeEssaiSqlDto(int id, DateTime startingDate, DateTime plannedEndingDate, DateTime realEndingDate, string comment, EnumIssueSql issue, int collaborateurId) + { + Id = id; + StartingDate = startingDate; + PlannedEndingDate = plannedEndingDate; + RealEndingDate = realEndingDate; + Comment = comment; + Issue = issue; + CollaborateurId = collaborateurId; } -} +} \ No newline at end of file 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 62df00f..9cd830b 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ProjetSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ProjetSqlDto.cs @@ -1,30 +1,29 @@ using System.Diagnostics.CodeAnalysis; using espacecollab.backend.infrastructure.sql.dtos.Interfaces; -namespace espacecollab.backend.infrastructure.sql.dtos +namespace espacecollab.backend.infrastructure.sql.dtos; + +public class ProjetSqlDto : IGenericIdSqlDto { - public class ProjetSqlDto : IGenericIdSqlDto - { - public int Id { get; set; } - public string Name { get; set; } - public string Client { get; set; } - public string Description { get; set; } - public DateTime StartingDate { get; set; } - public DateTime EndingDate { get; set; } + public int Id { get; set; } + public string Name { get; set; } + public string Client { get; set; } + public string Description { get; set; } + public DateTime StartingDate { get; set; } + public DateTime EndingDate { get; set; } - [ExcludeFromCodeCoverage] - private ProjetSqlDto() - { - } + [ExcludeFromCodeCoverage] + private ProjetSqlDto() + { + } - public ProjetSqlDto(int id, string name, string client, string description, DateTime startingDate, DateTime endingDate) - { - Id = id; - Name = name; - Client = client; - Description = description; - StartingDate = startingDate; - EndingDate = endingDate; - } + public ProjetSqlDto(int id, string name, string client, string description, DateTime startingDate, DateTime endingDate) + { + Id = id; + Name = name; + Client = client; + Description = description; + StartingDate = startingDate; + EndingDate = endingDate; } -} +} \ No newline at end of file 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 bf47a6a..48147de 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ProjetUtiliseTechnologieSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ProjetUtiliseTechnologieSqlDto.cs @@ -1,21 +1,20 @@ using System.Diagnostics.CodeAnalysis; -namespace espacecollab.backend.infrastructure.sql.dtos +namespace espacecollab.backend.infrastructure.sql.dtos; + +public class ProjetUtiliseTechnologieSqlDto { - public class ProjetUtiliseTechnologieSqlDto - { - public int ProjetId { get; set; } - public int TechnologieId { get; set; } + public int ProjetId { get; set; } + public int TechnologieId { get; set; } - [ExcludeFromCodeCoverage] - private ProjetUtiliseTechnologieSqlDto() - { - } + [ExcludeFromCodeCoverage] + private ProjetUtiliseTechnologieSqlDto() + { + } - public ProjetUtiliseTechnologieSqlDto(int projetId, int technologieId) - { - ProjetId = projetId; - TechnologieId = technologieId; - } + public ProjetUtiliseTechnologieSqlDto(int projetId, int technologieId) + { + ProjetId = projetId; + TechnologieId = technologieId; } -} +} \ No newline at end of file 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 8bd980a..09318a5 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ReferencementSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/ReferencementSqlDto.cs @@ -1,28 +1,27 @@ using System.Diagnostics.CodeAnalysis; using espacecollab.backend.infrastructure.sql.dtos.Interfaces; -namespace espacecollab.backend.infrastructure.sql.dtos +namespace espacecollab.backend.infrastructure.sql.dtos; + +public class ReferencementSqlDto : IGenericIdSqlDto { - public class ReferencementSqlDto : IGenericIdSqlDto - { - public int Id { get; set; } - public DateTime StartingDate { get; set; } - public DateTime EndingDate { get; set; } - public int ReferredId { get; set; } - public int ReferrerId { get; set; } + public int Id { get; set; } + public DateTime StartingDate { get; set; } + public DateTime EndingDate { get; set; } + public int ReferredId { get; set; } + public int ReferrerId { get; set; } - [ExcludeFromCodeCoverage] - private ReferencementSqlDto() - { - } + [ExcludeFromCodeCoverage] + private ReferencementSqlDto() + { + } - public ReferencementSqlDto(int id, DateTime startingDate, DateTime endingDate, int referredId, int referrerId) - { - Id = id; - StartingDate = startingDate; - EndingDate = endingDate; - ReferredId = referredId; - ReferrerId = referrerId; - } + public ReferencementSqlDto(int id, DateTime startingDate, DateTime endingDate, int referredId, int referrerId) + { + Id = id; + StartingDate = startingDate; + EndingDate = endingDate; + ReferredId = referredId; + ReferrerId = referrerId; } -} +} \ No newline at end of file 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 8cc3395..3572149 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/SiteDeveloppeProjetSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/SiteDeveloppeProjetSqlDto.cs @@ -1,24 +1,20 @@ using System.Diagnostics.CodeAnalysis; -namespace espacecollab.backend.infrastructure.sql.dtos -{ - public class SiteDeveloppeProjetSqlDto - { - public int SiteId { get; set; } - public int ProjetId { get; set; } - - [ExcludeFromCodeCoverage] - private SiteDeveloppeProjetSqlDto() - { - } - - public SiteDeveloppeProjetSqlDto(int siteId, int projetId) - { - SiteId = siteId; - ProjetId = projetId; - } +namespace espacecollab.backend.infrastructure.sql.dtos; +public class SiteDeveloppeProjetSqlDto +{ + public int SiteId { get; set; } + public int ProjetId { get; set; } + [ExcludeFromCodeCoverage] + private SiteDeveloppeProjetSqlDto() + { + } + public SiteDeveloppeProjetSqlDto(int siteId, int projetId) + { + SiteId = siteId; + ProjetId = projetId; } -} +} \ No newline at end of file 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 216ca5d..f639708 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/SiteSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/SiteSqlDto.cs @@ -1,29 +1,25 @@ using System.Diagnostics.CodeAnalysis; using espacecollab.backend.infrastructure.sql.dtos.Interfaces; -namespace espacecollab.backend.infrastructure.sql.dtos -{ - public class SiteSqlDto : IGenericIdSqlDto - { - public int Id { get; set; } - public string Name { get; set; } - public string Address { get; set; } - public int BusinessUnitId { get; set; } - - [ExcludeFromCodeCoverage] - private SiteSqlDto() - { - } - - public SiteSqlDto(int id, string name, string address, int businessUnitId) - { - Id = id; - Name = name; - Address = address; - BusinessUnitId = businessUnitId; - } +namespace espacecollab.backend.infrastructure.sql.dtos; +public class SiteSqlDto : IGenericIdSqlDto +{ + public int Id { get; set; } + public string Name { get; set; } + public string Address { get; set; } + public int BusinessUnitId { get; set; } + [ExcludeFromCodeCoverage] + private SiteSqlDto() + { + } + public SiteSqlDto(int id, string name, string address, int businessUnitId) + { + Id = id; + Name = name; + Address = address; + BusinessUnitId = businessUnitId; } -} +} \ No newline at end of file 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 cf53ce5..01df2e0 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/TechnologieSqlDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/TechnologieSqlDto.cs @@ -1,23 +1,21 @@ -using System.Diagnostics.CodeAnalysis; -using espacecollab.backend.infrastructure.sql.dtos.Interfaces; +using espacecollab.backend.infrastructure.sql.dtos.Interfaces; +using System.Diagnostics.CodeAnalysis; -namespace espacecollab.backend.infrastructure.sql.dtos -{ - public class TechnologieSqlDto : IGenericIdSqlDto - { - public int Id { get; set; } - public string Name { get; set; } +namespace espacecollab.backend.infrastructure.sql.dtos; - [ExcludeFromCodeCoverage] - private TechnologieSqlDto() - { - } +public class TechnologieSqlDto : IGenericIdSqlDto +{ + public int Id { get; set; } + public string Name { get; set; } - public TechnologieSqlDto(int id, string name) - { - Id = id; - Name = name; - } + [ExcludeFromCodeCoverage] + private TechnologieSqlDto() + { + } + public TechnologieSqlDto(int id, string name) + { + Id = id; + Name = name; } -} +} \ No newline at end of file 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 index f3298bc..617e7ff 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/Values/EnumGenreSql.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/Values/EnumGenreSql.cs @@ -1,9 +1,8 @@ -namespace espacecollab.backend.infrastructure.sql.dtos.Values +namespace espacecollab.backend.infrastructure.sql.dtos.Values; + +public enum EnumGenreSql { - public enum EnumGenreSql - { - MASCULIN, - FEMININ, - AUTRE - } -} + MASCULIN, + FEMININ, + AUTRE +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/Values/EnumIssueSql.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/Values/EnumIssueSql.cs index 63e990c..fa9fd6a 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/Values/EnumIssueSql.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/Values/EnumIssueSql.cs @@ -1,11 +1,10 @@ -namespace espacecollab.backend.infrastructure.sql.dtos.Values +namespace espacecollab.backend.infrastructure.sql.dtos.Values; + +public enum EnumIssueSql { - public enum EnumIssueSql - { - VALIDEE, - PROLONGEE_COLLAB, - PROLONGEE_APSIDE, - ARRETEE_COLLAB, - ARRETEE_APSIDE - } -} + VALIDEE, + PROLONGEE_COLLAB, + PROLONGEE_APSIDE, + ARRETEE_COLLAB, + ARRETEE_APSIDE +} \ No newline at end of file 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 index d0284a3..4131c9b 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/Values/EnumStatutSql.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql.dtos/Values/EnumStatutSql.cs @@ -1,10 +1,9 @@ -namespace espacecollab.backend.infrastructure.sql.dtos.Values +namespace espacecollab.backend.infrastructure.sql.dtos.Values; + +public enum EnumStatutSql { - public enum EnumStatutSql - { - CADRE, - NONCADRE, - ALTERNANT, - STAGIAIRE - } -} + CADRE, + NONCADRE, + ALTERNANT, + STAGIAIRE +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/MainDbContext.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/MainDbContext.cs index 332d107..b5a1163 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/MainDbContext.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/MainDbContext.cs @@ -2,39 +2,41 @@ using espacecollab.backend.infrastructure.sql.Options; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Options; -namespace espacecollab.backend.infrastructure.sql + +namespace espacecollab.backend.infrastructure.sql; + +public class MainDbContext : DbContext { - public class MainDbContext : DbContext + private IOptions SqlSettings { get; } + + public MainDbContext(IOptions sqlSettings) { - private IOptions SqlSettings { get; } - private DbSet? Collaborateur { get; set; } + SqlSettings = sqlSettings; + } - private DbSet? Agence { get; set; } + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + optionsBuilder.UseMySql(SqlSettings.Value.ConnectionString, + ServerVersion.AutoDetect(SqlSettings.Value.ConnectionString)) + .EnableSensitiveDataLogging(); + } - public MainDbContext(IOptions sqlSettings) - { - SqlSettings = sqlSettings; - } + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + modelBuilder.Entity().Property(p => p.Id).UseMySqlIdentityColumn(); + modelBuilder.Entity().Property(p => p.Id).UseMySqlIdentityColumn(); + modelBuilder.Entity().Property(p => p.Id).UseMySqlIdentityColumn(); + modelBuilder.Entity().Property(p => p.Id).UseMySqlIdentityColumn(); + modelBuilder.Entity().Property(p => p.Id).UseMySqlIdentityColumn(); - protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) - { - optionsBuilder.UseMySql(SqlSettings.Value.ConnectionString, - ServerVersion.AutoDetect(SqlSettings.Value.ConnectionString)) - .EnableSensitiveDataLogging(); - } + modelBuilder + .Entity() + .Property(e => e.Gender) + .HasConversion(); - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - modelBuilder.Entity().Property(p => p.Id).UseMySqlIdentityColumn(); - modelBuilder.Entity().Property(p=> p.Id).UseMySqlIdentityColumn(); - modelBuilder - .Entity() - .Property(e => e.Gender) - .HasConversion(); - modelBuilder - .Entity() - .Property(e => e.Status) - .HasConversion(); - } + modelBuilder + .Entity() + .Property(e => e.Status) + .HasConversion(); } -} +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Options/SqlOption.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Options/SqlOption.cs index f741343..0216f27 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Options/SqlOption.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Options/SqlOption.cs @@ -1,14 +1,13 @@ -namespace espacecollab.backend.infrastructure.sql.Options +namespace espacecollab.backend.infrastructure.sql.Options; + +public class SqlOption { - public class SqlOption - { - public static string Key => "Sql"; - public bool LoadFake { get; set; } - public string ConnectionString { get; set; } + public static string Key => "Sql"; + public bool LoadFake { get; set; } + public string ConnectionString { get; set; } - public SqlOption() - { - ConnectionString = string.Empty; - } + public SqlOption() + { + ConnectionString = string.Empty; } -} +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Repository/BusinessUnitSqlRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Repository/BusinessUnitSqlRepository.cs new file mode 100644 index 0000000..85e47c0 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Repository/BusinessUnitSqlRepository.cs @@ -0,0 +1,14 @@ +using espacecollab.backend.infrastructure.interfaces; +using espacecollab.backend.infrastructure.sql.dtos; + +namespace espacecollab.backend.infrastructure.sql.Repository; + +public class BusinessUnitSqlRepository : GenericSqlRepository, IBusinessUnitRepository +{ + public BusinessUnitSqlRepository(MainDbContext context) : base(context) + { + } + + public IList GetBusinessUnitsByAgence(int agenceId) + => Context.Set().Where(bu => bu.AgenceId == agenceId).ToList(); +} \ 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 index f24bf5f..7abfa46 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Repository/CollaborateurSqlRepository.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Repository/CollaborateurSqlRepository.cs @@ -1,22 +1,21 @@ using espacecollab.backend.infrastructure.interfaces; using espacecollab.backend.infrastructure.sql.dtos; -namespace espacecollab.backend.infrastructure.sql.Repository +namespace espacecollab.backend.infrastructure.sql.Repository; + +public class CollaborateurSqlRepository : GenericSqlRepository, ICollaborateurRepository { - public class CollaborateurSqlRepository : GenericSqlRepository, ICollaborateurRepository + public CollaborateurSqlRepository(MainDbContext context) : base(context) { - public CollaborateurSqlRepository(MainDbContext context) : base(context) - { - Context = context; - } + Context = context; + } - public IList GetCollaborateursByBusinessUnit(int businessUnitId) - => Context.Set().Where(collaborateur => collaborateur.BusinessUnitId == businessUnitId).ToList(); + 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 IList GetCollaborateursByReferrer(int referrerId) + => Context.Set().Where(collaborateur => collaborateur.ReferrerId == referrerId).ToList(); - public CollaborateurSqlDto? GetCollaborateurByApsideMail(string apsideMail) - => Context?.Set().SingleOrDefault(collaborateur => collaborateur.ApsideMail == apsideMail); - } -} + public CollaborateurSqlDto? GetCollaborateurByApsideMail(string apsideMail) + => Context?.Set().SingleOrDefault(collaborateur => collaborateur.ApsideMail == apsideMail); +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Repository/FonctionSqlRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Repository/FonctionSqlRepository.cs new file mode 100644 index 0000000..5f79650 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Repository/FonctionSqlRepository.cs @@ -0,0 +1,11 @@ +using espacecollab.backend.infrastructure.interfaces; +using espacecollab.backend.infrastructure.sql.dtos; + +namespace espacecollab.backend.infrastructure.sql.Repository; + +public class FonctionSqlRepository : GenericSqlRepository, IFonctionRepository +{ + public FonctionSqlRepository(MainDbContext context) : base(context) + { + } +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Repository/GenericSqlRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Repository/GenericSqlRepository.cs index 77d9023..532ea08 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Repository/GenericSqlRepository.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Repository/GenericSqlRepository.cs @@ -1,50 +1,51 @@ using espacecollab.backend.infrastructure.interfaces; using espacecollab.backend.infrastructure.sql.dtos.Interfaces; -using Microsoft.EntityFrameworkCore; -namespace espacecollab.backend.infrastructure.sql.Repository +namespace espacecollab.backend.infrastructure.sql.Repository; + +public class GenericSqlRepository : IGenericRepository where T : class, IGenericIdSqlDto { - 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) { - protected MainDbContext Context { get; set; } - - public GenericSqlRepository(MainDbContext context) - { - Context = context; - } - - public virtual T? Add(T entity) - { - Context.Set().Add(entity); - Context.SaveChanges(); - return entity; - - } - - 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); - } + Context.Set().Add(entity); + Context.SaveChanges(); + + return entity; + } + + 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().SingleOrDefault(entity => entity.Id == id); + } + + public virtual T? Update(T entity) + { + Context.Set().Update(entity); + Context.SaveChanges(); + + return GetById(entity.Id); } -} +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Repository/PeriodeEssaiSqlRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Repository/PeriodeEssaiSqlRepository.cs new file mode 100644 index 0000000..201f666 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Repository/PeriodeEssaiSqlRepository.cs @@ -0,0 +1,11 @@ +using espacecollab.backend.infrastructure.interfaces; +using espacecollab.backend.infrastructure.sql.dtos; + +namespace espacecollab.backend.infrastructure.sql.Repository; + +public class PeriodeEssaiSqlRepository: GenericSqlRepository, IPeriodeEssaiRepository +{ + public PeriodeEssaiSqlRepository(MainDbContext context) : base(context) + { + } +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Repository/TechnologieSqlRepository.cs b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Repository/TechnologieSqlRepository.cs new file mode 100644 index 0000000..3a48499 --- /dev/null +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.sql/Repository/TechnologieSqlRepository.cs @@ -0,0 +1,11 @@ +using espacecollab.backend.infrastructure.interfaces; +using espacecollab.backend.infrastructure.sql.dtos; + +namespace espacecollab.backend.infrastructure.sql.Repository; + +public class TechnologieSqlRepository : GenericSqlRepository, ITechnologieRepository +{ + public TechnologieSqlRepository(MainDbContext context) : base(context) + { + } +} \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.sln b/Collaborateur_Epa_Back/espacecollab.backend.sln index 0569be5..cfbc75f 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.sln +++ b/Collaborateur_Epa_Back/espacecollab.backend.sln @@ -23,7 +23,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "espacecollab.backend.infras 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}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "espacecollab.backend.appservices.interfaces", "espacecollab.backend.appservices.interfaces\espacecollab.backend.appservices.interfaces.csproj", "{7872657E-46E2-44A1-AFA6-0D3B9E45084A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "espacecollab.backend.api.tests", "espacecollab.backend.api.tests\espacecollab.backend.api.tests.csproj", "{5EA7CAB6-B7A8-4A54-8A1D-774A376974CB}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -63,6 +65,10 @@ Global {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 + {5EA7CAB6-B7A8-4A54-8A1D-774A376974CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5EA7CAB6-B7A8-4A54-8A1D-774A376974CB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5EA7CAB6-B7A8-4A54-8A1D-774A376974CB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5EA7CAB6-B7A8-4A54-8A1D-774A376974CB}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -76,6 +82,7 @@ Global {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} + {5EA7CAB6-B7A8-4A54-8A1D-774A376974CB} = {19237F76-6CA9-47DF-87F8-8027C78070C9} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {0A56A44C-135E-4CE4-834B-8DFDF69DC415}