Spaces:
Runtime error
Runtime error
File size: 659 Bytes
de8b914 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | using FluentValidation;
using SCM.Application.Medicao.Dtos;
using SCM.Domain.Medicao;
namespace SCM.Application.Medicao.Validators;
public sealed class CreateEapRequestValidator : AbstractValidator<CreateEapRequest>
{
public CreateEapRequestValidator()
{
RuleFor(x => x.ObraId).NotEmpty().WithMessage("A obra é obrigatória.");
RuleFor(x => x.Codigo)
.NotEmpty().WithMessage("O código da EAP é obrigatório.")
.MaximumLength(Eap.MaxCodigo);
RuleFor(x => x.Descricao)
.NotEmpty().WithMessage("A descrição da EAP é obrigatória.")
.MaximumLength(Eap.MaxDescricao);
}
}
|