namespace ZB.MOM.WW.ScadaBridge.Commons.Messages.ScriptExecution;

/// <param name="ParentExecutionId">
/// The spawning execution's <c>ExecutionId</c>.
/// For an inbound-API-routed call this is the inbound request's per-request
/// execution id (carried in from <c>RouteToCallRequest.ParentExecutionId</c>);
/// the routed script execution records it as its <c>ParentExecutionId</c> so a
/// spawned execution points back at its spawner. Additive trailing member —
/// null for normal (tag-change / timer-triggered) runs, nested <c>Script.Call</c>
/// invocations, and any request built before the field existed.
/// </param>
public record ScriptCallRequest(
    string ScriptName,
    IReadOnlyDictionary<string, object?>? Parameters,
    int CurrentCallDepth,
    string CorrelationId,
    Guid? ParentExecutionId = null);
