Move work on workflows

This commit is contained in:
Colin Dawson 2026-02-17 11:26:44 +00:00
parent aa4864a0bf
commit 737d3e4d08
6 changed files with 26 additions and 15 deletions

View File

@ -42,6 +42,11 @@ builder.Services.AddControllersWithViews()
.AddJsonOptions(options =>
{
options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter());
//todo add support for OneOf
//Add the OneOf nuget package, before uncommenting this, to allow properties to be mapped to public Oneof<string,int> test {get;set;}
//options.JsonSerializerOptions.Converters.Add(new OneOf.OneOfJsonConverter());//todo add support for OneOf
//Add the OneOf nuget package, before uncommenting this, to allow properties to be mapped to public Oneof<string,int> test {get;set;}
//options.JsonSerializerOptions.Converters.Add(new OneOf.OneOfJsonConverter());
options.JsonSerializerOptions.DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull;
});
builder.AddSwagger();

View File

@ -0,0 +1,10 @@
using e_suite.Workflow.Core.Attributes;
namespace e_suite.Workflow.Core.Interfaces;
[TaskCapability]
public interface IFormTemplate
{
public bool IsMultiple { get; set; }
IEnumerable<string> ValidateForTemplate();
}

View File

@ -1,5 +1,8 @@
namespace e_suite.Workflow.Core.Interfaces;
using e_suite.Workflow.Core.Attributes;
namespace e_suite.Workflow.Core.Interfaces;
[TaskCapability]
public interface ITask
{
/// <summary>
@ -25,7 +28,7 @@ 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>
ITask? Predecessor { get; set; }
List<ITask> Predecessors { get; set; }
//Todo can only be on a run-time instance
///// <summary>

View File

@ -9,7 +9,7 @@ public abstract class TaskBase : ITask, IBudget, ITags
public required ITask Parent { get; set; }
public required string Name { get; set; }
public string Description { get; set; } = string.Empty;
public ITask? Predecessor { 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;

View File

@ -1,5 +1,6 @@
using System.ComponentModel;
using e_suite.Workflow.Core.Attributes;
using e_suite.Workflow.Core.Interfaces;
namespace e_suite.Workflow.Core.Tasks;
@ -7,7 +8,7 @@ namespace e_suite.Workflow.Core.Tasks;
/// A user has to open this task, manually set it to ready to complete
/// </summary>
[GeneralTask]
public class BasicTask : TaskBase
public class BasicTask : TaskBase, IAssignees<ITaskAssignee>
{
public IList<ITaskAssignee> Assignees { get; }
}

View File

@ -4,19 +4,11 @@ using eSuite.Core.Miscellaneous;
namespace e_suite.Workflow.Core.Tasks;
public interface ITemplateValidatable
{
IEnumerable<string> ValidateForTemplate();
}
[GeneralTask]
public class FormDataInputTask : TaskBase, IAssignees<ITaskAssignee>, ITemplateValidatable
public class FormDataInputTask : TaskBase, IAssignees<ITaskAssignee>, IFormTemplate
{
public IList<ITaskAssignee> Assignees { get; } = new List<ITaskAssignee>();
public bool IsMultiple { get; set; }
public bool ContainsDecision { get; set; }
public required IGeneralIdRef FormIdRef { get; set; }
public IEnumerable<string> ValidateForTemplate()