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.
47 lines
1.3 KiB
C#
47 lines
1.3 KiB
C#
namespace DocumentOperator.Application.Common.DTOs;
|
|
|
|
/// <summary>
|
|
/// Response containing extracted Swiss QR Code data and passed-through references.
|
|
/// </summary>
|
|
/// <param name="References">Reference strings passed through from the request</param>
|
|
/// <param name="QrCodeData">Parsed Swiss QR Code data from the last page of the PDF</param>
|
|
public record ExtractSwissQrCodeResponse(
|
|
IReadOnlyList<string> References,
|
|
SwissQrCodeDataDto QrCodeData
|
|
);
|
|
|
|
/// <summary>
|
|
/// Swiss QR Code data according to Swiss QR Bill Standard 2.0
|
|
/// </summary>
|
|
public record SwissQrCodeDataDto(
|
|
string QrType,
|
|
string Version,
|
|
string CodingType,
|
|
string Iban,
|
|
AddressDataDto Creditor,
|
|
AddressDataDto? UltimateCreditor,
|
|
decimal? Amount,
|
|
string Currency,
|
|
AddressDataDto? UltimateDebtor,
|
|
string ReferenceType,
|
|
string? Reference,
|
|
string? UnstructuredMessage,
|
|
string? BillInformation,
|
|
IReadOnlyList<string>? AlternativeProcedureParameters
|
|
);
|
|
|
|
/// <summary>
|
|
/// Address data (creditor or debtor) in Swiss QR Code
|
|
/// </summary>
|
|
public record AddressDataDto(
|
|
string AddressType,
|
|
string Name,
|
|
string? Street,
|
|
string? BuildingNumber,
|
|
string? AddressLine1,
|
|
string? AddressLine2,
|
|
string PostalCode,
|
|
string City,
|
|
string Country
|
|
);
|