using FluentValidation;
using TakeoutSaaS.Application.App.Merchants.Queries;

namespace TakeoutSaaS.Application.App.Merchants.Validators;

/// <summary>
/// 商户列表查询验证器。
/// </summary>
public sealed class SearchMerchantsQueryValidator : AbstractValidator<SearchMerchantsQuery>
{
    /// <summary>
    /// 初始化验证规则。
    /// </summary>
    public SearchMerchantsQueryValidator()
    {
        RuleFor(x => x.Page).GreaterThan(0);
        RuleFor(x => x.PageSize).InclusiveBetween(1, 200);
        RuleFor(x => x.SortBy).MaximumLength(64);
    }
}
