Files
blazor-hrm/Features/Organization/Employee/Cqrs/CreateEmployeeDeductionValidator.cs
2026-07-21 14:08:10 +07:00

15 lines
638 B
C#

using FluentValidation;
using Indotalent.Shared.Consts;
namespace Indotalent.Features.Organization.Employee.Cqrs;
public class CreateEmployeeDeductionValidator : AbstractValidator<CreateEmployeeDeductionRequest>
{
public CreateEmployeeDeductionValidator()
{
RuleFor(x => x.EmployeeId).NotEmpty().WithMessage("Employee is required");
RuleFor(x => x.DeductionId).NotEmpty().WithMessage("Deduction component is required");
RuleFor(x => x.Amount).GreaterThanOrEqualTo(0).WithMessage("Amount must be 0 or greater");
RuleFor(x => x.Description).MaximumLength(GlobalConsts.StringLengthShort);
}
}