Complete Step 1.1: ValidatePDF Application Layer

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`.
This commit is contained in:
OlgunR
2026-06-25 15:23:58 +02:00
parent 62c67d86d4
commit afc0e34312
12 changed files with 367 additions and 48 deletions

View File

@@ -1,6 +1,6 @@
# ?? DocumentOperator - Phasenplan (Feature-Driven Development)
> **Stand:** 17.01.2025 | **Aktuell:** Feature 1 - ValidatePDF (Step 1.1 NEXT) | **Projektdauer:** 6 Wochen
> **Stand:** 17.01.2025 | **Aktuell:** Feature 1 - ValidatePDF (Step 1.2 NEXT) | **Projektdauer:** 6 Wochen
---
@@ -8,7 +8,7 @@
| Woche | Features / Concerns | Status | Fortschritt |
|-------|---------------------|--------|-------------|
| **W1** | Feature 1: ValidatePDF | ?? In Progress | 50% (Infrastructure fertig, Application NEXT) |
| **W1** | Feature 1: ValidatePDF | ?? In Progress | 75% (Foundation + Application fertig, API NEXT) |
| **W2** | Feature 2: ExtractAttachments | ? Geplant | 0% |
| **W2** | Feature 3: ApplyStamp | ? Geplant | 0% |
| **W3** | Feature 4: EmbedCertificate | ? Geplant | 0% |
@@ -42,7 +42,7 @@
## ?? DETAILLIERTER PLAN
### WOCHE 1 - Feature 1: ValidatePDF | ?? In Progress - 50%
### WOCHE 1 - Feature 1: ValidatePDF | ?? In Progress - 75%
**Ziel:** POST /api/v1/documents/validate Endpoint im Swagger testbar
@@ -58,38 +58,38 @@
---
#### ?? Step 1.1: Application Layer (MediatR Setup + ValidatePDF Feature) - **NEXT**
#### ? Step 1.1: Application Layer (MediatR Setup + ValidatePDF Feature) - **ABGESCHLOSSEN**
**Dauer:** ~4 Stunden
**Status:** ? NEXT
**Status:** ? ABGESCHLOSSEN
**Was wird erstellt:**
**Was wurde erstellt:**
1. **MediatR Setup**
- `Application/DependencyInjection.cs` (Service Registration)
- `Application/Common/Behaviors/ValidationBehavior.cs` (FluentValidation Pipeline)
- `Application/Common/Behaviors/LoggingBehavior.cs` (Logging Pipeline)
- ? `Application/DependencyInjection.cs` (Service Registration)
- ? `Application/Common/Behaviors/ValidationBehavior.cs` (FluentValidation Pipeline)
- ? `Application/Common/Behaviors/LoggingBehavior.cs` (Logging Pipeline mit ILogger<T>)
2. **ValidatePDF Feature (Vertical Slice)**
- `Application/Features/Documents/ValidatePdf/ValidatePdfQuery.cs`
- `Application/Features/Documents/ValidatePdf/ValidatePdfHandler.cs`
- `Application/Features/Documents/ValidatePdf/ValidatePdfValidator.cs`
- ? `Application/Features/Documents/ValidatePdf/ValidatePdfQuery.cs`
- ? `Application/Features/Documents/ValidatePdf/ValidatePdfHandler.cs`
- ? `Application/Features/Documents/ValidatePdf/ValidatePdfValidator.cs`
3. **DTOs**
- `Application/Common/DTOs/ValidatePdfRequest.cs`
- `Application/Common/DTOs/ValidatePdfResponse.cs`
- ? `Application/Common/DTOs/ValidatePdfRequest.cs`
- ? `Application/Common/DTOs/ValidatePdfResponse.cs`
4. **Tests**
- `Tests/Unit/Application/Features/ValidatePdf/ValidatePdfHandlerTests.cs`
- ? `Tests/Unit/Application/Features/ValidatePdf/ValidatePdfHandlerTests.cs` (2 Tests - alle grün!)
**Akzeptanzkriterien:**
- ? Build erfolgreich
- ? Tests grün (Handler Tests)
- ? Tests grün (Handler Tests: 2/2 passed)
- ? MediatR Pipeline funktioniert (Validation + Logging)
---
#### ? Step 1.2: API Layer (Endpoint + Exception Middleware)
#### ?? Step 1.2: API Layer (Endpoint + Exception Middleware) - **NEXT**
**Dauer:** ~3 Stunden
**Status:** ? Pending
**Status:** ? NEXT
**Was wird erstellt:**
1. **Exception Middleware**
@@ -418,7 +418,7 @@
| Kategorie | Status | Fortschritt |
|-----------|--------|-------------|
| **Foundation** | ? Abgeschlossen | 100% |
| **Feature 1** | ?? In Progress | 50% |
| **Feature 1** | ?? In Progress | 75% |
| **Feature 2-5** | ? Pending | 0% |
| **Multi-Tenancy** | ? Pending | 0% |
| **Cross-Cutting** | ? Pending | 0% |
@@ -430,19 +430,19 @@
### Heute (17.01.2025)
**Feature 1 - Step 1.1: Application Layer**
**Feature 1 - Step 1.1: Application Layer** ? **ABGESCHLOSSEN**
1. ? MediatR Setup (DependencyInjection.cs)
2. ? ValidationBehavior.cs erstellen
3. ? LoggingBehavior.cs erstellen
3. ? LoggingBehavior.cs erstellen (mit ILogger<T>)
4. ? ValidatePDF Feature erstellen (Query, Handler, Validator)
5. ? DTOs erstellen (Request, Response)
6. ? Tests schreiben (ValidatePdfHandlerTests.cs)
6. ? Tests schreiben (ValidatePdfHandlerTests.cs - 2 Tests grün)
7. ? Build + Tests grün
8. ? ROADMAP + PHASENPLAN aktualisieren
9. ? Commit
**Danach:**
? Feature 1 - Step 1.2: API Layer (Endpoint + Exception Middleware)
? Feature 1 - Step 1.2: API Layer (Endpoint + Exception Middleware) - **NEXT**
---
@@ -455,6 +455,7 @@
| 17.01.2025 | Infrastructure | DevExpressPdfProcessor.ValidateAsync implementiert |
| 17.01.2025 | Tests | DevExpressPdfProcessorTests.cs erstellt (6 Tests) |
| 17.01.2025 | **PHASENPLAN** | ?? **Komplett umstrukturiert** (Feature-basiert + Datum korrigiert 23.06.2026 ? 17.01.2025) |
| 17.01.2025 | **Feature 1 - Step 1.1** | ? **ABGESCHLOSSEN** - Application Layer (MediatR, Behaviors, ValidatePDF Feature, DTOs, Tests - 2/2 grün) |
---