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

namespace TakeoutSaaS.Application.App.Stores.Validators;

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