using System;
namespace GB5Shared.ActionProcessor
{
///
/// Maps to TEVENTACTIONRUN (T = Transaction table, app-generated INT PK).
/// RUNSTATUS: 0=Pending, 1=InProgress, 2=Completed, 3=Failed
///
public class EventActionRunDTO
{
public int ActionRunId { get; set; }
public int ActionId { get; set; }
/// FK to TJOBEXECUTION. -1 when triggered by event (not scheduler).
public int JobExecutionId { get; set; } = -1;
/// FK to MEVENTTYPE. -1 when triggered by scheduler (not event).
public int EventTypeId { get; set; } = -1;
public int TenantId { get; set; }
/// 0=Pending, 1=InProgress, 2=Completed, 3=Failed
public int RunStatus { get; set; }
public int Attempts { get; set; }
public string? ErrorMessage { get; set; }
public DateTime? StartedOn { get; set; }
public DateTime? CompletedOn { get; set; }
public string? Payload { get; set; }
public string? Result { get; set; }
///
/// Non-null only for Playground-triggered runs.
/// Groups all TEVENTACTIONRUN rows for a single playground execution.
///
public string? PlaygroundRunId { get; set; }
/// Correlation key from TOUTBOX — links this run back to the originating outbox event.
public string CorrelationKey { get; set; } = string.Empty;
}
}