Compare commits
25 Commits
b57de5a97d
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 307c81001a | |||
| 9c5346213e | |||
| 6542d804f8 | |||
| f470367d89 | |||
| 6ec2187361 | |||
| 8c6102d161 | |||
| 3c3744c0ce | |||
| 46da385b92 | |||
| 210c1f414c | |||
| ca3772e2a8 | |||
| a01e61aafe | |||
| f3784d24bd | |||
| 7d032c4a2c | |||
| 1a6baef807 | |||
| b35017fddc | |||
| 893b063ae9 | |||
| 9b60f5116b | |||
| 11ebb0567a | |||
| 12cb46d054 | |||
| e00be89d1a | |||
| 569bf360e6 | |||
| 405215a8bf | |||
| 232491d4ac | |||
| d07bc2418b | |||
| 048456ddc7 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -415,3 +415,4 @@ FodyWeavers.xsd
|
||||
*.vsix
|
||||
|
||||
/ignore
|
||||
/src/presentation/DigitalData.TaskFlow.API/Properties/PublishProfiles/IISProfileNet8.pubxml.user
|
||||
|
||||
30
AGENTS.md
30
AGENTS.md
@@ -1,30 +0,0 @@
|
||||
# AGENTS
|
||||
|
||||
## Repo Snapshot (verified)
|
||||
- This is a .NET 8 solution with 4 projects: API (`src/presentation/DigitalData.TaskFlow.API`), Application, Domain, Infrastructure.
|
||||
- `Program.cs` only wires DI + Swagger + `MapControllers`; there are currently no controller classes, so no HTTP endpoints are exposed yet.
|
||||
- There is no test project in the repository right now.
|
||||
|
||||
## High-value Commands
|
||||
- Restore/build whole solution from repo root:
|
||||
- `dotnet restore DigitalData.TaskFlow.sln`
|
||||
- `dotnet build DigitalData.TaskFlow.sln`
|
||||
- Run API project:
|
||||
- `dotnet run --project src/presentation/DigitalData.TaskFlow.API/DigitalData.TaskFlow.API.csproj`
|
||||
- Focused build for one layer:
|
||||
- `dotnet build src/core/DigitalData.TaskFlow.Application/DigitalData.TaskFlow.Application.csproj`
|
||||
|
||||
## Architecture That Matters During Edits
|
||||
- Dependency direction is strict: `API -> Application -> Domain`; `Infrastructure` depends on `Application` + `Domain` and is injected by API.
|
||||
- Application layer uses MediatR + FluentValidation pipeline behavior (`ValidationBehavior<,>`) + AutoMapper profile (`ApplicationMappingProfile`).
|
||||
- Response contract is centralized in Domain `ApiEnvelope<T>` + `MetaEntry`; use `ApiEnvelopeFactory` for consistent `meta.code/message` mapping.
|
||||
- Infrastructure registers `TaskFlowDbContext` and repository interfaces in `DependencyInjection.cs`; missing `ConnectionStrings:TaskFlowDb` throws at startup.
|
||||
- DB row-shape models (for procedures/views) live in Infrastructure (`Persistence/Models`), not in Domain.
|
||||
|
||||
## Current Implementation Gaps (easy to miss)
|
||||
- `DocumentRepository` and `WorkflowRepository.CloseAsync` are still baseline/stub implementations returning placeholder data.
|
||||
- `WorkflowListingReadModel` column mapping is based on read-only DB metadata and observed SP result sets; final shape must be re-verified from DB metadata (`sp_describe_first_result_set` or equivalent) before production hardening.
|
||||
- `Swagger:EnabledInProduction` exists in config model but is not used in `Program.cs` yet.
|
||||
|
||||
## Config/Security Gotcha
|
||||
- `src/presentation/DigitalData.TaskFlow.API/appsettings.json` currently contains a concrete SQL connection string and a MediatR license key; treat this file as sensitive and avoid propagating those values in docs, logs, or commits.
|
||||
@@ -1,23 +1,28 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.0.31903.59
|
||||
VisualStudioVersion = 17.14.36717.8
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DigitalData.TaskFlow.API", "src\presentation\DigitalData.TaskFlow.API\DigitalData.TaskFlow.API.csproj", "{C0F3BD78-47FF-4320-A139-99D42648BA6B}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "presentation", "presentation", "{BC4CBCBB-D810-4AA5-855C-C9E8FDADA008}"
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "presentation", "presentation", "{4F1A8452-FAEC-4EE4-87A3-DB0AF05B780F}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "core", "core", "{06231918-0EB3-49B0-B6CA-2A441D58B02F}"
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{8EC462FD-D22E-90A8-E5CE-7E832BA40C5D}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
.gitignore = .gitignore
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "infrastructure", "infrastructure", "{FD60D353-ABC5-4C93-92E5-069EE28B452E}"
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "core", "core", "{C3F5466A-4F6B-4DF3-B594-2B4FE943AC1E}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DigitalData.TaskFlow.API", "src\presentation\DigitalData.TaskFlow.API\DigitalData.TaskFlow.API.csproj", "{DAECF4CE-7AE3-4DBE-8D32-F5F2B4EC8AEC}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DigitalData.TaskFlow.Domain", "src\core\DigitalData.TaskFlow.Domain\DigitalData.TaskFlow.Domain.csproj", "{42B3A931-DDB1-4648-9EFA-9812354C6982}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DigitalData.TaskFlow.Domain", "src\core\DigitalData.TaskFlow.Domain\DigitalData.TaskFlow.Domain.csproj", "{EA5328FE-D015-4DAF-838D-57B4218ADA15}"
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "infrastructure", "infrastructure", "{9C44DE52-84B0-4441-9419-E810762D195D}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DigitalData.TaskFlow.Application", "src\core\DigitalData.TaskFlow.Application\DigitalData.TaskFlow.Application.csproj", "{104944BD-55C2-458C-B0C6-1B41C84B2C08}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DigitalData.TaskFlow.Infrastructure", "src\infrastructure\DigitalData.TaskFlow.Infrastructure\DigitalData.TaskFlow.Infrastructure.csproj", "{D414DF56-EBE6-4972-B76C-4004F1CEA812}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DigitalData.TaskFlow.Infrastructure", "src\infrastructure\DigitalData.TaskFlow.Infrastructure\DigitalData.TaskFlow.Infrastructure.csproj", "{D4459BE4-B483-46E8-9052-523646D24B90}"
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DigitalData.TaskFlow.Application", "src\core\DigitalData.TaskFlow.Application\DigitalData.TaskFlow.Application.csproj", "{FAC8E4F4-C0B2-4582-A5CE-A8BC76A135B8}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
@@ -25,36 +30,36 @@ Global
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{DAECF4CE-7AE3-4DBE-8D32-F5F2B4EC8AEC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{DAECF4CE-7AE3-4DBE-8D32-F5F2B4EC8AEC}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DAECF4CE-7AE3-4DBE-8D32-F5F2B4EC8AEC}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DAECF4CE-7AE3-4DBE-8D32-F5F2B4EC8AEC}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{EA5328FE-D015-4DAF-838D-57B4218ADA15}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{EA5328FE-D015-4DAF-838D-57B4218ADA15}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{EA5328FE-D015-4DAF-838D-57B4218ADA15}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{EA5328FE-D015-4DAF-838D-57B4218ADA15}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{104944BD-55C2-458C-B0C6-1B41C84B2C08}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{104944BD-55C2-458C-B0C6-1B41C84B2C08}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{104944BD-55C2-458C-B0C6-1B41C84B2C08}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{104944BD-55C2-458C-B0C6-1B41C84B2C08}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D4459BE4-B483-46E8-9052-523646D24B90}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D4459BE4-B483-46E8-9052-523646D24B90}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D4459BE4-B483-46E8-9052-523646D24B90}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D4459BE4-B483-46E8-9052-523646D24B90}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{C0F3BD78-47FF-4320-A139-99D42648BA6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{C0F3BD78-47FF-4320-A139-99D42648BA6B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{C0F3BD78-47FF-4320-A139-99D42648BA6B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{C0F3BD78-47FF-4320-A139-99D42648BA6B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{42B3A931-DDB1-4648-9EFA-9812354C6982}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{42B3A931-DDB1-4648-9EFA-9812354C6982}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{42B3A931-DDB1-4648-9EFA-9812354C6982}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{42B3A931-DDB1-4648-9EFA-9812354C6982}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{D414DF56-EBE6-4972-B76C-4004F1CEA812}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D414DF56-EBE6-4972-B76C-4004F1CEA812}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D414DF56-EBE6-4972-B76C-4004F1CEA812}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D414DF56-EBE6-4972-B76C-4004F1CEA812}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{FAC8E4F4-C0B2-4582-A5CE-A8BC76A135B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{FAC8E4F4-C0B2-4582-A5CE-A8BC76A135B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{FAC8E4F4-C0B2-4582-A5CE-A8BC76A135B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{FAC8E4F4-C0B2-4582-A5CE-A8BC76A135B8}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{BC4CBCBB-D810-4AA5-855C-C9E8FDADA008} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
|
||||
{06231918-0EB3-49B0-B6CA-2A441D58B02F} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
|
||||
{FD60D353-ABC5-4C93-92E5-069EE28B452E} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
|
||||
{DAECF4CE-7AE3-4DBE-8D32-F5F2B4EC8AEC} = {BC4CBCBB-D810-4AA5-855C-C9E8FDADA008}
|
||||
{EA5328FE-D015-4DAF-838D-57B4218ADA15} = {06231918-0EB3-49B0-B6CA-2A441D58B02F}
|
||||
{104944BD-55C2-458C-B0C6-1B41C84B2C08} = {06231918-0EB3-49B0-B6CA-2A441D58B02F}
|
||||
{D4459BE4-B483-46E8-9052-523646D24B90} = {FD60D353-ABC5-4C93-92E5-069EE28B452E}
|
||||
{C0F3BD78-47FF-4320-A139-99D42648BA6B} = {4F1A8452-FAEC-4EE4-87A3-DB0AF05B780F}
|
||||
{4F1A8452-FAEC-4EE4-87A3-DB0AF05B780F} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
|
||||
{C3F5466A-4F6B-4DF3-B594-2B4FE943AC1E} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
|
||||
{42B3A931-DDB1-4648-9EFA-9812354C6982} = {C3F5466A-4F6B-4DF3-B594-2B4FE943AC1E}
|
||||
{9C44DE52-84B0-4441-9419-E810762D195D} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
|
||||
{D414DF56-EBE6-4972-B76C-4004F1CEA812} = {9C44DE52-84B0-4441-9419-E810762D195D}
|
||||
{FAC8E4F4-C0B2-4582-A5CE-A8BC76A135B8} = {C3F5466A-4F6B-4DF3-B594-2B4FE943AC1E}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {95DC4052-26B6-44D1-8B13-9D934628204D}
|
||||
SolutionGuid = {9CDB06DD-EB59-4309-8B48-B34F488F9D2F}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
using DigitalData.TaskFlow.Domain.Enums;
|
||||
|
||||
namespace DigitalData.TaskFlow.Application.Common.Exceptions;
|
||||
|
||||
/// <summary>
|
||||
/// Represents an API-facing exception that carries HTTP and domain meta information.
|
||||
/// </summary>
|
||||
public class ApiException : Exception
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ApiException"/> class.
|
||||
/// </summary>
|
||||
/// <param name="statusCode">HTTP status code to return.</param>
|
||||
/// <param name="metaCode">Domain meta code to return.</param>
|
||||
/// <param name="message">Response message.</param>
|
||||
public ApiException(int statusCode, MetaCode metaCode, string message)
|
||||
: base(message)
|
||||
{
|
||||
StatusCode = statusCode;
|
||||
MetaCode = metaCode;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the HTTP status code.
|
||||
/// </summary>
|
||||
public int StatusCode { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the domain meta code.
|
||||
/// </summary>
|
||||
public MetaCode MetaCode { get; }
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
using DigitalData.TaskFlow.Domain.Enums;
|
||||
|
||||
namespace DigitalData.TaskFlow.Application.Common.Exceptions;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a 409 API exception.
|
||||
/// </summary>
|
||||
public sealed class ConflictApiException : ApiException
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ConflictApiException"/> class.
|
||||
/// </summary>
|
||||
/// <param name="metaCode">Domain meta code to return.</param>
|
||||
/// <param name="message">Response message.</param>
|
||||
public ConflictApiException(MetaCode metaCode, string message)
|
||||
: base(409, metaCode, message)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
using DigitalData.TaskFlow.Domain.Enums;
|
||||
|
||||
namespace DigitalData.TaskFlow.Application.Common.Exceptions;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a 403 API exception.
|
||||
/// </summary>
|
||||
public sealed class ForbiddenApiException : ApiException
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ForbiddenApiException"/> class.
|
||||
/// </summary>
|
||||
/// <param name="message">Response message.</param>
|
||||
public ForbiddenApiException(string message)
|
||||
: base(403, MetaCode.NoAccess, message)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
using DigitalData.TaskFlow.Domain.Enums;
|
||||
|
||||
namespace DigitalData.TaskFlow.Application.Common.Exceptions;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a 400 API exception.
|
||||
/// </summary>
|
||||
public sealed class InvalidRequestApiException : ApiException
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InvalidRequestApiException"/> class.
|
||||
/// </summary>
|
||||
/// <param name="message">Response message.</param>
|
||||
public InvalidRequestApiException(string message)
|
||||
: base(400, MetaCode.InvalidRequest, message)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
namespace DigitalData.TaskFlow.Application.Common.Exceptions;
|
||||
|
||||
public sealed class InvalidWorkflowPayloadException(string message) : Exception(message)
|
||||
{
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
using DigitalData.TaskFlow.Domain.Enums;
|
||||
|
||||
namespace DigitalData.TaskFlow.Application.Common.Exceptions;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a 404 API exception.
|
||||
/// </summary>
|
||||
public sealed class NotFoundApiException : ApiException
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="NotFoundApiException"/> class.
|
||||
/// </summary>
|
||||
/// <param name="message">Response message.</param>
|
||||
public NotFoundApiException(string message)
|
||||
: base(404, MetaCode.NotFound, message)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
using DigitalData.TaskFlow.Domain.Common;
|
||||
using DigitalData.TaskFlow.Domain.Enums;
|
||||
|
||||
namespace DigitalData.TaskFlow.Application.Common.Factories;
|
||||
|
||||
/// <summary>
|
||||
/// Creates standard API envelope instances with centralized meta code/message handling.
|
||||
/// </summary>
|
||||
public static class ApiEnvelopeFactory
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a successful or business-result response envelope.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Payload type.</typeparam>
|
||||
/// <param name="data">Payload data.</param>
|
||||
/// <param name="code">Business result code.</param>
|
||||
/// <param name="message">Optional custom message. If not supplied, a default message is resolved from <paramref name="code"/>.</param>
|
||||
/// <returns>Response envelope containing meta and payload.</returns>
|
||||
public static ApiEnvelope<T> Create<T>(T data, MetaCode code = MetaCode.Ok, string? message = null)
|
||||
{
|
||||
return new ApiEnvelope<T>
|
||||
{
|
||||
Meta =
|
||||
[
|
||||
new MetaEntry
|
||||
{
|
||||
Code = (int)code,
|
||||
Message = message ?? ResolveDefaultMessage(code)
|
||||
}
|
||||
],
|
||||
Data = data
|
||||
};
|
||||
}
|
||||
|
||||
private static string ResolveDefaultMessage(MetaCode code)
|
||||
{
|
||||
return code switch
|
||||
{
|
||||
MetaCode.Ok => "OK",
|
||||
MetaCode.NoOpenWorkflows => "Keine offenen Workflows",
|
||||
MetaCode.NoAccess => "Kein Zugriff",
|
||||
MetaCode.InvalidRequest => "Ungultiger Request",
|
||||
MetaCode.InternalError => "Interner Fehler",
|
||||
MetaCode.NotFound => "Vorgang nicht gefunden",
|
||||
MetaCode.AlreadyClosed => "Vorgang bereits abgeschlossen",
|
||||
_ => "Interner Fehler"
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,13 @@
|
||||
using DigitalData.TaskFlow.Domain.Documents;
|
||||
using DigitalData.TaskFlow.Domain.ProcedureResults;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace DigitalData.TaskFlow.Application.Common.Interfaces;
|
||||
|
||||
/// <summary>
|
||||
/// Defines document-specific data access operations.
|
||||
/// </summary>
|
||||
public interface IDocumentRepository : IRepository
|
||||
public interface IDocumentRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets document binary content for the given document identifier.
|
||||
/// </summary>
|
||||
/// <param name="id">Document identifier.</param>
|
||||
/// <param name="cancellationToken">Cancellation token.</param>
|
||||
/// <returns>Binary document payload when found; otherwise <see langword="null"/>.</returns>
|
||||
Task<DocumentBinaryResult?> GetAsync(string id, CancellationToken cancellationToken);
|
||||
Task<Document?> GetAsync(int userId, long processId, long docId, CancellationToken cancellationToken);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
using DigitalData.TaskFlow.Domain.ProcedureResults;
|
||||
|
||||
namespace DigitalData.TaskFlow.Application.Common.Interfaces;
|
||||
|
||||
public interface IUserRepository : IRepository
|
||||
{
|
||||
Task<IEnumerable<AuthorizedUser>> GetAuthorizedAsync(CancellationToken cancellationToken);
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using DigitalData.TaskFlow.Domain.Closing;
|
||||
using DigitalData.TaskFlow.Domain.Workflows;
|
||||
using DigitalData.TaskFlow.Domain.ProcedureResults;
|
||||
|
||||
namespace DigitalData.TaskFlow.Application.Common.Interfaces;
|
||||
|
||||
@@ -14,21 +13,25 @@ public interface IWorkflowRepository : IRepository
|
||||
/// <param name="wisagId">WISAG user identifier.</param>
|
||||
/// <param name="cancellationToken">Cancellation token.</param>
|
||||
/// <returns>Workflow data grouped by source.</returns>
|
||||
Task<WorkflowSourcesResponse> GetAsync(int wisagId, CancellationToken cancellationToken);
|
||||
Task<Workflow?> GetByWisagIdAsync(int wisagId, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Applies a closing decision to a workflow process.
|
||||
/// Closes a workflow item and returns procedure result code/message.
|
||||
/// </summary>
|
||||
/// <param name="wisagId">WISAG user identifier.</param>
|
||||
/// <param name="source">Source system name.</param>
|
||||
/// <param name="userId">Internal user identifier expected by the procedure.</param>
|
||||
/// <param name="source">Source system identifier.</param>
|
||||
/// <param name="processId">Process identifier.</param>
|
||||
/// <param name="decision">Closing decision payload.</param>
|
||||
/// <param name="closingMethodId">Closing method identifier.</param>
|
||||
/// <param name="comment">Optional comment.</param>
|
||||
/// <param name="rejectionReasonId">Optional rejection reason identifier.</param>
|
||||
/// <param name="cancellationToken">Cancellation token.</param>
|
||||
/// <returns>Closing operation result.</returns>
|
||||
Task<CloseWorkflowResult> CloseAsync(
|
||||
int wisagId,
|
||||
/// <returns>Close operation result.</returns>
|
||||
Task<WorkflowClosing?> CloseAsync(
|
||||
int userId,
|
||||
string source,
|
||||
int processId,
|
||||
CloseWorkflowDecision decision,
|
||||
long processId,
|
||||
int closingMethodId,
|
||||
string? comment,
|
||||
byte? rejectionReasonId,
|
||||
CancellationToken cancellationToken);
|
||||
}
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
using AutoMapper;
|
||||
using DigitalData.TaskFlow.Application.Features.Workflows.Commands.CloseWorkflow;
|
||||
using DigitalData.TaskFlow.Domain.Closing;
|
||||
|
||||
namespace DigitalData.TaskFlow.Application.Common.Mappings;
|
||||
|
||||
/// <summary>
|
||||
/// Defines AutoMapper configuration for application-level mappings.
|
||||
/// </summary>
|
||||
public sealed class ApplicationMappingProfile : Profile
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes mapping configuration.
|
||||
/// </summary>
|
||||
public ApplicationMappingProfile()
|
||||
{
|
||||
CreateMap<CloseWorkflowCommand, CloseWorkflowDecision>();
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using DigitalData.TaskFlow.Application.Options;
|
||||
using FluentValidation;
|
||||
using FluentValidation;
|
||||
using MediatR;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
@@ -10,29 +9,30 @@ namespace DigitalData.TaskFlow.Application;
|
||||
|
||||
public static class DependencyInjection
|
||||
{
|
||||
public const string LuckyPennySoftLicenseKeySection = "LuckyPennySoftLicenseKey";
|
||||
|
||||
public static IServiceCollection AddApplicationServices(this IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
var mediatROptions = configuration
|
||||
.GetSection(MediatROptions.SectionName)
|
||||
.Get<MediatROptions>();
|
||||
var lpSoftLicenseKey = configuration[LuckyPennySoftLicenseKeySection];
|
||||
var hasLpSoftLicenseKey = !string.IsNullOrWhiteSpace(lpSoftLicenseKey);
|
||||
|
||||
services
|
||||
.AddOptions<MediatROptions>()
|
||||
.Bind(configuration.GetSection(MediatROptions.SectionName));
|
||||
var assembly = Assembly.GetExecutingAssembly();
|
||||
|
||||
services.AddMediatR(config =>
|
||||
{
|
||||
config.RegisterServicesFromAssembly(typeof(DependencyInjection).Assembly);
|
||||
config.RegisterServicesFromAssembly(assembly);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(mediatROptions?.LuckyPennySoftLicenseKey))
|
||||
{
|
||||
config.LicenseKey = mediatROptions.LuckyPennySoftLicenseKey;
|
||||
}
|
||||
if (hasLpSoftLicenseKey)
|
||||
config.LicenseKey = lpSoftLicenseKey;
|
||||
});
|
||||
|
||||
services.AddValidatorsFromAssembly(typeof(DependencyInjection).Assembly);
|
||||
services.AddValidatorsFromAssembly(assembly);
|
||||
services.AddTransient(typeof(IPipelineBehavior<,>), typeof(ValidationBehavior<,>));
|
||||
services.AddAutoMapper(_ => { }, Assembly.GetExecutingAssembly());
|
||||
services.AddAutoMapper(config =>
|
||||
{
|
||||
if (hasLpSoftLicenseKey)
|
||||
config.LicenseKey = lpSoftLicenseKey;
|
||||
}, assembly);
|
||||
|
||||
return services;
|
||||
}
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
using DigitalData.TaskFlow.Application.Common.Factories;
|
||||
using DigitalData.TaskFlow.Application.Common.Exceptions;
|
||||
using DigitalData.TaskFlow.Application.Common.Interfaces;
|
||||
using DigitalData.TaskFlow.Domain.Common;
|
||||
using DigitalData.TaskFlow.Domain.Documents;
|
||||
using DigitalData.TaskFlow.Domain.Enums;
|
||||
using FluentValidation;
|
||||
using MediatR;
|
||||
|
||||
namespace DigitalData.TaskFlow.Application.Features.Documents.Queries.GetDocument;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a request to retrieve binary document content by document identifier.
|
||||
/// </summary>
|
||||
/// <param name="Id">Document identifier.</param>
|
||||
public sealed record GetDocumentQuery(string Id) : IRequest<ApiEnvelope<DocumentBinaryResult>>;
|
||||
|
||||
/// <summary>
|
||||
/// Validates <see cref="GetDocumentQuery"/> requests.
|
||||
/// </summary>
|
||||
public sealed class GetDocumentQueryValidator : AbstractValidator<GetDocumentQuery>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes validation rules for <see cref="GetDocumentQuery"/>.
|
||||
/// </summary>
|
||||
public GetDocumentQueryValidator()
|
||||
{
|
||||
RuleFor(x => x.Id)
|
||||
.NotEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles <see cref="GetDocumentQuery"/> requests.
|
||||
/// </summary>
|
||||
public sealed class GetDocumentQueryHandler(IDocumentRepository documentRepository)
|
||||
: IRequestHandler<GetDocumentQuery, ApiEnvelope<DocumentBinaryResult>>
|
||||
{
|
||||
/// <summary>
|
||||
/// Executes the query and returns binary document data in the standard API envelope.
|
||||
/// </summary>
|
||||
/// <param name="request">Query request.</param>
|
||||
/// <param name="cancellationToken">Cancellation token.</param>
|
||||
/// <returns>Document response envelope.</returns>
|
||||
public async Task<ApiEnvelope<DocumentBinaryResult>> Handle(GetDocumentQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
var document = await documentRepository.GetAsync(request.Id, cancellationToken);
|
||||
|
||||
if (document is null)
|
||||
{
|
||||
throw new NotFoundApiException("Dokument nicht gefunden");
|
||||
}
|
||||
|
||||
return ApiEnvelopeFactory.Create(document);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
using DigitalData.TaskFlow.Application.Common.Exceptions;
|
||||
using DigitalData.TaskFlow.Application.Common.Interfaces;
|
||||
using MediatR;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace DigitalData.TaskFlow.Application.Features.Documents.Queries;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="UserId"></param>
|
||||
/// <param name="ProcessId"></param>
|
||||
/// <param name="Id"></param>
|
||||
public sealed record GetDocumentQuery(int UserId, long ProcessId, long Id) : IRequest<JsonElement>;
|
||||
|
||||
public sealed class GetDocumentQueryHandler(IDocumentRepository Repo) : IRequestHandler<GetDocumentQuery, JsonElement>
|
||||
{
|
||||
public async Task<JsonElement> Handle(GetDocumentQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
var document = await Repo.GetAsync(userId: request.UserId, processId: request.ProcessId, docId: request.Id, cancellationToken);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(document?.Result))
|
||||
{
|
||||
using var doc = JsonDocument.Parse(document.Result);
|
||||
var root = doc.RootElement;
|
||||
|
||||
if (root.ValueKind == JsonValueKind.Object &&
|
||||
root.TryGetProperty("response", out var response))
|
||||
{
|
||||
return response.Clone();
|
||||
}
|
||||
}
|
||||
|
||||
throw new InvalidWorkflowPayloadException(
|
||||
"Stored procedure returned an invalid payload. Expected a JSON object with a 'response' property.");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
using DigitalData.TaskFlow.Application.Common.Interfaces;
|
||||
using MediatR;
|
||||
|
||||
namespace DigitalData.TaskFlow.Application.Features.Users.Queries;
|
||||
|
||||
public sealed record GetAuthorizedUsersQuery : IRequest<GetAuthorizedUsersResult>;
|
||||
|
||||
public sealed record GetAuthorizedUsersResult(IEnumerable<GetAuthorizedUsersMeta> Meta, IEnumerable<int> Wisagids);
|
||||
|
||||
public sealed record GetAuthorizedUsersMeta(int? Code, string Message);
|
||||
|
||||
public sealed class GetAuthorizedUsersQueryHandler(IUserRepository repo) : IRequestHandler<GetAuthorizedUsersQuery, GetAuthorizedUsersResult>
|
||||
{
|
||||
public async Task<GetAuthorizedUsersResult> Handle(GetAuthorizedUsersQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
var users = await repo.GetAuthorizedAsync(cancellationToken);
|
||||
|
||||
return new GetAuthorizedUsersResult(
|
||||
Meta: [new GetAuthorizedUsersMeta(Code: 0, Message: "OK")],
|
||||
Wisagids: users.Select(x => x.WisagId));
|
||||
}
|
||||
}
|
||||
@@ -1,121 +0,0 @@
|
||||
using DigitalData.TaskFlow.Application.Common.Exceptions;
|
||||
using DigitalData.TaskFlow.Application.Common.Interfaces;
|
||||
using DigitalData.TaskFlow.Application.Common.Factories;
|
||||
using AutoMapper;
|
||||
using DigitalData.TaskFlow.Domain.Closing;
|
||||
using DigitalData.TaskFlow.Domain.Common;
|
||||
using DigitalData.TaskFlow.Domain.Enums;
|
||||
using FluentValidation;
|
||||
using MediatR;
|
||||
|
||||
namespace DigitalData.TaskFlow.Application.Features.Workflows.Commands.CloseWorkflow;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a request to close a workflow process using a selected closing method.
|
||||
/// </summary>
|
||||
/// <param name="WisagId">WISAG user identifier.</param>
|
||||
/// <param name="Source">Source system name.</param>
|
||||
/// <param name="ProcessId">Process identifier.</param>
|
||||
/// <param name="ClosingMethodId">Selected closing method identifier.</param>
|
||||
/// <param name="Comment">Optional user comment.</param>
|
||||
/// <param name="RejectionReasonId">Optional rejection reason identifier.</param>
|
||||
public sealed record CloseWorkflowCommand(
|
||||
int WisagId,
|
||||
string Source,
|
||||
int ProcessId,
|
||||
int ClosingMethodId,
|
||||
string? Comment,
|
||||
int? RejectionReasonId)
|
||||
: IRequest<ApiEnvelope<CloseWorkflowResult>>;
|
||||
|
||||
/// <summary>
|
||||
/// Validates <see cref="CloseWorkflowCommand"/> requests.
|
||||
/// </summary>
|
||||
public sealed class CloseWorkflowCommandValidator : AbstractValidator<CloseWorkflowCommand>
|
||||
{
|
||||
private static readonly string[] AllowedSources = ["Ferdinand", "Contracts"];
|
||||
private const int ApproveMethodId = 2;
|
||||
private const int RejectMethodId = 3;
|
||||
private const int BackToPerMethodId = 4;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes validation rules for <see cref="CloseWorkflowCommand"/>.
|
||||
/// </summary>
|
||||
public CloseWorkflowCommandValidator()
|
||||
{
|
||||
RuleFor(x => x.WisagId)
|
||||
.GreaterThan(0);
|
||||
|
||||
RuleFor(x => x.ProcessId)
|
||||
.GreaterThan(0);
|
||||
|
||||
RuleFor(x => x.ClosingMethodId)
|
||||
.GreaterThan(0);
|
||||
|
||||
RuleFor(x => x.Source)
|
||||
.NotEmpty()
|
||||
.Must(source => AllowedSources.Contains(source))
|
||||
.WithMessage("Source must be one of the supported source systems.");
|
||||
|
||||
RuleFor(x => x.ClosingMethodId)
|
||||
.Must(methodId => methodId is ApproveMethodId or RejectMethodId or BackToPerMethodId)
|
||||
.WithMessage("Unbekannte closing_method_id");
|
||||
|
||||
RuleFor(x => x.Comment)
|
||||
.NotEmpty()
|
||||
.When(x => x.ClosingMethodId is RejectMethodId or BackToPerMethodId)
|
||||
.WithMessage("Kommentar ist fur diese closing_method Pflicht");
|
||||
|
||||
RuleFor(x => x.RejectionReasonId)
|
||||
.NotNull()
|
||||
.When(x => x.ClosingMethodId == RejectMethodId)
|
||||
.WithMessage("rejection_reason_id ist fur diese closing_method Pflicht");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles <see cref="CloseWorkflowCommand"/> requests.
|
||||
/// </summary>
|
||||
public sealed class CloseWorkflowCommandHandler(IWorkflowRepository workflowRepository, IMapper mapper)
|
||||
: IRequestHandler<CloseWorkflowCommand, ApiEnvelope<CloseWorkflowResult>>
|
||||
{
|
||||
/// <summary>
|
||||
/// Executes the closing request and returns the operation result in the standard API envelope.
|
||||
/// </summary>
|
||||
/// <param name="request">Command request.</param>
|
||||
/// <param name="cancellationToken">Cancellation token.</param>
|
||||
/// <returns>Closing result envelope.</returns>
|
||||
public async Task<ApiEnvelope<CloseWorkflowResult>> Handle(CloseWorkflowCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
var decision = mapper.Map<CloseWorkflowDecision>(request);
|
||||
|
||||
var result = await workflowRepository.CloseAsync(
|
||||
request.WisagId,
|
||||
request.Source,
|
||||
request.ProcessId,
|
||||
decision,
|
||||
cancellationToken);
|
||||
|
||||
if (result.Outcome == CloseWorkflowOutcome.NoAccess)
|
||||
{
|
||||
throw new ForbiddenApiException("Kein Zugriff");
|
||||
}
|
||||
|
||||
if (result.Outcome == CloseWorkflowOutcome.NotImplemented)
|
||||
{
|
||||
throw new InvalidOperationException("Closing integration is not finalized yet.");
|
||||
}
|
||||
|
||||
if (result.ProcessId <= 0)
|
||||
{
|
||||
throw new NotFoundApiException("Vorgang nicht gefunden");
|
||||
}
|
||||
|
||||
if (!result.IsClosed)
|
||||
{
|
||||
throw new ConflictApiException(MetaCode.AlreadyClosed, "Vorgang bereits abgeschlossen");
|
||||
}
|
||||
|
||||
return ApiEnvelopeFactory.Create(result);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using MediatR;
|
||||
|
||||
namespace DigitalData.TaskFlow.Application.Features.Workflows.Commands;
|
||||
|
||||
public sealed record CloseWorkflowCommand(
|
||||
int WisagId,
|
||||
string Source,
|
||||
long ProcessId,
|
||||
int ClosingMethodId,
|
||||
string? Comment,
|
||||
byte? RejectionReasonId) : IRequest<CloseWorkflowResult>;
|
||||
|
||||
public sealed record CloseWorkflowResult(
|
||||
int? Code,
|
||||
string Message);
|
||||
@@ -0,0 +1,26 @@
|
||||
using DigitalData.TaskFlow.Application.Common.Exceptions;
|
||||
using DigitalData.TaskFlow.Application.Common.Interfaces;
|
||||
using MediatR;
|
||||
|
||||
namespace DigitalData.TaskFlow.Application.Features.Workflows.Commands;
|
||||
|
||||
public sealed class CloseWorkflowCommandHandler(IWorkflowRepository Repo) : IRequestHandler<CloseWorkflowCommand, CloseWorkflowResult>
|
||||
{
|
||||
public async Task<CloseWorkflowResult> Handle(CloseWorkflowCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
var procedureResult = await Repo.CloseAsync(
|
||||
userId: request.WisagId,
|
||||
source: request.Source,
|
||||
processId: request.ProcessId,
|
||||
closingMethodId: request.ClosingMethodId,
|
||||
comment: request.Comment,
|
||||
rejectionReasonId: request.RejectionReasonId,
|
||||
cancellationToken: cancellationToken);
|
||||
|
||||
return procedureResult is null
|
||||
? throw new InvalidWorkflowPayloadException("Close workflow closing procedure returned no result.")
|
||||
: new CloseWorkflowResult(
|
||||
Code: procedureResult.Code,
|
||||
Message: procedureResult.Result ?? string.Empty);
|
||||
}
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
using DigitalData.TaskFlow.Application.Common.Factories;
|
||||
using DigitalData.TaskFlow.Application.Common.Interfaces;
|
||||
using DigitalData.TaskFlow.Domain.Common;
|
||||
using DigitalData.TaskFlow.Domain.Enums;
|
||||
using DigitalData.TaskFlow.Domain.Workflows;
|
||||
using FluentValidation;
|
||||
using MediatR;
|
||||
|
||||
namespace DigitalData.TaskFlow.Application.Features.Workflows.Queries.GetWorkflows;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a request to fetch grouped workflow data for a WISAG user.
|
||||
/// </summary>
|
||||
/// <param name="WisagId">WISAG user identifier.</param>
|
||||
public sealed record GetWorkflowsQuery(int WisagId) : IRequest<ApiEnvelope<WorkflowSourcesResponse>>;
|
||||
|
||||
/// <summary>
|
||||
/// Validates <see cref="GetWorkflowsQuery"/> requests.
|
||||
/// </summary>
|
||||
public sealed class GetWorkflowsQueryValidator : AbstractValidator<GetWorkflowsQuery>
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes validation rules for <see cref="GetWorkflowsQuery"/>.
|
||||
/// </summary>
|
||||
public GetWorkflowsQueryValidator()
|
||||
{
|
||||
RuleFor(x => x.WisagId)
|
||||
.GreaterThan(0);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Handles <see cref="GetWorkflowsQuery"/> requests.
|
||||
/// </summary>
|
||||
public sealed class GetWorkflowsQueryHandler(IWorkflowRepository workflowRepository)
|
||||
: IRequestHandler<GetWorkflowsQuery, ApiEnvelope<WorkflowSourcesResponse>>
|
||||
{
|
||||
/// <summary>
|
||||
/// Executes the query and returns a workflow payload wrapped in the standard API envelope.
|
||||
/// </summary>
|
||||
/// <param name="request">Query request.</param>
|
||||
/// <param name="cancellationToken">Cancellation token.</param>
|
||||
/// <returns>Workflow response envelope.</returns>
|
||||
public async Task<ApiEnvelope<WorkflowSourcesResponse>> Handle(GetWorkflowsQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
var data = await workflowRepository.GetAsync(request.WisagId, cancellationToken);
|
||||
|
||||
if (data.Sources.Count == 0)
|
||||
{
|
||||
return ApiEnvelopeFactory.Create(data, MetaCode.NoAccess);
|
||||
}
|
||||
|
||||
var hasListingData = data.Sources.Any(source => source switch
|
||||
{
|
||||
FerdinandSourceBlock ferdinand => ferdinand.Listing.Count > 0,
|
||||
ContractsSourceBlock contracts => contracts.Listing.Count > 0,
|
||||
_ => false
|
||||
});
|
||||
|
||||
if (!hasListingData)
|
||||
{
|
||||
return ApiEnvelopeFactory.Create(data, MetaCode.NoOpenWorkflows);
|
||||
}
|
||||
|
||||
return ApiEnvelopeFactory.Create(data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
using DigitalData.TaskFlow.Application.Common.Exceptions;
|
||||
using DigitalData.TaskFlow.Application.Common.Interfaces;
|
||||
using MediatR;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace DigitalData.TaskFlow.Application.Features.Workflows.Queries;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a request to fetch grouped workflow data for a WISAG user.
|
||||
/// </summary>
|
||||
/// <param name="WisagId">WISAG user identifier.</param>
|
||||
public sealed record GetWorkflowsQuery(int WisagId) : IRequest<JsonElement>;
|
||||
|
||||
public sealed class GetWorkflowsQueryHandler(IWorkflowRepository Repo) : IRequestHandler<GetWorkflowsQuery, JsonElement>
|
||||
{
|
||||
public async Task<JsonElement> Handle(GetWorkflowsQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
var workflow = await Repo.GetByWisagIdAsync(request.WisagId, cancellationToken);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(workflow?.Result))
|
||||
{
|
||||
using var document = JsonDocument.Parse(workflow.Result);
|
||||
var root = document.RootElement;
|
||||
|
||||
if (root.ValueKind == JsonValueKind.Object &&
|
||||
root.TryGetProperty("response", out var response))
|
||||
{
|
||||
return response.Clone();
|
||||
}
|
||||
}
|
||||
|
||||
throw new InvalidWorkflowPayloadException(
|
||||
"Stored procedure returned an invalid payload. Expected a JSON object with a 'response' property.");
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
namespace DigitalData.TaskFlow.Application.Options;
|
||||
|
||||
public sealed class MediatROptions
|
||||
{
|
||||
public const string SectionName = "MediatR";
|
||||
|
||||
public string? LuckyPennySoftLicenseKey { get; init; }
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
# DigitalData.TaskFlow.Application
|
||||
|
||||
Dieses Projekt enthaelt die Use-Case-Schicht der Anwendung.
|
||||
|
||||
## Zweck
|
||||
|
||||
Die Application-Schicht orchestriert fachliche Anwendungsfaelle. Sie nimmt Requests entgegen, validiert diese, ruft Domain-nahe Abstraktionen auf und liefert strukturierte Ergebnisse zurueck.
|
||||
|
||||
## Aktueller Inhalt
|
||||
|
||||
- `DependencyInjection.cs`
|
||||
- Registriert zentrale Application-Dienste:
|
||||
- MediatR
|
||||
- FluentValidation
|
||||
- AutoMapper
|
||||
- Bindet `MediatR`-Optionen inklusive Lizenzschluessel.
|
||||
- `Options/`
|
||||
- `MediatROptions`: Konfiguration fuer MediatR (z. B. `LuckyPennySoftLicenseKey`).
|
||||
|
||||
## Geplante Inhalte (naechste Phasen)
|
||||
|
||||
- `Features/`
|
||||
- Queries/Commands fuer Workflows, Closing und Documents.
|
||||
- `Validators/`
|
||||
- FluentValidation-Regeln pro Request.
|
||||
- `Common/Behaviors/`
|
||||
- Pipeline-Behavior (z. B. zentrale Request-Validierung).
|
||||
- `Common/Interfaces/`
|
||||
- Repository-Abstraktionen fuer Datenzugriff.
|
||||
- `Mappings/`
|
||||
- AutoMapper-Profile zwischen Infrastrukturmodellen und Domainmodellen.
|
||||
|
||||
## Architektur-Regeln
|
||||
|
||||
- Keine direkten SQL- oder EF-Core-Aufrufe.
|
||||
- Keine HTTP-spezifischen Controller-Abhaengigkeiten.
|
||||
- Kommunikation nach aussen nur ueber Interfaces.
|
||||
|
||||
## Rolle im Gesamtsystem
|
||||
|
||||
Diese Schicht ist der zentrale Ausfuehrungspunkt fuer Use-Cases und verbindet die API-Schicht mit Domain und Infrastructure, ohne Technologie-Details nach oben durchzureichen.
|
||||
@@ -1,22 +0,0 @@
|
||||
namespace DigitalData.TaskFlow.Domain.Closing;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the user decision payload for closing a workflow process.
|
||||
/// </summary>
|
||||
public sealed record CloseWorkflowDecision
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the selected closing method identifier.
|
||||
/// </summary>
|
||||
public required int ClosingMethodId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the optional comment attached to the decision.
|
||||
/// </summary>
|
||||
public string? Comment { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the optional rejection reason identifier.
|
||||
/// </summary>
|
||||
public int? RejectionReasonId { get; init; }
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
namespace DigitalData.TaskFlow.Domain.Closing;
|
||||
|
||||
/// <summary>
|
||||
/// Defines business outcomes of a close workflow attempt.
|
||||
/// </summary>
|
||||
public enum CloseWorkflowOutcome
|
||||
{
|
||||
/// <summary>
|
||||
/// Workflow can be closed successfully.
|
||||
/// </summary>
|
||||
Closed = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Caller has no access to the requested workflow.
|
||||
/// </summary>
|
||||
NoAccess = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Workflow process was not found.
|
||||
/// </summary>
|
||||
NotFound = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Workflow is already closed and cannot be closed again.
|
||||
/// </summary>
|
||||
AlreadyClosed = 3,
|
||||
|
||||
/// <summary>
|
||||
/// Closing cannot be completed yet because write integration is not finalized.
|
||||
/// </summary>
|
||||
NotImplemented = 4
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
namespace DigitalData.TaskFlow.Domain.Closing;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the result of a workflow closing operation.
|
||||
/// </summary>
|
||||
public sealed record CloseWorkflowResult
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the process identifier.
|
||||
/// </summary>
|
||||
public required int ProcessId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the process was closed successfully.
|
||||
/// </summary>
|
||||
public required bool IsClosed { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the business outcome of the close request.
|
||||
/// </summary>
|
||||
public CloseWorkflowOutcome Outcome { get; init; } = CloseWorkflowOutcome.Closed;
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
namespace DigitalData.TaskFlow.Domain.Common;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the standard API envelope that contains meta information and payload data.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">Type of the payload in the response.</typeparam>
|
||||
public sealed record ApiEnvelope<T>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the list of metadata entries describing the business result.
|
||||
/// </summary>
|
||||
public required IReadOnlyList<MetaEntry> Meta { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the payload data returned by the endpoint.
|
||||
/// </summary>
|
||||
public T? Data { get; init; }
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
namespace DigitalData.TaskFlow.Domain.Common;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a single metadata item describing the business result state of an API response.
|
||||
/// </summary>
|
||||
public sealed record MetaEntry
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the domain-specific result code.
|
||||
/// </summary>
|
||||
public required int Code { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the human-readable message that belongs to <see cref="Code"/>.
|
||||
/// </summary>
|
||||
public required string Message { get; init; }
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
namespace DigitalData.TaskFlow.Domain.Documents;
|
||||
|
||||
/// <summary>
|
||||
/// Represents binary document content returned by the document endpoint.
|
||||
/// </summary>
|
||||
public sealed record DocumentBinaryResult
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the raw binary content.
|
||||
/// </summary>
|
||||
public required byte[] Content { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the MIME content type.
|
||||
/// </summary>
|
||||
public required string ContentType { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the file name used for download.
|
||||
/// </summary>
|
||||
public required string FileName { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the content length in bytes.
|
||||
/// </summary>
|
||||
public required long Length { get; init; }
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
namespace DigitalData.TaskFlow.Domain.Enums;
|
||||
|
||||
/// <summary>
|
||||
/// Defines domain-level result codes used in API meta responses.
|
||||
/// </summary>
|
||||
public enum MetaCode
|
||||
{
|
||||
/// <summary>
|
||||
/// Operation completed successfully.
|
||||
/// </summary>
|
||||
Ok = 0,
|
||||
|
||||
/// <summary>
|
||||
/// Request is valid but no open workflows are available.
|
||||
/// </summary>
|
||||
NoOpenWorkflows = 1,
|
||||
|
||||
/// <summary>
|
||||
/// Caller has no access to the requested resource.
|
||||
/// </summary>
|
||||
NoAccess = 2,
|
||||
|
||||
/// <summary>
|
||||
/// Request is invalid or authentication failed according to endpoint rules.
|
||||
/// </summary>
|
||||
InvalidRequest = 4,
|
||||
|
||||
/// <summary>
|
||||
/// Internal server error occurred.
|
||||
/// </summary>
|
||||
InternalError = 5,
|
||||
|
||||
/// <summary>
|
||||
/// Requested resource was not found.
|
||||
/// </summary>
|
||||
NotFound = 6,
|
||||
|
||||
/// <summary>
|
||||
/// Target workflow was already closed.
|
||||
/// </summary>
|
||||
AlreadyClosed = 7
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace DigitalData.TaskFlow.Domain.ProcedureResults;
|
||||
|
||||
public class AuthorizedUser
|
||||
{
|
||||
public int WisagId { get; init; }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
namespace DigitalData.TaskFlow.Domain.ProcedureResults;
|
||||
|
||||
public class Document : ProcedureResultBase
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace DigitalData.TaskFlow.Domain.ProcedureResults;
|
||||
|
||||
public abstract class ProcedureResultBase
|
||||
{
|
||||
public virtual int? Code { get; init; }
|
||||
|
||||
public virtual string? Result { get; init; }
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
namespace DigitalData.TaskFlow.Domain.ProcedureResults;
|
||||
|
||||
public class Workflow : ProcedureResultBase
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
namespace DigitalData.TaskFlow.Domain.ProcedureResults;
|
||||
|
||||
public sealed class WorkflowClosing : ProcedureResultBase
|
||||
{
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
# DigitalData.TaskFlow.Domain
|
||||
|
||||
Dieses Projekt bildet den fachlichen Kern von `DigitalData.TaskFlow`.
|
||||
|
||||
## Zweck
|
||||
|
||||
Die Domain-Schicht enthaelt ausschließlich fachliche Modelle und Begriffe. Hier wird beschrieben, **was** das System fachlich darstellt, nicht **wie** Daten gelesen/geschrieben werden.
|
||||
|
||||
## Aktueller Inhalt
|
||||
|
||||
- `Common/`
|
||||
- `ApiEnvelope<T>`: Standard-Response-Huelle mit `Meta` und `Data`.
|
||||
- `MetaEntry`: Einzelner Meta-Eintrag (`Code`, `Message`).
|
||||
- `Enums/`
|
||||
- `MetaCode`: Fachliche Status-Codes (z. B. `Ok`, `NoAccess`, `AlreadyClosed`).
|
||||
- `Workflows/`
|
||||
- Modelle fuer den Endpoint `GET /workflows/{wisagid}`.
|
||||
- Enthalten Quellblock-Struktur (`SourceBlock`, `FerdinandSourceBlock`, `ContractsSourceBlock`) und Untermodelle (`ProfileItem`, `WorkflowListingItem`, `ApprovalItem`, `DocumentReferenceItem`, `ClosingMethodItem`, `RejectionReasonItem`).
|
||||
- `Closing/`
|
||||
- Modelle fuer den Endpoint `POST /workflows/{wisagid}/{source}/{processid}/closing`.
|
||||
- `CloseWorkflowDecision` (Eingabe), `CloseWorkflowResult` (Ergebnis).
|
||||
- `Documents/`
|
||||
- `DocumentBinaryResult` fuer den Endpoint `GET /documents/{id}`.
|
||||
|
||||
## Architektur-Regeln
|
||||
|
||||
- Keine EF-Core-, HTTP-, SQL- oder Infrastruktur-Abhaengigkeiten.
|
||||
- Keine Controller- oder Middleware-Logik.
|
||||
- Modelle bleiben in PascalCase; technische DB-Namensabweichungen werden spaeter in Infrastructure gemappt.
|
||||
|
||||
## Warum diese Schicht wichtig ist
|
||||
|
||||
Die Domain stellt eine stabile, technologieunabhaengige Sprache bereit. Dadurch koennen API, Application und Infrastructure getrennt entwickelt werden, ohne den fachlichen Vertrag zu verlieren.
|
||||
@@ -1,32 +0,0 @@
|
||||
namespace DigitalData.TaskFlow.Domain.Workflows;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a completed approval action for a workflow process.
|
||||
/// </summary>
|
||||
public sealed record ApprovalItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the process identifier.
|
||||
/// </summary>
|
||||
public required int ProcessId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the approval sequence index.
|
||||
/// </summary>
|
||||
public required int Sequence { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the user name or identifier of the approver.
|
||||
/// </summary>
|
||||
public required string ApprovedBy { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the UTC timestamp when approval was recorded.
|
||||
/// </summary>
|
||||
public required DateTime ApprovedAtUtc { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the optional approval comment.
|
||||
/// </summary>
|
||||
public string? Comment { get; init; }
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
namespace DigitalData.TaskFlow.Domain.Workflows;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a workflow closing option available for user decision.
|
||||
/// </summary>
|
||||
public sealed record ClosingMethodItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the closing method identifier.
|
||||
/// </summary>
|
||||
public required int ClosingMethodId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the display name of the method.
|
||||
/// </summary>
|
||||
public required string Name { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether a comment is mandatory for this method.
|
||||
/// </summary>
|
||||
public required bool CommentRequired { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this method represents a rejection.
|
||||
/// </summary>
|
||||
public required bool IsRejection { get; init; }
|
||||
}
|
||||
@@ -1,40 +0,0 @@
|
||||
namespace DigitalData.TaskFlow.Domain.Workflows;
|
||||
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
/// <summary>
|
||||
/// Represents workflow data for the Contracts source system.
|
||||
/// </summary>
|
||||
public sealed record ContractsSourceBlock : SourceBlock
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets available approval profiles.
|
||||
/// </summary>
|
||||
[JsonPropertyName("profile")]
|
||||
public required IReadOnlyList<JsonElement> Profile { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets workflow listing items.
|
||||
/// </summary>
|
||||
[JsonPropertyName("Listing")]
|
||||
public required IReadOnlyList<JsonElement> Listing { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets already executed approvals.
|
||||
/// </summary>
|
||||
[JsonPropertyName("approvals")]
|
||||
public required IReadOnlyList<JsonElement> Approvals { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets document references for workflows.
|
||||
/// </summary>
|
||||
[JsonPropertyName("document")]
|
||||
public required IReadOnlyList<JsonElement> Document { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets available closing methods for workflows.
|
||||
/// </summary>
|
||||
[JsonPropertyName("closing_method")]
|
||||
public required IReadOnlyList<JsonElement> ClosingMethod { get; init; }
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
namespace DigitalData.TaskFlow.Domain.Workflows;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a lightweight document reference linked to a workflow process.
|
||||
/// </summary>
|
||||
public sealed record DocumentReferenceItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the document identifier used for binary retrieval.
|
||||
/// </summary>
|
||||
public required string Id { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the process identifier.
|
||||
/// </summary>
|
||||
public required int ProcessId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the document title.
|
||||
/// </summary>
|
||||
public required string Title { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the document subtitle.
|
||||
/// </summary>
|
||||
public required string Subtitle { get; init; }
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
namespace DigitalData.TaskFlow.Domain.Workflows;
|
||||
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
/// <summary>
|
||||
/// Represents workflow data for the Ferdinand source system.
|
||||
/// </summary>
|
||||
public sealed record FerdinandSourceBlock : SourceBlock
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets available approval profiles.
|
||||
/// </summary>
|
||||
[JsonPropertyName("profile")]
|
||||
public required IReadOnlyList<JsonElement> Profile { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets workflow listing items.
|
||||
/// </summary>
|
||||
[JsonPropertyName("Listing")]
|
||||
public required IReadOnlyList<JsonElement> Listing { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets already executed approvals.
|
||||
/// </summary>
|
||||
[JsonPropertyName("approvals")]
|
||||
public required IReadOnlyList<JsonElement> Approvals { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets document references for workflows.
|
||||
/// </summary>
|
||||
[JsonPropertyName("document")]
|
||||
public required IReadOnlyList<JsonElement> Document { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets available closing methods for workflows.
|
||||
/// </summary>
|
||||
[JsonPropertyName("closing_method")]
|
||||
public required IReadOnlyList<JsonElement> ClosingMethod { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets available rejection reasons for rejection-type methods.
|
||||
/// </summary>
|
||||
[JsonPropertyName("rejection_reason")]
|
||||
public required IReadOnlyList<JsonElement> RejectionReason { get; init; }
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
namespace DigitalData.TaskFlow.Domain.Workflows;
|
||||
|
||||
/// <summary>
|
||||
/// Represents an approval profile for workflow processing.
|
||||
/// </summary>
|
||||
public sealed record ProfileItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the profile identifier.
|
||||
/// </summary>
|
||||
public required int ProfileId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the display title of the profile.
|
||||
/// </summary>
|
||||
public required string Title { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the optional priority value.
|
||||
/// </summary>
|
||||
public int? Priority { get; init; }
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
namespace DigitalData.TaskFlow.Domain.Workflows;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a rejection reason that can be selected for rejection methods.
|
||||
/// </summary>
|
||||
public sealed record RejectionReasonItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the rejection reason identifier.
|
||||
/// </summary>
|
||||
public required int RejectionReasonId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the display name of the rejection reason.
|
||||
/// </summary>
|
||||
public required string Name { get; init; }
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
namespace DigitalData.TaskFlow.Domain.Workflows;
|
||||
|
||||
/// <summary>
|
||||
/// Base type for source-specific workflow blocks.
|
||||
/// </summary>
|
||||
public abstract record SourceBlock
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the source system name.
|
||||
/// </summary>
|
||||
public required string Source { get; init; }
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
namespace DigitalData.TaskFlow.Domain.Workflows;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a single workflow listing row.
|
||||
/// </summary>
|
||||
public sealed record WorkflowListingItem
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the process identifier.
|
||||
/// </summary>
|
||||
public required int ProcessId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the profile identifier associated with the process.
|
||||
/// </summary>
|
||||
public required int ProfileId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the voucher type.
|
||||
/// </summary>
|
||||
public required string VoucherType { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the voucher number.
|
||||
/// </summary>
|
||||
public required string VoucherNumber { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the voucher date.
|
||||
/// </summary>
|
||||
public required DateOnly VoucherDate { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the cost center number.
|
||||
/// </summary>
|
||||
public required string CostCenter { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the cost center description.
|
||||
/// </summary>
|
||||
public required string CostCenterDescription { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the client number.
|
||||
/// </summary>
|
||||
public required int ClientNumber { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the client name.
|
||||
/// </summary>
|
||||
public required string ClientName { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the supplier number.
|
||||
/// </summary>
|
||||
public required string SupplierNumber { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the supplier name.
|
||||
/// </summary>
|
||||
public required string SupplierName { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the net amount.
|
||||
/// </summary>
|
||||
public required decimal NetAmount { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the gross amount.
|
||||
/// </summary>
|
||||
public required decimal GrossAmount { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the discount amount.
|
||||
/// </summary>
|
||||
public required decimal DiscountAmount { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the currency.
|
||||
/// </summary>
|
||||
public required string Currency { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the priority value.
|
||||
/// </summary>
|
||||
public required int Priority { get; init; }
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
namespace DigitalData.TaskFlow.Domain.Workflows;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the workflow payload grouped by source systems.
|
||||
/// </summary>
|
||||
public sealed record WorkflowSourcesResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the source blocks included in the response.
|
||||
/// </summary>
|
||||
public required IReadOnlyList<SourceBlock> Sources { get; init; }
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
using DigitalData.TaskFlow.Application.Common.Interfaces;
|
||||
using DigitalData.TaskFlow.Infrastructure.Options;
|
||||
using DigitalData.TaskFlow.Infrastructure.Persistence;
|
||||
using DigitalData.TaskFlow.Infrastructure.Repositories;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
@@ -13,25 +12,17 @@ public static class DependencyInjection
|
||||
public static IServiceCollection AddInfrastructureServices(this IServiceCollection services, IConfiguration configuration)
|
||||
{
|
||||
var connectionString = configuration.GetConnectionString("TaskFlowDb");
|
||||
var databaseOptions = configuration.GetSection(DatabaseOptions.SectionName).Get<DatabaseOptions>() ?? new DatabaseOptions();
|
||||
|
||||
if (string.IsNullOrWhiteSpace(connectionString))
|
||||
{
|
||||
throw new InvalidOperationException("Connection string 'TaskFlowDb' is not configured.");
|
||||
}
|
||||
|
||||
services.AddDbContext<TaskFlowDbContext>(options =>
|
||||
{
|
||||
options.UseSqlServer(connectionString, sqlOptions =>
|
||||
{
|
||||
sqlOptions.CommandTimeout(databaseOptions.CommandTimeoutSeconds);
|
||||
});
|
||||
options.UseSqlServer(connectionString);
|
||||
});
|
||||
|
||||
services.Configure<DatabaseOptions>(configuration.GetSection(DatabaseOptions.SectionName));
|
||||
|
||||
services.AddScoped<IWorkflowRepository, WorkflowRepository>();
|
||||
services.AddScoped<IDocumentRepository, DocumentRepository>();
|
||||
services.AddScoped<IUserRepository, UserRepository>();
|
||||
|
||||
return services;
|
||||
}
|
||||
|
||||
@@ -7,20 +7,15 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.11" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.11" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.11" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.11" />
|
||||
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="11.0.0-rc.1.26425.128" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="11.0.0-rc.1.26425.128" />
|
||||
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="11.0.0-rc.1.26425.128" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\core\DigitalData.TaskFlow.Application\DigitalData.TaskFlow.Application.csproj" />
|
||||
<ProjectReference Include="..\..\core\DigitalData.TaskFlow.Domain\DigitalData.TaskFlow.Domain.csproj" />
|
||||
<ProjectReference Include="..\..\core\DigitalData.TaskFlow.Application\DigitalData.TaskFlow.Application.csproj" />
|
||||
<ProjectReference Include="..\..\core\DigitalData.TaskFlow.Domain\DigitalData.TaskFlow.Domain.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Options\" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
namespace DigitalData.TaskFlow.Infrastructure.Options;
|
||||
|
||||
/// <summary>
|
||||
/// Holds infrastructure database options.
|
||||
/// </summary>
|
||||
public sealed class DatabaseOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Configuration section name.
|
||||
/// </summary>
|
||||
public const string SectionName = "Database";
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets command timeout in seconds for SQL operations.
|
||||
/// </summary>
|
||||
public int CommandTimeoutSeconds { get; set; } = 30;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets object type passed to workflow listing procedure.
|
||||
/// </summary>
|
||||
public string WorkflowListingObjectType { get; set; } = "Ferdinand";
|
||||
}
|
||||
@@ -1,111 +0,0 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace DigitalData.TaskFlow.Infrastructure.Persistence.Models;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a stored procedure row shape for workflow listing data.
|
||||
/// </summary>
|
||||
public sealed class WorkflowListingReadModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the process identifier.
|
||||
/// </summary>
|
||||
[Column("processid")]
|
||||
public int ProcessId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the profile identifier.
|
||||
/// </summary>
|
||||
[Column("profileid")]
|
||||
public byte ProfileId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the voucher type.
|
||||
/// </summary>
|
||||
[Column("belegart")]
|
||||
public string VoucherType { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the voucher number.
|
||||
/// </summary>
|
||||
[Column("belegnr")]
|
||||
public string VoucherNumber { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the voucher date.
|
||||
/// </summary>
|
||||
[Column("belegdatum")]
|
||||
public DateTime VoucherDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the cost center.
|
||||
/// </summary>
|
||||
[Column("kostenstelle")]
|
||||
public string CostCenter { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the cost center description.
|
||||
/// </summary>
|
||||
[Column("kostenstellenbezeichnung")]
|
||||
public string CostCenterDescription { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the client number.
|
||||
/// </summary>
|
||||
[Column("mandantnr")]
|
||||
public short ClientNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the client name.
|
||||
/// </summary>
|
||||
[Column("mandantbez")]
|
||||
public string ClientName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the supplier number.
|
||||
/// </summary>
|
||||
[Column("lieferantnr")]
|
||||
public string SupplierNumber { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the supplier name.
|
||||
/// </summary>
|
||||
[Column("lieferantbez")]
|
||||
public string SupplierName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the net amount.
|
||||
/// </summary>
|
||||
[Column("netto")]
|
||||
public double NetAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the gross amount.
|
||||
/// </summary>
|
||||
[Column("brutto")]
|
||||
public double GrossAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the discount amount.
|
||||
/// </summary>
|
||||
[Column("skontobetrag")]
|
||||
public double DiscountAmount { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the currency.
|
||||
/// </summary>
|
||||
[Column("waehrung")]
|
||||
public string Currency { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the priority.
|
||||
/// </summary>
|
||||
[Column("priority")]
|
||||
public byte Priority { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the source group text.
|
||||
/// </summary>
|
||||
[Column("GROUP_TEXT")]
|
||||
public string GroupText { get; set; } = string.Empty;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
using DigitalData.TaskFlow.Infrastructure.Persistence.Models;
|
||||
using DigitalData.TaskFlow.Domain.ProcedureResults;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace DigitalData.TaskFlow.Infrastructure.Persistence;
|
||||
@@ -9,18 +9,58 @@ namespace DigitalData.TaskFlow.Infrastructure.Persistence;
|
||||
public sealed class TaskFlowDbContext(DbContextOptions<TaskFlowDbContext> options) : DbContext(options)
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the keyless result model used for workflow listing procedure reads.
|
||||
/// Gets the keyless result model used for workflow procedure reads.
|
||||
/// </summary>
|
||||
public DbSet<WorkflowListingReadModel> WorkflowListingReadModels => Set<WorkflowListingReadModel>();
|
||||
public DbSet<Workflow> Workflows => Set<Workflow>();
|
||||
|
||||
/// <summary>
|
||||
/// Gets the keyless result model used for document procedure reads.
|
||||
/// </summary>
|
||||
public DbSet<Document> Documents => Set<Document>();
|
||||
|
||||
/// <summary>
|
||||
/// Gets the keyless result model used for workflow close procedure results.
|
||||
/// </summary>
|
||||
public DbSet<WorkflowClosing> WorkflowClosings => Set<WorkflowClosing>();
|
||||
|
||||
/// <summary>
|
||||
/// Gets the keyless result model used for authorized users procedure results.
|
||||
/// </summary>
|
||||
public DbSet<AuthorizedUser> AuthorizedUsers => Set<AuthorizedUser>();
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
base.OnModelCreating(modelBuilder);
|
||||
|
||||
modelBuilder.Entity<WorkflowListingReadModel>(entity =>
|
||||
modelBuilder.Entity<Workflow>(entity =>
|
||||
{
|
||||
entity.HasNoKey();
|
||||
entity.ToView(null);
|
||||
entity.Property(x => x.Code).HasColumnName("CODE").HasColumnType("int");
|
||||
entity.Property(x => x.Result).HasColumnName("RESULT").HasColumnType("nvarchar(max)");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<Document>(entity =>
|
||||
{
|
||||
entity.HasNoKey();
|
||||
entity.ToView(null);
|
||||
entity.Property(x => x.Code).HasColumnName("CODE").HasColumnType("int");
|
||||
entity.Property(x => x.Result).HasColumnName("RESULT").HasColumnType("nvarchar(max)");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<WorkflowClosing>(entity =>
|
||||
{
|
||||
entity.HasNoKey();
|
||||
entity.ToView(null);
|
||||
entity.Property(x => x.Code).HasColumnName("CODE").HasColumnType("int");
|
||||
entity.Property(x => x.Result).HasColumnName("RESULT").HasColumnType("nvarchar(400)");
|
||||
});
|
||||
|
||||
modelBuilder.Entity<AuthorizedUser>(entity =>
|
||||
{
|
||||
entity.HasNoKey();
|
||||
entity.ToView(null);
|
||||
entity.Property(x => x.WisagId).HasColumnName("wisagid").HasColumnType("int");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
# DigitalData.TaskFlow.Infrastructure
|
||||
|
||||
Dieses Projekt implementiert technische Integrationen der Anwendung.
|
||||
|
||||
## Zweck
|
||||
|
||||
Die Infrastructure-Schicht setzt die in Application definierten Abstraktionen konkret um. Dazu gehoeren Datenbankzugriffe (EF Core, Stored Procedures) und spaeter ggf. DMS- oder externe Service-Anbindungen.
|
||||
|
||||
## Aktueller Inhalt
|
||||
|
||||
- `DependencyInjection.cs`
|
||||
- Einstiegspunkt fuer die Registrierung technischer Dienste.
|
||||
- `Options/`
|
||||
- Platz fuer Infrastruktur-spezifische Optionen (falls benoetigt).
|
||||
|
||||
## Geplante Inhalte (naechste Phasen)
|
||||
|
||||
- `Persistence/`
|
||||
- `TaskFlowDbContext` mit SQL-Server-Konfiguration.
|
||||
- Entity-Konfigurationen inklusive Feld-Mapping (DB-Namen -> PascalCase-Modelle).
|
||||
- `Repositories/`
|
||||
- Implementierungen fuer:
|
||||
- Workflow-Lesezugriff (u. a. `PRCUST_F19_GET_LISTING_DATA`)
|
||||
- Workflow-Closing (Write-Procedure)
|
||||
- Dokument-Binary-Zugriff
|
||||
- `Persistence/Models/`
|
||||
- Keyless Modelle fuer Procedure-Ergebnisse.
|
||||
|
||||
## Wichtiger Hinweis zu DB-Spaltennamen
|
||||
|
||||
- Spaltennamen in `Persistence/Models` (z. B. `WorkflowListingReadModel`) basieren aktuell auf:
|
||||
- read-only Abfragen auf `sys.columns` (u. a. `TBCUST_F19_LISTING_RESULT`),
|
||||
- beobachteten Result-Sets von `PRCUST_F19_GET_LISTING_DATA` im `table`-Modus.
|
||||
- Vor produktiven Aenderungen muss das finale SP-Resultset read-only verifiziert werden, idealerweise mit
|
||||
`sp_describe_first_result_set` oder einer gleichwertigen Metadata-Pruefung.
|
||||
- Domain-Modelle bleiben davon getrennt: DB-Feldnamen werden nur in Infrastructure gemappt, nicht in Domain.
|
||||
|
||||
## Architektur-Regeln
|
||||
|
||||
- Keine Controller- oder HTTP-Logik.
|
||||
- Keine fachliche Regel-Definition; nur technische Umsetzung.
|
||||
- SQL-Zugriff stets parameterisiert und sicher.
|
||||
|
||||
## Rolle im Gesamtsystem
|
||||
|
||||
Infrastructure kapselt alle externen Abhaengigkeiten. Dadurch bleibt die Application-Schicht testbar und von Technologie-Details entkoppelt.
|
||||
@@ -1,25 +1,22 @@
|
||||
using DigitalData.TaskFlow.Application.Common.Interfaces;
|
||||
using DigitalData.TaskFlow.Domain.Documents;
|
||||
using DigitalData.TaskFlow.Domain.ProcedureResults;
|
||||
using DigitalData.TaskFlow.Infrastructure.Persistence;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace DigitalData.TaskFlow.Infrastructure.Repositories;
|
||||
|
||||
/// <summary>
|
||||
/// Document repository implementation for binary document retrieval.
|
||||
/// Document repository implementation for reading document listing data and applying close operations.
|
||||
/// </summary>
|
||||
public sealed class DocumentRepository : IDocumentRepository
|
||||
public sealed class DocumentRepository(TaskFlowDbContext context) : IDocumentRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// Retrieves binary document content by identifier.
|
||||
/// </summary>
|
||||
/// <param name="id">Document identifier.</param>
|
||||
/// <param name="cancellationToken">Cancellation token.</param>
|
||||
/// <returns>Binary document payload when found; otherwise <see langword="null"/>.</returns>
|
||||
public Task<DocumentBinaryResult?> GetAsync(string id, CancellationToken cancellationToken)
|
||||
public async Task<Document?> GetAsync(int userId, long processId, long docId, CancellationToken cancellationToken)
|
||||
{
|
||||
_ = id;
|
||||
_ = cancellationToken;
|
||||
var rows = await context.Documents
|
||||
.FromSqlInterpolated(@$"EXEC [PRCUST_F19_GET_DOCUMENT] @pRESULT_TYPE = 'json', @pOBJECT_TYPE = 'Ferdinand', @pUSER_ID = {userId}, @pPROCESS_ID = {processId}, @pDOC_ID = {docId}")
|
||||
.AsNoTracking()
|
||||
.ToListAsync(cancellationToken);
|
||||
|
||||
throw new NotSupportedException(
|
||||
"Document retrieval procedure/DMS contract is not finalized yet. Configure final integration before enabling GetAsync.");
|
||||
return rows.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using DigitalData.TaskFlow.Application.Common.Interfaces;
|
||||
using DigitalData.TaskFlow.Domain.ProcedureResults;
|
||||
using DigitalData.TaskFlow.Infrastructure.Persistence;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace DigitalData.TaskFlow.Infrastructure.Repositories;
|
||||
|
||||
public sealed class UserRepository(TaskFlowDbContext context) : IUserRepository
|
||||
{
|
||||
public async Task<IEnumerable<AuthorizedUser>> GetAuthorizedAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
return await context.AuthorizedUsers
|
||||
.FromSqlInterpolated($"EXEC [dbo].[PRCUST_F19_GET_AUTHORIZED_USERS]")
|
||||
.AsNoTracking()
|
||||
.ToListAsync(cancellationToken);
|
||||
}
|
||||
}
|
||||
@@ -1,254 +1,53 @@
|
||||
using DigitalData.TaskFlow.Application.Common.Interfaces;
|
||||
using DigitalData.TaskFlow.Domain.Closing;
|
||||
using DigitalData.TaskFlow.Domain.Workflows;
|
||||
using DigitalData.TaskFlow.Infrastructure.Options;
|
||||
using DigitalData.TaskFlow.Domain.ProcedureResults;
|
||||
using DigitalData.TaskFlow.Infrastructure.Persistence;
|
||||
using DigitalData.TaskFlow.Infrastructure.Persistence.Models;
|
||||
using Microsoft.Data.SqlClient;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Options;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace DigitalData.TaskFlow.Infrastructure.Repositories;
|
||||
|
||||
/// <summary>
|
||||
/// Workflow repository implementation for reading workflow listing data and applying close operations.
|
||||
/// </summary>
|
||||
public sealed class WorkflowRepository(TaskFlowDbContext dbContext, IOptions<DatabaseOptions> databaseOptions) : IWorkflowRepository
|
||||
public sealed class WorkflowRepository(TaskFlowDbContext context) : IWorkflowRepository
|
||||
{
|
||||
/// <summary>
|
||||
/// Retrieves grouped workflow data for a user.
|
||||
/// </summary>
|
||||
/// <param name="wisagId">WISAG user identifier.</param>
|
||||
/// <param name="cancellationToken">Cancellation token.</param>
|
||||
/// <returns>Grouped workflow response.</returns>
|
||||
public async Task<WorkflowSourcesResponse> GetAsync(int wisagId, CancellationToken cancellationToken)
|
||||
public async Task<Workflow?> GetByWisagIdAsync(int wisagId, CancellationToken cancellationToken)
|
||||
{
|
||||
var objectType = string.IsNullOrWhiteSpace(databaseOptions.Value.WorkflowListingObjectType)
|
||||
? "Ferdinand"
|
||||
: databaseOptions.Value.WorkflowListingObjectType;
|
||||
|
||||
var jsonPayload = await ExecuteListingJsonAsync(wisagId, objectType, cancellationToken);
|
||||
if (string.IsNullOrWhiteSpace(jsonPayload))
|
||||
{
|
||||
return new WorkflowSourcesResponse { Sources = [] };
|
||||
}
|
||||
|
||||
using var document = JsonDocument.Parse(jsonPayload);
|
||||
if (!document.RootElement.TryGetProperty("response", out var responseElement))
|
||||
{
|
||||
return new WorkflowSourcesResponse { Sources = [] };
|
||||
}
|
||||
|
||||
if (TryReadMetaCode(responseElement) == 2)
|
||||
{
|
||||
return new WorkflowSourcesResponse { Sources = [] };
|
||||
}
|
||||
|
||||
var sources = new List<SourceBlock>();
|
||||
if (!responseElement.TryGetProperty("sources", out var sourcesElement) || sourcesElement.ValueKind != JsonValueKind.Array)
|
||||
{
|
||||
return new WorkflowSourcesResponse { Sources = sources };
|
||||
}
|
||||
|
||||
foreach (var sourceElement in sourcesElement.EnumerateArray())
|
||||
{
|
||||
if (!sourceElement.TryGetProperty("source", out var sourceNameElement))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var sourceName = sourceNameElement.GetString();
|
||||
if (string.Equals(sourceName, "Ferdinand", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
sources.Add(new FerdinandSourceBlock
|
||||
{
|
||||
Source = "Ferdinand",
|
||||
Profile = ReadArray(sourceElement, "profile"),
|
||||
Listing = ReadArray(sourceElement, "Listing"),
|
||||
Approvals = ReadArray(sourceElement, "approvals"),
|
||||
Document = ReadArray(sourceElement, "document"),
|
||||
ClosingMethod = ReadArray(sourceElement, "closing_method"),
|
||||
RejectionReason = ReadArray(sourceElement, "rejection_reason")
|
||||
});
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (string.Equals(sourceName, "Contracts", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
sources.Add(new ContractsSourceBlock
|
||||
{
|
||||
Source = "Contracts",
|
||||
Profile = ReadArray(sourceElement, "profile"),
|
||||
Listing = ReadArray(sourceElement, "Listing"),
|
||||
Approvals = ReadArray(sourceElement, "approvals"),
|
||||
Document = ReadArray(sourceElement, "document"),
|
||||
ClosingMethod = ReadArray(sourceElement, "closing_method")
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return new WorkflowSourcesResponse { Sources = sources };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Applies a closing decision to a workflow item.
|
||||
/// </summary>
|
||||
/// <param name="wisagId">WISAG user identifier.</param>
|
||||
/// <param name="source">Source system name.</param>
|
||||
/// <param name="processId">Process identifier.</param>
|
||||
/// <param name="decision">Closing decision payload.</param>
|
||||
/// <param name="cancellationToken">Cancellation token.</param>
|
||||
/// <returns>Result of the close operation.</returns>
|
||||
public Task<CloseWorkflowResult> CloseAsync(
|
||||
int wisagId,
|
||||
string source,
|
||||
int processId,
|
||||
CloseWorkflowDecision decision,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
_ = decision;
|
||||
|
||||
if (!string.Equals(source, "Ferdinand", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return Task.FromResult(new CloseWorkflowResult
|
||||
{
|
||||
ProcessId = processId,
|
||||
IsClosed = false,
|
||||
Outcome = CloseWorkflowOutcome.NotFound
|
||||
});
|
||||
}
|
||||
|
||||
return EvaluateCloseOutcomeAsync(wisagId, source, processId, cancellationToken);
|
||||
}
|
||||
|
||||
private async Task<CloseWorkflowResult> EvaluateCloseOutcomeAsync(
|
||||
int wisagId,
|
||||
string source,
|
||||
int processId,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
var rows = await ExecuteListingTableAsync(wisagId, source, cancellationToken);
|
||||
if (rows.Any(row => row.ProcessId == processId))
|
||||
{
|
||||
return new CloseWorkflowResult
|
||||
{
|
||||
ProcessId = processId,
|
||||
IsClosed = true,
|
||||
Outcome = CloseWorkflowOutcome.Closed
|
||||
};
|
||||
}
|
||||
|
||||
var metaCode = await TryGetWorkflowMetaCodeAsync(wisagId, source, cancellationToken);
|
||||
if (metaCode == 2)
|
||||
{
|
||||
return new CloseWorkflowResult
|
||||
{
|
||||
ProcessId = processId,
|
||||
IsClosed = false,
|
||||
Outcome = CloseWorkflowOutcome.NoAccess
|
||||
};
|
||||
}
|
||||
|
||||
return new CloseWorkflowResult
|
||||
{
|
||||
ProcessId = 0,
|
||||
IsClosed = false,
|
||||
Outcome = CloseWorkflowOutcome.NotFound
|
||||
};
|
||||
}
|
||||
|
||||
private async Task<int?> TryGetWorkflowMetaCodeAsync(int wisagId, string objectType, CancellationToken cancellationToken)
|
||||
{
|
||||
var jsonPayload = await ExecuteListingJsonAsync(wisagId, objectType, cancellationToken);
|
||||
|
||||
if (string.IsNullOrWhiteSpace(jsonPayload))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
using var document = JsonDocument.Parse(jsonPayload);
|
||||
|
||||
return document.RootElement.TryGetProperty("response", out var responseElement)
|
||||
? TryReadMetaCode(responseElement)
|
||||
: null;
|
||||
}
|
||||
catch (JsonException)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private async Task<IReadOnlyList<WorkflowListingReadModel>> ExecuteListingTableAsync(
|
||||
int wisagId,
|
||||
string objectType,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
const string resultType = "table";
|
||||
|
||||
return await dbContext
|
||||
.WorkflowListingReadModels
|
||||
.FromSqlInterpolated($"EXEC dbo.PRCUST_F19_GET_LISTING_DATA @pUSER_ID={wisagId}, @pRESULT_TYPE={resultType}, @pOBJECT_TYPE={objectType}")
|
||||
var rows = await context.Workflows
|
||||
.FromSqlInterpolated(@$"EXEC [PRCUST_F19_GET_LISTING_DATA] @pUSER_ID = {wisagId}, @pRESULT_TYPE = 'json', @pOBJECT_TYPE = 'Ferdinand'")
|
||||
.AsNoTracking()
|
||||
.ToListAsync(cancellationToken);
|
||||
|
||||
return rows.FirstOrDefault();
|
||||
}
|
||||
|
||||
private async Task<string?> ExecuteListingJsonAsync(int wisagId, string objectType, CancellationToken cancellationToken)
|
||||
public async Task<WorkflowClosing?> CloseAsync(
|
||||
int userId,
|
||||
string source,
|
||||
long processId,
|
||||
int closingMethodId,
|
||||
string? comment,
|
||||
byte? rejectionReasonId,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
const string commandText = "EXEC dbo.PRCUST_F19_GET_LISTING_DATA @pUSER_ID, @pRESULT_TYPE, @pOBJECT_TYPE";
|
||||
const string resultType = "json";
|
||||
var rows = await context.WorkflowClosings
|
||||
.FromSqlInterpolated($@"
|
||||
DECLARE @ResultCode INT;
|
||||
DECLARE @ResultMessage NVARCHAR(400);
|
||||
|
||||
await using var command = dbContext.Database.GetDbConnection().CreateCommand();
|
||||
command.CommandText = commandText;
|
||||
EXEC dbo.PRCUST_F19_CLOSING
|
||||
@UserID = {userId},
|
||||
@Source = {source},
|
||||
@ProcessID = {processId},
|
||||
@ClosingMethodID = {closingMethodId},
|
||||
@Comment = {comment},
|
||||
@RejectionReasonID = {rejectionReasonId},
|
||||
@ResultCode = @ResultCode OUTPUT,
|
||||
@ResultMessage = @ResultMessage OUTPUT;
|
||||
|
||||
command.Parameters.Add(new SqlParameter("@pUSER_ID", wisagId));
|
||||
command.Parameters.Add(new SqlParameter("@pRESULT_TYPE", resultType));
|
||||
command.Parameters.Add(new SqlParameter("@pOBJECT_TYPE", objectType));
|
||||
SELECT @ResultCode AS CODE, @ResultMessage AS RESULT;")
|
||||
.AsNoTracking()
|
||||
.ToListAsync(cancellationToken);
|
||||
|
||||
if (command.Connection is null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (command.Connection.State != System.Data.ConnectionState.Open)
|
||||
{
|
||||
await command.Connection.OpenAsync(cancellationToken);
|
||||
}
|
||||
|
||||
await using var reader = await command.ExecuteReaderAsync(cancellationToken);
|
||||
if (!await reader.ReadAsync(cancellationToken) || reader.FieldCount == 0 || reader.IsDBNull(0))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return reader.GetString(0);
|
||||
}
|
||||
|
||||
private static int? TryReadMetaCode(JsonElement responseElement)
|
||||
{
|
||||
if (!responseElement.TryGetProperty("meta", out var metaElement) || metaElement.ValueKind != JsonValueKind.Array)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (metaElement.GetArrayLength() == 0 || !metaElement[0].TryGetProperty("code", out var codeElement))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return codeElement.GetInt32();
|
||||
}
|
||||
|
||||
private static IReadOnlyList<JsonElement> ReadArray(JsonElement sourceElement, string propertyName)
|
||||
{
|
||||
if (!sourceElement.TryGetProperty(propertyName, out var propertyElement) || propertyElement.ValueKind != JsonValueKind.Array)
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
return propertyElement.EnumerateArray().Select(item => item.Clone()).ToList();
|
||||
return rows.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
using DigitalData.TaskFlow.Domain.Common;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace DigitalData.TaskFlow.API.Contracts.Common;
|
||||
|
||||
/// <summary>
|
||||
/// Represents a contract response that contains only metadata.
|
||||
/// </summary>
|
||||
public sealed record MetaOnlyResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets metadata entries.
|
||||
/// </summary>
|
||||
[JsonPropertyName("meta")]
|
||||
public required IReadOnlyList<MetaEntry> Meta { get; init; }
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace DigitalData.TaskFlow.API.Contracts.Workflows;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the request payload for closing a workflow.
|
||||
/// </summary>
|
||||
public sealed class CloseWorkflowRequest
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the selected closing method identifier.
|
||||
/// </summary>
|
||||
[JsonPropertyName("closing_method_id")]
|
||||
public required int ClosingMethodId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets an optional user comment.
|
||||
/// </summary>
|
||||
[JsonPropertyName("comment")]
|
||||
public string? Comment { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets an optional rejection reason identifier.
|
||||
/// </summary>
|
||||
[JsonPropertyName("rejection_reason_id")]
|
||||
public int? RejectionReasonId { get; init; }
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
using DigitalData.TaskFlow.Domain.Common;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace DigitalData.TaskFlow.API.Contracts.Workflows;
|
||||
|
||||
/// <summary>
|
||||
/// Represents the GET workflows response contract.
|
||||
/// </summary>
|
||||
public sealed record WorkflowsResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets metadata entries.
|
||||
/// </summary>
|
||||
[JsonPropertyName("meta")]
|
||||
public required IReadOnlyList<MetaEntry> Meta { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets grouped source blocks.
|
||||
/// </summary>
|
||||
[JsonPropertyName("sources")]
|
||||
public required IReadOnlyList<object> Sources { get; init; }
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
using DigitalData.TaskFlow.Application.Features.Documents.Queries;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace DigitalData.TaskFlow.API.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Provides workflow read and close endpoints.
|
||||
/// </summary>
|
||||
[ApiController]
|
||||
[Route("api/documents")]
|
||||
public sealed class DocumentController(ISender sender) : ControllerBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns open documents for a WISAG user identifier.
|
||||
/// </summary>
|
||||
/// <param name="id">Document identifier.</param>
|
||||
/// <param name="userId">User identifier.</param>
|
||||
/// <param name="processId">Process identifier.</param>
|
||||
/// <param name="cancellationToken">Cancellation token.</param>
|
||||
/// <returns>Document response envelope grouped by source.</returns>
|
||||
[HttpGet("{id:int}")]
|
||||
[ProducesResponseType(typeof(JsonElement), StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status502BadGateway)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<JsonElement>> GetAsync([FromRoute] int id, [FromQuery] int userId, [FromQuery] long processId, CancellationToken cancellationToken = default)
|
||||
{
|
||||
return Ok(await sender.Send(new GetDocumentQuery(Id: id, UserId: userId, ProcessId: processId), cancellationToken));
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
using DigitalData.TaskFlow.Application.Features.Documents.Queries.GetDocument;
|
||||
using DigitalData.TaskFlow.API.Contracts.Common;
|
||||
using DigitalData.TaskFlow.Domain.Common;
|
||||
using DigitalData.TaskFlow.Domain.Documents;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace DigitalData.TaskFlow.API.Controllers;
|
||||
|
||||
/// <summary>
|
||||
/// Provides document binary download endpoints.
|
||||
/// </summary>
|
||||
[ApiController]
|
||||
[Route("api/documents")]
|
||||
public sealed class DocumentsController(ISender sender) : ControllerBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns binary document content by document identifier.
|
||||
/// </summary>
|
||||
/// <param name="id">Document identifier.</param>
|
||||
/// <param name="cancellationToken">Cancellation token.</param>
|
||||
/// <returns>Binary stream when available.</returns>
|
||||
[HttpGet("{id}")]
|
||||
[ProducesResponseType(typeof(FileContentResult), StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(typeof(MetaOnlyResponse), StatusCodes.Status400BadRequest)]
|
||||
[ProducesResponseType(typeof(MetaOnlyResponse), StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(typeof(MetaOnlyResponse), StatusCodes.Status403Forbidden)]
|
||||
[ProducesResponseType(typeof(MetaOnlyResponse), StatusCodes.Status404NotFound)]
|
||||
[ProducesResponseType(typeof(MetaOnlyResponse), StatusCodes.Status500InternalServerError)]
|
||||
public async Task<IActionResult> GetAsync([FromRoute] string id, CancellationToken cancellationToken)
|
||||
{
|
||||
var response = await sender.Send(new GetDocumentQuery(id), cancellationToken);
|
||||
var data = response.Data ?? throw new InvalidOperationException("Document payload is unexpectedly null.");
|
||||
return File(data.Content, data.ContentType, data.FileName);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using DigitalData.TaskFlow.Application.Features.Users.Queries;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace DigitalData.TaskFlow.API.Controllers;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
[ApiController]
|
||||
[Route("api/users")]
|
||||
public sealed class UsersController(ISender sender) : ControllerBase
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("authorized")]
|
||||
[ProducesResponseType(typeof(GetAuthorizedUsersResult), StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(typeof(GetAuthorizedUsersResult), StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(typeof(GetAuthorizedUsersResult), StatusCodes.Status500InternalServerError)]
|
||||
public async Task<IActionResult> GetAuthorizedAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
var result = await sender.Send(new GetAuthorizedUsersQuery(), cancellationToken);
|
||||
var code = result.Meta.FirstOrDefault()?.Code;
|
||||
|
||||
return code switch
|
||||
{
|
||||
0 => Ok(result),
|
||||
4 => Unauthorized(result),
|
||||
_ => StatusCode(StatusCodes.Status500InternalServerError, result)
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,10 @@
|
||||
using DigitalData.TaskFlow.API.Contracts.Workflows;
|
||||
using DigitalData.TaskFlow.API.Contracts.Common;
|
||||
using DigitalData.TaskFlow.Application.Features.Workflows.Commands.CloseWorkflow;
|
||||
using DigitalData.TaskFlow.Application.Features.Workflows.Queries.GetWorkflows;
|
||||
using DigitalData.TaskFlow.API.Models;
|
||||
using DigitalData.TaskFlow.Application.Common.Exceptions;
|
||||
using DigitalData.TaskFlow.Application.Features.Workflows.Commands;
|
||||
using DigitalData.TaskFlow.Application.Features.Workflows.Queries;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace DigitalData.TaskFlow.API.Controllers;
|
||||
|
||||
@@ -21,64 +22,55 @@ public sealed class WorkflowsController(ISender sender) : ControllerBase
|
||||
/// <param name="cancellationToken">Cancellation token.</param>
|
||||
/// <returns>Workflow response envelope grouped by source.</returns>
|
||||
[HttpGet("{wisagId:int}")]
|
||||
[ProducesResponseType(typeof(WorkflowsResponse), StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(typeof(MetaOnlyResponse), StatusCodes.Status400BadRequest)]
|
||||
[ProducesResponseType(typeof(MetaOnlyResponse), StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(typeof(MetaOnlyResponse), StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<WorkflowsResponse>> GetAsync(
|
||||
[FromRoute] int wisagId,
|
||||
CancellationToken cancellationToken)
|
||||
[ProducesResponseType(typeof(JsonElement), StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status502BadGateway)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<JsonElement>> GetAsync([FromRoute] int wisagId, CancellationToken cancellationToken)
|
||||
{
|
||||
var response = await sender.Send(new GetWorkflowsQuery(wisagId), cancellationToken);
|
||||
|
||||
var sources = response.Data?.Sources
|
||||
.Cast<object>()
|
||||
.ToList()
|
||||
?? [];
|
||||
|
||||
return Ok(new WorkflowsResponse
|
||||
{
|
||||
Meta = response.Meta,
|
||||
Sources = sources
|
||||
});
|
||||
return Ok(await sender.Send(new GetWorkflowsQuery(wisagId), cancellationToken));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Applies a closing decision to a workflow process.
|
||||
/// Closes a workflow for a WISAG user identifier, source, and process identifier.
|
||||
/// </summary>
|
||||
/// <param name="wisagId">WISAG user identifier.</param>
|
||||
/// <param name="source">Source system name.</param>
|
||||
/// <param name="processId">Process identifier.</param>
|
||||
/// <param name="request">Closing request payload.</param>
|
||||
/// <param name="cancellationToken">Cancellation token.</param>
|
||||
/// <returns>Close result envelope.</returns>
|
||||
[HttpPost("{wisagId:int}/{source}/{processId:int}/closing")]
|
||||
[ProducesResponseType(typeof(MetaOnlyResponse), StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(typeof(MetaOnlyResponse), StatusCodes.Status400BadRequest)]
|
||||
[ProducesResponseType(typeof(MetaOnlyResponse), StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(typeof(MetaOnlyResponse), StatusCodes.Status403Forbidden)]
|
||||
[ProducesResponseType(typeof(MetaOnlyResponse), StatusCodes.Status404NotFound)]
|
||||
[ProducesResponseType(typeof(MetaOnlyResponse), StatusCodes.Status409Conflict)]
|
||||
[ProducesResponseType(typeof(MetaOnlyResponse), StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<MetaOnlyResponse>> CloseAsync(
|
||||
/// <param name="wisagId"></param>
|
||||
/// <param name="processId"></param>
|
||||
/// <param name="body"></param>
|
||||
/// <param name="source"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost("{wisagId:int}/{source}/{processId:long}/closing")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||
[ProducesResponseType(StatusCodes.Status409Conflict)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<IActionResult> CloseAsync(
|
||||
[FromRoute] int wisagId,
|
||||
[FromRoute] string source,
|
||||
[FromRoute] int processId,
|
||||
[FromBody] CloseWorkflowRequest request,
|
||||
CancellationToken cancellationToken)
|
||||
[FromRoute] long processId,
|
||||
[FromBody] CloseWorkflowReqBody body,
|
||||
[FromRoute] string source = "Ferdinand",
|
||||
CancellationToken cancellationToken = default)
|
||||
{
|
||||
var command = new CloseWorkflowCommand(
|
||||
wisagId,
|
||||
source,
|
||||
processId,
|
||||
request.ClosingMethodId,
|
||||
request.Comment,
|
||||
request.RejectionReasonId);
|
||||
var result = await sender.Send(
|
||||
new CloseWorkflowCommand(
|
||||
WisagId: wisagId,
|
||||
Source: source,
|
||||
ProcessId: processId,
|
||||
ClosingMethodId: body.ClosingMethodId,
|
||||
Comment: body.Comment,
|
||||
RejectionReasonId: body.RejectionReasonId),
|
||||
cancellationToken);
|
||||
|
||||
var response = await sender.Send(command, cancellationToken);
|
||||
return Ok(new MetaOnlyResponse
|
||||
var metaResult = new CloseWorkflowReqResponse() { Meta = [result] };
|
||||
return result.Code switch
|
||||
{
|
||||
Meta = response.Meta
|
||||
});
|
||||
0 => Ok(metaResult),
|
||||
4 => BadRequest(metaResult),
|
||||
6 => NotFound(metaResult),
|
||||
7 => Conflict(metaResult),
|
||||
_ => StatusCode(StatusCodes.Status500InternalServerError, metaResult)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
@@ -10,9 +10,9 @@
|
||||
<Authors>Digital Data GmbH</Authors>
|
||||
<Company>Digital Data GmbH</Company>
|
||||
<Product>DigitalData.TaskFlow.API</Product>
|
||||
<Version>1.0.0-beta</Version>
|
||||
<FileVersion>1.0.0.0</FileVersion>
|
||||
<AssemblyVersion>1.0.0.0</AssemblyVersion>
|
||||
<Version>1.4.0-beta</Version>
|
||||
<FileVersion>1.4.0.0</FileVersion>
|
||||
<AssemblyVersion>1.4.0.0</AssemblyVersion>
|
||||
<Copyright>Copyright © 2026 Digital Data GmbH. All rights reserved.</Copyright>
|
||||
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
@@ -31,16 +31,12 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Controllers\" />
|
||||
<None Include="Properties\PublishProfiles\IISProfileNet8.pubxml.user" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="Properties\PublishProfiles\IISProfileNet8.pubxml.user" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\core\DigitalData.TaskFlow.Application\DigitalData.TaskFlow.Application.csproj" />
|
||||
<ProjectReference Include="..\..\infrastructure\DigitalData.TaskFlow.Infrastructure\DigitalData.TaskFlow.Infrastructure.csproj" />
|
||||
<ProjectReference Include="..\..\core\DigitalData.TaskFlow.Application\DigitalData.TaskFlow.Application.csproj" />
|
||||
<ProjectReference Include="..\..\infrastructure\DigitalData.TaskFlow.Infrastructure\DigitalData.TaskFlow.Infrastructure.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,51 +1,55 @@
|
||||
using DigitalData.TaskFlow.API.Contracts.Common;
|
||||
using DigitalData.TaskFlow.Domain.Common;
|
||||
using DigitalData.TaskFlow.Domain.Enums;
|
||||
using DigitalData.TaskFlow.API.Options;
|
||||
using Microsoft.Extensions.Options;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace DigitalData.TaskFlow.API.Middleware;
|
||||
|
||||
/// <summary>
|
||||
/// Validates required API key header for API endpoints.
|
||||
/// Enforces API key authentication for all requests under the /api path prefix.
|
||||
/// Expects the key to be supplied via the <c>X-Api-Key</c> request header.
|
||||
/// </summary>
|
||||
public sealed class ApiKeyAuthMiddleware(RequestDelegate next)
|
||||
public sealed class ApiKeyAuthMiddleware(RequestDelegate next, IOptions<ApiKeyAuthOptions> options)
|
||||
{
|
||||
private static readonly JsonSerializerOptions JsonOptions = new(JsonSerializerDefaults.Web);
|
||||
|
||||
/// <summary>
|
||||
/// Executes middleware logic.
|
||||
/// </summary>
|
||||
/// <param name="context">HTTP context.</param>
|
||||
// Snapshot at startup; options are not expected to change at runtime.
|
||||
private readonly string? _configuredKey = options.Value.Key;
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task InvokeAsync(HttpContext context)
|
||||
{
|
||||
// Only guard /api/** routes; let non-API paths pass through (e.g. health, swagger).
|
||||
if (!context.Request.Path.StartsWithSegments("/api", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
await next(context);
|
||||
return;
|
||||
}
|
||||
|
||||
if (context.Request.Headers.TryGetValue("X-Api-Key", out var values)
|
||||
&& !string.IsNullOrWhiteSpace(values.FirstOrDefault()))
|
||||
// Treat a missing or empty configured key as a misconfiguration — deny all traffic.
|
||||
if (!string.IsNullOrWhiteSpace(_configuredKey)
|
||||
&& context.Request.Headers.TryGetValue("X-Api-Key", out var provided)
|
||||
&& string.Equals(provided, _configuredKey, StringComparison.Ordinal))
|
||||
{
|
||||
await next(context);
|
||||
return;
|
||||
}
|
||||
|
||||
context.Response.StatusCode = StatusCodes.Status401Unauthorized;
|
||||
context.Response.ContentType = "application/json";
|
||||
await WriteUnauthorizedAsync(context);
|
||||
}
|
||||
|
||||
var response = new MetaOnlyResponse
|
||||
private static Task WriteUnauthorizedAsync(HttpContext context)
|
||||
{
|
||||
context.Response.StatusCode = StatusCodes.Status401Unauthorized;
|
||||
context.Response.ContentType = "application/problem+json";
|
||||
|
||||
var body = new
|
||||
{
|
||||
Meta =
|
||||
[
|
||||
new MetaEntry
|
||||
{
|
||||
Code = (int)MetaCode.InvalidRequest,
|
||||
Message = "Authentifizierung fehlgeschlagen"
|
||||
}
|
||||
]
|
||||
type = "https://tools.ietf.org/html/rfc7807",
|
||||
title = "Unauthorized",
|
||||
status = StatusCodes.Status401Unauthorized,
|
||||
detail = "A valid API key must be supplied via the X-Api-Key header."
|
||||
};
|
||||
|
||||
await context.Response.WriteAsync(JsonSerializer.Serialize(response, JsonOptions));
|
||||
return context.Response.WriteAsync(JsonSerializer.Serialize(body, JsonOptions));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,110 +1,98 @@
|
||||
using DigitalData.TaskFlow.Application.Common.Exceptions;
|
||||
using DigitalData.TaskFlow.API.Contracts.Common;
|
||||
using DigitalData.TaskFlow.Domain.Common;
|
||||
using DigitalData.TaskFlow.Domain.Enums;
|
||||
using FluentValidation;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace DigitalData.TaskFlow.API.Middleware;
|
||||
|
||||
/// <summary>
|
||||
/// Handles exceptions globally and returns ticket-compatible API envelopes.
|
||||
/// Handles exceptions globally and returns RFC 7807 (Problem Details) compatible API envelopes.
|
||||
/// </summary>
|
||||
public sealed class ExceptionHandlingMiddleware(RequestDelegate next, ILogger<ExceptionHandlingMiddleware> logger)
|
||||
{
|
||||
private static readonly JsonSerializerOptions JsonOptions = new(JsonSerializerDefaults.Web);
|
||||
|
||||
/// <summary>
|
||||
/// Executes the middleware.
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="context">HTTP context.</param>
|
||||
/// <param name="context"></param>
|
||||
/// <returns></returns>
|
||||
public async Task InvokeAsync(HttpContext context)
|
||||
{
|
||||
try
|
||||
{
|
||||
await next(context);
|
||||
}
|
||||
catch (ApiException apiException)
|
||||
catch (ValidationException ex)
|
||||
{
|
||||
logger.LogWarning(apiException, "API exception intercepted.");
|
||||
logger.LogWarning(ex, "Validation failed for {Method} {Path}",
|
||||
context.Request.Method, context.Request.Path);
|
||||
|
||||
context.Response.StatusCode = apiException.StatusCode;
|
||||
context.Response.ContentType = "application/json";
|
||||
var errors = ex.Errors
|
||||
.GroupBy(e => e.PropertyName)
|
||||
.ToDictionary(
|
||||
g => g.Key,
|
||||
g => g.Select(e => e.ErrorMessage).ToArray()
|
||||
);
|
||||
|
||||
var response = new MetaOnlyResponse
|
||||
var response = new
|
||||
{
|
||||
Meta =
|
||||
[
|
||||
new MetaEntry
|
||||
{
|
||||
Code = (int)apiException.MetaCode,
|
||||
Message = apiException.Message
|
||||
}
|
||||
]
|
||||
type = "https://tools.ietf.org/html/rfc7807",
|
||||
title = "Validation Error",
|
||||
status = StatusCodes.Status400BadRequest,
|
||||
errors
|
||||
};
|
||||
|
||||
context.Response.StatusCode = StatusCodes.Status400BadRequest;
|
||||
context.Response.ContentType = "application/problem+json";
|
||||
await context.Response.WriteAsync(JsonSerializer.Serialize(response, JsonOptions));
|
||||
}
|
||||
catch (ValidationException validationException)
|
||||
catch (InvalidWorkflowPayloadException ex)
|
||||
{
|
||||
logger.LogWarning(validationException, "Validation failed.");
|
||||
logger.LogError(ex, "Invalid upstream payload for {Method} {Path}",
|
||||
context.Request.Method, context.Request.Path);
|
||||
|
||||
context.Response.StatusCode = StatusCodes.Status400BadRequest;
|
||||
context.Response.ContentType = "application/json";
|
||||
|
||||
var message = validationException.Errors.FirstOrDefault()?.ErrorMessage
|
||||
?? "Ungultiger Request";
|
||||
|
||||
var response = new MetaOnlyResponse
|
||||
var response = new
|
||||
{
|
||||
Meta =
|
||||
[
|
||||
new MetaEntry
|
||||
{
|
||||
Code = (int)MetaCode.InvalidRequest,
|
||||
Message = message
|
||||
}
|
||||
]
|
||||
type = "https://tools.ietf.org/html/rfc7807",
|
||||
title = "Bad Gateway",
|
||||
status = StatusCodes.Status502BadGateway,
|
||||
detail = ex.Message
|
||||
};
|
||||
|
||||
context.Response.StatusCode = StatusCodes.Status502BadGateway;
|
||||
context.Response.ContentType = "application/problem+json";
|
||||
await context.Response.WriteAsync(JsonSerializer.Serialize(response, JsonOptions));
|
||||
}
|
||||
catch (NotSupportedException notSupportedException)
|
||||
catch (NotImplementedException ex)
|
||||
{
|
||||
logger.LogWarning(notSupportedException, "Operation not supported yet.");
|
||||
logger.LogWarning(ex, "Not implemented: {Method} {Path}",
|
||||
context.Request.Method, context.Request.Path);
|
||||
|
||||
context.Response.StatusCode = StatusCodes.Status500InternalServerError;
|
||||
context.Response.ContentType = "application/json";
|
||||
|
||||
var response = new MetaOnlyResponse
|
||||
var response = new
|
||||
{
|
||||
Meta =
|
||||
[
|
||||
new MetaEntry
|
||||
{
|
||||
Code = (int)MetaCode.InternalError,
|
||||
Message = notSupportedException.Message
|
||||
}
|
||||
]
|
||||
type = "https://tools.ietf.org/html/rfc7807",
|
||||
title = "Not Implemented",
|
||||
status = StatusCodes.Status501NotImplemented
|
||||
};
|
||||
|
||||
context.Response.StatusCode = StatusCodes.Status501NotImplemented;
|
||||
context.Response.ContentType = "application/problem+json";
|
||||
await context.Response.WriteAsync(JsonSerializer.Serialize(response, JsonOptions));
|
||||
}
|
||||
catch (Exception exception)
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.LogError(exception, "Unhandled exception.");
|
||||
logger.LogError(ex, "Unhandled exception for {Method} {Path}",
|
||||
context.Request.Method, context.Request.Path);
|
||||
|
||||
context.Response.StatusCode = StatusCodes.Status500InternalServerError;
|
||||
context.Response.ContentType = "application/json";
|
||||
|
||||
var response = new MetaOnlyResponse
|
||||
var response = new
|
||||
{
|
||||
Meta =
|
||||
[
|
||||
new MetaEntry
|
||||
{
|
||||
Code = (int)MetaCode.InternalError,
|
||||
Message = "Interner Fehler"
|
||||
}
|
||||
]
|
||||
type = "https://tools.ietf.org/html/rfc7807",
|
||||
title = "Internal Server Error",
|
||||
status = StatusCodes.Status500InternalServerError
|
||||
};
|
||||
|
||||
context.Response.StatusCode = StatusCodes.Status500InternalServerError;
|
||||
context.Response.ContentType = "application/problem+json";
|
||||
await context.Response.WriteAsync(JsonSerializer.Serialize(response, JsonOptions));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace DigitalData.TaskFlow.API.Models;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class CloseWorkflowReqBody
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[JsonPropertyName("closing_method_id")]
|
||||
public int ClosingMethodId { get; init; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string? Comment { get; init; }
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
[JsonPropertyName("rejection_reason_id")]
|
||||
public byte? RejectionReasonId { get; init; }
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
using DigitalData.TaskFlow.Application.Features.Workflows.Commands;
|
||||
|
||||
namespace DigitalData.TaskFlow.API.Models;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class CloseWorkflowReqResponse
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public List<CloseWorkflowResult> Meta { get; init; } = [];
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace DigitalData.TaskFlow.API.Options;
|
||||
|
||||
public sealed class ApiKeyAuthOptions
|
||||
{
|
||||
public const string SectionName = "ApiKey";
|
||||
|
||||
public string? Key { get; init; }
|
||||
}
|
||||
@@ -70,6 +70,8 @@ try
|
||||
|
||||
builder.Services.AddControllers();
|
||||
builder.Services.AddEndpointsApiExplorer();
|
||||
var apiKeyConfigured = !string.IsNullOrWhiteSpace(config[$"{ApiKeyAuthOptions.SectionName}:Key"]);
|
||||
|
||||
builder.Services.AddSwaggerGen(options =>
|
||||
{
|
||||
options.SwaggerDoc("v1", new OpenApiInfo
|
||||
@@ -77,11 +79,11 @@ try
|
||||
Title = "DigitalData TaskFlow API",
|
||||
Version = "v1",
|
||||
Description = """
|
||||
Integration API for taskFLOW workflow and document operations.
|
||||
Integrations-API für taskFLOW Workflow- und Dokumentenoperationen.
|
||||
|
||||
---
|
||||
|
||||
- [Serilog Log Viewer](/serilog-ui)
|
||||
- [Serilog Protokoll-Viewer](/serilog-ui)
|
||||
""",
|
||||
Contact = new OpenApiContact
|
||||
{
|
||||
@@ -90,12 +92,42 @@ try
|
||||
Email = "info-flow@digitaldata.works"
|
||||
}
|
||||
});
|
||||
|
||||
if (apiKeyConfigured)
|
||||
{
|
||||
options.AddSecurityDefinition("ApiKey", new OpenApiSecurityScheme
|
||||
{
|
||||
Type = SecuritySchemeType.ApiKey,
|
||||
In = ParameterLocation.Header,
|
||||
Name = "X-Api-Key",
|
||||
Description = "Optionaler API-Schlüssel. Leer lassen, falls nicht erforderlich."
|
||||
});
|
||||
|
||||
options.AddSecurityRequirement(new OpenApiSecurityRequirement
|
||||
{
|
||||
{
|
||||
new OpenApiSecurityScheme
|
||||
{
|
||||
Reference = new OpenApiReference
|
||||
{
|
||||
Type = ReferenceType.SecurityScheme,
|
||||
Id = "ApiKey"
|
||||
}
|
||||
},
|
||||
[]
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
builder.Services
|
||||
.AddOptions<SwaggerOptions>()
|
||||
.Bind(config.GetSection(SwaggerOptions.SectionName));
|
||||
|
||||
builder.Services
|
||||
.AddOptions<ApiKeyAuthOptions>()
|
||||
.Bind(config.GetSection(ApiKeyAuthOptions.SectionName));
|
||||
|
||||
builder.Services.AddSerilogUi(options =>
|
||||
{
|
||||
options.UseSqliteServer(databaseOptions =>
|
||||
@@ -110,11 +142,18 @@ try
|
||||
var swaggerOptions = app.Services
|
||||
.GetRequiredService<Microsoft.Extensions.Options.IOptions<SwaggerOptions>>()
|
||||
.Value;
|
||||
var apiKeyOptions = app.Services
|
||||
.GetRequiredService<Microsoft.Extensions.Options.IOptions<ApiKeyAuthOptions>>()
|
||||
.Value;
|
||||
|
||||
var enableSwagger = app.Environment.IsDevelopment() || swaggerOptions.EnabledInProduction;
|
||||
var enforceApiKey = !string.IsNullOrWhiteSpace(apiKeyOptions.Key);
|
||||
|
||||
app.UseMiddleware<ExceptionHandlingMiddleware>();
|
||||
app.UseMiddleware<ApiKeyAuthMiddleware>();
|
||||
if (enforceApiKey)
|
||||
{
|
||||
app.UseMiddleware<ApiKeyAuthMiddleware>();
|
||||
}
|
||||
app.UseSerilogRequestLogging();
|
||||
|
||||
if (enableSwagger)
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- https://go.microsoft.com/fwlink/?LinkID=208121. -->
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<History>True|2026-08-18T22:53:21.1836568Z||;True|2026-08-17T17:15:45.8141849+02:00||;True|2026-07-29T14:38:42.8852954+02:00||;True|2026-07-29T12:03:16.6266877+02:00||;</History>
|
||||
<LastFailureDetails />
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -4,8 +4,8 @@
|
||||
"windowsAuthentication": false,
|
||||
"anonymousAuthentication": true,
|
||||
"iisExpress": {
|
||||
"applicationUrl": "http://localhost:3557",
|
||||
"sslPort": 44339
|
||||
"applicationUrl": "http://localhost:63206",
|
||||
"sslPort": 44315
|
||||
}
|
||||
},
|
||||
"profiles": {
|
||||
@@ -14,7 +14,7 @@
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"applicationUrl": "http://localhost:5298",
|
||||
"applicationUrl": "http://localhost:5062",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
@@ -24,7 +24,7 @@
|
||||
"dotnetRunMessages": true,
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "swagger",
|
||||
"applicationUrl": "https://localhost:7049;http://localhost:5298",
|
||||
"applicationUrl": "https://localhost:7131;http://localhost:5062",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
}
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
# 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.
|
||||
@@ -10,6 +10,9 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"ApiKey": {
|
||||
"Key": "jGXP7m536fnyTVCh4NROu1wgjaSOrJ5"
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
|
||||
@@ -13,16 +13,13 @@
|
||||
"ConnectionStrings": {
|
||||
"TaskFlowDb": "Server=SDD-VHP04-SQL19\\DD_TESTING01;Database=DD_ECM;User Id=sa;Password=123456789dD!;Encrypt=false;TrustServerCertificate=True;"
|
||||
},
|
||||
"MediatR": {
|
||||
"LuckyPennySoftLicenseKey": "eyJhbGciOiJSUzI1NiIsImtpZCI6Ikx1Y2t5UGVubnlTb2Z0d2FyZUxpY2Vuc2VLZXkvYmJiMTNhY2I1OTkwNGQ4OWI0Y2IxYzg1ZjA4OGNjZjkiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL2x1Y2t5cGVubnlzb2Z0d2FyZS5jb20iLCJhdWQiOiJMdWNreVBlbm55U29mdHdhcmUiLCJleHAiOiIxODE2MTI4MDAwIiwiaWF0IjoiMTc4NDYyNDU1NyIsImFjY291bnRfaWQiOiIwMTk4M2M1OWU0YjM3MjhlYmZkMzEwM2MyYTQ4NmU4NSIsImN1c3RvbWVyX2lkIjoiMDE5ODNjNTllNGIzNzI4ZWJmZDMxMDNjMmE0ODZlODUiLCJzdWJfaWQiOiItIiwiZWRpdGlvbiI6IjAiLCJ0eXBlIjoiMiJ9.IUUO926m9crYGYxMjjKD_n9BnUm-EDyjFIn0YmMUCo7C-QTwvB8WhXP8veTSFsBq-leIIDJ4jyl7Pgc_7ciwg1XhUSIs4mkQroEUaSFCGOxw7Pi41WM8MK5YFSaqLTYYXec9zxgiJbGzABbh3CHTSup3okGnVm_CMoPEs91l2c0A6N1JyZy74urd_tF0KGVKf0MOvzdlQIWLQ8o73S4pTv2N-F6UlzI0fdMtTHMLNNQyr0NdWdnuBk_jMBXO-gy5RE_oCRfMTTYRX2n3XLK6pTfXE0Ct338o9F5sH8Ph2lTXSu56cpdsfZOQZGqCH0LoFp1Dd7RJgIgNmBiTGfvDnA"
|
||||
"ApiKey": {
|
||||
"Key": "jGXP7m536fnyTVCh4NROu1wgjaSOrJ5"
|
||||
},
|
||||
"LuckyPennySoftLicenseKey": "eyJhbGciOiJSUzI1NiIsImtpZCI6Ikx1Y2t5UGVubnlTb2Z0d2FyZUxpY2Vuc2VLZXkvYmJiMTNhY2I1OTkwNGQ4OWI0Y2IxYzg1ZjA4OGNjZjkiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL2x1Y2t5cGVubnlzb2Z0d2FyZS5jb20iLCJhdWQiOiJMdWNreVBlbm55U29mdHdhcmUiLCJleHAiOiIxODE2MTI4MDAwIiwiaWF0IjoiMTc4NDYyNDU1NyIsImFjY291bnRfaWQiOiIwMTk4M2M1OWU0YjM3MjhlYmZkMzEwM2MyYTQ4NmU4NSIsImN1c3RvbWVyX2lkIjoiMDE5ODNjNTllNGIzNzI4ZWJmZDMxMDNjMmE0ODZlODUiLCJzdWJfaWQiOiItIiwiZWRpdGlvbiI6IjAiLCJ0eXBlIjoiMiJ9.IUUO926m9crYGYxMjjKD_n9BnUm-EDyjFIn0YmMUCo7C-QTwvB8WhXP8veTSFsBq-leIIDJ4jyl7Pgc_7ciwg1XhUSIs4mkQroEUaSFCGOxw7Pi41WM8MK5YFSaqLTYYXec9zxgiJbGzABbh3CHTSup3okGnVm_CMoPEs91l2c0A6N1JyZy74urd_tF0KGVKf0MOvzdlQIWLQ8o73S4pTv2N-F6UlzI0fdMtTHMLNNQyr0NdWdnuBk_jMBXO-gy5RE_oCRfMTTYRX2n3XLK6pTfXE0Ct338o9F5sH8Ph2lTXSu56cpdsfZOQZGqCH0LoFp1Dd7RJgIgNmBiTGfvDnA",
|
||||
"Swagger": {
|
||||
"EnabledInProduction": false
|
||||
},
|
||||
"Database": {
|
||||
"CommandTimeoutSeconds": 30,
|
||||
"WorkflowListingObjectType": "Ferdinand"
|
||||
},
|
||||
"Application": {
|
||||
"LogDirectory": "logs"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user