23 lines
800 B
C#
23 lines
800 B
C#
using FluentValidation;
|
|
using Liber_Incantamentum.Application.DTOs.Spell;
|
|
|
|
namespace Liber_Incantamentum.Application.Services.Validations
|
|
{
|
|
public class SpellDtoCreateValidator : AbstractValidator<SpellDtoCreate>
|
|
{
|
|
public SpellDtoCreateValidator()
|
|
{
|
|
RuleFor(m => m.Name)
|
|
.NotEmpty().WithMessage("The Name is required");
|
|
RuleFor(m => m.Description)
|
|
.NotEmpty().WithMessage("The description is required");
|
|
RuleFor(m => m.Type)
|
|
.NotEmpty().WithMessage("The type is required");
|
|
RuleFor(m => m.CreationDate)
|
|
.LessThanOrEqualTo(DateTime.UtcNow);
|
|
RuleFor(m => m.MageId)
|
|
.NotEmpty().WithMessage("The mage id is required");
|
|
}
|
|
}
|
|
}
|