20 lines
503 B
C#
20 lines
503 B
C#
using FluentValidation;
|
|
|
|
namespace AutobusApi.Application.Buses.Commands.UpdateBus;
|
|
|
|
public class UpdateBusCommandValidator : AbstractValidator<UpdateBusCommand>
|
|
{
|
|
public UpdateBusCommandValidator()
|
|
{
|
|
RuleFor(v => v.Id).GreaterThan(0);
|
|
|
|
RuleFor(v => v.CompanyId).GreaterThan(0);
|
|
|
|
RuleFor(v => v.Number).MinimumLength(8).MaximumLength(8);
|
|
|
|
RuleFor(v => v.Model).MinimumLength(2).MaximumLength(64);
|
|
|
|
RuleFor(v => v.Capacity).GreaterThan(0);
|
|
}
|
|
}
|