This commit is contained in:
andrei-mihnea-cerbu
2024-04-08 13:37:58 +03:00
parent 333ad8be09
commit 370bbdedcd
164 changed files with 3915 additions and 161 deletions
@@ -0,0 +1,18 @@
using FluentValidation;
namespace Application.Endpoints.Chats;
public class SendMessageValidator : AbstractValidator<SendMessageDto>
{
public SendMessageValidator()
{
RuleFor(x => x.Sender)
.NotEmpty().WithMessage("Sender Id is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString());
RuleFor(x => x.Receiver)
.NotEmpty().WithMessage("Receiver Id is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString());
RuleFor(x => x.Message)
.NotEmpty().WithMessage("Message is required.").WithErrorCode(HttpStatusCodes.BadRequest.ToString());
}
}