initial commit
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
using FluentValidation;
|
||||
using Indotalent.Shared.Consts;
|
||||
|
||||
namespace Indotalent.Features.Organization.Employee.Cqrs;
|
||||
|
||||
public class CreateEmployeeIncomeValidator : AbstractValidator<CreateEmployeeIncomeRequest>
|
||||
{
|
||||
public CreateEmployeeIncomeValidator()
|
||||
{
|
||||
RuleFor(x => x.EmployeeId).NotEmpty().WithMessage("Employee is required");
|
||||
RuleFor(x => x.IncomeId).NotEmpty().WithMessage("Income component is required");
|
||||
RuleFor(x => x.Amount).GreaterThanOrEqualTo(0).WithMessage("Amount must be 0 or greater");
|
||||
RuleFor(x => x.Description).MaximumLength(GlobalConsts.StringLengthShort);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user