14 lines
608 B
C#
14 lines
608 B
C#
using FluentValidation;
|
|
|
|
namespace Indotalent.Features.Sales.PaymentReceive.Cqrs;
|
|
|
|
public class CreatePaymentReceiveValidator : AbstractValidator<CreatePaymentReceiveRequest>
|
|
{
|
|
public CreatePaymentReceiveValidator()
|
|
{
|
|
RuleFor(x => x.InvoiceId).NotEmpty().WithMessage("Invoice reference is required");
|
|
RuleFor(x => x.PaymentDate).NotEmpty().WithMessage("Payment date is required");
|
|
RuleFor(x => x.PaymentMethodId).NotEmpty().WithMessage("Payment method is required");
|
|
RuleFor(x => x.PaymentAmount).GreaterThan(0).WithMessage("Amount must be greater than 0");
|
|
}
|
|
} |