Split the non-essential parts out of the ITask, into ITags and IBudget
This commit is contained in:
parent
52ba6ee606
commit
cbee1422b4
36
e-suite.Workflow.Core/Interfaces/IBudget.cs
Normal file
36
e-suite.Workflow.Core/Interfaces/IBudget.cs
Normal 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; }
|
||||
}
|
||||
6
e-suite.Workflow.Core/Interfaces/ITags.cs
Normal file
6
e-suite.Workflow.Core/Interfaces/ITags.cs
Normal file
@ -0,0 +1,6 @@
|
||||
namespace e_suite.Workflow.Core.Interfaces;
|
||||
|
||||
public interface ITags
|
||||
{
|
||||
public IList<string> Tags { get; set; }
|
||||
}
|
||||
@ -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.
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user