15 lines
609 B
C#
15 lines
609 B
C#
using FluentValidation;
|
|
using Indotalent.Shared.Consts;
|
|
|
|
namespace Indotalent.Features.Organization.Employee.Cqrs;
|
|
|
|
public class UpdateEmployeeIncomeValidator : AbstractValidator<UpdateEmployeeIncomeRequest>
|
|
{
|
|
public UpdateEmployeeIncomeValidator()
|
|
{
|
|
RuleFor(x => x.Id).NotEmpty().WithMessage("ID 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);
|
|
}
|
|
} |