Added restrictions on DB

This commit is contained in:
2026-03-17 09:17:27 +01:00
parent 706c621177
commit 1e14bb01c9
18 changed files with 584 additions and 40 deletions
@@ -17,7 +17,7 @@ public class GetAchievementDtoValidator : Validator<GetAchievementDto>
.WithMessage("Description must be specified")
.MinimumLength(2)
.WithMessage("Description must contain more than 2 characters")
.MaximumLength(200) // Add BDD
.MaximumLength(200)
.WithMessage("Description cannot contain more than 200 characters");
RuleFor(x => x.Label)
@@ -25,7 +25,7 @@ public class GetAchievementDtoValidator : Validator<GetAchievementDto>
.WithMessage("Label must be specified")
.MinimumLength(2)
.WithMessage("Description must contain more than 2 characters")
.MaximumLength(200) // Add BDD
.MaximumLength(200)
.WithMessage("Description cannot contain more than 200 characters");
}
}
@@ -17,7 +17,7 @@ public class GetDesignationDtoValidator : Validator<GetDesignationDto>
RuleFor(x => x.Label)
.NotEmpty()
.WithMessage("Label cannot be empty")
.MaximumLength(100) // Add BDD
.MaximumLength(100)
.WithMessage("Label cannot contain more than 100 characters")
.MinimumLength(2)
.WithMessage("Label must contain more than 2 characters");
@@ -11,15 +11,15 @@ public class CreateGroupDtoValidator : Validator<CreateGroupDto>
RuleFor(x => x.Label)
.NotEmpty()
.WithMessage("Label cannot be empty")
.MaximumLength(50) // Add BDD
.WithMessage("Label cannot exceed 50 characters")
.MaximumLength(100)
.WithMessage("Label cannot exceed 100 characters")
.MinimumLength(2)
.WithMessage("Label must exceed 2 characters");
RuleFor(x => x.Title)
.NotEmpty()
.WithMessage("Title cannot be empty")
.MaximumLength(50) // Add BDD
.MaximumLength(50)
.WithMessage("Title cannot exceed 50 characters")
.MinimumLength(2)
.WithMessage("Title must exceed 2 characters");
@@ -27,8 +27,8 @@ public class CreateGroupDtoValidator : Validator<CreateGroupDto>
RuleFor(x => x.Description)
.NotEmpty()
.WithMessage("Description cannot be empty")
.MaximumLength(200) // Add BDD
.WithMessage("Description cannot exceed 50 characters")
.MaximumLength(200)
.WithMessage("Description cannot exceed 200 characters")
.MinimumLength(2)
.WithMessage("Description must exceed 2 characters");
@@ -17,8 +17,8 @@ public class GetGroupDetailsDtoValidator : Validator<GetGroupDetailsDto>
RuleFor(x => x.Label)
.NotEmpty()
.WithMessage("Label cannot be empty")
.MaximumLength(50) // Add BDD
.WithMessage("Label cannot exceed 50 characters")
.MaximumLength(100)
.WithMessage("Label cannot exceed 100 characters")
.MinimumLength(2)
.WithMessage("Label must exceed 2 characters");
@@ -29,7 +29,7 @@ public class GetGroupDetailsDtoValidator : Validator<GetGroupDetailsDto>
RuleFor(x => x.Title)
.NotEmpty()
.WithMessage("Title cannot be empty")
.MaximumLength(100) // Add BDD
.MaximumLength(50)
.WithMessage("Title cannot exceed 50 characters")
.MinimumLength(2)
.WithMessage("Title must exceed 2 characters");
@@ -37,7 +37,7 @@ public class GetGroupDetailsDtoValidator : Validator<GetGroupDetailsDto>
RuleFor(x => x.Description)
.NotEmpty()
.WithMessage("Description cannot be empty")
.MaximumLength(200) // Add BDD
.MaximumLength(200)
.WithMessage("Description cannot exceed 50 characters")
.MinimumLength(2)
.WithMessage("Description must exceed 2 characters");
@@ -17,8 +17,8 @@ public class GetGroupDtoValidator : Validator<GetGroupDto>
RuleFor(x => x.Label)
.NotEmpty()
.WithMessage("Label cannot be empty")
.MaximumLength(50) // Add BDD
.WithMessage("Label cannot exceed 50 characters")
.MaximumLength(100)
.WithMessage("Label cannot exceed 100 characters")
.MinimumLength(2)
.WithMessage("Label must exceed 2 characters");
@@ -11,12 +11,12 @@ public class CreateMessageDtoValidator : Validator<CreateMessageDto>
RuleFor(x => x.Libelle)
.NotEmpty()
.WithMessage("Libelle is required")
.MaximumLength(200) //Add BDD
.MaximumLength(200)
.WithMessage("Libelle cannot exceed 200 characters")
.MinimumLength(2)
.WithMessage("Libelle must exceed 2 characters");
RuleFor(x => x.SendDate) //Edit BDD
RuleFor(x => x.SendDate)
.NotEmpty()
.WithMessage("SendDate is required");
@@ -11,7 +11,7 @@ public class GetRandomChallengeDtoValidator : Validator<GetRandomChallengeDto>
RuleFor(x => x.Libelle)
.NotEmpty()
.WithMessage("Libelle is required")
.MaximumLength(200) //Add BDD
.MaximumLength(200)
.WithMessage("Libelle cannot exceed 200 characters")
.MinimumLength(2)
.WithMessage("Libelle must exceed 2 characters");
@@ -11,8 +11,8 @@ public class GetUserChallengeDtoValidator : Validator<GetUserChallengeDto>
RuleFor(x => x.ChallengeTitle)
.NotEmpty()
.WithMessage("Challenge Title is required")
.MaximumLength(100)
.WithMessage("Challenge Title cannot exceed 100 characters");
.MaximumLength(200)
.WithMessage("Challenge Title cannot exceed 200 characters");
RuleFor(x => x.ChallengeDescription)
.NotEmpty()
@@ -11,8 +11,6 @@ public class PatchUserPasswordDtoValidator : Validator<PatchUserPasswordDto>
RuleFor(x => x.Password)
.NotEmpty()
.WithMessage("Password is required")
.MaximumLength(60)
.WithMessage("Password cannot exceed 60 characters")
.MinimumLength(12)
.WithMessage("Password must exceed 12 characters");
}