Add ValidatePDF feature with API, Swagger, and tests

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.
This commit is contained in:
OlgunR
2026-06-25 16:01:33 +02:00
parent afc0e34312
commit 930b76ecb5
12 changed files with 493 additions and 143 deletions

View File

@@ -1,7 +1,7 @@
namespace DocumentOperator.Application.Common.DTOs;
/// <summary>
/// Request DTO for ValidatePdf endpoint
/// Request für PDF-Validierung
/// </summary>
/// <param name="Base64Pdf">PDF content as Base64 string</param>
/// <param name="Base64Pdf">Base64-encodiertes PDF-Dokument</param>
public record ValidatePdfRequest(string Base64Pdf);

View File

@@ -1,14 +1,18 @@
namespace DocumentOperator.Application.Common.DTOs;
/// <summary>
/// Response DTO for ValidatePdf endpoint
/// Contains PDF metadata
/// Response mit PDF-Metadaten
/// </summary>
/// <param name="PageCount">Anzahl der Seiten</param>
/// <param name="FileSizeBytes">Dateigröße in Bytes</param>
/// <param name="FileSizeMB">Dateigröße in MB (gerundet auf 2 Dezimalstellen)</param>
/// <param name="PdfVersion">PDF-Version (z.B. "1.4")</param>
/// <param name="HasAttachments">Hat das PDF Anhänge?</param>
/// <param name="AttachmentCount">Anzahl der Anhänge</param>
public record ValidatePdfResponse(
int PageCount,
long FileSizeBytes,
double FileSizeMB,
string PdfVersion,
bool HasAttachments,
int AttachmentCount
);
int AttachmentCount);