namespace CashLineERP.Domain.Workflow;

public sealed class WorkflowAction
{
    public long Id { get; private set; }

    public long WorkflowInstanceId { get; private set; }

    public string ActionCode { get; private set; } = string.Empty;

    public string PreviousStatusCode { get; private set; } = string.Empty;

    public string NewStatusCode { get; private set; } = string.Empty;

    public long ActorUserId { get; private set; }

    public string? Comment { get; private set; }

    public DateTime OccurredAtUtc { get; private set; } = DateTime.UtcNow;

    public WorkflowAction(
        long workflowInstanceId,
        string actionCode,
        string previousStatusCode,
        string newStatusCode,
        long actorUserId,
        string? comment = null)
    {
        WorkflowInstanceId = workflowInstanceId;
        ActionCode = actionCode;
        PreviousStatusCode = previousStatusCode;
        NewStatusCode = newStatusCode;
        ActorUserId = actorUserId;
        Comment = comment;
    }

    private WorkflowAction()
    {
    }
}
