using FluentValidation; using TakeoutSaaS.Application.App.Payments.Commands; namespace TakeoutSaaS.Application.App.Payments.Validators; /// /// 更新支付记录命令验证器。 /// public sealed class UpdatePaymentCommandValidator : AbstractValidator { /// /// 初始化验证规则。 /// public UpdatePaymentCommandValidator() { RuleFor(x => x.PaymentId).GreaterThan(0); RuleFor(x => x.OrderId).GreaterThan(0); RuleFor(x => x.Amount).GreaterThan(0); RuleFor(x => x.TradeNo).MaximumLength(64); RuleFor(x => x.ChannelTransactionId).MaximumLength(64); RuleFor(x => x.Remark).MaximumLength(256); } }