namespace AutomationDAL.DTO.Run; public class RunExecutionDTO { public long RunId { get; set; } public int ScriptId { get; set; } public int VersionId { get; set; } public int? TargetId { get; set; } public int? AgentId { get; set; } public string Status { get; set; } = "Queued"; // Queued|Running|Success|Failed|Cancelled public string TriggeredBy { get; set; } = string.Empty; public string? ParametersJson { get; set; } public DateTime? StartedOn { get; set; } public DateTime? CompletedOn { get; set; } public string? Summary { get; set; } public string? ErrorMessage { get; set; } public int RetryCount { get; set; } public Guid CorrelationId { get; set; } public int TenantId { get; set; } public int CreatedById { get; set; } public DateTime CreatedOn { get; set; } } // The payload an agent receives from GetNextJob — enough to actually run the container without a // second round-trip: image/runtime info from the released version, target endpoint/credential // reference, and the script's declared secret references (Vault resolution happens agent-side). public class NextJobDTO { public long RunId { get; set; } public Guid CorrelationId { get; set; } public int ScriptId { get; set; } public int VersionId { get; set; } public int TenantId { get; set; } public string TriggeredBy { get; set; } = string.Empty; public string RuntimeType { get; set; } = string.Empty; public string? ImageTag { get; set; } public int? TargetId { get; set; } public string? TargetUrl { get; set; } public string? CredentialVaultRef { get; set; } public string? ParametersJson { get; set; } public List SecretRefs { get; set; } = new(); } public class RunSecretRefDTO { public string SecretName { get; set; } = string.Empty; public string VaultReference { get; set; } = string.Empty; } public class RunListDTO { public long RunId { get; set; } public int ScriptId { get; set; } public string ScriptName { get; set; } = string.Empty; public int VersionId { get; set; } public string Status { get; set; } = string.Empty; public string TriggeredBy { get; set; } = string.Empty; public DateTime? StartedOn { get; set; } public DateTime? CompletedOn { get; set; } }