Renamed the TaskEditor attribute to TaskCapability as this is a more descriptive name for it.

This commit is contained in:
Colin Dawson 2026-02-13 01:30:35 +00:00
parent cbee1422b4
commit aa4864a0bf
10 changed files with 34 additions and 12 deletions

View File

@ -6,10 +6,11 @@ using e_suite.Database.Core.Extensions;
using e_suite.Modules.WorkflowTemplatesManager.Repository;
using e_suite.Utilities.Pagination;
using e_suite.Workflow.Core.Attributes;
using eSuite.Core.Miscellaneous;
using System.Linq.Expressions;
using e_suite.Workflow.Core.Extensions;
using e_suite.Workflow.Core.Interfaces;
using eSuite.Core.Miscellaneous;
using System.Linq.Expressions;
using System.Reflection;
//using WorkflowVersion = e_suite.Workflow.Core.WorkflowVersion;
@ -180,10 +181,7 @@ public class WorkflowTemplateManager : IWorkflowTemplateManager
{
var interfaces = t.GetInterfaces();
var capabilities = interfaces
.Where(i =>
i != typeof(ITask) &&
i.Namespace?.StartsWith("e_suite.Workflow") == true // avoid system interfaces
)
.Where(i => i.GetCustomAttribute<TaskCapabilityAttribute>() != null)
.Select(FormatInterfaceName)
.ToList();

View File

@ -0,0 +1,6 @@
namespace e_suite.Workflow.Core.Attributes;
[AttributeUsage(AttributeTargets.Interface)]
public sealed class TaskCapabilityAttribute : Attribute
{
}

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 IApprovalTaskAssignee : ITaskAssignee, IBypassable
{
public bool AllowNoVerdict { get; set; }

View File

@ -1,7 +1,9 @@
using System.ComponentModel.DataAnnotations;
using e_suite.Workflow.Core.Attributes;
using System.ComponentModel.DataAnnotations;
namespace e_suite.Workflow.Core.Interfaces;
[TaskCapability]
public interface IAssignees<T> where T : ITaskAssignee
{
[Required]

View File

@ -1,7 +1,9 @@
using e_suite.Workflow.Core.Enums;
using e_suite.Workflow.Core.Attributes;
using e_suite.Workflow.Core.Enums;
namespace e_suite.Workflow.Core.Interfaces;
[TaskCapability]
public interface IBudget
{
/// <summary>

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 IBypassable
{
public bool Bypassable { get; set; }

View File

@ -1,7 +1,9 @@
using System.ComponentModel.DataAnnotations;
using e_suite.Workflow.Core.Attributes;
using System.ComponentModel.DataAnnotations;
namespace e_suite.Workflow.Core.Interfaces;
[TaskCapability]
public interface IFailedLoopback
{
/// <summary>

View File

@ -3,6 +3,7 @@ using e_suite.Workflow.Core.Attributes;
namespace e_suite.Workflow.Core.Interfaces;
[TaskCapability]
public interface IStage<T> where T : TaskTypeAttribute
{
/// <summary>

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 ITags
{
public IList<string> Tags { get; set; }

View File

@ -1,9 +1,11 @@
using e_suite.Database.Core.Tables.Contacts;
using e_suite.Database.Core.Tables.Domain;
using e_suite.Workflow.Core.Attributes;
using e_suite.Workflow.Core.Enums;
namespace e_suite.Workflow.Core.Interfaces;
[TaskCapability]
public interface ITaskAssignee
{
public Role? Role { get; set; }