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

namespace TakeoutSaaS.Application.App.Payments.Validators;

/// <summary>
/// 支付记录查询验证器。
/// </summary>
public sealed class SearchPaymentsQueryValidator : AbstractValidator<SearchPaymentsQuery>
{
    /// <summary>
    /// 初始化验证规则。
    /// </summary>
    public SearchPaymentsQueryValidator()
    {
        RuleFor(x => x.Page).GreaterThan(0);
        RuleFor(x => x.PageSize).InclusiveBetween(1, 200);
        RuleFor(x => x.SortBy).MaximumLength(64);
    }
}
