Add Swiss QR Code extraction feature
Introduced DTOs for request and response to handle Swiss QR Code extraction from PDF documents. Implemented `ExtractSwissQrCodeHandler` to process the extraction using `ISwissQrCodeProcessor`. Added validation for the query with `ExtractSwissQrCodeValidator`. Developed unit tests to ensure correct behavior for successful and failure scenarios.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
using FluentValidation;
|
||||
|
||||
namespace DocumentOperator.Application.Features.Documents.ExtractSwissQrCode;
|
||||
|
||||
/// <summary>
|
||||
/// Validates ExtractSwissQrCodeQuery before handler execution.
|
||||
/// Ensures references array and PDF content are provided.
|
||||
/// </summary>
|
||||
public sealed class ExtractSwissQrCodeValidator : AbstractValidator<ExtractSwissQrCodeQuery>
|
||||
{
|
||||
public ExtractSwissQrCodeValidator()
|
||||
{
|
||||
RuleFor(x => x.References)
|
||||
.NotNull()
|
||||
.WithMessage("References array is required.");
|
||||
|
||||
RuleFor(x => x.PdfContent)
|
||||
.NotNull()
|
||||
.WithMessage("PDF content is required.");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user