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

using TaskStatus = Workflow.Domain.Enums.TaskStatus;

namespace Workflow.Domain.Entities;

public class WorkflowTask : BaseEntity, IFullAudit
{
    public Guid InstanceId { get; set; }
    public Guid TokenId { get; set; }
    public Guid NodeId { get; set; }
    public string Title { get; set; } = string.Empty;
    public Guid? AssigneeId { get; set; }
    public string? AssigneeRole { get; set; }
    public Guid? DelegatedFromId { get; set; }
    public string? CandidateUsers { get; set; }
    public string? CandidateRoles { get; set; }
    public TaskType Type { get; set; } = TaskType.Approval;
    public TaskStatus Status { get; set; } = TaskStatus.Pending;
    public string? Result { get; set; }
    public string? Comment { get; set; }
    public DateTime? DueAt { get; set; }
    public DateTime? CompletedAt { get; set; }

    public Guid CreatedBy { get; set; }
    public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
    public Guid UpdatedBy { get; set; }
    public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
    public bool IsDeleted { get; set; } = false;
    public string? OperatorIP { get; set; }
}
