using FrameworkDAL.DTO.EIPConversation;
using System.Collections.Generic;
namespace FrameworkBLL.EIPConversation.EIPHandlers.UrlResolver
{
///
/// Resolves the final HTTP URL and builds body/query/header parameter sets
/// for EIP capability and action calls.
///
/// Internal GB5 calls: URL = login.BaseUri / ServicePrefix / PathTemplate
/// — always installation-portable because BaseUri comes from LoginDTO (the YARP gateway).
///
/// External API calls: URL is the Url field with {VarName} substitution applied.
/// — base URL for each integration is stored in MEIPACTIONREGISTRY.ConfigJson per action row
/// and pre-seeded into context.Variables before step execution.
///
public interface IEIPUrlResolver
{
///
/// Builds the final URL from EIPApiConfig.
/// Applies {VarName} substitution to PathTemplate/Url using the provided variables.
/// Query-string parameters (In="query") are appended to the returned URL.
///
string ResolveUrl(EIPApiConfig config, Dictionary variables, string baseUri);
///
/// Builds the JSON body string and extra header dictionary from EIPApiConfig.Parameters.
/// Returns empty body string and empty dict when Parameters is null (caller should use BodyTemplate).
///
(string bodyJson, Dictionary extraHeaders)
BuildRequest(EIPApiConfig config, Dictionary variables);
///
/// Convenience: resolves URL from raw payload keys (ServicePrefix/PathTemplate/Url).
/// Used by action handlers that receive context.Payload rather than EIPApiConfig.
///
string ResolveUrlFromPayload(
Dictionary payload,
Dictionary variables,
string baseUri);
}
}