- 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.
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).
- API-spezifische Konfigurationsmodelle (z. B.
Geplante Inhalte (naechste Phasen)
- Controller fuer:
GET /workflows/{wisagid}POST /workflows/{wisagid}/{source}/{processid}/closingGET /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.