| | | 1 | | using ArturRios.Heimdall.Shared.Messages; |
| | | 2 | | using FluentValidation; |
| | | 3 | | |
| | | 4 | | namespace ArturRios.Heimdall.Command.Input.Validation; |
| | | 5 | | |
| | | 6 | | /// <summary> |
| | | 7 | | /// Shape validation for <see cref="CreateScopeOwnerCommand" /> (UC-06 path c, AF-06d). Scope |
| | | 8 | | /// existence, ownership, and email uniqueness are enforced by the handler. |
| | | 9 | | /// </summary> |
| | | 10 | | public class CreateScopeOwnerCommandValidator : AbstractValidator<CreateScopeOwnerCommand> |
| | | 11 | | { |
| | 5 | 12 | | public CreateScopeOwnerCommandValidator() |
| | | 13 | | { |
| | 5 | 14 | | RuleFor(command => command.Name) |
| | 5 | 15 | | .NotEmpty().WithMessage(PersonMessages.NameRequired) |
| | 5 | 16 | | .MaximumLength(200).WithMessage(PersonMessages.NameTooLong); |
| | | 17 | | |
| | 5 | 18 | | RuleFor(command => command.Email) |
| | 5 | 19 | | .NotEmpty().WithMessage(PersonMessages.EmailRequired) |
| | 5 | 20 | | .EmailAddress().WithMessage(PersonMessages.EmailInvalid); |
| | | 21 | | |
| | 5 | 22 | | RuleFor(command => command.Password) |
| | 5 | 23 | | .NotEmpty().WithMessage(PersonMessages.PasswordRequired) |
| | 5 | 24 | | .MinimumLength(8).WithMessage(PersonMessages.PasswordTooShort); |
| | 5 | 25 | | } |
| | | 26 | | } |