namespace Hua.Todo.Core.Entities;

/// <summary>
/// 任务实体类，表示一个代办
/// </summary>
public class TaskEntity
{
    /// <summary>
    /// 任务唯一标识符
    /// </summary>
    public int Id { get; set; }
    
    /// <summary>
    /// 任务标题
    /// </summary>
    public string Title { get; set; } = string.Empty;
    
    /// <summary>
    /// 任务优先级
    /// </summary>
    public TaskPriority Priority { get; set; } = TaskPriority.Medium;
    
    /// <summary>
    /// 任务是否已完成
    /// </summary>
    public bool IsCompleted { get; set; }
    
    /// <summary>
    /// 任务创建时间（UTC）
    /// </summary>
    public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
    
    /// <summary>
    /// 任务最后更新时间（UTC）
    /// </summary>
    public DateTime UpdatedAt { get; set; } = DateTime.UtcNow;
    
    /// <summary>
    /// 父任务ID，用于支持子任务功能
    /// </summary>
    public int? ParentTaskId { get; set; }
    
    /// <summary>
    /// 父任务导航属性
    /// </summary>
    public TaskEntity? ParentTask { get; set; }
    
    /// <summary>
    /// 子任务集合
    /// </summary>
    public List<TaskEntity> SubTasks { get; set; } = new();
}
