Refactor DTOs and tests; add framework-specific handling
Refactored the codebase to use shared DTOs from `DocumentService.Application.Common.DTOs`, removing inline DTO definitions in client interfaces and tests. Introduced conditional compilation to handle framework-specific differences in DTOs and handlers. Updated test cases to align with the new DTO structures, including `SwissQrCodeExtractionResult`, `PdfValidationResult`, and `ZugferdExtractionResult`. Adjusted test data to match updated DTO properties. Cleaned up solution and project files, ensuring proper references and organization. Removed unused files and fixed project references in `DocumentService.Tests.csproj`. Improved maintainability and consistency across the codebase.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
using DocumentService.Application.Common.DTOs;
|
||||
|
||||
namespace DocumentService.Client.Interfaces;
|
||||
|
||||
/// <summary>
|
||||
@@ -24,13 +26,3 @@ public interface ISwissQrCodeClient
|
||||
Task<SwissQrCodeExtractionResult> ExtractSwissQrCodeAsync(byte[] pdfBytes, bool raw = false, CancellationToken cancellationToken = default);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// DTO for Swiss QR Code extraction result
|
||||
/// </summary>
|
||||
public record SwissQrCodeExtractionResult
|
||||
{
|
||||
/// <summary>Parsed Swiss QR bill object. <c>null</c> when <c>raw=true</c> was requested.</summary>
|
||||
public object? Bill { get; init; }
|
||||
/// <summary>Raw QR code text lines. Populated when <c>raw=true</c> was requested.</summary>
|
||||
public List<string> RawLines { get; init; } = new();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user