using FluentValidation; namespace DocumentOperator.Application.ValidatePdfA.Validators; /// /// Validator for ValidatePdfAQuery /// Ensures exactly ONE input format is provided (PdfBytes XOR Base64Pdf) /// public class ValidatePdfAQueryValidator : AbstractValidator { public ValidatePdfAQueryValidator() { RuleFor(x => x) .Must(x => (x.PdfBytes != null && x.PdfBytes.Length > 0) ^ !string.IsNullOrWhiteSpace(x.Base64Pdf)) .WithMessage("Either PdfBytes or Base64Pdf must be provided, but not both"); } }