23 lines
698 B
C#
23 lines
698 B
C#
using FluentValidation;
|
|
using Indotalent.Shared.Consts;
|
|
|
|
namespace Indotalent.Features.Utilities.BookingManager.Cqrs;
|
|
|
|
public class CreateBookingValidator : AbstractValidator<CreateBookingRequest>
|
|
{
|
|
public CreateBookingValidator()
|
|
{
|
|
RuleFor(x => x.Subject)
|
|
.NotEmpty().WithMessage("Subject is required")
|
|
.MaximumLength(GlobalConsts.StringLengthShort);
|
|
|
|
RuleFor(x => x.StartTime)
|
|
.NotEmpty().WithMessage("Start Time is required");
|
|
|
|
RuleFor(x => x.EndTime)
|
|
.NotEmpty().WithMessage("End Time is required");
|
|
|
|
RuleFor(x => x.BookingResourceId)
|
|
.NotEmpty().WithMessage("Resource is required");
|
|
}
|
|
} |