Cleaned code

This commit is contained in:
2026-03-24 18:02:10 +01:00
parent ae8a33b7b6
commit c8cd5d9257
24 changed files with 66 additions and 67 deletions
@@ -20,7 +20,7 @@ public class GetAllProofsEndpoint(UserGroupsRepository userGroupsRepository, Gro
public override async Task HandleAsync(GroupProofRequest req, CancellationToken ct)
{
Group? group = await groupsRepository.SingleOrDefaultAsync(new GetGroupByIdSpec(req.Id), ct);
Group? group = await groupsRepository.SingleOrDefaultAsync(new GetGroupByIdSpec(req.Id), ct);
if (group is null)
{
await Send.NotFoundAsync(ct);
@@ -38,7 +38,7 @@ public class PatchProofEndpoint(
if (randomChallenge.GeneratedAt != null && DateTime.Now > randomChallenge.GeneratedAt.Value.AddHours(randomChallenge.Duration))
{
await Send.StringAsync("Le défi est terminé", 400, cancellation: ct);
await Send.StringAsync("Le défi est terminé", 400, cancellation: ct);
return;
}
@@ -13,6 +13,5 @@ public class UnlockAchievementDtoValidator : Validator<UnlockAchievementDto>
.WithMessage("AchievementId cannot be empty")
.GreaterThan(0)
.WithMessage("AchievementId must be greater than 0");
}
}
@@ -4,7 +4,7 @@ using FluentValidation;
namespace BeReadyBackend.Validators.Auth;
public class LoginDtoValidator: Validator<LoginDto>
public class LoginDtoValidator : Validator<LoginDto>
{
public LoginDtoValidator()
{
@@ -6,7 +6,7 @@ namespace BeReadyBackend.Validators.Friends;
public class GetFriendDtoValidator : Validator<GetFriendDto>
{
public GetFriendDtoValidator()
public GetFriendDtoValidator()
{
RuleFor(x => x.Username)
.NotEmpty()
@@ -6,7 +6,7 @@ namespace BeReadyBackend.Validators.Friends;
public class GetFriendRequestDtoValidator : Validator<GetFriendDto>
{
public GetFriendRequestDtoValidator()
public GetFriendRequestDtoValidator()
{
RuleFor(x => x.Username)
.NotEmpty()
@@ -6,7 +6,7 @@ namespace BeReadyBackend.Validators.Users;
public class GetUserChallengeDtoValidator : Validator<GetUserChallengeDto>
{
public GetUserChallengeDtoValidator()
public GetUserChallengeDtoValidator()
{
RuleFor(x => x.ChallengeTitle)
.NotEmpty()
@@ -6,7 +6,7 @@ namespace BeReadyBackend.Validators.Users;
public class GetUserDetailsDtoValidator : Validator<GetUserDetailsDto>
{
public GetUserDetailsDtoValidator()
public GetUserDetailsDtoValidator()
{
RuleFor(x => x.FirstName)
.NotEmpty()
@@ -6,8 +6,8 @@ namespace BeReadyBackend.Validators.Users;
public class GetUserDtoValidator : Validator<GetUserDto>
{
public GetUserDtoValidator() {
public GetUserDtoValidator()
{
RuleFor(x => x.Id)
.NotEmpty()
.WithMessage("Id cannot be empty")
@@ -6,30 +6,30 @@ namespace BeReadyBackend.Validators.Users;
public class GetUserStatsDtoValidator : Validator<GetUserStatsDto>
{
public GetUserStatsDtoValidator()
{
RuleFor(x => x.Score)
.NotEmpty()
.WithMessage("Score is required");
public GetUserStatsDtoValidator()
{
RuleFor(x => x.Score)
.NotEmpty()
.WithMessage("Score is required");
RuleFor(x => x.TotalWin)
.NotEmpty()
.WithMessage("Total win is required");
RuleFor(x => x.TotalWin)
.NotEmpty()
.WithMessage("Total win is required");
RuleFor(x=> x.TotalChallenge)
.NotEmpty()
.WithMessage("Total challenge is required");
RuleFor(x => x.TotalChallenge)
.NotEmpty()
.WithMessage("Total challenge is required");
RuleFor(x => x.TotalPodium)
.NotEmpty()
.WithMessage("Total podium is required");
RuleFor(x => x.TotalPodium)
.NotEmpty()
.WithMessage("Total podium is required");
RuleFor(x => x.TotalBonusChallenge)
.NotEmpty()
.WithMessage("Total bonus is required");
RuleFor(x => x.TotalBonusChallenge)
.NotEmpty()
.WithMessage("Total bonus is required");
RuleFor(x => x.Series)
.NotEmpty()
.WithMessage("Series is required");
}
RuleFor(x => x.Series)
.NotEmpty()
.WithMessage("Series is required");
}
}
@@ -6,7 +6,7 @@ namespace BeReadyBackend.Validators.Users;
public class UpdateUserDtoValidator : Validator<UpdateUserDto>
{
public UpdateUserDtoValidator()
public UpdateUserDtoValidator()
{
RuleFor(x => x.FirstName)
.NotEmpty()