validators

This commit is contained in:
2026-05-28 21:53:46 +02:00
parent 2f7f996faf
commit 76b5c0b49d
12 changed files with 172 additions and 3 deletions
@@ -0,0 +1,20 @@
using FluentValidation;
using WebApi.DataTransferObjects.PlayLists;
namespace WebApi.Validators.PlayLists;
public sealed class RequestPlayListPictureUploadRequestValidator : AbstractValidator<RequestPlayListPictureUploadRequest>
{
public RequestPlayListPictureUploadRequestValidator()
{
RuleFor(x => x.FileType)
.NotEmpty();
RuleFor(x => x.ContentType)
.NotEmpty();
RuleFor(x => x.ExpectedSizeBytes)
.GreaterThan(0)
.When(x => x.ExpectedSizeBytes.HasValue);
}
}