Added Label on dto from Random Challenge

This commit is contained in:
2026-04-12 15:12:32 +01:00
parent 24ef10cdd1
commit ac830bf865
2 changed files with 9 additions and 0 deletions
@@ -3,6 +3,7 @@
public class GetRandomChallengeDto
{
public int Id { get; set; }
public string? Label { get; set; }
public string? Libelle { get; set; }
public int Duration { get; set; }
public bool IsAlreadyPast { get; set; }
@@ -8,6 +8,14 @@ public class GetRandomChallengeDtoValidator : Validator<GetRandomChallengeDto>
{
public GetRandomChallengeDtoValidator()
{
RuleFor(x => x.Label)
.NotEmpty()
.WithMessage("Label is required")
.MaximumLength(200)
.WithMessage("Label cannot exceed 200 characters")
.MinimumLength(2)
.WithMessage("Label must exceed 2 characters");
RuleFor(x => x.Libelle)
.NotEmpty()
.WithMessage("Libelle is required")