using Workflow.Domain.Common;
using Workflow.Domain.Enums;

namespace Workflow.Domain.Entities;

public class WorkflowInstance : BaseEntity, IAuditable
{
    public Guid DefinitionId { get; set; }
    public string Title { get; set; } = string.Empty;
    public InstanceStatus Status { get; set; } = InstanceStatus.Running;
    public string? Variables { get; set; }
    public Guid InitiatorId { get; set; }
    public DateTime StartedAt { get; set; } = DateTime.UtcNow;
    public DateTime? CompletedAt { get; set; }
    public Guid? ParentInstanceId { get; set; }
    public Guid? ParentTokenId { get; set; }

    public List<WorkflowToken> Tokens { get; set; } = new();
    public List<WorkflowTask> Tasks { get; set; } = new();

    public Guid CreatedBy { get; set; }
    public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
    public Guid UpdatedBy { get; set; }
    public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
}
