Split the non-essential parts out of the ITask, into ITags and IBudget

This commit is contained in:
Colin Dawson 2026-02-13 01:04:22 +00:00
parent 52ba6ee606
commit cbee1422b4
4 changed files with 46 additions and 38 deletions

View File

@ -0,0 +1,36 @@
using e_suite.Workflow.Core.Enums;
namespace e_suite.Workflow.Core.Interfaces;
public interface IBudget
{
/// <summary>
/// units of work involved in this item (UoW is a business term in this context)
/// </summary>
public decimal UnitsOfWork { get; set; }
/// <summary>
/// Cost of this work item
/// </summary>
public Cost Cost { get; set; }
/// <summary>
/// The option to show in budget.
/// </summary>
public BudgetOption BudgetOption { get; set; }
/// <summary>
/// Time tracking of this item
/// </summary>
public bool AllowTimeTracking { get; set; }
/// <summary>
/// Priority of this item
/// </summary>
public Priority Priority { get; set; }
/// <summary>
/// alloted duration of this item.
/// </summary>
public TimeSpan Duration { get; set; }
}

View File

@ -0,0 +1,6 @@
namespace e_suite.Workflow.Core.Interfaces;
public interface ITags
{
public IList<string> Tags { get; set; }
}

View File

@ -1,6 +1,4 @@
using e_suite.Workflow.Core.Enums;
namespace e_suite.Workflow.Core.Interfaces;
namespace e_suite.Workflow.Core.Interfaces;
public interface ITask
{
@ -27,40 +25,8 @@ public interface ITask
/// <summary>
/// List of tasks that need to be completed before this on can start. (If empty, will start when the workflow starts)
/// </summary>
IList<ITask> Predecessors { get; }
/// <summary>
/// units of work involved in this item (UoW is a business term in this context)
/// </summary>
public decimal UnitsOfWork { get; set; }
/// <summary>
/// Cost of this work item
/// </summary>
public Cost Cost { get; set; }
/// <summary>
/// The option to show in budget.
/// </summary>
public BudgetOption BudgetOption { get; set; }
/// <summary>
/// Time tracking of this item
/// </summary>
public bool AllowTimeTracking { get; set; }
/// <summary>
/// Priority of this item
/// </summary>
public Priority Priority { get; set; }
ITask? Predecessor { get; set; }
/// <summary>
/// alloted duration of this item.
/// </summary>
public TimeSpan Duration { get; set; }
public IList<string> Tags { get; set; }
//Todo can only be on a run-time instance
///// <summary>
///// Called when the task status has been progressed from Pending to Active.

View File

@ -3,13 +3,13 @@ using e_suite.Workflow.Core.Interfaces;
namespace e_suite.Workflow.Core;
public abstract class TaskBase : ITask
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 IList<ITask> Predecessors { get; set; } = new List<ITask>();
public ITask? Predecessor { get; set; }
public decimal UnitsOfWork { get; set; } = 1;
public required Cost Cost { get; set; }
public BudgetOption BudgetOption { get; set; } = BudgetOption.DoNotShow;