using FluentValidation;
using TakeoutSaaS.Application.App.Products.Commands;

namespace TakeoutSaaS.Application.App.Products.Validators;

/// <summary>
/// 下架商品命令验证器。
/// </summary>
public sealed class UnpublishProductCommandValidator : AbstractValidator<UnpublishProductCommand>
{
    /// <summary>
    /// 初始化验证规则。
    /// </summary>
    public UnpublishProductCommandValidator()
    {
        RuleFor(x => x.ProductId).GreaterThan(0);
        RuleFor(x => x.Reason).MaximumLength(256);
    }
}
