33 lines
1.1 KiB
C#
33 lines
1.1 KiB
C#
using FluentValidation;
|
|
using Indotalent.Shared.Consts;
|
|
|
|
namespace Indotalent.Features.Payroll.Income.Cqrs;
|
|
|
|
public class UpdateIncomeValidator : AbstractValidator<UpdateIncomeRequest>
|
|
{
|
|
public UpdateIncomeValidator()
|
|
{
|
|
RuleFor(x => x.Id)
|
|
.NotEmpty().WithMessage("ID is required for update");
|
|
|
|
RuleFor(x => x.Code)
|
|
.NotEmpty().WithMessage("Code is required")
|
|
.MaximumLength(GlobalConsts.StringLengthShort);
|
|
|
|
RuleFor(x => x.Name)
|
|
.NotEmpty().WithMessage("Name is required")
|
|
.MaximumLength(GlobalConsts.StringLengthShort);
|
|
|
|
RuleFor(x => x.Type)
|
|
.NotEmpty().WithMessage("Type is required")
|
|
.MaximumLength(GlobalConsts.StringLengthShort);
|
|
|
|
RuleFor(x => x.CalculationBase)
|
|
.NotEmpty().WithMessage("Calculation Base is required")
|
|
.MaximumLength(GlobalConsts.StringLengthShort);
|
|
|
|
RuleFor(x => x.Status)
|
|
.NotEmpty().WithMessage("Status is required")
|
|
.MaximumLength(GlobalConsts.StringLengthShort);
|
|
}
|
|
} |