diff --git a/Knots/DTO/Group/UpdateGroupNomDto.cs b/Knots/DTO/Group/UpdateGroupNomDto.cs new file mode 100644 index 0000000..6f6982d --- /dev/null +++ b/Knots/DTO/Group/UpdateGroupNomDto.cs @@ -0,0 +1,6 @@ +namespace Knots.DTO.Group; + +public class UpdateGroupNomDto +{ + public string? Nom { get; set; } +} \ No newline at end of file diff --git a/Knots/DTO/Group/UpdateGroupNombreMembresDto.cs b/Knots/DTO/Group/UpdateGroupNombreMembresDto.cs new file mode 100644 index 0000000..55791a9 --- /dev/null +++ b/Knots/DTO/Group/UpdateGroupNombreMembresDto.cs @@ -0,0 +1,6 @@ +namespace Knots.DTO.Group; + +public class UpdateGroupNombreMembresDto +{ + public int NombreMembres { get; set; } +} \ No newline at end of file diff --git a/Knots/DTO/Group/UpdateGroupProfilePictureDto.cs b/Knots/DTO/Group/UpdateGroupProfilePictureDto.cs new file mode 100644 index 0000000..e40f53c --- /dev/null +++ b/Knots/DTO/Group/UpdateGroupProfilePictureDto.cs @@ -0,0 +1,6 @@ +namespace Knots.DTO.Group; + +public class UpdateGroupProfilePictureDto +{ + public string? ProfilePicture { get; set; } +} \ No newline at end of file diff --git a/Knots/DTO/User/UpdateUserDescriptionDto.cs b/Knots/DTO/User/UpdateUserDescriptionDto.cs new file mode 100644 index 0000000..c65d9e6 --- /dev/null +++ b/Knots/DTO/User/UpdateUserDescriptionDto.cs @@ -0,0 +1,6 @@ +namespace Knots.DTO.User; + +public class UpdateUserDescriptionDto +{ + public string? Description {get; set;} +} \ No newline at end of file diff --git a/Knots/DTO/User/UpdateUserEmailDto.cs b/Knots/DTO/User/UpdateUserEmailDto.cs new file mode 100644 index 0000000..641ecae --- /dev/null +++ b/Knots/DTO/User/UpdateUserEmailDto.cs @@ -0,0 +1,6 @@ +namespace Knots.DTO.User; + +public class UpdateUserEmailDto +{ + public string? Email { get; set; } +} \ No newline at end of file diff --git a/Knots/DTO/User/UpdateUserPasswordDto.cs b/Knots/DTO/User/UpdateUserPasswordDto.cs new file mode 100644 index 0000000..83660e0 --- /dev/null +++ b/Knots/DTO/User/UpdateUserPasswordDto.cs @@ -0,0 +1,6 @@ +namespace Knots.DTO.User; + +public class UpdateUserPasswordDto +{ + public string? Password { get; set; } +} \ No newline at end of file diff --git a/Knots/DTO/User/UpdateUserProfilePictureDto.cs b/Knots/DTO/User/UpdateUserProfilePictureDto.cs new file mode 100644 index 0000000..e84c2d9 --- /dev/null +++ b/Knots/DTO/User/UpdateUserProfilePictureDto.cs @@ -0,0 +1,6 @@ +namespace Knots.DTO.User; + +public class UpdateUserProfilePictureDto +{ + public string? ProfilePicture { get; set; } +} \ No newline at end of file diff --git a/Knots/DTO/User/UpdateUserTelDto.cs b/Knots/DTO/User/UpdateUserTelDto.cs new file mode 100644 index 0000000..3507bec --- /dev/null +++ b/Knots/DTO/User/UpdateUserTelDto.cs @@ -0,0 +1,6 @@ +namespace Knots.DTO.User; + +public class UpdateUserTelDto +{ + public string? Tel { get; set; } +} \ No newline at end of file diff --git a/Knots/DTO/User/UpdateUsernameDto.cs b/Knots/DTO/User/UpdateUsernameDto.cs new file mode 100644 index 0000000..e47da7c --- /dev/null +++ b/Knots/DTO/User/UpdateUsernameDto.cs @@ -0,0 +1,6 @@ +namespace Knots.DTO.User; + +public class UpdateUsernameDto +{ + public string? Username { get; set; } +} \ No newline at end of file diff --git a/Knots/Validators/Discussion/CreateDiscussionDtoValidator.cs b/Knots/Validators/Discussion/CreateDiscussionDtoValidator.cs index ba6106d..301076a 100644 --- a/Knots/Validators/Discussion/CreateDiscussionDtoValidator.cs +++ b/Knots/Validators/Discussion/CreateDiscussionDtoValidator.cs @@ -1,6 +1,15 @@ +using FastEndpoints; +using FluentValidation; +using Knots.DTO.Discussion; + namespace Knots.Validators.Discussion; -public class CreateDiscussionDtoValidator +public class CreateDiscussionDtoValidator : Validator { - + public CreateDiscussionDtoValidator() + { + RuleFor(x => x.Id) + .NotEmpty() + .WithMessage("Id is required"); + } } \ No newline at end of file diff --git a/Knots/Validators/Discussion/DeleteDiscussionDtoValidator.cs b/Knots/Validators/Discussion/DeleteDiscussionDtoValidator.cs index c8f1c64..c03fb56 100644 --- a/Knots/Validators/Discussion/DeleteDiscussionDtoValidator.cs +++ b/Knots/Validators/Discussion/DeleteDiscussionDtoValidator.cs @@ -1,6 +1,15 @@ +using FastEndpoints; +using FluentValidation; +using Knots.DTO.Discussion; + namespace Knots.Validators.Discussion; -public class DeleteDiscussionDtoValidator +public class DeleteDiscussionDtoValidator : Validator { - + public DeleteDiscussionDtoValidator() + { + RuleFor(x => x.Id) + .NotEmpty() + .WithMessage("Id is required"); + } } \ No newline at end of file diff --git a/Knots/Validators/Discussion/GetDiscussionDtoValidator.cs b/Knots/Validators/Discussion/GetDiscussionDtoValidator.cs deleted file mode 100644 index c73960f..0000000 --- a/Knots/Validators/Discussion/GetDiscussionDtoValidator.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Knots.Validators.Discussion; - -public class GetDiscussionDtoValidator -{ - -} \ No newline at end of file diff --git a/Knots/Validators/Group/CreateGroupDtoValidator.cs b/Knots/Validators/Group/CreateGroupDtoValidator.cs index 516a3f1..c7cf415 100644 --- a/Knots/Validators/Group/CreateGroupDtoValidator.cs +++ b/Knots/Validators/Group/CreateGroupDtoValidator.cs @@ -1,6 +1,21 @@ +using FastEndpoints; +using FluentValidation; +using Knots.DTO.Group; + namespace Knots.Validators.Group; -public class CreateGroupDtoValidator +public class CreateGroupDtoValidator : Validator { - + public CreateGroupDtoValidator() + { + RuleFor(x => x.Nom) + .NotEmpty() + .WithMessage("You must enter a name for the group") + .MaximumLength(50) + .WithMessage("Maximum 50 character are required"); + + RuleFor(x => x.NombreMembres) + .NotEmpty() + .WithMessage("Members cannot be empty"); + } } \ No newline at end of file diff --git a/Knots/Validators/Group/DeleteGroupDtoValidator.cs b/Knots/Validators/Group/DeleteGroupDtoValidator.cs index 05039f2..004e2f8 100644 --- a/Knots/Validators/Group/DeleteGroupDtoValidator.cs +++ b/Knots/Validators/Group/DeleteGroupDtoValidator.cs @@ -1,6 +1,15 @@ +using FastEndpoints; +using FluentValidation; +using Knots.DTO.Group; + namespace Knots.Validators.Group; -public class DeleteGroupDtoValidator +public class DeleteGroupDtoValidator : Validator { - + public DeleteGroupDtoValidator() + { + RuleFor(x => x.Id) + .NotEmpty() + .WithMessage("Id is required"); + } } \ No newline at end of file diff --git a/Knots/Validators/Group/GetGroupDetailsDtoValidator.cs b/Knots/Validators/Group/GetGroupDetailsDtoValidator.cs deleted file mode 100644 index 180e6c0..0000000 --- a/Knots/Validators/Group/GetGroupDetailsDtoValidator.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Knots.Validators.Group; - -public class GetGroupDetailsDtoValidator -{ - -} \ No newline at end of file diff --git a/Knots/Validators/Group/GetGroupDtoValidator.cs b/Knots/Validators/Group/GetGroupDtoValidator.cs index 7c13a4e..ded426f 100644 --- a/Knots/Validators/Group/GetGroupDtoValidator.cs +++ b/Knots/Validators/Group/GetGroupDtoValidator.cs @@ -1,6 +1,15 @@ +using FastEndpoints; +using FluentValidation; +using Knots.DTO.Group; + namespace Knots.Validators.Group; -public class GetGroupDtoValidator +public class GetGroupDtoValidator : Validator { - + public GetGroupDtoValidator() + { + RuleFor(x => x.Id) + .NotEmpty() + .WithMessage("Id cannot be empty"); + } } \ No newline at end of file diff --git a/Knots/Validators/Group/UpdateGroupDtoValidator.cs b/Knots/Validators/Group/UpdateGroupDtoValidator.cs index ce15819..0163f5c 100644 --- a/Knots/Validators/Group/UpdateGroupDtoValidator.cs +++ b/Knots/Validators/Group/UpdateGroupDtoValidator.cs @@ -1,6 +1,9 @@ +using FastEndpoints; +using Knots.DTO.Group; + namespace Knots.Validators.Group; -public class UpdateGroupDtoValidator +public class UpdateGroupDtoValidator : Validator { } \ No newline at end of file diff --git a/Knots/Validators/Key/GetKeyDetailsDtoValidator.cs b/Knots/Validators/Key/GetKeyDetailsDtoValidator.cs deleted file mode 100644 index 91e9068..0000000 --- a/Knots/Validators/Key/GetKeyDetailsDtoValidator.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Knots.Validators.Key; - -public class GetKeyDetailsDtoValidator -{ - -} \ No newline at end of file diff --git a/Knots/Validators/Message/GetMessageDetailsDto.cs b/Knots/Validators/Message/GetMessageDetailsDto.cs deleted file mode 100644 index 7e6fed8..0000000 --- a/Knots/Validators/Message/GetMessageDetailsDto.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Knots.Validators.Message; - -public class GetMessageDetailsDto -{ - -} \ No newline at end of file diff --git a/Knots/Validators/User/GetUserDetailsDtoValidator.cs b/Knots/Validators/User/GetUserDetailsDtoValidator.cs deleted file mode 100644 index cd1b1f7..0000000 --- a/Knots/Validators/User/GetUserDetailsDtoValidator.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace Knots.Validators.User; - -public class GetUserDetailsDtoValidator -{ - -} \ No newline at end of file