- Move PdfMetadata, PdfAMetadata from Domain.Models.ValueObjects to Application.Common.DTOs
- Move AttachmentInfo, AttachmentMetadata from Domain.Models.ValueObjects to Application.Common.DTOs
- Reason: DTOs belong in Application layer, Domain should have zero external dependencies (Clean Architecture)
Removed detailed description of the `raw` parameter in XML
documentation for two methods in `SwissQrCodeController`.
Updated `<returns>` tag to simplify the explanation by
removing conditional details based on the `raw` parameter.
These changes affect methods handling multipart/form-data
PDF input and Base64 JSON input.
- Removed `<Folder>` elements in `DocumentOperator.Domain.csproj`
and replaced them with `<Compile Remove>`, `<EmbeddedResource Remove>`,
and `<None Remove>` to exclude specific directories.
- Removed unused `using DocumentOperator.Domain.Exceptions;` directive.
- Simplified `Split` method syntax for delimiter specification.
- Updated `return` statements to use concise parameter syntax.
- Removed page number validation logic in `DevExpressSwissQrCodeProcessor`.
- Replaced default page scanning logic with modern range expression.
- Overall, improved code clarity, reduced redundancy, and modernized syntax.
- Add 'raw' query parameter to both ExtractFromFile and ExtractFromBase64 methods
- Returns raw QR text lines when raw=true, parsed Bill object when raw=false (default)
- Remove obsolete 'references' parameter (not part of QR extraction logic)
- Add XML documentation for raw parameter
- Update ExceptionHandlingMiddleware to handle BadRequestException
- Update unit tests to assert (Bill, string[]) tuple return
- Update integration tests for new response structure (Bill + RawLines)
- Fix exception message assertion in DevExpressSwissQrCodeProcessorTests
- All 34 tests passing, 6 skipped (require real Swiss QR Bill PDFs)
- Add [Serializable] attribute to all custom exceptions
- Add protected constructors for serialization support
- Add XML documentation comments
- Update SwissQrCodeNotFoundException message format
- Change return type to tuple (Bill, string[])
- Remove custom parsing methods (ParseSwissQrBillContent, MapAddress, DetermineReferenceType)
- Use Codecrete QRBill.DecodeQrCodeText() for parsing
- Add SkiaSharp.QrCode v1.0.0 for QR decoding
- Remove obsolete ZXing and System.Drawing dependencies
- Add StringExtensions for QR code detection
- Raw lines properly split and trimmed from QR text
- Change SwissQrCodeExtractionResult to use Bill + RawLines
- Update ISwissQrCodeProcessor to return tuple (Bill, string[])
- Add Codecrete.SwissQRBill.Generator v3.4.0 package reference
- Update ExtractSwissQrCodeQuery handler to use AutoMapper for Bill->DTO mapping
- Remove References property from query (not needed for QR extraction)
- Add SwissQrBillDto, AddressDto, AlternativeSchemeDto for Codecrete Bill mapping
- Add BadRequestException to Domain exceptions
- DTOs include [Obsolete] warnings for deprecated fields (AddressLine1/2)
Introduced the `DualInputDocumentFilter` class to merge Swagger operations with the same path but different `[Consumes]` attributes (`multipart/form-data` and `application/json`) into a single operation. This ensures both content types are visible in the Swagger UI.
Updated `SwaggerConfiguration.cs` to:
- Resolve conflicting actions by keeping the first variant.
- Register the `DualInputDocumentFilter` to enable content type merging.
Integration test updates:
- PdfValidationControllerTests.cs (new)
- Test /api/pdf/validation/validate endpoint
- Test BOTH multipart/form-data AND Base64 JSON
- ExtractSwissQrCodeEndpointTests.cs (updated)
- Update endpoint path to /api/swissqrcode/extract
- Test BOTH input formats
Unit test updates:
- ValidatePdfHandlerTests.cs:
- Update for Query + Handler co-location
- Test AutoMapper integration
- ExtractSwissQrCodeHandlerTests.cs:
- Update for Query + Handler co-location
- Test AutoMapper integration
Deleted:
- DocumentEndpointsTests.cs (Minimal API tests, no longer relevant)
Result: 20/20 tests passing, Controller endpoint coverage
- Upgrade AutoMapper from 12.0.1 to 16.2.0
- Remove deprecated AutoMapper.Extensions.Microsoft.DependencyInjection v12.0.1
(deprecated 25 May 2023, DI moved to main package in v13.0+)
- Update DI registration: AddAutoMapper(cfg => {}, typeof(MappingProfile))
(v13.0+ requires Action<IMapperConfigurationExpression> + marker type)
Security fix:
- Resolves NU1903 vulnerability (GHSA-rvv3-g6hj-g44x DoS in v12.0.1)
Result: AutoMapper v16.2.0, 0 security warnings, all tests passing
Comprehensive architecture documentation including:
- Clean Architecture with Controller-based API (NOT Minimal API)
- Vertical slice architecture pattern
- Exception-based error handling (no Result<T>)
- Feature-driven development approach
- Primary constructor coding standards
- Git commit guidelines
- Swiss QR Bill backward compatibility decisions
Key decisions documented:
- Windows-only targeting (no Linux support needed)
- Support BOTH multipart/form-data AND Base64 JSON
- Separate endpoints for Combined Address (K-Type) legacy support
- Multi-tenancy deferred until after all sync features complete
Add missing XML doc comments to resolve CS1591 warnings:
- SerilogConfiguration: Class comment
- SwaggerConfiguration: Class and AddSwaggerDocumentation() method
- ExceptionHandlingMiddleware: Constructor and InvokeAsync() method
- RequestLoggingMiddleware: Placeholder class comment
- TenantResolutionMiddleware: Placeholder class comment
- Program: Partial class comment for integration test access
Result: 0 CS1591 warnings in DocumentOperator.API project
- Replace System.Drawing.Bitmap with DevExpress.Drawing.DXBitmap
- Fix CA1416 warnings (Windows-specific API usage)
- Fix CS0618 warning (TryInverted property moved to Options.TryInverted)
- Add [SupportedOSPlatform(windows)] attribute to DecodeQrCodeFromImage()
- Add Swiss QR Bill backward compatibility documentation
- Suppress CS0618 for AddressLine1/AddressLine2 (deprecated since Nov 2025)
- Use modern C# 12 collection expression syntax
Technical changes:
- CreateBitmap() to CreateDXBitmap() (returns DXBitmap)
- Convert DXBitmap to PNG stream to System.Drawing.Bitmap for ZXing
- Add using DevExpress.Drawing and System.Runtime.Versioning
Result: 0 CA1416 warnings, 0 CS0618 warnings in DevExpressSwissQrCodeProcessor
Added `CONTROLLER_ENDPOINTS.md` to define REST API endpoints and
`REQUIRED_FEATURES.md` to outline required functions and features
for the `DocumentOperator` service. These documents include
detailed specifications for controllers, input/output formats,
usage scenarios, and technical requirements.
Updated `DocumentOperator.sln` to include the new documentation
files under a "Solution Items" section for better visibility.
Defined a prioritization strategy for feature implementation,
technical requirements, and a comprehensive test strategy.
Referenced relevant standards (e.g., PDF/A, ZUGFeRD) and
documented usage of the DevExpress Office File API.
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.
Added a new `/extract-swiss-qr-code` endpoint to extract and parse Swiss QR Codes from the last page of a PDF document. Implemented the `ExtractSwissQrCode` handler method, along with helper methods to map domain value objects (`SwissQrCodeData` and `AddressData`) to DTOs.
Updated `ExceptionHandlingMiddleware` to handle the new `SwissQrCodeNotFoundException` with a 404 Not Found response.
Added integration tests in `ExtractSwissQrCodeEndpointTests` to validate the endpoint's behavior for valid requests, invalid Base64 input, empty references, and empty PDFs. Introduced a helper method to load embedded PDF resources as Base64 strings for testing.
Updated `using` directives to include necessary namespaces for the new feature and exception handling.
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.
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.
Refactored `DevExpressPdfProcessor` to improve attachment detection:
- Changed `DetectEmbeddedFiles` return type to a tuple for better
handling of attachment presence and count.
- Enhanced logic to parse `/Names` arrays and count object references
for accurate attachment detection.
- Implemented robust search for `/EmbeddedFiles` to handle multiple
occurrences and ensure proper context validation.
Updated PHASENPLAN.md and ROADMAP.md to reflect these changes, including
the addition of fixes for attachment detection and counting logic.
Added new tests in `DevExpressPdfProcessorTests`:
- Verified detection of multiple attachments and accurate counts.
- Ensured no crashes when processing PDFs with `/EmbeddedFiles`.
Included a new test resource (`pdfWithMoreThanOneAttachment.pdf`) for
validating multiple attachment scenarios.
Updated PHASENPLAN.md and ROADMAP.md to reflect a complete restructuring of the development plan and added a "Bugfix: Attachment Detection" entry.
Implemented attachment detection in DevExpressPdfProcessor.cs using the new `DetectEmbeddedFiles` method, which scans raw PDF data for the `/EmbeddedFiles` keyword. Updated the `hasAttachments` property to use this method and set `attachmentCount` to `-1` when attachments are detected.
Added a new test, `ValidateAsync_PdfWithoutAttachments_ReturnsNoAttachments`, in DevExpressPdfProcessorTests.cs to verify that PDFs without attachments are correctly identified. Included a note about future testing for PDFs with attachments using ZUGFeRD files.
All related tests are passing (12/12 green).
Implemented the ValidatePDF feature end-to-end:
- Added `/api/v1/documents/validate` Minimal API endpoint.
- Introduced centralized ExceptionHandlingMiddleware.
- Configured Swagger with `AddSwaggerDocumentation` extension.
- Enabled XML comments in `DocumentOperator.API.csproj`.
- Updated DTOs with XML comments and added `FileSizeMB`.
- Added integration tests for the ValidatePDF endpoint (3 tests).
- Registered infrastructure services (e.g., `IPdfProcessor`).
- Refactored `Program.cs` to include middleware and endpoints.
- Updated PHASENPLAN.md and ROADMAP.md to reflect progress.
- Cleaned up code and made `Program` accessible for tests.
Updated PHASENPLAN and ROADMAP to reflect progress on Feature 1 - ValidatePDF (75% complete). Marked Step 1.1 as completed, including MediatR setup, pipeline behaviors (`ValidationBehavior`, `LoggingBehavior`), ValidatePDF feature (Query, Handler, Validator), and DTOs.
Added `DependencyInjection.cs` for Application Layer DI configuration. Introduced `LoggingBehavior` and `ValidationBehavior` for MediatR pipelines. Implemented `ValidatePdfHandler`, `ValidatePdfQuery`, and `ValidatePdfValidator`.
Created DTOs (`ValidatePdfRequest`, `ValidatePdfResponse`) for the ValidatePDF feature. Added unit tests for `ValidatePdfHandler` to verify metadata handling and exception propagation.
Removed unused folder references in `DocumentOperator.Application.csproj`.
Updated PROJECT_STATUS.md, ROADMAP.md, and PHASENPLAN.md to adopt a feature-driven development approach. Replaced the layer-by-layer methodology with a focus on delivering complete, testable features.
Key changes:
- PROJECT_STATUS.md: Added detailed status updates, milestones, and removed Azure dependencies in favor of local solutions (e.g., temp folders, in-memory queues).
- ROADMAP.md: Restructured tasks by feature (e.g., ValidatePDF, ExtractAttachments) with detailed steps and acceptance criteria. Introduced cross-cutting concerns like multi-tenancy and resilience.
- PHASENPLAN.md: Introduced a week-by-week breakdown, progress tracking, and next steps for each feature.
These changes improve clarity, align tasks with deliverables, and provide a clear roadmap for project completion.
Updated `PROJECT_STATUS.md` to reflect the current progress, including updates to the project status, phase overview, and milestones. Added a new section summarizing completed milestones (Phases 1-2.5) and detailed progress for Phase 3.
Created `STATUS_UPDATE_17_01_2025.md` to document the latest project status, including the availability of the DevExpress Universal License, completed phases, and a step-by-step plan for the next sprint. Highlighted action items such as cleaning up the Application Layer and implementing the `DevExpressPdfProcessor` using TDD.
These changes ensure alignment between the roadmap and the actual project status while providing clear next steps for stakeholders.
Eliminated a redundant `using DevExpress.Pdf;` statement to improve code readability and maintain cleaner imports. This change has no functional impact but enhances code clarity.
Updated the ROADMAP.md file to reflect the completion of Phase 3 (Infrastructure Layer) and the transition to Phase 4 (Application Layer).
Marked Step 3.2 (DevExpressPdfProcessor implementation) as completed, including sub-steps such as creating tests, implementing the processor, and preparing for execution.
Added a new Phase 4 section detailing next steps, including MediatR setup. Removed references to incomplete Phase 3 steps, as they are now finished.
Highlighted a major update noting production-ready features and added architectural notes for multi-tenancy, async processing, file storage, and resilience using Polly.
Updated project documentation to reflect the completion of the `DevExpressPdfProcessor` implementation in Phase 3. Adjusted progress in `PROJECT_STATUS.md` to 75% and updated the overall progress to ~28%.
Documented the successful execution of all six tests for `DevExpressPdfProcessor` and added implementation details, including the use of `PdfDocumentProcessor` from `DevExpress.Document.Processor` (v26.1.3), exception handling, and metadata extraction. Deferred attachment handling to Phase 6 due to API limitations.
Updated the "Last Updated" date in `PROJECT_STATUS.md` and `ROADMAP.md` to **17.01.2025** and adjusted the estimated time effort for the implementation to ~2 days.
Replaced `DevExpress.Pdf.Core` with `DevExpress.Document.Processor` in `DocumentOperator.Infrastructure.csproj` to adopt a newer library for PDF processing. Removed the `Services\PdfProcessing\` folder reference.
Updated `DevExpressPdfProcessorTests` to reflect changes in the `ValidateAsync` method's behavior.
Introduced the `DevExpressPdfProcessor` class, implementing the `IPdfProcessor` interface. This class validates PDF documents and extracts metadata using the `DevExpress.Pdf` library. Added defensive input validation, metadata extraction, and exception handling for domain consistency.
Replaced Azure Blob Storage and Storage Queue with local
temp folders and an in-memory queue for file storage and
async processing. Updated `IFileStorage` and `IJobQueue`
interfaces to support the new architecture.
Modified `TenantSettings` and `ApplyStampHandler` to use
local file paths. Updated `JobProcessorService` to handle
in-memory queue jobs. Added file cleanup policies to
`LocalFileStorage`.
Revised roadmap and documentation to reflect the shift
to local-first architecture, emphasizing simplicity,
reduced cloud dependencies, and single-server readiness.
Logging now uses file-based storage instead of Application
Insights. Adjusted production deployment and health check
phases to align with the new approach.
The roadmap has been updated to reflect a shift towards a
scalable, resilient, and production-ready architecture. Key
changes include:
- Multi-tenancy with EF Core, SQLite, and Redis Cache.
- Async processing using Azure Storage Queue and workers.
- File storage abstraction with Azure Blob and local storage.
- Resilience with Polly (retry, circuit breaker, timeout).
- Early health checks for Kubernetes readiness/liveness.
- Enhanced logging with Correlation IDs, Seq, and App Insights.
- Expanded roadmap to 11 phases with new production features.
- Added Swagger updates for API-Key auth and response examples.
- Introduced EF Core tenant management with CRUD operations.
- Added background services for async jobs and temp cleanup.
- Updated testing strategy for resilience and async processing.
- Documented 11 key learnings and updated best practices.
Updated ROADMAP.md to reflect progress on the TDD process for
DevExpressPdfProcessor, including the creation of unit tests
(6 tests in the Red Phase). Updated progress to 4/7 mini-steps
completed and outlined the next step (Green Phase).
Added `DevExpressPdfProcessorTests.cs` with unit tests to
validate PDF files and extract metadata. Tests cover valid
PDFs, null/empty inputs, corrupted PDFs, and file size
calculations. Used `FluentAssertions` for assertions.
Cleaned up `DocumentOperator.Tests.csproj` by removing an
unused folder reference. No functional changes to the project
structure.
Updated ROADMAP.md to reflect progress on Phase 3, Step 3.2:
- Created test folder structure under Unit/Infrastructure/Services/PdfProcessing.
- Updated progress status to 2/7 mini-steps completed.
- Documented next step (adding a test PDF file) and marked DevExpressPdfProcessor.cs implementation as "IN PROGRESS."
- Highlighted availability of the DevExpress Universal License.
Modified DocumentOperator.Tests.csproj:
- Added the new test folder structure to the project file.