Ajout d'update pour patch + début validator
This commit is contained in:
6
Knots/DTO/Group/UpdateGroupNomDto.cs
Normal file
6
Knots/DTO/Group/UpdateGroupNomDto.cs
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
namespace Knots.DTO.Group;
|
||||||
|
|
||||||
|
public class UpdateGroupNomDto
|
||||||
|
{
|
||||||
|
public string? Nom { get; set; }
|
||||||
|
}
|
||||||
6
Knots/DTO/Group/UpdateGroupNombreMembresDto.cs
Normal file
6
Knots/DTO/Group/UpdateGroupNombreMembresDto.cs
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
namespace Knots.DTO.Group;
|
||||||
|
|
||||||
|
public class UpdateGroupNombreMembresDto
|
||||||
|
{
|
||||||
|
public int NombreMembres { get; set; }
|
||||||
|
}
|
||||||
6
Knots/DTO/Group/UpdateGroupProfilePictureDto.cs
Normal file
6
Knots/DTO/Group/UpdateGroupProfilePictureDto.cs
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
namespace Knots.DTO.Group;
|
||||||
|
|
||||||
|
public class UpdateGroupProfilePictureDto
|
||||||
|
{
|
||||||
|
public string? ProfilePicture { get; set; }
|
||||||
|
}
|
||||||
6
Knots/DTO/User/UpdateUserDescriptionDto.cs
Normal file
6
Knots/DTO/User/UpdateUserDescriptionDto.cs
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
namespace Knots.DTO.User;
|
||||||
|
|
||||||
|
public class UpdateUserDescriptionDto
|
||||||
|
{
|
||||||
|
public string? Description {get; set;}
|
||||||
|
}
|
||||||
6
Knots/DTO/User/UpdateUserEmailDto.cs
Normal file
6
Knots/DTO/User/UpdateUserEmailDto.cs
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
namespace Knots.DTO.User;
|
||||||
|
|
||||||
|
public class UpdateUserEmailDto
|
||||||
|
{
|
||||||
|
public string? Email { get; set; }
|
||||||
|
}
|
||||||
6
Knots/DTO/User/UpdateUserPasswordDto.cs
Normal file
6
Knots/DTO/User/UpdateUserPasswordDto.cs
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
namespace Knots.DTO.User;
|
||||||
|
|
||||||
|
public class UpdateUserPasswordDto
|
||||||
|
{
|
||||||
|
public string? Password { get; set; }
|
||||||
|
}
|
||||||
6
Knots/DTO/User/UpdateUserProfilePictureDto.cs
Normal file
6
Knots/DTO/User/UpdateUserProfilePictureDto.cs
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
namespace Knots.DTO.User;
|
||||||
|
|
||||||
|
public class UpdateUserProfilePictureDto
|
||||||
|
{
|
||||||
|
public string? ProfilePicture { get; set; }
|
||||||
|
}
|
||||||
6
Knots/DTO/User/UpdateUserTelDto.cs
Normal file
6
Knots/DTO/User/UpdateUserTelDto.cs
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
namespace Knots.DTO.User;
|
||||||
|
|
||||||
|
public class UpdateUserTelDto
|
||||||
|
{
|
||||||
|
public string? Tel { get; set; }
|
||||||
|
}
|
||||||
6
Knots/DTO/User/UpdateUsernameDto.cs
Normal file
6
Knots/DTO/User/UpdateUsernameDto.cs
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
namespace Knots.DTO.User;
|
||||||
|
|
||||||
|
public class UpdateUsernameDto
|
||||||
|
{
|
||||||
|
public string? Username { get; set; }
|
||||||
|
}
|
||||||
@@ -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");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -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");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
namespace Knots.Validators.Discussion;
|
|
||||||
|
|
||||||
public class GetDiscussionDtoValidator
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -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");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -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");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
namespace Knots.Validators.Group;
|
|
||||||
|
|
||||||
public class GetGroupDetailsDtoValidator
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -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");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -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>
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
namespace Knots.Validators.Key;
|
|
||||||
|
|
||||||
public class GetKeyDetailsDtoValidator
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
namespace Knots.Validators.Message;
|
|
||||||
|
|
||||||
public class GetMessageDetailsDto
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
namespace Knots.Validators.User;
|
|
||||||
|
|
||||||
public class GetUserDetailsDtoValidator
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user