| | | 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="UpdateApplicationCommand" /> (UC-18 main flow step 2). The |
| | | 8 | | /// messages are UC-16's: the two use cases reject the same shapes, and UC-18 defines no |
| | | 9 | | /// alternative flow of its own for invalid input. Application existence, actor authorization, and |
| | | 10 | | /// owner eligibility are enforced by the handler. |
| | | 11 | | /// </summary> |
| | | 12 | | public class UpdateApplicationCommandValidator : AbstractValidator<UpdateApplicationCommand> |
| | | 13 | | { |
| | 17 | 14 | | public UpdateApplicationCommandValidator() |
| | | 15 | | { |
| | 17 | 16 | | RuleFor(command => command.Name) |
| | 17 | 17 | | .NotEmpty().WithMessage(ApplicationMessages.NameRequired) |
| | 17 | 18 | | .MaximumLength(200).WithMessage(ApplicationMessages.NameTooLong); |
| | | 19 | | |
| | 17 | 20 | | RuleFor(command => command.OwnerId) |
| | 17 | 21 | | .NotEmpty().WithMessage(ApplicationMessages.OwnerRequired); |
| | 17 | 22 | | } |
| | | 23 | | } |