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

namespace TakeoutSaaS.Application.App.Stores.Validators;

/// <summary>
/// 批量生成桌码命令验证器。
/// </summary>
public sealed class GenerateStoreTablesCommandValidator : AbstractValidator<GenerateStoreTablesCommand>
{
    /// <summary>
    /// 初始化验证规则。
    /// </summary>
    public GenerateStoreTablesCommandValidator()
    {
        RuleFor(x => x.StoreId).GreaterThan(0);
        RuleFor(x => x.TableCodePrefix).NotEmpty().MaximumLength(16);
        RuleFor(x => x.StartNumber).GreaterThan(0);
        RuleFor(x => x.Count).GreaterThan(0).LessThanOrEqualTo(500);
        RuleFor(x => x.DefaultCapacity).GreaterThan(0).LessThanOrEqualTo(50);
        RuleFor(x => x.Tags).MaximumLength(128);
    }
}
