using AutobusApi.Domain.Enums; using FluentValidation; namespace AutobusApi.Application.Addresses.Commands.CreateAddress; public class CreateAddressCommandValidator : AbstractValidator { public CreateAddressCommandValidator() { RuleFor(v => v.Name).MinimumLength(2).MaximumLength(64); RuleFor(v => v.CityId).GreaterThan(0); RuleFor(v => v.Latitude).GreaterThanOrEqualTo(-180).LessThanOrEqualTo(180); RuleFor(v => v.Longitude).GreaterThanOrEqualTo(-180).LessThanOrEqualTo(180); RuleFor(v => v.VehicleType).Must(value => Enum.TryParse(value, true, out _)); } }