using Atomx.Admin.Client.Models;
using FluentValidation;

namespace Atomx.Admin.Client.Validators
{
    public class AddressModelValidator : AbstractValidator<AddressModel>
    {
        public AddressModelValidator()
        {
            RuleFor(p => p.Name).NotEmpty().WithMessage("请填写收件人信息");
            RuleFor(p => p.Email).EmailAddress().When(p => !string.IsNullOrEmpty(p.Email)).WithMessage("请填写你常用的邮箱地址");
        }
    }
}
