using Azaion.Common.Entities; using FluentValidation; namespace Azaion.Common.Requests; public class GetResourceRequest { public string Password { get; set; } = null!; public string HardwareId { get; set; } = null!; public ResourceEnum ResourceEnum { get; set; } } public class GetResourceRequestValidator : AbstractValidator { public GetResourceRequestValidator() { RuleFor(r => r.Password) .MinimumLength(8).WithErrorCode(ExceptionEnum.PasswordLengthIncorrect.ToString()).WithMessage("Password should be at least 8 characters."); RuleFor(r => r.HardwareId) .NotEmpty().WithErrorCode(ExceptionEnum.HardwareIdMismatch.ToString()).WithMessage("Hardware Id should be not empty."); } }