diff --git a/e-suite.Workflow.Core/Interfaces/IBudget.cs b/e-suite.Workflow.Core/Interfaces/IBudget.cs new file mode 100644 index 0000000..effd483 --- /dev/null +++ b/e-suite.Workflow.Core/Interfaces/IBudget.cs @@ -0,0 +1,36 @@ +using e_suite.Workflow.Core.Enums; + +namespace e_suite.Workflow.Core.Interfaces; + +public interface IBudget +{ + /// + /// units of work involved in this item (UoW is a business term in this context) + /// + public decimal UnitsOfWork { get; set; } + + /// + /// Cost of this work item + /// + public Cost Cost { get; set; } + + /// + /// The option to show in budget. + /// + public BudgetOption BudgetOption { get; set; } + + /// + /// Time tracking of this item + /// + public bool AllowTimeTracking { get; set; } + + /// + /// Priority of this item + /// + public Priority Priority { get; set; } + + /// + /// alloted duration of this item. + /// + public TimeSpan Duration { get; set; } +} \ No newline at end of file diff --git a/e-suite.Workflow.Core/Interfaces/ITags.cs b/e-suite.Workflow.Core/Interfaces/ITags.cs new file mode 100644 index 0000000..5e0bba5 --- /dev/null +++ b/e-suite.Workflow.Core/Interfaces/ITags.cs @@ -0,0 +1,6 @@ +namespace e_suite.Workflow.Core.Interfaces; + +public interface ITags +{ + public IList Tags { get; set; } +} \ No newline at end of file diff --git a/e-suite.Workflow.Core/Interfaces/ITask.cs b/e-suite.Workflow.Core/Interfaces/ITask.cs index 61d5459..e65406a 100644 --- a/e-suite.Workflow.Core/Interfaces/ITask.cs +++ b/e-suite.Workflow.Core/Interfaces/ITask.cs @@ -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 /// /// List of tasks that need to be completed before this on can start. (If empty, will start when the workflow starts) /// - IList Predecessors { get; } - - /// - /// units of work involved in this item (UoW is a business term in this context) - /// - public decimal UnitsOfWork { get; set; } - - /// - /// Cost of this work item - /// - public Cost Cost { get; set; } - - /// - /// The option to show in budget. - /// - public BudgetOption BudgetOption { get; set; } - - /// - /// Time tracking of this item - /// - public bool AllowTimeTracking { get; set; } - - /// - /// Priority of this item - /// - public Priority Priority { get; set; } + ITask? Predecessor { get; set; } - /// - /// alloted duration of this item. - /// - public TimeSpan Duration { get; set; } - - public IList Tags { get; set; } - //Todo can only be on a run-time instance ///// ///// Called when the task status has been progressed from Pending to Active. diff --git a/e-suite.Workflow.Core/TaskBase.cs b/e-suite.Workflow.Core/TaskBase.cs index c7915b4..0e75863 100644 --- a/e-suite.Workflow.Core/TaskBase.cs +++ b/e-suite.Workflow.Core/TaskBase.cs @@ -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 Predecessors { get; set; } = new List(); + public ITask? Predecessor { get; set; } public decimal UnitsOfWork { get; set; } = 1; public required Cost Cost { get; set; } public BudgetOption BudgetOption { get; set; } = BudgetOption.DoNotShow;