Ajout d'update pour patch + début validator

This commit is contained in:
2026-03-12 17:44:39 +01:00
parent 74cab09948
commit da3def1eea
20 changed files with 119 additions and 41 deletions

View File

@@ -0,0 +1,6 @@
namespace Knots.DTO.Group;
public class UpdateGroupNomDto
{
public string? Nom { get; set; }
}

View File

@@ -0,0 +1,6 @@
namespace Knots.DTO.Group;
public class UpdateGroupNombreMembresDto
{
public int NombreMembres { get; set; }
}

View File

@@ -0,0 +1,6 @@
namespace Knots.DTO.Group;
public class UpdateGroupProfilePictureDto
{
public string? ProfilePicture { get; set; }
}

View File

@@ -0,0 +1,6 @@
namespace Knots.DTO.User;
public class UpdateUserDescriptionDto
{
public string? Description {get; set;}
}

View File

@@ -0,0 +1,6 @@
namespace Knots.DTO.User;
public class UpdateUserEmailDto
{
public string? Email { get; set; }
}

View File

@@ -0,0 +1,6 @@
namespace Knots.DTO.User;
public class UpdateUserPasswordDto
{
public string? Password { get; set; }
}

View File

@@ -0,0 +1,6 @@
namespace Knots.DTO.User;
public class UpdateUserProfilePictureDto
{
public string? ProfilePicture { get; set; }
}

View File

@@ -0,0 +1,6 @@
namespace Knots.DTO.User;
public class UpdateUserTelDto
{
public string? Tel { get; set; }
}

View File

@@ -0,0 +1,6 @@
namespace Knots.DTO.User;
public class UpdateUsernameDto
{
public string? Username { get; set; }
}

View File

@@ -1,6 +1,15 @@
using FastEndpoints;
using FluentValidation;
using Knots.DTO.Discussion;
namespace Knots.Validators.Discussion; namespace Knots.Validators.Discussion;
public class CreateDiscussionDtoValidator public class CreateDiscussionDtoValidator : Validator<CreateDiscussionDto>
{ {
public CreateDiscussionDtoValidator()
{
RuleFor(x => x.Id)
.NotEmpty()
.WithMessage("Id is required");
}
} }

View File

@@ -1,6 +1,15 @@
using FastEndpoints;
using FluentValidation;
using Knots.DTO.Discussion;
namespace Knots.Validators.Discussion; namespace Knots.Validators.Discussion;
public class DeleteDiscussionDtoValidator public class DeleteDiscussionDtoValidator : Validator<DeleteDiscussionDto>
{ {
public DeleteDiscussionDtoValidator()
{
RuleFor(x => x.Id)
.NotEmpty()
.WithMessage("Id is required");
}
} }

View File

@@ -1,6 +0,0 @@
namespace Knots.Validators.Discussion;
public class GetDiscussionDtoValidator
{
}

View File

@@ -1,6 +1,21 @@
using FastEndpoints;
using FluentValidation;
using Knots.DTO.Group;
namespace Knots.Validators.Group; namespace Knots.Validators.Group;
public class CreateGroupDtoValidator public class CreateGroupDtoValidator : Validator<CreateGroupDto>
{ {
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");
}
} }

View File

@@ -1,6 +1,15 @@
using FastEndpoints;
using FluentValidation;
using Knots.DTO.Group;
namespace Knots.Validators.Group; namespace Knots.Validators.Group;
public class DeleteGroupDtoValidator public class DeleteGroupDtoValidator : Validator<DeleteGroupDto>
{ {
public DeleteGroupDtoValidator()
{
RuleFor(x => x.Id)
.NotEmpty()
.WithMessage("Id is required");
}
} }

View File

@@ -1,6 +0,0 @@
namespace Knots.Validators.Group;
public class GetGroupDetailsDtoValidator
{
}

View File

@@ -1,6 +1,15 @@
using FastEndpoints;
using FluentValidation;
using Knots.DTO.Group;
namespace Knots.Validators.Group; namespace Knots.Validators.Group;
public class GetGroupDtoValidator public class GetGroupDtoValidator : Validator<GetGroupDto>
{ {
public GetGroupDtoValidator()
{
RuleFor(x => x.Id)
.NotEmpty()
.WithMessage("Id cannot be empty");
}
} }

View File

@@ -1,6 +1,9 @@
using FastEndpoints;
using Knots.DTO.Group;
namespace Knots.Validators.Group; namespace Knots.Validators.Group;
public class UpdateGroupDtoValidator public class UpdateGroupDtoValidator : Validator<UpdateGroupDto>
{ {
} }

View File

@@ -1,6 +0,0 @@
namespace Knots.Validators.Key;
public class GetKeyDetailsDtoValidator
{
}

View File

@@ -1,6 +0,0 @@
namespace Knots.Validators.Message;
public class GetMessageDetailsDto
{
}

View File

@@ -1,6 +0,0 @@
namespace Knots.Validators.User;
public class GetUserDetailsDtoValidator
{
}