diff --git a/Knots/Validators/Message/CreateMessageDtoValidator.cs b/Knots/Validators/Message/CreateMessageDtoValidator.cs index 5f4863f..59f47a8 100644 --- a/Knots/Validators/Message/CreateMessageDtoValidator.cs +++ b/Knots/Validators/Message/CreateMessageDtoValidator.cs @@ -1,6 +1,23 @@ +using FastEndpoints; +using FluentValidation; +using Knots.DTO.Message; + namespace Knots.Validators.Message; -public class CreateMessageDtoValidator +public class CreateMessageDtoValidator : Validator { - + public CreateMessageDtoValidator() + { + RuleFor(x => x.Contenu) + .NotEmpty() + .WithMessage("Le message ne peux pas être vide") + .MaximumLength(1000) + .WithMessage("Le message ne doit pas faire plus de 1000 caractères"); + + + RuleFor(x => x.Date) + .NotEmpty() + .WithMessage("La date ne peut pas être vide"); + + } } \ No newline at end of file diff --git a/Knots/Validators/Role/CreateRoleDtoValidator.cs b/Knots/Validators/Role/CreateRoleDtoValidator.cs index d4eb2dc..9430846 100644 --- a/Knots/Validators/Role/CreateRoleDtoValidator.cs +++ b/Knots/Validators/Role/CreateRoleDtoValidator.cs @@ -1,6 +1,17 @@ +using FastEndpoints; +using FluentValidation; +using Knots.DTO.Role; + namespace Knots.Validators.Role; -public class CreateRoleDtoValidator +public class CreateRoleDtoValidator : Validator { - + public CreateRoleDtoValidator() + { + RuleFor(x => x.Libelle) + .NotEmpty() + .WithMessage("Libelle cannot be empty") + .MaximumLength(50) + .WithMessage("Libelle maximum length is 50"); + } } \ No newline at end of file diff --git a/Knots/Validators/Role/DeleteRoleDtoValidator.cs b/Knots/Validators/Role/DeleteRoleDtoValidator.cs index e7670d5..aa45976 100644 --- a/Knots/Validators/Role/DeleteRoleDtoValidator.cs +++ b/Knots/Validators/Role/DeleteRoleDtoValidator.cs @@ -1,6 +1,15 @@ +using FastEndpoints; +using FluentValidation; +using Knots.DTO.Role; + namespace Knots.Validators.Role; -public class DeleteRoleDtoValidator +public class DeleteRoleDtoValidator : Validator { - + public DeleteRoleDtoValidator() + { + RuleFor(x => x.Id) + .NotEmpty() + .WithMessage("Id cannot be empty"); + } } \ No newline at end of file diff --git a/Knots/Validators/Role/GetRoleDtoValidator.cs b/Knots/Validators/Role/GetRoleDtoValidator.cs index bd7b33d..817b029 100644 --- a/Knots/Validators/Role/GetRoleDtoValidator.cs +++ b/Knots/Validators/Role/GetRoleDtoValidator.cs @@ -1,6 +1,17 @@ +using FastEndpoints; +using FluentValidation; +using Knots.DTO.Role; + namespace Knots.Validators.Role; -public class GetRoleDtoValidator +public class GetRoleDtoValidator : Validator { - + public GetRoleDtoValidator() + { + RuleFor(x => x.Libelle) + .NotEmpty() + .WithMessage("Libelle cannot be empty") + .MaximumLength(50) + .WithMessage("Libelle maximum length is 50"); + } } \ No newline at end of file diff --git a/Knots/obj/Debug/net8.0/Knots.AssemblyInfo.cs b/Knots/obj/Debug/net8.0/Knots.AssemblyInfo.cs index c6018ed..a53a225 100644 --- a/Knots/obj/Debug/net8.0/Knots.AssemblyInfo.cs +++ b/Knots/obj/Debug/net8.0/Knots.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("Knots")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+dc9aa8c840b4064bd32793b90b273caaf36c360f")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+3a833724031a4e7076b11dcb48bd7aa2c7376432")] [assembly: System.Reflection.AssemblyProductAttribute("Knots")] [assembly: System.Reflection.AssemblyTitleAttribute("Knots")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/Knots/obj/Debug/net8.0/Knots.AssemblyInfoInputs.cache b/Knots/obj/Debug/net8.0/Knots.AssemblyInfoInputs.cache index eb2a92d..a0a0275 100644 --- a/Knots/obj/Debug/net8.0/Knots.AssemblyInfoInputs.cache +++ b/Knots/obj/Debug/net8.0/Knots.AssemblyInfoInputs.cache @@ -1 +1 @@ -1b8ae9dfe4e2b2618cd70cfa49fe9679d0b7d9b1c2eb5ae991b2036ea16d6dfd +ea906d69ee00ac134acfca751c691f6f874ba5373dc51f1200fce206bc66abe5 diff --git a/Knots/obj/rider.project.model.nuget.info b/Knots/obj/rider.project.model.nuget.info index 4f31dc6..7008409 100644 --- a/Knots/obj/rider.project.model.nuget.info +++ b/Knots/obj/rider.project.model.nuget.info @@ -1 +1 @@ -17733319213920905 \ No newline at end of file +17733307741808199 \ No newline at end of file