using FluentValidation;
using Hotline.Share.Dtos.Org;

namespace Hotline.Validators.Orgs;

public class AddOrgDtoValidator : AbstractValidator<AddOrgDto>
{
    public AddOrgDtoValidator()
    {
        RuleFor(d => d.Name).NotEmpty();
        RuleFor(d => d.ShortName).NotEmpty();
        RuleFor(d => d.AreaCode).NotEmpty();
        RuleFor(d => d.AreaName).NotEmpty();
    }
}

public class UpdateOrgDtoValidator : AbstractValidator<UpdateOrgDto>
{
    public UpdateOrgDtoValidator()
    {
        Include(new AddOrgDtoValidator());
    }
}