Add ExtractSwissQrCode feature and update feature order

Updated PHASENPLAN.md and ROADMAP.md to reflect the new
feature order, making "ExtractSwissQrCode" Feature 2 and
renumbering previous Features 2-5 to 3-6. Added detailed
steps, endpoints, and acceptance criteria for the new
feature.

Implemented `ISwissQrCodeProcessor` interface with
`DevExpressSwissQrCodeProcessor` for extracting and parsing
Swiss QR Codes using DevExpress and Codecrete libraries.
Registered the new service in DependencyInjection.cs.

Introduced `SwissQrCodeData` value object and
`SwissQrCodeNotFoundException` for domain modeling and
error handling. Updated project dependencies to include
libraries for QR code processing.

Adjusted existing feature descriptions and steps to align
with the new feature order.
This commit is contained in:
OlgunR
2026-06-26 08:39:44 +02:00
parent 18e956c2cf
commit 47cba50d0f
8 changed files with 534 additions and 59 deletions

View File

@@ -0,0 +1,22 @@
namespace DocumentOperator.Domain.Exceptions;
/// <summary>
/// Exception thrown when a Swiss QR Code cannot be found in a PDF document.
/// </summary>
public sealed class SwissQrCodeNotFoundException : Exception
{
public SwissQrCodeNotFoundException()
: base("No Swiss QR Code found on the last page of the PDF document.")
{
}
public SwissQrCodeNotFoundException(string message)
: base(message)
{
}
public SwissQrCodeNotFoundException(string message, Exception innerException)
: base(message, innerException)
{
}
}

View File

@@ -0,0 +1,129 @@
namespace DocumentOperator.Domain.ValueObjects;
/// <summary>
/// Represents Swiss QR Code data according to Swiss QR Bill Standard 2.0.
/// Immutable value object containing all fields from a Swiss QR payment part.
/// </summary>
public sealed record SwissQrCodeData
{
/// <summary>
/// QR type - always "SPC" for Swiss Payment Code
/// </summary>
public required string QrType { get; init; }
/// <summary>
/// Version of the Swiss QR Code standard (e.g., "0200" for version 2.0)
/// </summary>
public required string Version { get; init; }
/// <summary>
/// Character set code (always "1" for UTF-8)
/// </summary>
public required string CodingType { get; init; }
/// <summary>
/// IBAN of the creditor (payee)
/// </summary>
public required string Iban { get; init; }
/// <summary>
/// Creditor (payee) information
/// </summary>
public required AddressData Creditor { get; init; }
/// <summary>
/// Ultimate creditor information (optional)
/// </summary>
public AddressData? UltimateCreditor { get; init; }
/// <summary>
/// Payment amount (null if not specified)
/// </summary>
public decimal? Amount { get; init; }
/// <summary>
/// Currency code (CHF or EUR)
/// </summary>
public required string Currency { get; init; }
/// <summary>
/// Ultimate debtor (payer) information (optional)
/// </summary>
public AddressData? UltimateDebtor { get; init; }
/// <summary>
/// Reference type (QRR, SCOR, or NON)
/// </summary>
public required string ReferenceType { get; init; }
/// <summary>
/// Payment reference (format depends on ReferenceType)
/// </summary>
public string? Reference { get; init; }
/// <summary>
/// Unstructured message (max 140 characters)
/// </summary>
public string? UnstructuredMessage { get; init; }
/// <summary>
/// Bill information (structured data for automated processing)
/// </summary>
public string? BillInformation { get; init; }
/// <summary>
/// Alternative procedure parameters (up to 2 entries)
/// </summary>
public IReadOnlyList<string>? AlternativeProcedureParameters { get; init; }
}
/// <summary>
/// Represents address data in Swiss QR Code (creditor or debtor)
/// </summary>
public sealed record AddressData
{
/// <summary>
/// Address type: "S" for structured, "K" for combined
/// </summary>
public required string AddressType { get; init; }
/// <summary>
/// Name of person or company
/// </summary>
public required string Name { get; init; }
/// <summary>
/// Street name (structured address only)
/// </summary>
public string? Street { get; init; }
/// <summary>
/// Building number (structured address only)
/// </summary>
public string? BuildingNumber { get; init; }
/// <summary>
/// Address line 1 (combined address only)
/// </summary>
public string? AddressLine1 { get; init; }
/// <summary>
/// Address line 2 (combined address only)
/// </summary>
public string? AddressLine2 { get; init; }
/// <summary>
/// Postal code
/// </summary>
public required string PostalCode { get; init; }
/// <summary>
/// City/town name
/// </summary>
public required string City { get; init; }
/// <summary>
/// Two-letter country code (ISO 3166-1 alpha-2)
/// </summary>
public required string Country { get; init; }
}