Enhance ExtractSwissQrCode feature documentation

Updated `DocumentEndpoints` to include detailed requirements, return values, and use case for the `ExtractSwissQrCode` endpoint.

Marked Feature 2 (`ExtractSwissQrCode`) as completed in `PHASENPLAN.md` and `ROADMAP.md`, summarizing achievements and outlining next steps for Feature 3 (`ExtractAttachments`).

Enhanced `ExtractSwissQrCodeRequest` and `ExtractSwissQrCodeResponse` DTOs with example JSON payloads for clarity.

Expanded `SwissQrCodeDataDto` and `AddressDataDto` with detailed field-level documentation to improve usability and adherence to Swiss QR Bill Standard 2.0.
This commit is contained in:
OlgunR
2026-06-26 08:58:25 +02:00
parent c5db216f15
commit 84c0a54c1e
5 changed files with 159 additions and 38 deletions

View File

@@ -6,6 +6,12 @@ namespace DocumentOperator.Application.Common.DTOs;
/// </summary>
/// <param name="References">Array of reference strings to pass through in the response</param>
/// <param name="Base64Pdf">PDF document encoded as Base64 string</param>
/// <example>
/// {
/// "references": ["REF-001", "REF-002"],
/// "base64Pdf": "JVBERi0xLjQK..."
/// }
/// </example>
public record ExtractSwissQrCodeRequest(
IReadOnlyList<string> References,
string Base64Pdf

View File

@@ -5,42 +5,112 @@ namespace DocumentOperator.Application.Common.DTOs;
/// </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>
/// <example>
/// {
/// "references": ["REF-001", "REF-002"],
/// "qrCodeData": {
/// "qrType": "SPC",
/// "version": "0200",
/// "codingType": "1",
/// "iban": "CH4431999123000889012",
/// "creditor": {
/// "addressType": "S",
/// "name": "Robert Schneider AG",
/// "street": "Rue du Lac",
/// "buildingNumber": "1268",
/// "postalCode": "2501",
/// "city": "Biel",
/// "country": "CH"
/// },
/// "amount": 1949.75,
/// "currency": "CHF",
/// "referenceType": "QRR",
/// "reference": "210000000003139471430009017"
/// }
/// }
/// </example>
public record ExtractSwissQrCodeResponse(
IReadOnlyList<string> References,
SwissQrCodeDataDto QrCodeData
);
/// <summary>
/// Swiss QR Code data according to Swiss QR Bill Standard 2.0
/// Swiss QR Code data according to Swiss QR Bill Standard 2.0.
/// Contains all fields defined in the Swiss Payment Standards.
/// </summary>
public record SwissQrCodeDataDto(
/// <summary>QR type - always "SPC" for Swiss Payment Code</summary>
string QrType,
/// <summary>Version of the Swiss QR Code standard (e.g., "0200" for version 2.0)</summary>
string Version,
/// <summary>Character set code (always "1" for UTF-8)</summary>
string CodingType,
/// <summary>IBAN of the creditor (payee)</summary>
string Iban,
/// <summary>Creditor (payee) information</summary>
AddressDataDto Creditor,
/// <summary>Ultimate creditor information (optional)</summary>
AddressDataDto? UltimateCreditor,
/// <summary>Payment amount (null if not specified)</summary>
decimal? Amount,
/// <summary>Currency code (CHF or EUR)</summary>
string Currency,
/// <summary>Ultimate debtor (payer) information (optional)</summary>
AddressDataDto? UltimateDebtor,
/// <summary>Reference type: "QRR" (QR Reference), "SCOR" (Creditor Reference ISO 11649), or "NON" (No Reference)</summary>
string ReferenceType,
/// <summary>Payment reference (format depends on ReferenceType)</summary>
string? Reference,
/// <summary>Unstructured message (max 140 characters)</summary>
string? UnstructuredMessage,
/// <summary>Bill information (structured data for automated processing)</summary>
string? BillInformation,
/// <summary>Alternative procedure parameters (up to 2 entries)</summary>
IReadOnlyList<string>? AlternativeProcedureParameters
);
/// <summary>
/// Address data (creditor or debtor) in Swiss QR Code
/// Address data in Swiss QR Code (creditor or debtor).
/// Can be either structured (S) or combined (K) format.
/// </summary>
public record AddressDataDto(
/// <summary>Address type: "S" for structured, "K" for combined</summary>
string AddressType,
/// <summary>Name of person or company</summary>
string Name,
/// <summary>Street name (structured address only)</summary>
string? Street,
/// <summary>Building number (structured address only)</summary>
string? BuildingNumber,
/// <summary>Address line 1 (combined address only)</summary>
string? AddressLine1,
/// <summary>Address line 2 (combined address only)</summary>
string? AddressLine2,
/// <summary>Postal code</summary>
string PostalCode,
/// <summary>City/town name</summary>
string City,
/// <summary>Two-letter country code (ISO 3166-1 alpha-2)</summary>
string Country
);