26 lines
808 B
C#
26 lines
808 B
C#
using FluentValidation;
|
|
using Indotalent.Shared.Consts;
|
|
|
|
namespace Indotalent.Features.Performance.Evaluation.Cqrs;
|
|
|
|
public class UpdateEvaluationValidator : AbstractValidator<UpdateEvaluationRequest>
|
|
{
|
|
public UpdateEvaluationValidator()
|
|
{
|
|
RuleFor(x => x.Id)
|
|
.NotEmpty().WithMessage("ID is required for update");
|
|
|
|
RuleFor(x => x.EmployeeId)
|
|
.NotEmpty().WithMessage("Employee is required");
|
|
|
|
RuleFor(x => x.Period)
|
|
.NotEmpty().WithMessage("Evaluation Period is required")
|
|
.MaximumLength(GlobalConsts.StringLengthShort);
|
|
|
|
RuleFor(x => x.FinalScore)
|
|
.NotEmpty().WithMessage("Final Score is required");
|
|
|
|
RuleFor(x => x.EvaluatorId)
|
|
.NotEmpty().WithMessage("Evaluator is required");
|
|
}
|
|
} |