using FrameworkDAL.DTO.EIPConversation; using GB5Shared.DTO.Framework.Login; using Microsoft.Extensions.Logging; using System; using System.Threading; using System.Threading.Tasks; namespace FrameworkBLL.EIPConversation.EIPHandlers.ChannelHandler { // ============================================================ // DirectActionWebChannelHandler — ChannelType.DirectActionWeb. // // No real outbound push: the HTML stepper endpoints (GET/POST // /Action/Conversation*) read the result directly off // IEIPConversationEngine.ProcessIncomingMessageAsync's return // value and render it themselves, the same way a caller reads // PostmanChannelHandler's simulated send. This handler exists // only so EIPResponseEngine's channel-handler lookup succeeds. // ============================================================ public class DirectActionWebChannelHandler : IEIPChannelHandler { public string ChannelName => "DIRECTACTIONWEB"; public bool CanHandle(string channel) => string.Equals(channel, ChannelName, StringComparison.OrdinalIgnoreCase); private readonly ILogger _logger; public DirectActionWebChannelHandler(ILogger logger) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); } public Task SendAsync( EIPResponseContext context, LoginDTO loginDTO, CancellationToken cancellationToken) { _logger.LogDebug( "DirectActionWeb response captured for direct rendering | Recipient={Recipient}", context?.Recipient); return Task.FromResult(new EIPChannelResponseDTO { IsSent = true, Status = "RENDERED_BY_CALLER" }); } } }