diff --git a/DocumentService.Client/Clients/WorkflowsClient.cs b/DocumentService.Client/Clients/WorkflowsClient.cs index bc3e17a..823b37e 100644 --- a/DocumentService.Client/Clients/WorkflowsClient.cs +++ b/DocumentService.Client/Clients/WorkflowsClient.cs @@ -41,33 +41,4 @@ public class WorkflowsClient(IPdfValidationClient validation, ISwissQrCodeClient var qrCode = await swissQrCode.ExtractAsync(pdfStream, raw, cancellationToken); return new SwissQrCodeResult(qrCode, validationResult); } -} - -/// -/// Convenience extensions for that accept a file path as input. -/// Defined alongside so they are discoverable without an additional using directive. -/// -public static class WorkflowsClientExtensions -{ - /// - /// Validates the PDF at and attempts Swiss QR Code extraction - /// in a single call. Opens a and delegates to - /// . - /// - /// The workflows client. - /// Absolute or relative path to the PDF file. - /// - /// false (default) – returns a parsed Bill object.
- /// true – returns raw QR text lines without parsing. - /// - /// Cancellation token. - public static async Task InspectSwissQrCodeAsync( - this IWorkflowsClient client, - string filePath, - bool raw = false, - CancellationToken cancellationToken = default) - { - using var stream = File.OpenRead(filePath); - return await client.InspectSwissQrCodeAsync(stream, raw, cancellationToken); - } -} +} \ No newline at end of file diff --git a/DocumentService.Client/Interfaces/IWorkflowsClient.cs b/DocumentService.Client/Interfaces/IWorkflowsClient.cs index 93400cc..52d8e47 100644 --- a/DocumentService.Client/Interfaces/IWorkflowsClient.cs +++ b/DocumentService.Client/Interfaces/IWorkflowsClient.cs @@ -40,3 +40,32 @@ public interface IWorkflowsClient bool raw = false, CancellationToken cancellationToken = default); } + +/// +/// Convenience extensions for that accept a file path as input. +/// Defined alongside so they are discoverable without an additional using directive. +/// +public static class WorkflowsClientExtensions +{ + /// + /// Validates the PDF at and attempts Swiss QR Code extraction + /// in a single call. Opens a and delegates to + /// . + /// + /// The workflows client. + /// Absolute or relative path to the PDF file. + /// + /// false (default) – returns a parsed Bill object.
+ /// true – returns raw QR text lines without parsing. + /// + /// Cancellation token. + public static async Task InspectSwissQrCodeAsync( + this IWorkflowsClient client, + string filePath, + bool raw = false, + CancellationToken cancellationToken = default) + { + using var stream = File.OpenRead(filePath); + return await client.InspectSwissQrCodeAsync(stream, raw, cancellationToken); + } +} \ No newline at end of file