using System.Threading; using System.Threading.Tasks; using GB5Shared.DTO.Framework.Login; using GB5Shared.DTO.GOP; using Microsoft.Extensions.Logging; namespace FrameworkBLL.GOP.Worker.NodeExecutors { // ============================================================ // ApprovalNodeExecutor — executes an Approval node type. // // GopExecutionPipeline intercepts "Approval" steps BEFORE dispatching to any // INodeExecutor — it pauses the execution (Status='PendingApproval') and returns, // rather than calling ExecuteAsync here. This executor exists only so the // keyed-DI pattern stays complete/extensible (e.g. a future design-time // "test execute" path that runs the graph without pause semantics) — it is a // pass-through that never blocks. // ============================================================ public class ApprovalNodeExecutor : INodeExecutor { private readonly ILogger _Logger; public ApprovalNodeExecutor(ILogger logger) => _Logger = logger; public string NodeType => "Approval"; public Task ExecuteAsync( GopFlowSnapshotStepDTO step, GopExecutionHeaderDTO header, string? inputPayloadJson, LoginDTO loginDTO, CancellationToken ct) { _Logger.LogDebug( "ApprovalNodeExecutor: execution {ExecutionId} step {NodeCode} — pass-through (pipeline handles gating)", header.ExecutionId, step.NodeCode); return Task.FromResult(inputPayloadJson); } } }