From a97d30e3d85ae4b3a4a5f85626a71b2bd3e7cdbf Mon Sep 17 00:00:00 2001 From: Clement FERRERE Date: Mon, 4 Jul 2022 14:25:41 +0200 Subject: [PATCH] fix MR --- .../CollaborateurApiDto.cs | 4 ++-- .../Mappers/CollaborateurMapper.cs | 8 ++++---- .../Mappers/ReferencementMapper.cs | 4 ++-- .../ReferencementApiDto.cs | 2 +- .../FakeCollaborateurRepository.cs | 12 ++++++------ 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/CollaborateurApiDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/CollaborateurApiDto.cs index 93d6082..d4b342c 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/CollaborateurApiDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/CollaborateurApiDto.cs @@ -3,8 +3,8 @@ using espacecollab.backend.appservices.dtos.Values; 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 BusinessUnitId) : IGenericIdApiDto +public record CollaborateurApiDto(uint Id, string Name, string FirstName, DateTime BirthDate, EnumGenreApi Gender, EnumStatutApi Status, uint ChildrenNumber, string Address, + string Telephone, string PersonalMail, string ApsideMail, DateTime? ResignationDate, uint BusinessUnitId) : IGenericIdApiDto { public uint Id { get; set; } = Id; } \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/CollaborateurMapper.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/CollaborateurMapper.cs index 75ae43b..19c2b70 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/CollaborateurMapper.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/CollaborateurMapper.cs @@ -7,16 +7,16 @@ public static class CollaborateurMapper public static CollaborateurApiDto ToApi(this CollaborateurSqlDto collaborateurSql) { return new CollaborateurApiDto((uint)collaborateurSql.Id, collaborateurSql.Name, collaborateurSql.FirstName, - collaborateurSql.BirthDate, collaborateurSql.Gender.ToEnumGenreApi(), collaborateurSql.Status.ToEnumStatutApi(), collaborateurSql.ChildrenNumber, + collaborateurSql.BirthDate, collaborateurSql.Gender.ToEnumGenreApi(), collaborateurSql.Status.ToEnumStatutApi(), (uint)collaborateurSql.ChildrenNumber, collaborateurSql.Address, collaborateurSql.Telephone, collaborateurSql.PersonalMail, collaborateurSql.ApsideMail, - collaborateurSql.ResignationDate, collaborateurSql.BusinessUnitId); + collaborateurSql.ResignationDate, (uint)collaborateurSql.BusinessUnitId); } public static CollaborateurSqlDto ToSql(this CollaborateurApiDto collaborateurApi) { return new CollaborateurSqlDto((int)collaborateurApi.Id, collaborateurApi.Name, collaborateurApi.FirstName, - collaborateurApi.BirthDate, collaborateurApi.Gender.ToEnumGenreSql(), collaborateurApi.Status.ToEnumStatutSql(), collaborateurApi.ChildrenNumber, + collaborateurApi.BirthDate, collaborateurApi.Gender.ToEnumGenreSql(), collaborateurApi.Status.ToEnumStatutSql(), (int)collaborateurApi.ChildrenNumber, collaborateurApi.Address, collaborateurApi.Telephone, collaborateurApi.PersonalMail, collaborateurApi.ApsideMail, - collaborateurApi.ResignationDate, collaborateurApi.BusinessUnitId); + collaborateurApi.ResignationDate, (int)collaborateurApi.BusinessUnitId); } } \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/ReferencementMapper.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/ReferencementMapper.cs index 8d5c6b6..da716b5 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/ReferencementMapper.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/Mappers/ReferencementMapper.cs @@ -6,10 +6,10 @@ public static class ReferencementMapper { public static ReferencementApiDto ToApi(this ReferencementSqlDto referencementSqlDto) { - return new ReferencementApiDto((uint)referencementSqlDto.Id, referencementSqlDto.StartingDate,referencementSqlDto.EndingDate,referencementSqlDto.ReferredId, referencementSqlDto.ReferrerId); + return new ReferencementApiDto((uint)referencementSqlDto.Id, referencementSqlDto.StartingDate,referencementSqlDto.EndingDate,(uint)referencementSqlDto.ReferredId, (uint)referencementSqlDto.ReferrerId); } public static ReferencementSqlDto ToSql(this ReferencementApiDto referencementApiDto) { - return new ReferencementSqlDto((int)referencementApiDto.Id, referencementApiDto.StartingDate, referencementApiDto.EndingDate, referencementApiDto.ReferredId, referencementApiDto.ReferrerId); + return new ReferencementSqlDto((int)referencementApiDto.Id, referencementApiDto.StartingDate, referencementApiDto.EndingDate, (int)referencementApiDto.ReferredId, (int)referencementApiDto.ReferrerId); } } \ No newline at end of file diff --git a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/ReferencementApiDto.cs b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/ReferencementApiDto.cs index 51c135c..953ad32 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/ReferencementApiDto.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.appservices.dtos/ReferencementApiDto.cs @@ -6,7 +6,7 @@ using espacecollab.backend.infrastructure.sql.dtos.Interfaces; namespace espacecollab.backend.appservices.dtos; -public record ReferencementApiDto(uint Id, DateTime StartingDate, DateTime? EndingDate, int ReferredId, int ReferrerId) : IGenericIdApiDto +public record ReferencementApiDto(uint Id, DateTime StartingDate, DateTime? EndingDate, uint ReferredId, uint ReferrerId) : IGenericIdApiDto { public uint Id { get; set; } = Id; } \ 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 8ccde8e..1c216ab 100644 --- a/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.fake/FakeCollaborateurRepository.cs +++ b/Collaborateur_Epa_Back/espacecollab.backend.infrastructure.fake/FakeCollaborateurRepository.cs @@ -10,12 +10,12 @@ public class FakeCollaborateurRepository : GenericFakeRepository { - //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), 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) }; }