14 lines
624 B
C#
14 lines
624 B
C#
using FluentValidation;
|
|
|
|
namespace Indotalent.Features.Inventory.TransferOut.Cqrs;
|
|
|
|
public class CreateTransferOutValidator : AbstractValidator<CreateTransferOutRequest>
|
|
{
|
|
public CreateTransferOutValidator()
|
|
{
|
|
RuleFor(x => x.TransferReleaseDate).NotEmpty().WithMessage("Date is required");
|
|
RuleFor(x => x.WarehouseFromId).NotEmpty().WithMessage("Source warehouse is required");
|
|
RuleFor(x => x.WarehouseToId).NotEmpty().WithMessage("Destination warehouse is required")
|
|
.NotEqual(x => x.WarehouseFromId).WithMessage("Source and Destination warehouse cannot be the same");
|
|
}
|
|
} |