Backend/e-suite.Workflow.Core/TaskBase.cs
Colin Dawson 800f10f9fb Moved the duration to ITask, so it's common to everything.
More work on the ApprovalTask, IOutcome<T> should now be working.
2026-02-23 23:13:55 +00:00

32 lines
1.1 KiB
C#

using e_suite.Workflow.Core.Enums;
using e_suite.Workflow.Core.Interfaces;
namespace e_suite.Workflow.Core;
public abstract class TaskBase : ITask, IBudget, ITags
{
public Guid Guid { get; set; } = Guid.CreateVersion7();
public required ITask Parent { get; set; }
public required string Name { get; set; }
public string Description { get; set; } = string.Empty;
public required TimeSpan Duration { get; set; }
public List<ITask> Predecessors { get; set; } = [];
public decimal UnitsOfWork { get; set; } = 1;
public required Cost Cost { get; set; }
public BudgetOption BudgetOption { get; set; } = BudgetOption.DoNotShow;
public bool AllowTimeTracking { get; set; } = true;
public Priority Priority { get; set; } = Priority.Normal;
public IList<string> Tags { get; set; } = new List<string>();
//Todo can only be on a run-time instance
//public virtual Task OnActivateAsync()
//{
// return Task.CompletedTask;
//}
//public virtual Task<bool> OnCompleteAsync()
//{
// return Task.FromResult(true);
//}
}