Created all validators

This commit is contained in:
2026-03-10 10:43:28 +01:00
parent 9f858df5f8
commit 5c3419abc0
19 changed files with 54 additions and 34 deletions

View File

@@ -14,9 +14,9 @@ public class CreateBookDtoValidator : Validator<CreateBookDto>
.WithMessage("Le titre ne peut pas dépasser 200 caractères.");
RuleFor(x => x.Isbn)
.NotEmpty().WithMessage("LISBN est obligatoire.")
.Matches(@"^\d{13}$")
.WithMessage("LISBN doit contenir exactement 13 chiffres.");
.NotEmpty()
.WithMessage("LISBN est obligatoire.")!
.IsValidIsbn13();
RuleFor(x => x.PageCount)
.GreaterThan(0)