Files
DigitalData.TaskFlow/src/presentation/DigitalData.TaskFlow.API
TekH 70e82567d8 Refactor workflows and improve API responses
- Added `BackToPerMethodId` constant and updated validation rules in `CloseWorkflowCommandValidator`.
- Refactored `GetWorkflowsQueryHandler` for simpler `hasListingData` logic.
- Replaced strongly-typed properties with `JsonElement` in `ContractsSourceBlock` and `FerdinandSourceBlock`.
- Updated `WorkflowListingReadModel` to use smaller data types for efficiency.
- Refactored `WorkflowRepository` to use JSON-based data retrieval and parsing.
- Introduced `MetaOnlyResponse` and `WorkflowsResponse` for consistent API responses.
- Updated `DocumentsController` and `WorkflowsController` to use new response types.
- Added `ApiKeyAuthMiddleware` for API key validation and integrated it into the middleware pipeline.
- Refactored `ExceptionHandlingMiddleware` to use `MetaOnlyResponse` for error handling.
- Performed general cleanup and modernization for improved readability and maintainability.
2026-10-10 20:47:31 +02:00
..

DigitalData.TaskFlow.API

Dieses Projekt stellt die HTTP-Schnittstelle fuer externe Konsumenten bereit.

Zweck

Die API-Schicht nimmt HTTP-Requests entgegen, leitet diese an die Application-Schicht weiter und liefert standardisierte Responses zurueck.

Aktueller Inhalt

  • Program.cs
    • Startpunkt der ASP.NET-Core-Anwendung.
    • Registriert Application- und Infrastructure-Dienste.
    • Enthält Grundkonfiguration fuer Controller und OpenAPI/Swagger.
  • appsettings.json
    • Allgemeine Runtime-Konfiguration (Logging, ConnectionString, MediatR-Lizenz, Swagger-Optionen).
  • Controllers/
    • Zielordner fuer HTTP-Controller (aktuell noch leer).
  • Options/
    • API-spezifische Konfigurationsmodelle (z. B. SwaggerOptions).

Geplante Inhalte (naechste Phasen)

  • Controller fuer:
    • GET /workflows/{wisagid}
    • POST /workflows/{wisagid}/{source}/{processid}/closing
    • GET /documents/{id}
  • Middleware fuer:
    • FluentValidation-Fehlerbehandlung
    • Generelle Exception-Behandlung
  • OpenAPI-Dokumentation:
    • Swagger in Development, optional in Production
    • Firmen-/Produkt-Metadaten
    • Scalar als alternative UI

Architektur-Regeln

  • Keine direkte SQL- oder EF-Core-Logik im Controller.
  • Transport-spezifische Aufgaben bleiben in API; fachliche Verarbeitung erfolgt in Application.
  • Einheitliches Response-Schema gemaess Ticket-Vorgabe (meta.code, meta.message).

Rolle im Gesamtsystem

Die API ist das Eingangstor fuer externe Systeme (z. B. fabrik19) und sorgt fuer stabile, versionierbare und gut dokumentierte Endpunkte.