23 lines
690 B
C#
23 lines
690 B
C#
using FluentValidation;
|
|
using TakeoutSaaS.Application.App.Payments.Commands;
|
|
|
|
namespace TakeoutSaaS.Application.App.Payments.Validators;
|
|
|
|
/// <summary>
|
|
/// 创建支付记录命令验证器。
|
|
/// </summary>
|
|
public sealed class CreatePaymentCommandValidator : AbstractValidator<CreatePaymentCommand>
|
|
{
|
|
/// <summary>
|
|
/// 初始化验证规则。
|
|
/// </summary>
|
|
public CreatePaymentCommandValidator()
|
|
{
|
|
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);
|
|
}
|
|
}
|