| | | 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="CreateApplicationCommand" /> (UC-16, AF-16d). Scope existence, |
| | | 8 | | /// actor authorization, and owner eligibility are enforced by the handler. |
| | | 9 | | /// </summary> |
| | | 10 | | public class CreateApplicationCommandValidator : AbstractValidator<CreateApplicationCommand> |
| | | 11 | | { |
| | 21 | 12 | | public CreateApplicationCommandValidator() |
| | | 13 | | { |
| | 21 | 14 | | RuleFor(command => command.Name) |
| | 21 | 15 | | .NotEmpty().WithMessage(ApplicationMessages.NameRequired) |
| | 21 | 16 | | .MaximumLength(200).WithMessage(ApplicationMessages.NameTooLong); |
| | | 17 | | |
| | 21 | 18 | | RuleFor(command => command.OwnerId) |
| | 21 | 19 | | .NotEmpty().WithMessage(ApplicationMessages.OwnerRequired); |
| | 21 | 20 | | } |
| | | 21 | | } |