initial commit
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
using FluentValidation;
|
||||
|
||||
namespace Indotalent.Features.Leave.LeaveBalance.Cqrs;
|
||||
|
||||
public class UpdateLeaveBalanceValidator : AbstractValidator<UpdateLeaveBalanceRequest>
|
||||
{
|
||||
public UpdateLeaveBalanceValidator()
|
||||
{
|
||||
RuleFor(x => x.Id).NotEmpty().WithMessage("ID is required for update");
|
||||
RuleFor(x => x.EmployeeId).NotEmpty().WithMessage("Employee is required");
|
||||
RuleFor(x => x.LeaveCategoryId).NotEmpty().WithMessage("Leave Category is required");
|
||||
RuleFor(x => x.Year).GreaterThan(2000);
|
||||
RuleFor(x => x.Entitlement).GreaterThanOrEqualTo(0);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user