| | | 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="RegisterCommand" /> (UC-47, FR-SR-03). A caller learns only that |
| | | 8 | | /// their own input is malformed — never whether an address is registered. |
| | | 9 | | /// </summary> |
| | | 10 | | public class RegisterCommandValidator : AbstractValidator<RegisterCommand> |
| | | 11 | | { |
| | 41 | 12 | | public RegisterCommandValidator() |
| | | 13 | | { |
| | 41 | 14 | | RuleFor(command => command.Name).PersonName(); |
| | 41 | 15 | | RuleFor(command => command.Email).PersonEmail(); |
| | 41 | 16 | | RuleFor(command => command.Password).PersonPassword(); |
| | 41 | 17 | | RuleFor(command => command.ScopeId).NotNull().WithMessage(AuthMessages.ScopeRequired); |
| | 41 | 18 | | } |
| | | 19 | | } |