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

namespace TakeoutSaaS.Application.App.Inventory.Validators;

/// <summary>
/// 释放库存命令验证器。
/// </summary>
public sealed class ReleaseInventoryCommandValidator : AbstractValidator<ReleaseInventoryCommand>
{
    /// <summary>
    /// 初始化验证规则。
    /// </summary>
    public ReleaseInventoryCommandValidator()
    {
        RuleFor(x => x.StoreId).GreaterThan(0);
        RuleFor(x => x.ProductSkuId).GreaterThan(0);
        RuleFor(x => x.Quantity).GreaterThan(0);
        RuleFor(x => x.IdempotencyKey).MaximumLength(128);
    }
}
