Register announcement validator in application layer
TaxBaik CI/CD / build-and-deploy (push) Successful in 1m1s
TaxBaik CI/CD / build-and-deploy (push) Successful in 1m1s
This commit is contained in:
@@ -54,6 +54,23 @@ public sealed class CreateClientDtoValidator : AbstractValidator<CreateClientDto
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class AnnouncementDtoValidator : AbstractValidator<AnnouncementDto>
|
||||
{
|
||||
public AnnouncementDtoValidator()
|
||||
{
|
||||
RuleFor(x => x.Title)
|
||||
.NotEmpty().WithMessage("제목을 입력하세요.")
|
||||
.MaximumLength(ValidationRules.TitleMaxLength).WithMessage("제목은 최대 100자까지 입력 가능합니다.");
|
||||
|
||||
RuleFor(x => x.Content)
|
||||
.MaximumLength(2000).WithMessage("상세 내용은 최대 2000자까지 입력 가능합니다.");
|
||||
|
||||
RuleFor(x => x.DisplayType)
|
||||
.NotEmpty().WithMessage("표시 유형을 선택하세요.")
|
||||
.MaximumLength(20).WithMessage("표시 유형은 최대 20자까지 입력 가능합니다.");
|
||||
}
|
||||
}
|
||||
|
||||
public sealed class FaqValidator : AbstractValidator<TaxBaik.Domain.Entities.Faq>
|
||||
{
|
||||
public FaqValidator()
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
namespace TaxBaik.Web.Endpoints.Announcement;
|
||||
|
||||
using FluentValidation;
|
||||
using TaxBaik.Application.DTOs;
|
||||
|
||||
public sealed class AnnouncementDtoValidator : AbstractValidator<AnnouncementDto>
|
||||
{
|
||||
public AnnouncementDtoValidator()
|
||||
{
|
||||
RuleFor(x => x.Title)
|
||||
.NotEmpty().WithMessage("제목을 입력하세요.")
|
||||
.MaximumLength(ValidationRules.TitleMaxLength).WithMessage("제목은 최대 100자까지 입력 가능합니다.");
|
||||
|
||||
RuleFor(x => x.Content).MaximumLength(2000).WithMessage("상세 내용은 최대 2000자까지 입력 가능합니다.");
|
||||
RuleFor(x => x.DisplayType)
|
||||
.NotEmpty().WithMessage("표시 유형을 선택하세요.")
|
||||
.MaximumLength(20).WithMessage("표시 유형은 최대 20자까지 입력 가능합니다.");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user