Squash and merge of version-0.1 Co-authored-by: James Wampler <james@wamp.dev> Co-committed-by: James Wampler <james@wamp.dev>
21 lines
504 B
C#
Executable File
21 lines
504 B
C#
Executable File
using FluentValidation;
|
|
|
|
namespace MicCheck.Api.Features;
|
|
|
|
public record UpdateFeatureRequest(
|
|
string Name,
|
|
string? Description
|
|
);
|
|
|
|
public class UpdateFeatureRequestValidator : AbstractValidator<UpdateFeatureRequest>
|
|
{
|
|
public UpdateFeatureRequestValidator()
|
|
{
|
|
RuleFor(x => x.Name)
|
|
.NotEmpty()
|
|
.MaximumLength(150)
|
|
.Matches("^[a-zA-Z0-9_-]+$")
|
|
.WithMessage("Name may only contain letters, digits, underscores, and hyphens.");
|
|
}
|
|
}
|