Add AuthScopedValidator and register FluentValidation
Introduced AuthScopedValidator to enforce non-empty AddedWho on IAuthScoped entities with a clear error message. Registered all validators from the assembly in DI to enable automatic validation for authentication-scoped entities.
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
using FluentValidation;
|
||||
using ReC.Application.Common.Interfaces;
|
||||
|
||||
namespace ReC.Application.Common.Validations;
|
||||
|
||||
public class AuthScopedValidator : AbstractValidator<IAuthScoped>
|
||||
{
|
||||
public AuthScopedValidator()
|
||||
{
|
||||
RuleFor(x => x.AddedWho)
|
||||
.NotEmpty()
|
||||
.WithMessage("The 'AddedWho' field is required. A missing value may indicate an API configuration issue. Please contact your system administrator for assistance.");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user