using System;
using System.Collections.Generic;
namespace FrameworkDAL.DTO.Playground
{
// ── Request DTOs (used by SL parameters) ─────────────────────────────────
public class TriggerEventDTO
{
/// FK to MEVENTTYPE. Required for Live mode.
public int EventTypeId { get; set; }
/// JSON payload forwarded as action context.
public string Payload { get; set; } = "{}";
///
/// true = use inline mock records (no real DB data fetched).
/// false = use real actions configured in MEVENTTYPEACTION for the EventTypeId.
///
public bool MockMode { get; set; } = true;
/// Cap how many action rows to generate (safety for large event types).
public int RecordLimit { get; set; } = 50;
/// Optional scenario label stored on the run for display purposes.
public string? ScenarioName { get; set; }
/// Simulated action type for MockMode (0=Email,1=SMS,2=Webhook,3=Push).
public int MockActionType { get; set; } = 0;
}
public class RetryActionDTO
{
public int ActionRunId { get; set; }
}
// ── Response DTOs ─────────────────────────────────────────────────────────
public class TriggerEventResultDTO
{
public string RunId { get; set; } = string.Empty;
public DateTime TriggeredAt { get; set; }
public int ActionsQueued { get; set; }
public string ScenarioName { get; set; } = string.Empty;
}
public class PipelineStatusDTO
{
public string RunId { get; set; } = string.Empty;
public bool IsComplete { get; set; }
public TaskQueueStatsDTO TaskQueue { get; set; } = new();
public ActionQueueStatsDTO ActionQueue { get; set; } = new();
}
public class TaskQueueStatsDTO
{
/// RUNSTATUS=0 Pending
public int Pending { get; set; }
/// RUNSTATUS=1 InProgress
public int InProgress { get; set; }
/// RUNSTATUS=2 Completed
public int Completed { get; set; }
/// RUNSTATUS=3 Failed
public int Failed { get; set; }
public int Total => Pending + InProgress + Completed + Failed;
}
public class ActionQueueStatsDTO
{
/// SENDSTATUS=0 Pending
public int Pending { get; set; }
/// SENDSTATUS=1 Sent
public int Sent { get; set; }
/// SENDSTATUS=2 Failed
public int Failed { get; set; }
public int Total => Pending + Sent + Failed;
}
public class ActionRunStatusDTO
{
public int ActionRunId { get; set; }
public int ActionId { get; set; }
/// 0=Pending, 1=InProgress, 2=Completed, 3=Failed
public int RunStatus { get; set; }
public string RunStatusLabel => RunStatus switch
{
0 => "Pending",
1 => "InProgress",
2 => "Completed",
3 => "Failed",
_ => "Unknown"
};
public int Attempts { get; set; }
public string? ErrorMessage { get; set; }
public DateTime? StartedOn { get; set; }
public DateTime? CompletedOn { get; set; }
/// 0=Pending, 1=Sent, 2=Failed (from TACTIONOUTBOX)
public int? SendStatus { get; set; }
public string SendStatusLabel => SendStatus switch
{
0 => "Pending",
1 => "Sent",
2 => "Failed",
null => "-",
_ => "Unknown"
};
public string? DestinationTopic { get; set; }
}
// ── DAL projection DTOs ───────────────────────────────────────────────────
public class RunStatusCountDTO
{
public int RunStatus { get; set; }
public int ItemCount { get; set; }
}
public class SendStatusCountDTO
{
public int SendStatus { get; set; }
public int ItemCount { get; set; }
}
public class PlaygroundActionDTO
{
public int ActionId { get; set; }
public int ActionType { get; set; }
public string? SendTo { get; set; }
public string? ReplyTo { get; set; }
public int TemplateId { get; set; }
public string? MailCc { get; set; }
public string? MailBcc { get; set; }
public int WebServiceId { get; set; }
public string? UriParameterValue { get; set; }
public int ReportId { get; set; }
}
}