Initial import

This commit is contained in:
Stein Helge Riise
2025-11-17 08:32:46 +01:00
commit ede31fbb7e
129 changed files with 9514 additions and 0 deletions
@@ -0,0 +1,22 @@
using FluentValidation;
namespace MinAttest.Application.Features.Attests.Commands;
public class PersonUploadAttestCommandValidator : AbstractValidator<PersonUploadAttestCommand>
{
public PersonUploadAttestCommandValidator()
{
RuleFor(x => x.PersonId).NotEqual(Guid.Empty);
RuleFor(x => x.Request.Title).NotEmpty().MaximumLength(200);
RuleFor(x => x.Request.BlobPath).MaximumLength(500);
RuleFor(x => x.Request.From).LessThanOrEqualTo(x => x.Request.To);
RuleFor(x => x.Request)
.Must(r => !string.IsNullOrWhiteSpace(r.BlobPath) || !string.IsNullOrWhiteSpace(r.ContentBase64))
.WithMessage("Either BlobPath or ContentBase64 must be provided");
When(x => !string.IsNullOrWhiteSpace(x.Request.ContentBase64), () =>
{
RuleFor(x => x.Request.ContentType).NotEmpty().MaximumLength(255);
});
}
}