From 8afe7ac5a0e1b8c952a61934f1e26a8ff3710cc0 Mon Sep 17 00:00:00 2001 From: Colin Dawson Date: Wed, 11 Mar 2026 22:44:22 +0000 Subject: [PATCH] More work on the workflow processing engine, removed the predecessors, and have change the architecture to progress based on IOutcome only. --- .../e-suite.API.Common.UnitTests.csproj | 4 +- .../e-suite.API.Common.csproj | 2 +- .../repository/IActivityRepository.cs | 1 + .../eSuite.API.UnitTests.csproj | 2 +- e-suite.API/eSuite.API/eSuite.API.csproj | 4 +- .../eSuite.Core.UnitTests.csproj | 2 +- .../eSuite.Core/Enums/ActivityState.cs | 2 + e-suite.Core/eSuite.Core/eSuite.Core.csproj | 4 +- .../e-suite.Database.Audit.UnitTests.csproj | 4 +- .../e-suite.Database.Audit.csproj | 2 +- .../e-suite.Database.Core.UnitTests.csproj | 4 +- .../Tables/Activity/ActivityTask.cs | 6 + .../e-suite.Database.MigrationBuilder.csproj | 2 +- ...-suite.Database.SqlServer.UnitTests.csproj | 2 +- .../20260311161348_addingTaskType.Designer.cs | 2224 +++++++++++++++++ .../20260311161348_addingTaskType.cs | 31 + ...SqlEsuiteDatabaseDbContextModelSnapshot.cs | 6 +- .../e-suite.Database.SqlServer.csproj | 4 +- ...suite.DependencyInjection.UnitTests.csproj | 2 +- .../e-suite.DependencyInjection.csproj | 4 +- ...Modules.BlockedIPsManager.UnitTests.csproj | 4 +- .../e-suite.MessageProcessor.UnitTests.csproj | 2 +- .../e-suite.Messaging.Common.UnitTests.csproj | 2 +- .../e-suite.Messaging.Common.csproj | 2 +- .../AuditLog.UnitTests.csproj | 2 +- ...Modules.CustomFieldManagerUnitTests.csproj | 4 +- ...ite.Modules.DomainManager.UnitTests.csproj | 2 +- ...dules.ExceptionLogManager.UnitTests.csproj | 4 +- ...suite.Modules.FormsManagerUnitTests.csproj | 4 +- .../GlossariesManager.UnitTests.csproj | 2 +- ...ules.MailTemplatesManager.UnitTests.csproj | 2 +- ...ules.OrganisationsManager.UnitTests.csproj | 4 +- ...es.PerformanceManager.csproj.nuget.g.props | 2 +- ....PerformanceManager.csproj.nuget.g.targets | 6 +- ...suite.Modules.RoleManager.UnitTests.csproj | 2 +- .../repository/ActivityRepository.cs | 9 + .../SSOManager.UnitTests.csproj | 2 +- .../SequenceManager.UnitTests.csproj | 4 +- ...suite.Modules.SiteManager.UnitTests.csproj | 2 +- ...ules.SpecificationManager.UnitTests.csproj | 2 +- .../UserManager.UnitTests.csproj | 2 +- .../e-suite.Modules.UserManager.csproj | 6 +- ...uite.Nuget.PasswordHasher.UnitTests.csproj | 2 +- .../e-suite.Scheduler.UnitTests.csproj | 2 +- .../e-suite.Scheduler.csproj | 2 +- ...ice.CustomFieldValidation.UnitTests.csproj | 2 +- ...e-suite.Service.EFlowSync.UnitTests.csproj | 2 +- .../e-suite.Service.EFlowSync.csproj | 2 +- .../e-suite.Service.Mail.UnitTests.csproj | 2 +- .../e-suite.Service.Mail.csproj | 2 +- ...suite.Service.Performance.UnitTests.csproj | 4 +- .../Sentinel.UnitTests.csproj | 2 +- .../SigmaImporter.UnitTests.csproj | 2 +- .../e-suite.Service.SigmaImporter.csproj | 2 +- .../WorkflowProcessor.cs | 44 +- .../e-suite.Service.WorkflowProcessor.csproj | 2 +- .../e-suite.UnitTestCore.csproj | 2 +- ...uite.Utilities.Pagination.UnitTests.csproj | 2 +- .../e-suite.Utilities.Pagination.csproj | 2 +- e-suite.Workflow.Core/Enums/DefaultOutcome.cs | 6 + .../Extensions/ObjectExtensions.cs | 7 +- .../Extensions/StageExtensions.cs | 48 +- .../Extensions/TaskExtensions.cs | 115 +- e-suite.Workflow.Core/Interfaces/IJoin.cs | 6 + e-suite.Workflow.Core/Interfaces/IOutcome.cs | 1 - e-suite.Workflow.Core/Interfaces/IStage.cs | 9 +- e-suite.Workflow.Core/Interfaces/ITask.cs | 31 +- e-suite.Workflow.Core/TaskBase.cs | 24 +- .../Tasks/AdhocApprovalTask.cs | 2 +- e-suite.Workflow.Core/Tasks/ApprovalStep.cs | 4 +- e-suite.Workflow.Core/Tasks/ApprovalTask.cs | 2 +- .../Tasks/AssetUploadTask.cs | 5 +- e-suite.Workflow.Core/Tasks/BasicTask.cs | 4 +- .../Tasks/ContentCollationTask.cs | 4 +- .../Tasks/FileReleaseTask.cs | 6 +- .../Tasks/FormDataInputTask.cs | 5 +- .../Tasks/LinkActivityTask.cs | 6 +- e-suite.Workflow.Core/Tasks/MilestoneTask.cs | 22 +- e-suite.Workflow.Core/Tasks/StageTask.cs | 4 +- .../Tasks/VisualBriefReviewTask.cs | 6 +- .../Tasks/VisualBriefUploadTask.cs | 6 +- ...e-suite.Workflow.Core.csproj.nuget.g.props | 2 +- ...suite.Workflow.Core.csproj.nuget.g.targets | 6 +- 83 files changed, 2595 insertions(+), 197 deletions(-) create mode 100644 e-suite.Database.SqlServer/e-suite.Database.SqlServer/Migrations/20260311161348_addingTaskType.Designer.cs create mode 100644 e-suite.Database.SqlServer/e-suite.Database.SqlServer/Migrations/20260311161348_addingTaskType.cs create mode 100644 e-suite.Workflow.Core/Enums/DefaultOutcome.cs create mode 100644 e-suite.Workflow.Core/Interfaces/IJoin.cs diff --git a/e-suite.API.Common/e-suite.API.Common.UnitTests/e-suite.API.Common.UnitTests.csproj b/e-suite.API.Common/e-suite.API.Common.UnitTests/e-suite.API.Common.UnitTests.csproj index 318b4fc..86253ea 100644 --- a/e-suite.API.Common/e-suite.API.Common.UnitTests/e-suite.API.Common.UnitTests.csproj +++ b/e-suite.API.Common/e-suite.API.Common.UnitTests/e-suite.API.Common.UnitTests.csproj @@ -8,10 +8,10 @@ - + - + diff --git a/e-suite.API.Common/e-suite.API.Common/e-suite.API.Common.csproj b/e-suite.API.Common/e-suite.API.Common/e-suite.API.Common.csproj index 3881911..3ddf60d 100644 --- a/e-suite.API.Common/e-suite.API.Common/e-suite.API.Common.csproj +++ b/e-suite.API.Common/e-suite.API.Common/e-suite.API.Common.csproj @@ -8,7 +8,7 @@ - + diff --git a/e-suite.API.Common/e-suite.API.Common/repository/IActivityRepository.cs b/e-suite.API.Common/e-suite.API.Common/repository/IActivityRepository.cs index 71ff588..1a933a0 100644 --- a/e-suite.API.Common/e-suite.API.Common/repository/IActivityRepository.cs +++ b/e-suite.API.Common/e-suite.API.Common/repository/IActivityRepository.cs @@ -22,4 +22,5 @@ public interface IActivityRepository : IRepository ); Task AddActivityTasksAsync(AuditUserDetails auditUserDetails, IEnumerable activityTasks, CancellationToken cancellationToken); + Task UpdateActivityTasksAsync(AuditUserDetails auditUserDetails, ICollection tasks, CancellationToken cancellationToken); } \ No newline at end of file diff --git a/e-suite.API/eSuite.API.UnitTests/eSuite.API.UnitTests.csproj b/e-suite.API/eSuite.API.UnitTests/eSuite.API.UnitTests.csproj index 26b6b82..2aaf19c 100644 --- a/e-suite.API/eSuite.API.UnitTests/eSuite.API.UnitTests.csproj +++ b/e-suite.API/eSuite.API.UnitTests/eSuite.API.UnitTests.csproj @@ -14,7 +14,7 @@ - + diff --git a/e-suite.API/eSuite.API/eSuite.API.csproj b/e-suite.API/eSuite.API/eSuite.API.csproj index fd14dd2..51b98d8 100644 --- a/e-suite.API/eSuite.API/eSuite.API.csproj +++ b/e-suite.API/eSuite.API/eSuite.API.csproj @@ -34,9 +34,9 @@ - + - + diff --git a/e-suite.Core/eSuite.Core.UnitTests/eSuite.Core.UnitTests.csproj b/e-suite.Core/eSuite.Core.UnitTests/eSuite.Core.UnitTests.csproj index fc89dbc..9f1c9d2 100644 --- a/e-suite.Core/eSuite.Core.UnitTests/eSuite.Core.UnitTests.csproj +++ b/e-suite.Core/eSuite.Core.UnitTests/eSuite.Core.UnitTests.csproj @@ -8,7 +8,7 @@ - + diff --git a/e-suite.Core/eSuite.Core/Enums/ActivityState.cs b/e-suite.Core/eSuite.Core/Enums/ActivityState.cs index ae6c80a..a4923af 100644 --- a/e-suite.Core/eSuite.Core/Enums/ActivityState.cs +++ b/e-suite.Core/eSuite.Core/Enums/ActivityState.cs @@ -10,6 +10,8 @@ public enum ActivityState Cancelled, [Description("The activity is currently active for processing")] Active, + [Description("Interactive processing of this task has finished and the workflow processor can process the outcome")] + ReadyToComplete, [Description("Processing of this activity has finished")] Completed } \ No newline at end of file diff --git a/e-suite.Core/eSuite.Core/eSuite.Core.csproj b/e-suite.Core/eSuite.Core/eSuite.Core.csproj index 0bd1ac6..a1e1738 100644 --- a/e-suite.Core/eSuite.Core/eSuite.Core.csproj +++ b/e-suite.Core/eSuite.Core/eSuite.Core.csproj @@ -7,8 +7,8 @@ - - + + diff --git a/e-suite.Database.Audit/e-suite.Database.Audit.UnitTests/e-suite.Database.Audit.UnitTests.csproj b/e-suite.Database.Audit/e-suite.Database.Audit.UnitTests/e-suite.Database.Audit.UnitTests.csproj index db718a8..c34a549 100644 --- a/e-suite.Database.Audit/e-suite.Database.Audit.UnitTests/e-suite.Database.Audit.UnitTests.csproj +++ b/e-suite.Database.Audit/e-suite.Database.Audit.UnitTests/e-suite.Database.Audit.UnitTests.csproj @@ -16,10 +16,10 @@ - + - + diff --git a/e-suite.Database.Audit/e-suite.Database.Audit/e-suite.Database.Audit.csproj b/e-suite.Database.Audit/e-suite.Database.Audit/e-suite.Database.Audit.csproj index 693dc33..4c42bc3 100644 --- a/e-suite.Database.Audit/e-suite.Database.Audit/e-suite.Database.Audit.csproj +++ b/e-suite.Database.Audit/e-suite.Database.Audit/e-suite.Database.Audit.csproj @@ -16,7 +16,7 @@ - + diff --git a/e-suite.Database.Core/e-suite.Database.Core.UnitTests/e-suite.Database.Core.UnitTests.csproj b/e-suite.Database.Core/e-suite.Database.Core.UnitTests/e-suite.Database.Core.UnitTests.csproj index 0c63159..70a55ab 100644 --- a/e-suite.Database.Core/e-suite.Database.Core.UnitTests/e-suite.Database.Core.UnitTests.csproj +++ b/e-suite.Database.Core/e-suite.Database.Core.UnitTests/e-suite.Database.Core.UnitTests.csproj @@ -8,11 +8,11 @@ - + - + diff --git a/e-suite.Database.Core/e-suite.Database.Core/Tables/Activity/ActivityTask.cs b/e-suite.Database.Core/e-suite.Database.Core/Tables/Activity/ActivityTask.cs index 84710e2..caa98c0 100644 --- a/e-suite.Database.Core/e-suite.Database.Core/Tables/Activity/ActivityTask.cs +++ b/e-suite.Database.Core/e-suite.Database.Core/Tables/Activity/ActivityTask.cs @@ -31,6 +31,12 @@ public class ActivityTask : IGeneralId, ISoftDeletable [Required] public Guid TaskGuid { get; set; } + /// + /// This is the fullname of the tasktype + /// + [Required] + public string TaskType { get; set; } + [AuditName] [Required] public string TaskName { get; set; } diff --git a/e-suite.Database.SqlServer/e-suite.Database.MigrationBuilder/e-suite.Database.MigrationBuilder.csproj b/e-suite.Database.SqlServer/e-suite.Database.MigrationBuilder/e-suite.Database.MigrationBuilder.csproj index 7da9b75..188189f 100644 --- a/e-suite.Database.SqlServer/e-suite.Database.MigrationBuilder/e-suite.Database.MigrationBuilder.csproj +++ b/e-suite.Database.SqlServer/e-suite.Database.MigrationBuilder/e-suite.Database.MigrationBuilder.csproj @@ -9,7 +9,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/e-suite.Database.SqlServer/e-suite.Database.SqlServer.UnitTests/e-suite.Database.SqlServer.UnitTests.csproj b/e-suite.Database.SqlServer/e-suite.Database.SqlServer.UnitTests/e-suite.Database.SqlServer.UnitTests.csproj index d0f3a3b..067187c 100644 --- a/e-suite.Database.SqlServer/e-suite.Database.SqlServer.UnitTests/e-suite.Database.SqlServer.UnitTests.csproj +++ b/e-suite.Database.SqlServer/e-suite.Database.SqlServer.UnitTests/e-suite.Database.SqlServer.UnitTests.csproj @@ -10,7 +10,7 @@ - + diff --git a/e-suite.Database.SqlServer/e-suite.Database.SqlServer/Migrations/20260311161348_addingTaskType.Designer.cs b/e-suite.Database.SqlServer/e-suite.Database.SqlServer/Migrations/20260311161348_addingTaskType.Designer.cs new file mode 100644 index 0000000..1b2dc69 --- /dev/null +++ b/e-suite.Database.SqlServer/e-suite.Database.SqlServer/Migrations/20260311161348_addingTaskType.Designer.cs @@ -0,0 +1,2224 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using e_suite.Database.SqlServer; + +#nullable disable + +namespace esuite.Database.SqlServer.Migrations +{ + [DbContext(typeof(SqlEsuiteDatabaseDbContext))] + [Migration("20260311161348_addingTaskType")] + partial class addingTaskType + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "10.0.4") + .HasAnnotation("Relational:MaxIdentifierLength", 128); + + SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); + + modelBuilder.Entity("e_suite.Database.Audit.Tables.Audit.AuditDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Comment") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DateTime") + .HasColumnType("datetimeoffset"); + + b.Property("Fields") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Type") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("UserDisplayName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.ToTable("AuditDetails", "Audit"); + }); + + modelBuilder.Entity("e_suite.Database.Audit.Tables.Audit.AuditDrillHierarchy", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ChildAuditDrillDownEntityId") + .HasColumnType("bigint"); + + b.Property("ParentAuditDrillDownEntityId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ChildAuditDrillDownEntityId"); + + b.HasIndex("ParentAuditDrillDownEntityId"); + + b.ToTable("AuditDrillHierarchies", "Audit"); + }); + + modelBuilder.Entity("e_suite.Database.Audit.Tables.Audit.AuditEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AuditLogId") + .HasColumnType("bigint"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("EntityName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("IsPrimary") + .HasColumnType("bit"); + + b.Property("PrimaryKey") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.ToTable("AuditEntries", "Audit"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Activity.Activity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ActivityState") + .HasColumnType("int"); + + b.Property("Deleted") + .HasColumnType("bit"); + + b.Property("Guid") + .HasColumnType("uniqueidentifier"); + + b.Property("LastUpdated") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("WorkflowVersionId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("Guid") + .IsUnique(); + + b.HasIndex("Name") + .IsUnique(); + + b.HasIndex("WorkflowVersionId"); + + b.ToTable("Activities", "Activity"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Activity.ActivityTask", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ActivityId") + .HasColumnType("bigint"); + + b.Property("ActivityOrdinal") + .HasColumnType("bigint"); + + b.Property("ActivityState") + .HasColumnType("int"); + + b.Property("Deleted") + .HasColumnType("bit"); + + b.Property("FinishDateTime") + .HasColumnType("datetimeoffset"); + + b.Property("Guid") + .HasColumnType("uniqueidentifier"); + + b.Property("LastUpdated") + .HasColumnType("datetimeoffset"); + + b.Property("ParentId") + .HasColumnType("bigint"); + + b.Property("StartDateTime") + .HasColumnType("datetimeoffset"); + + b.Property("TaskGuid") + .HasColumnType("uniqueidentifier"); + + b.Property("TaskName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TaskType") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Guid") + .IsUnique(); + + b.HasIndex("ParentId"); + + b.HasIndex("ActivityId", "ActivityOrdinal") + .IsUnique(); + + b.ToTable("ActivityTasks", "Activity"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Contacts.Contact", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Guid") + .HasColumnType("uniqueidentifier"); + + b.Property("JCard") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("LastUpdated") + .HasColumnType("datetimeoffset"); + + b.HasKey("Id"); + + b.HasIndex("Guid") + .IsUnique(); + + b.HasIndex("Id") + .IsUnique(); + + b.ToTable("Contacts", "Contacts"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.CustomFields.CustomField", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("DefaultValue") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Deleted") + .HasColumnType("bit"); + + b.Property("FieldType") + .HasColumnType("int"); + + b.Property("Guid") + .HasColumnType("uniqueidentifier"); + + b.Property("LastUpdated") + .HasColumnType("datetimeoffset"); + + b.Property("MaxEntries") + .HasColumnType("bigint"); + + b.Property("MinEntries") + .HasColumnType("bigint"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Guid") + .IsUnique(); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("CustomFields", "CustomFields"); + + b.HasData( + new + { + Id = 1L, + DefaultValue = "", + Deleted = false, + FieldType = 7, + Guid = new Guid("8d910089-3079-4a29-abad-8ddf82db6dbb"), + LastUpdated = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + MaxEntries = 1L, + MinEntries = 1L, + Name = "Print Specification Form Template" + }); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.CustomFields.CustomFieldFormTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CustomFieldId") + .HasColumnType("bigint"); + + b.Property("FormTemplateId") + .HasColumnType("bigint"); + + b.Property("LastUpdated") + .HasColumnType("datetimeoffset"); + + b.HasKey("Id"); + + b.HasIndex("CustomFieldId"); + + b.HasIndex("FormTemplateId"); + + b.ToTable("CustomFieldFormTemplates", "CustomFields"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.CustomFields.CustomFieldGlossary", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CustomFieldId") + .HasColumnType("bigint"); + + b.Property("GlossaryId") + .HasColumnType("bigint"); + + b.Property("LastUpdated") + .HasColumnType("datetimeoffset"); + + b.HasKey("Id"); + + b.HasIndex("CustomFieldId"); + + b.HasIndex("GlossaryId"); + + b.ToTable("CustomFieldGlossaries", "CustomFields"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.CustomFields.CustomFieldNumber", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CustomFieldId") + .HasColumnType("bigint"); + + b.Property("LastUpdated") + .HasColumnType("datetimeoffset"); + + b.Property("MaximumValue") + .HasPrecision(28, 8) + .HasColumnType("decimal(28,8)"); + + b.Property("MinimumValue") + .HasPrecision(28, 8) + .HasColumnType("decimal(28,8)"); + + b.Property("Step") + .HasPrecision(28, 8) + .HasColumnType("decimal(28,8)"); + + b.HasKey("Id"); + + b.HasIndex("CustomFieldId"); + + b.ToTable("CustomFieldNumbers", "CustomFields"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.CustomFields.CustomFieldSequence", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CustomFieldId") + .HasColumnType("bigint"); + + b.Property("LastUpdated") + .HasColumnType("datetimeoffset"); + + b.Property("SequenceId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("CustomFieldId"); + + b.HasIndex("SequenceId"); + + b.ToTable("CustomFieldSequences", "CustomFields"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.CustomFields.CustomFieldText", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CustomFieldId") + .HasColumnType("bigint"); + + b.Property("LastUpdated") + .HasColumnType("datetimeoffset"); + + b.Property("MultiLine") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("CustomFieldId"); + + b.ToTable("CustomFieldTexts", "CustomFields"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Diagnostics.ExceptionLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Application") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("ExceptionJson") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Message") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OccuredAt") + .HasColumnType("datetimeoffset"); + + b.Property("StackTrace") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("SupportingData") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("ExceptionLogs", "Diagnostics"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Diagnostics.PerformanceReport", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ActionName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("ActionParameters") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("ControllerName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Host") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("RequestType") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("StartDateTime") + .HasColumnType("datetimeoffset"); + + b.Property("Timings") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TotalTimeMS") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("PerformanceReports", "Diagnostics"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Diagnostics.PerformanceThreshold", b => + { + b.Property("ControllerName") + .HasColumnType("nvarchar(450)"); + + b.Property("ActionName") + .HasColumnType("nvarchar(450)"); + + b.Property("RequestType") + .HasColumnType("nvarchar(450)"); + + b.Property("TotalTimeMS") + .HasColumnType("int"); + + b.HasKey("ControllerName", "ActionName", "RequestType"); + + b.ToTable("PerformanceThresholds", "Diagnostics"); + + b.HasData( + new + { + ControllerName = "", + ActionName = "", + RequestType = "", + TotalTimeMS = 2000 + }); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Domain.Domain", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Deleted") + .HasColumnType("bit"); + + b.Property("Guid") + .HasColumnType("uniqueidentifier"); + + b.Property("LastUpdated") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("SigmaId") + .HasColumnType("bigint"); + + b.Property("SsoProviderId") + .HasColumnType("bigint"); + + b.Property("SunriseAppId") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("nvarchar(128)"); + + b.Property("SunriseCategoryId") + .IsRequired() + .HasMaxLength(16) + .HasColumnType("nvarchar(16)"); + + b.Property("SunriseHostname") + .IsRequired() + .HasMaxLength(16) + .HasColumnType("nvarchar(16)"); + + b.HasKey("Id"); + + b.HasIndex("Guid") + .IsUnique(); + + b.HasIndex("Name") + .IsUnique(); + + b.HasIndex("SsoProviderId"); + + b.ToTable("Domains", "Domain"); + + b.HasData( + new + { + Id = 1L, + Deleted = false, + Guid = new Guid("4eb1b0c7-e81b-4c9d-ba91-384ed47a1cf9"), + LastUpdated = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "Sun-Strategy", + SunriseAppId = "", + SunriseCategoryId = "", + SunriseHostname = "" + }); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Domain.Role", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CanDelete") + .HasColumnType("bit"); + + b.Property("Deleted") + .HasColumnType("bit"); + + b.Property("DomainId") + .HasColumnType("bigint"); + + b.Property("Guid") + .HasColumnType("uniqueidentifier"); + + b.Property("IsAdministrator") + .HasColumnType("bit"); + + b.Property("IsSuperUser") + .HasColumnType("bit"); + + b.Property("LastUpdated") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Guid") + .IsUnique(); + + b.HasIndex("DomainId", "Name") + .IsUnique(); + + b.ToTable("Roles", "Domain"); + + b.HasData( + new + { + Id = 1L, + CanDelete = false, + Deleted = false, + DomainId = 1L, + Guid = new Guid("32d65817-4de4-4bd5-912e-2b33054a2171"), + IsAdministrator = false, + IsSuperUser = true, + LastUpdated = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "Super Users" + }, + new + { + Id = 2L, + CanDelete = false, + Deleted = false, + DomainId = 1L, + Guid = new Guid("2f77f57c-fe2c-4a36-ad17-5d902afc86cb"), + IsAdministrator = true, + IsSuperUser = false, + LastUpdated = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "Administrators" + }); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Domain.RoleAccess", b => + { + b.Property("RoleId") + .HasColumnType("bigint"); + + b.Property("AccessKey") + .HasColumnType("int"); + + b.Property("LastUpdated") + .HasColumnType("datetimeoffset"); + + b.HasKey("RoleId", "AccessKey"); + + b.ToTable("RoleAccess", "Domain"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Domain.UserAccess", b => + { + b.Property("AccessKey") + .HasColumnType("int"); + + b.Property("DomainId") + .HasColumnType("bigint"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasIndex("DomainId"); + + b.HasIndex("UserId"); + + b.ToTable("UserAccess", "Domain"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Domain.UserRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Deleted") + .HasColumnType("bit"); + + b.Property("LastUpdated") + .HasColumnType("datetimeoffset"); + + b.Property("RoleId") + .HasColumnType("bigint"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasAlternateKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("UserRoles", "Domain"); + + b.HasData( + new + { + Id = 1L, + Deleted = false, + LastUpdated = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + RoleId = 1L, + UserId = 1L + }); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Forms.FormFieldInstance", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CustomFieldId") + .HasColumnType("bigint"); + + b.Property("DisplayValue") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("FormInstanceId") + .HasColumnType("bigint"); + + b.Property("Guid") + .HasColumnType("uniqueidentifier"); + + b.Property("Index") + .HasColumnType("bigint"); + + b.Property("LastUpdated") + .HasColumnType("datetimeoffset"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("CustomFieldId"); + + b.HasIndex("Guid") + .IsUnique(); + + b.HasIndex("FormInstanceId", "CustomFieldId", "Index") + .IsUnique(); + + b.ToTable("FormFieldInstances", "Forms"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Forms.FormInstance", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Deleted") + .HasColumnType("bit"); + + b.Property("FormTemplateVersionId") + .HasColumnType("bigint"); + + b.Property("Guid") + .HasColumnType("uniqueidentifier"); + + b.Property("LastUpdated") + .HasColumnType("datetimeoffset"); + + b.HasKey("Id"); + + b.HasIndex("FormTemplateVersionId"); + + b.HasIndex("Guid") + .IsUnique(); + + b.ToTable("FormInstances", "Forms"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Forms.FormTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Deleted") + .HasColumnType("bit"); + + b.Property("Guid") + .HasColumnType("uniqueidentifier"); + + b.Property("LastUpdated") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Guid") + .IsUnique(); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("FormTemplates", "Forms"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Forms.FormTemplateVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Deleted") + .HasColumnType("bit"); + + b.Property("FormDefinition") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Guid") + .HasColumnType("uniqueidentifier"); + + b.Property("LastUpdated") + .HasColumnType("datetimeoffset"); + + b.Property("TemplateId") + .HasColumnType("bigint"); + + b.Property("Version") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("Guid") + .IsUnique(); + + b.HasIndex("TemplateId", "Version") + .IsUnique(); + + b.ToTable("FormTemplateVersions", "Forms"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Glossaries.Glossary", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Deleted") + .HasColumnType("bit"); + + b.Property("Guid") + .HasColumnType("uniqueidentifier"); + + b.Property("LastUpdated") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("ParentId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("Guid") + .IsUnique(); + + b.HasIndex("Name") + .IsUnique(); + + b.HasIndex("ParentId"); + + b.HasIndex("Id", "ParentId") + .IsUnique() + .HasFilter("[ParentId] IS NOT NULL"); + + b.ToTable("Glossaries", "Glossaries"); + + b.HasData( + new + { + Id = 1L, + Deleted = false, + Guid = new Guid("fa6566f8-b4b0-48c5-9985-336c9284796e"), + LastUpdated = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "System" + }, + new + { + Id = 2L, + Deleted = false, + Guid = new Guid("90c48cf1-1a2b-4a76-b30b-260ecb149ccc"), + LastUpdated = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "Domain" + }, + new + { + Id = 3L, + Deleted = false, + Guid = new Guid("35eb8c23-4528-49a7-a798-b8bae3b06daf"), + LastUpdated = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + Name = "Print Specifications", + ParentId = 1L + }); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Glossaries.GlossaryCustomField", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CustomFieldId") + .HasColumnType("bigint"); + + b.Property("GlossaryId") + .HasColumnType("bigint"); + + b.Property("LastUpdated") + .HasColumnType("datetimeoffset"); + + b.HasKey("Id"); + + b.HasAlternateKey("GlossaryId", "CustomFieldId"); + + b.HasIndex("CustomFieldId"); + + b.ToTable("GlossaryCustomFields", "Glossaries"); + + b.HasData( + new + { + Id = 1L, + CustomFieldId = 1L, + GlossaryId = 3L, + LastUpdated = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)) + }); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Glossaries.GlossaryCustomFieldValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("CustomFieldId") + .HasColumnType("bigint"); + + b.Property("DisplayValue") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("GlossaryId") + .HasColumnType("bigint"); + + b.Property("Guid") + .HasColumnType("uniqueidentifier"); + + b.Property("Index") + .HasColumnType("bigint"); + + b.Property("LastUpdated") + .HasColumnType("datetimeoffset"); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasAlternateKey("GlossaryId", "CustomFieldId", "Index"); + + b.HasIndex("CustomFieldId"); + + b.HasIndex("Guid") + .IsUnique(); + + b.HasIndex("GlossaryId", "CustomFieldId", "Index") + .IsUnique(); + + b.ToTable("GlossaryCustomFieldValues", "Glossaries"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Mail.MailTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Deleted") + .HasColumnType("bit"); + + b.Property("DomainId") + .HasColumnType("bigint"); + + b.Property("Guid") + .HasColumnType("uniqueidentifier"); + + b.Property("LastUpdated") + .HasColumnType("datetimeoffset"); + + b.Property("MailType") + .HasColumnType("int"); + + b.Property("Subject") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TemplateDefinition") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Guid") + .IsUnique(); + + b.HasIndex("DomainId", "MailType") + .IsUnique(); + + b.ToTable("MailTemplates", "Mail"); + + b.HasData( + new + { + Id = 1L, + Deleted = false, + DomainId = 1L, + Guid = new Guid("32b657af-5e17-47f3-b8dc-59580516b141"), + LastUpdated = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + MailType = 0, + Subject = "Confirmation e-mail", + TemplateDefinition = "

Please confirm your e-mail

Welcome to . Please click on this link to confirm your e-mail address is correct." + }, + new + { + Id = 2L, + Deleted = false, + DomainId = 1L, + Guid = new Guid("77fff2b0-dd8c-43e6-a9fd-304c79850f81"), + LastUpdated = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + MailType = 2, + Subject = "Password reset", + TemplateDefinition = "

Please follow the link to reset your password


Reset Password" + }, + new + { + Id = 3L, + Deleted = false, + DomainId = 1L, + Guid = new Guid("2e2d84a5-be1c-4e3b-a86a-bdafed42801b"), + LastUpdated = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + MailType = 1, + Subject = "Disable two factor authentication", + TemplateDefinition = "

Please follow the link to reset two factor authentication


Disable two factor authentication" + }, + new + { + Id = 4L, + Deleted = false, + DomainId = 1L, + Guid = new Guid("421b67c7-5f4b-4cad-adc5-528e2921790c"), + LastUpdated = new DateTimeOffset(new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + MailType = 3, + Subject = "Password successfully reset", + TemplateDefinition = "

Your password has been reset. Please contact your admin if this wasn't you.

" + }); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Miscellaneous.ExternalKey", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("EntityName") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("ExternalId") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("ExternalSystemId") + .HasColumnType("bigint"); + + b.Property("PrimaryKey") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("EntityName", "PrimaryKey") + .IsUnique(); + + b.HasIndex("ExternalSystemId", "ExternalId") + .IsUnique(); + + b.ToTable("ExternalKeys", "Miscellaneous"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Miscellaneous.ExternalSystem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("SystemName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("nvarchar(200)"); + + b.HasKey("Id"); + + b.HasIndex("SystemName") + .IsUnique(); + + b.ToTable("ExternalSystems", "Miscellaneous"); + + b.HasData( + new + { + Id = 1L, + SystemName = "e-flow" + }); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Printer.Organisation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Address") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Deleted") + .HasColumnType("bit"); + + b.Property("Guid") + .HasColumnType("uniqueidentifier"); + + b.Property("LastUpdated") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Status") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("Guid") + .IsUnique(); + + b.HasIndex("Id") + .IsUnique(); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Organisations", "Printer"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Printer.OrganisationContact", b => + { + b.Property("OrganisationId") + .HasColumnType("bigint"); + + b.Property("ContactId") + .HasColumnType("bigint"); + + b.Property("LastUpdated") + .HasColumnType("datetimeoffset"); + + b.Property("Primary") + .HasColumnType("bit"); + + b.HasKey("OrganisationId", "ContactId"); + + b.HasIndex("ContactId"); + + b.ToTable("OrganisationContacts", "Printer"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Printer.Site", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Address") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Deleted") + .HasColumnType("bit"); + + b.Property("Guid") + .HasColumnType("uniqueidentifier"); + + b.Property("LastUpdated") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("OrganisationId") + .HasColumnType("bigint"); + + b.Property("SigmaId") + .HasColumnType("bigint"); + + b.Property("Status") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("Guid") + .IsUnique(); + + b.HasIndex("OrganisationId"); + + b.HasIndex("SigmaId") + .IsUnique() + .HasFilter("[SigmaId] IS NOT NULL"); + + b.ToTable("Sites", "Printer"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Printer.SiteContact", b => + { + b.Property("SiteId") + .HasColumnType("bigint"); + + b.Property("ContactId") + .HasColumnType("bigint"); + + b.Property("LastUpdated") + .HasColumnType("datetimeoffset"); + + b.Property("Primary") + .HasColumnType("bit"); + + b.HasKey("SiteId", "ContactId"); + + b.HasIndex("ContactId"); + + b.ToTable("SiteContacts", "Printer"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Printer.Specification", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Deleted") + .HasColumnType("bit"); + + b.Property("FormInstanceId") + .HasColumnType("bigint"); + + b.Property("Guid") + .HasColumnType("uniqueidentifier"); + + b.Property("LastUpdated") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("SigmaId") + .HasColumnType("bigint"); + + b.Property("SiteId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("Guid") + .IsUnique(); + + b.HasIndex("Id") + .IsUnique(); + + b.HasIndex("SigmaId") + .IsUnique() + .HasFilter("[SigmaId] IS NOT NULL"); + + b.HasIndex("SiteId"); + + b.ToTable("Specifications", "Printer"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Sentinel.FailedAccessAttempt", b => + { + b.Property("IPAddress") + .HasMaxLength(50) + .HasColumnType("nvarchar(50)"); + + b.Property("AttemptedTime") + .HasColumnType("datetimeoffset"); + + b.HasKey("IPAddress", "AttemptedTime"); + + b.ToTable("FailedAccessAttempts", "Sentinel"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Sequences.Sequence", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Deleted") + .HasColumnType("bit"); + + b.Property("Guid") + .HasColumnType("uniqueidentifier"); + + b.Property("Increment") + .HasColumnType("bigint"); + + b.Property("LastIssueDate") + .HasColumnType("datetimeoffset"); + + b.Property("LastIssueValue") + .HasColumnType("bigint"); + + b.Property("LastUpdated") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("Pattern") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("nvarchar(255)"); + + b.Property("Rollover") + .HasColumnType("int"); + + b.Property("Seed") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("Guid") + .IsUnique(); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Sequences", "Sequences"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.UserManager.EmailUserAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Created") + .HasColumnType("datetimeoffset"); + + b.Property("EmailActionType") + .HasColumnType("int"); + + b.Property("Expires") + .HasColumnType("datetimeoffset"); + + b.Property("Token") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasAlternateKey("Token", "EmailActionType"); + + b.HasIndex("UserId"); + + b.ToTable("EmailUserActions", "UserManager"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.UserManager.SingleUseGuid", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Expires") + .HasColumnType("datetimeoffset"); + + b.Property("Guid") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("Guid") + .IsUnique(); + + b.HasIndex("UserId"); + + b.ToTable("SingleUseGuids", "UserManager"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.UserManager.SsoProvider", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("AuthorizationEndpoint") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("ClientSecret") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Deleted") + .HasColumnType("bit"); + + b.Property("Guid") + .HasColumnType("uniqueidentifier"); + + b.Property("IsPublic") + .HasColumnType("bit"); + + b.Property("LastUpdated") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("TokenEndpoint") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("ValidIssuer") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("Guid") + .IsUnique(); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("SsoProviders", "UserManager"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.UserManager.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Active") + .HasColumnType("bit"); + + b.Property("Created") + .HasColumnType("datetimeoffset"); + + b.Property("DomainId") + .HasColumnType("bigint"); + + b.Property("Email") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.Property("EmailConfirmed") + .HasColumnType("bit"); + + b.Property("FirstName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Guid") + .HasColumnType("uniqueidentifier"); + + b.Property("LastName") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("LastUpdated") + .HasColumnType("datetimeoffset"); + + b.Property("MiddleNames") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Password") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("PreferredLocale") + .IsRequired() + .HasMaxLength(20) + .HasColumnType("nvarchar(20)"); + + b.Property("SsoProviderId") + .HasColumnType("bigint"); + + b.Property("SsoSubject") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("TwoFactorAuthenticationKey") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("UsingTwoFactorAuthentication") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.HasIndex("DomainId"); + + b.HasIndex("Email") + .IsUnique(); + + b.HasIndex("Guid") + .IsUnique(); + + b.HasIndex("SsoProviderId"); + + b.ToTable("Users", "UserManager"); + + b.HasData( + new + { + Id = 1L, + Active = true, + Created = new DateTimeOffset(new DateTime(2022, 6, 9, 12, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + DomainId = 1L, + Email = "testuser1@sun-strategy.com", + EmailConfirmed = true, + FirstName = "Test1", + Guid = new Guid("30cfcd5b-3385-43f1-b59a-fd35236f3d92"), + LastName = "User", + LastUpdated = new DateTimeOffset(new DateTime(2022, 6, 9, 12, 0, 0, 0, DateTimeKind.Unspecified), new TimeSpan(0, 0, 0, 0, 0)), + MiddleNames = "", + Password = "AgAAAAIAACcQAAAAAAAAABDGmF9Hre4l8k9lkZAxBRJk0zNHD2b6xfKz4C7h6UjuirkoyoP2fVR6d9b7riT03UnL5yAgFh2pSSVQDx+nQ5PBjZRB9UG4u5FrY8W7ouA/+w==", + PreferredLocale = "en-GB", + SsoSubject = "", + TwoFactorAuthenticationKey = "4EHHG42OWCN3L72TSRYSHTV6MRJXVOY3", + UsingTwoFactorAuthentication = false + }); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Workflow.Workflow", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("Deleted") + .HasColumnType("bit"); + + b.Property("Guid") + .HasColumnType("uniqueidentifier"); + + b.Property("LastUpdated") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("Guid") + .IsUnique(); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("Workflows", "Workflow"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Workflow.WorkflowVersion", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); + + b.Property("ActivityNameTemplate") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Deleted") + .HasColumnType("bit"); + + b.Property("Description") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("DomainId") + .HasColumnType("bigint"); + + b.Property("Guid") + .HasColumnType("uniqueidentifier"); + + b.Property("LastUpdated") + .HasColumnType("datetimeoffset"); + + b.Property("Tasks") + .IsRequired() + .HasColumnType("nvarchar(max)"); + + b.Property("Version") + .HasColumnType("bigint"); + + b.Property("WorkflowId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("DomainId"); + + b.HasIndex("Guid") + .IsUnique(); + + b.HasIndex("WorkflowId", "Version") + .IsUnique(); + + b.ToTable("WorkflowVersions", "Workflow"); + }); + + modelBuilder.Entity("e_suite.Database.Audit.Tables.Audit.AuditDrillHierarchy", b => + { + b.HasOne("e_suite.Database.Audit.Tables.Audit.AuditEntry", "ChildAuditDrillDownEntity") + .WithMany() + .HasForeignKey("ChildAuditDrillDownEntityId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.HasOne("e_suite.Database.Audit.Tables.Audit.AuditEntry", "ParentAuditDrillDownEntity") + .WithMany() + .HasForeignKey("ParentAuditDrillDownEntityId") + .OnDelete(DeleteBehavior.NoAction) + .IsRequired(); + + b.Navigation("ChildAuditDrillDownEntity"); + + b.Navigation("ParentAuditDrillDownEntity"); + }); + + modelBuilder.Entity("e_suite.Database.Audit.Tables.Audit.AuditEntry", b => + { + b.HasOne("e_suite.Database.Audit.Tables.Audit.AuditDetail", "AuditLog") + .WithMany() + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("AuditLog"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Activity.Activity", b => + { + b.HasOne("e_suite.Database.Core.Tables.Workflow.WorkflowVersion", "WorkflowVersion") + .WithMany() + .HasForeignKey("WorkflowVersionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("WorkflowVersion"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Activity.ActivityTask", b => + { + b.HasOne("e_suite.Database.Core.Tables.Activity.Activity", "Activity") + .WithMany("Tasks") + .HasForeignKey("ActivityId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("e_suite.Database.Core.Tables.Activity.ActivityTask", "ParentTask") + .WithMany("Tasks") + .HasForeignKey("ParentId"); + + b.Navigation("Activity"); + + b.Navigation("ParentTask"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.CustomFields.CustomFieldFormTemplate", b => + { + b.HasOne("e_suite.Database.Core.Tables.CustomFields.CustomField", "CustomField") + .WithMany() + .HasForeignKey("CustomFieldId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("e_suite.Database.Core.Tables.Forms.FormTemplate", "FormTemplate") + .WithMany() + .HasForeignKey("FormTemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CustomField"); + + b.Navigation("FormTemplate"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.CustomFields.CustomFieldGlossary", b => + { + b.HasOne("e_suite.Database.Core.Tables.CustomFields.CustomField", "CustomField") + .WithMany() + .HasForeignKey("CustomFieldId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("e_suite.Database.Core.Tables.Glossaries.Glossary", "Glossary") + .WithMany() + .HasForeignKey("GlossaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CustomField"); + + b.Navigation("Glossary"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.CustomFields.CustomFieldNumber", b => + { + b.HasOne("e_suite.Database.Core.Tables.CustomFields.CustomField", "CustomField") + .WithMany() + .HasForeignKey("CustomFieldId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CustomField"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.CustomFields.CustomFieldSequence", b => + { + b.HasOne("e_suite.Database.Core.Tables.CustomFields.CustomField", "CustomField") + .WithMany() + .HasForeignKey("CustomFieldId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("e_suite.Database.Core.Tables.Sequences.Sequence", "Sequence") + .WithMany() + .HasForeignKey("SequenceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CustomField"); + + b.Navigation("Sequence"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.CustomFields.CustomFieldText", b => + { + b.HasOne("e_suite.Database.Core.Tables.CustomFields.CustomField", "CustomField") + .WithMany() + .HasForeignKey("CustomFieldId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CustomField"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Domain.Domain", b => + { + b.HasOne("e_suite.Database.Core.Tables.UserManager.SsoProvider", "SsoProvider") + .WithMany() + .HasForeignKey("SsoProviderId"); + + b.Navigation("SsoProvider"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Domain.Role", b => + { + b.HasOne("e_suite.Database.Core.Tables.Domain.Domain", "Domain") + .WithMany() + .HasForeignKey("DomainId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Domain"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Domain.RoleAccess", b => + { + b.HasOne("e_suite.Database.Core.Tables.Domain.Role", "Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Domain.UserAccess", b => + { + b.HasOne("e_suite.Database.Core.Tables.Domain.Domain", "Domain") + .WithMany() + .HasForeignKey("DomainId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("e_suite.Database.Core.Tables.UserManager.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Domain"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Domain.UserRole", b => + { + b.HasOne("e_suite.Database.Core.Tables.Domain.Role", "Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("e_suite.Database.Core.Tables.UserManager.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Role"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Forms.FormFieldInstance", b => + { + b.HasOne("e_suite.Database.Core.Tables.CustomFields.CustomField", "CustomField") + .WithMany() + .HasForeignKey("CustomFieldId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("e_suite.Database.Core.Tables.Forms.FormInstance", "FormInstance") + .WithMany("FormFields") + .HasForeignKey("FormInstanceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CustomField"); + + b.Navigation("FormInstance"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Forms.FormInstance", b => + { + b.HasOne("e_suite.Database.Core.Tables.Forms.FormTemplateVersion", "FormTemplateVersion") + .WithMany() + .HasForeignKey("FormTemplateVersionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("FormTemplateVersion"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Forms.FormTemplateVersion", b => + { + b.HasOne("e_suite.Database.Core.Tables.Forms.FormTemplate", "Template") + .WithMany("Versions") + .HasForeignKey("TemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Template"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Glossaries.Glossary", b => + { + b.HasOne("e_suite.Database.Core.Tables.Glossaries.Glossary", "Parent") + .WithMany() + .HasForeignKey("ParentId"); + + b.Navigation("Parent"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Glossaries.GlossaryCustomField", b => + { + b.HasOne("e_suite.Database.Core.Tables.CustomFields.CustomField", "CustomField") + .WithMany() + .HasForeignKey("CustomFieldId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("e_suite.Database.Core.Tables.Glossaries.Glossary", "Glossary") + .WithMany("CustomFieldDefinitions") + .HasForeignKey("GlossaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CustomField"); + + b.Navigation("Glossary"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Glossaries.GlossaryCustomFieldValue", b => + { + b.HasOne("e_suite.Database.Core.Tables.CustomFields.CustomField", "CustomField") + .WithMany() + .HasForeignKey("CustomFieldId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("e_suite.Database.Core.Tables.Glossaries.Glossary", "Glossary") + .WithMany("CustomFieldValues") + .HasForeignKey("GlossaryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("CustomField"); + + b.Navigation("Glossary"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Mail.MailTemplate", b => + { + b.HasOne("e_suite.Database.Core.Tables.Domain.Domain", "Domain") + .WithMany() + .HasForeignKey("DomainId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Domain"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Miscellaneous.ExternalKey", b => + { + b.HasOne("e_suite.Database.Core.Tables.Miscellaneous.ExternalSystem", "ExternalSystem") + .WithMany() + .HasForeignKey("ExternalSystemId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("ExternalSystem"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Printer.OrganisationContact", b => + { + b.HasOne("e_suite.Database.Core.Tables.Contacts.Contact", "Contact") + .WithMany() + .HasForeignKey("ContactId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("e_suite.Database.Core.Tables.Printer.Organisation", "Organisation") + .WithMany() + .HasForeignKey("OrganisationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Contact"); + + b.Navigation("Organisation"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Printer.Site", b => + { + b.HasOne("e_suite.Database.Core.Tables.Printer.Organisation", "Organisation") + .WithMany("Sites") + .HasForeignKey("OrganisationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organisation"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Printer.SiteContact", b => + { + b.HasOne("e_suite.Database.Core.Tables.Contacts.Contact", "Contact") + .WithMany() + .HasForeignKey("ContactId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("e_suite.Database.Core.Tables.Printer.Site", "Site") + .WithMany() + .HasForeignKey("SiteId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Contact"); + + b.Navigation("Site"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Printer.Specification", b => + { + b.HasOne("e_suite.Database.Core.Tables.Printer.Site", "Site") + .WithMany("Specifications") + .HasForeignKey("SiteId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Site"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.UserManager.EmailUserAction", b => + { + b.HasOne("e_suite.Database.Core.Tables.UserManager.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.UserManager.SingleUseGuid", b => + { + b.HasOne("e_suite.Database.Core.Tables.UserManager.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.UserManager.User", b => + { + b.HasOne("e_suite.Database.Core.Tables.Domain.Domain", "Domain") + .WithMany() + .HasForeignKey("DomainId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("e_suite.Database.Core.Tables.UserManager.SsoProvider", "SsoProvider") + .WithMany() + .HasForeignKey("SsoProviderId"); + + b.Navigation("Domain"); + + b.Navigation("SsoProvider"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Workflow.WorkflowVersion", b => + { + b.HasOne("e_suite.Database.Core.Tables.Domain.Domain", "Domain") + .WithMany() + .HasForeignKey("DomainId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("e_suite.Database.Core.Tables.Workflow.Workflow", "Workflow") + .WithMany("Versions") + .HasForeignKey("WorkflowId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Domain"); + + b.Navigation("Workflow"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Activity.Activity", b => + { + b.Navigation("Tasks"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Activity.ActivityTask", b => + { + b.Navigation("Tasks"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Forms.FormInstance", b => + { + b.Navigation("FormFields"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Forms.FormTemplate", b => + { + b.Navigation("Versions"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Glossaries.Glossary", b => + { + b.Navigation("CustomFieldDefinitions"); + + b.Navigation("CustomFieldValues"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Printer.Organisation", b => + { + b.Navigation("Sites"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Printer.Site", b => + { + b.Navigation("Specifications"); + }); + + modelBuilder.Entity("e_suite.Database.Core.Tables.Workflow.Workflow", b => + { + b.Navigation("Versions"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/e-suite.Database.SqlServer/e-suite.Database.SqlServer/Migrations/20260311161348_addingTaskType.cs b/e-suite.Database.SqlServer/e-suite.Database.SqlServer/Migrations/20260311161348_addingTaskType.cs new file mode 100644 index 0000000..deb7d0e --- /dev/null +++ b/e-suite.Database.SqlServer/e-suite.Database.SqlServer/Migrations/20260311161348_addingTaskType.cs @@ -0,0 +1,31 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace esuite.Database.SqlServer.Migrations +{ + /// + public partial class addingTaskType : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "TaskType", + schema: "Activity", + table: "ActivityTasks", + type: "nvarchar(max)", + nullable: false, + defaultValue: ""); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "TaskType", + schema: "Activity", + table: "ActivityTasks"); + } + } +} diff --git a/e-suite.Database.SqlServer/e-suite.Database.SqlServer/Migrations/SqlEsuiteDatabaseDbContextModelSnapshot.cs b/e-suite.Database.SqlServer/e-suite.Database.SqlServer/Migrations/SqlEsuiteDatabaseDbContextModelSnapshot.cs index 5e76deb..c9e8dac 100644 --- a/e-suite.Database.SqlServer/e-suite.Database.SqlServer/Migrations/SqlEsuiteDatabaseDbContextModelSnapshot.cs +++ b/e-suite.Database.SqlServer/e-suite.Database.SqlServer/Migrations/SqlEsuiteDatabaseDbContextModelSnapshot.cs @@ -17,7 +17,7 @@ namespace esuite.Database.SqlServer.Migrations { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("ProductVersion", "10.0.3") + .HasAnnotation("ProductVersion", "10.0.4") .HasAnnotation("Relational:MaxIdentifierLength", 128); SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); @@ -196,6 +196,10 @@ namespace esuite.Database.SqlServer.Migrations .IsRequired() .HasColumnType("nvarchar(max)"); + b.Property("TaskType") + .IsRequired() + .HasColumnType("nvarchar(max)"); + b.HasKey("Id"); b.HasIndex("Guid") diff --git a/e-suite.Database.SqlServer/e-suite.Database.SqlServer/e-suite.Database.SqlServer.csproj b/e-suite.Database.SqlServer/e-suite.Database.SqlServer/e-suite.Database.SqlServer.csproj index 533832e..60f5fdf 100644 --- a/e-suite.Database.SqlServer/e-suite.Database.SqlServer/e-suite.Database.SqlServer.csproj +++ b/e-suite.Database.SqlServer/e-suite.Database.SqlServer/e-suite.Database.SqlServer.csproj @@ -13,8 +13,8 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/e-suite.DependencyInjection.UnitTests/e-suite.DependencyInjection.UnitTests.csproj b/e-suite.DependencyInjection.UnitTests/e-suite.DependencyInjection.UnitTests.csproj index 26f5643..3f356d3 100644 --- a/e-suite.DependencyInjection.UnitTests/e-suite.DependencyInjection.UnitTests.csproj +++ b/e-suite.DependencyInjection.UnitTests/e-suite.DependencyInjection.UnitTests.csproj @@ -10,7 +10,7 @@ - + diff --git a/e-suite.DependencyInjection/e-suite.DependencyInjection.csproj b/e-suite.DependencyInjection/e-suite.DependencyInjection.csproj index 5fa372e..2e2a655 100644 --- a/e-suite.DependencyInjection/e-suite.DependencyInjection.csproj +++ b/e-suite.DependencyInjection/e-suite.DependencyInjection.csproj @@ -16,7 +16,7 @@ - - + + diff --git a/e-suite.Manager.BlockedIPs/e-suite.Modules.BlockedIPsManager.UnitTests/e-suite.Modules.BlockedIPsManager.UnitTests.csproj b/e-suite.Manager.BlockedIPs/e-suite.Modules.BlockedIPsManager.UnitTests/e-suite.Modules.BlockedIPsManager.UnitTests.csproj index 31cb8c7..44aafc3 100644 --- a/e-suite.Manager.BlockedIPs/e-suite.Modules.BlockedIPsManager.UnitTests/e-suite.Modules.BlockedIPsManager.UnitTests.csproj +++ b/e-suite.Manager.BlockedIPs/e-suite.Modules.BlockedIPsManager.UnitTests/e-suite.Modules.BlockedIPsManager.UnitTests.csproj @@ -12,9 +12,9 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/e-suite.MessageProcessor/e-suite.MessageProcessor.UnitTests/e-suite.MessageProcessor.UnitTests.csproj b/e-suite.MessageProcessor/e-suite.MessageProcessor.UnitTests/e-suite.MessageProcessor.UnitTests.csproj index 5612c31..780f9a4 100644 --- a/e-suite.MessageProcessor/e-suite.MessageProcessor.UnitTests/e-suite.MessageProcessor.UnitTests.csproj +++ b/e-suite.MessageProcessor/e-suite.MessageProcessor.UnitTests/e-suite.MessageProcessor.UnitTests.csproj @@ -10,7 +10,7 @@ - + diff --git a/e-suite.Messaging.Common/e-suite.Messaging.Common.UnitTests/e-suite.Messaging.Common.UnitTests.csproj b/e-suite.Messaging.Common/e-suite.Messaging.Common.UnitTests/e-suite.Messaging.Common.UnitTests.csproj index 5bc571c..0f59036 100644 --- a/e-suite.Messaging.Common/e-suite.Messaging.Common.UnitTests/e-suite.Messaging.Common.UnitTests.csproj +++ b/e-suite.Messaging.Common/e-suite.Messaging.Common.UnitTests/e-suite.Messaging.Common.UnitTests.csproj @@ -10,7 +10,7 @@ - + diff --git a/e-suite.Messaging.Common/e-suite.Messaging.Common/e-suite.Messaging.Common.csproj b/e-suite.Messaging.Common/e-suite.Messaging.Common/e-suite.Messaging.Common.csproj index 0d23ff5..fae511c 100644 --- a/e-suite.Messaging.Common/e-suite.Messaging.Common/e-suite.Messaging.Common.csproj +++ b/e-suite.Messaging.Common/e-suite.Messaging.Common/e-suite.Messaging.Common.csproj @@ -8,7 +8,7 @@ - + diff --git a/e-suite.Modules.AuditLog/AuditLog.UnitTests/AuditLog.UnitTests.csproj b/e-suite.Modules.AuditLog/AuditLog.UnitTests/AuditLog.UnitTests.csproj index 1ddf795..842991b 100644 --- a/e-suite.Modules.AuditLog/AuditLog.UnitTests/AuditLog.UnitTests.csproj +++ b/e-suite.Modules.AuditLog/AuditLog.UnitTests/AuditLog.UnitTests.csproj @@ -9,7 +9,7 @@ - + diff --git a/e-suite.Modules.CustomFieldsManager/e_suite.Modules.CusomFieldManagerUnitTest/e_suite.Modules.CustomFieldManagerUnitTests.csproj b/e-suite.Modules.CustomFieldsManager/e_suite.Modules.CusomFieldManagerUnitTest/e_suite.Modules.CustomFieldManagerUnitTests.csproj index 10fadb4..b4efd04 100644 --- a/e-suite.Modules.CustomFieldsManager/e_suite.Modules.CusomFieldManagerUnitTest/e_suite.Modules.CustomFieldManagerUnitTests.csproj +++ b/e-suite.Modules.CustomFieldsManager/e_suite.Modules.CusomFieldManagerUnitTest/e_suite.Modules.CustomFieldManagerUnitTests.csproj @@ -12,9 +12,9 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/e-suite.Modules.DomainManager/e-suite.Modules.DomainManager.UnitTests/e-suite.Modules.DomainManager.UnitTests.csproj b/e-suite.Modules.DomainManager/e-suite.Modules.DomainManager.UnitTests/e-suite.Modules.DomainManager.UnitTests.csproj index d7f2f66..584d6b0 100644 --- a/e-suite.Modules.DomainManager/e-suite.Modules.DomainManager.UnitTests/e-suite.Modules.DomainManager.UnitTests.csproj +++ b/e-suite.Modules.DomainManager/e-suite.Modules.DomainManager.UnitTests/e-suite.Modules.DomainManager.UnitTests.csproj @@ -11,7 +11,7 @@ - + diff --git a/e-suite.Modules.ExceptionLogManager/e-suite.Modules.ExceptionLogManager.UnitTests/e-suite.Modules.ExceptionLogManager.UnitTests.csproj b/e-suite.Modules.ExceptionLogManager/e-suite.Modules.ExceptionLogManager.UnitTests/e-suite.Modules.ExceptionLogManager.UnitTests.csproj index c977ca7..207ce27 100644 --- a/e-suite.Modules.ExceptionLogManager/e-suite.Modules.ExceptionLogManager.UnitTests/e-suite.Modules.ExceptionLogManager.UnitTests.csproj +++ b/e-suite.Modules.ExceptionLogManager/e-suite.Modules.ExceptionLogManager.UnitTests/e-suite.Modules.ExceptionLogManager.UnitTests.csproj @@ -12,9 +12,9 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/e-suite.Modules.FormsManager/e_suite.Modules.Form.ManagerUnitTest/e_suite.Modules.FormsManagerUnitTests.csproj b/e-suite.Modules.FormsManager/e_suite.Modules.Form.ManagerUnitTest/e_suite.Modules.FormsManagerUnitTests.csproj index 591b3e1..96f660a 100644 --- a/e-suite.Modules.FormsManager/e_suite.Modules.Form.ManagerUnitTest/e_suite.Modules.FormsManagerUnitTests.csproj +++ b/e-suite.Modules.FormsManager/e_suite.Modules.Form.ManagerUnitTest/e_suite.Modules.FormsManagerUnitTests.csproj @@ -11,9 +11,9 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/e-suite.Modules.GlossariesManager/GlossariesManager.UnitTests/GlossariesManager.UnitTests.csproj b/e-suite.Modules.GlossariesManager/GlossariesManager.UnitTests/GlossariesManager.UnitTests.csproj index 7aa5328..5691ecc 100644 --- a/e-suite.Modules.GlossariesManager/GlossariesManager.UnitTests/GlossariesManager.UnitTests.csproj +++ b/e-suite.Modules.GlossariesManager/GlossariesManager.UnitTests/GlossariesManager.UnitTests.csproj @@ -10,7 +10,7 @@ - + diff --git a/e-suite.Modules.MailTemplatesManager/e-suite.Modules.MailTemplatesManager.UnitTests/e-suite.Modules.MailTemplatesManager.UnitTests.csproj b/e-suite.Modules.MailTemplatesManager/e-suite.Modules.MailTemplatesManager.UnitTests/e-suite.Modules.MailTemplatesManager.UnitTests.csproj index 26b80b4..32a1518 100644 --- a/e-suite.Modules.MailTemplatesManager/e-suite.Modules.MailTemplatesManager.UnitTests/e-suite.Modules.MailTemplatesManager.UnitTests.csproj +++ b/e-suite.Modules.MailTemplatesManager/e-suite.Modules.MailTemplatesManager.UnitTests/e-suite.Modules.MailTemplatesManager.UnitTests.csproj @@ -9,7 +9,7 @@ - + diff --git a/e-suite.Modules.OrganisationManager/e-Suite.Modules.OrganisationManger.UnitTests/e-suite.Modules.OrganisationsManager.UnitTests.csproj b/e-suite.Modules.OrganisationManager/e-Suite.Modules.OrganisationManger.UnitTests/e-suite.Modules.OrganisationsManager.UnitTests.csproj index 6d14e8c..b369178 100644 --- a/e-suite.Modules.OrganisationManager/e-Suite.Modules.OrganisationManger.UnitTests/e-suite.Modules.OrganisationsManager.UnitTests.csproj +++ b/e-suite.Modules.OrganisationManager/e-Suite.Modules.OrganisationManger.UnitTests/e-suite.Modules.OrganisationsManager.UnitTests.csproj @@ -11,9 +11,9 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/e-suite.Modules.PerformanceManager/e-suite.Modules.PerformanceManager/obj/e-suite.Modules.PerformanceManager.csproj.nuget.g.props b/e-suite.Modules.PerformanceManager/e-suite.Modules.PerformanceManager/obj/e-suite.Modules.PerformanceManager.csproj.nuget.g.props index 34cdfde..02a5a98 100644 --- a/e-suite.Modules.PerformanceManager/e-suite.Modules.PerformanceManager/obj/e-suite.Modules.PerformanceManager.csproj.nuget.g.props +++ b/e-suite.Modules.PerformanceManager/e-suite.Modules.PerformanceManager/obj/e-suite.Modules.PerformanceManager.csproj.nuget.g.props @@ -14,6 +14,6 @@ - + \ No newline at end of file diff --git a/e-suite.Modules.PerformanceManager/e-suite.Modules.PerformanceManager/obj/e-suite.Modules.PerformanceManager.csproj.nuget.g.targets b/e-suite.Modules.PerformanceManager/e-suite.Modules.PerformanceManager/obj/e-suite.Modules.PerformanceManager.csproj.nuget.g.targets index 89055c1..3d8b966 100644 --- a/e-suite.Modules.PerformanceManager/e-suite.Modules.PerformanceManager/obj/e-suite.Modules.PerformanceManager.csproj.nuget.g.targets +++ b/e-suite.Modules.PerformanceManager/e-suite.Modules.PerformanceManager/obj/e-suite.Modules.PerformanceManager.csproj.nuget.g.targets @@ -1,8 +1,8 @@  - - - + + + \ No newline at end of file diff --git a/e-suite.Modules.RoleManager/e-suite.Modules.RoleManager.UnitTests/e-suite.Modules.RoleManager.UnitTests.csproj b/e-suite.Modules.RoleManager/e-suite.Modules.RoleManager.UnitTests/e-suite.Modules.RoleManager.UnitTests.csproj index b380acc..3d24184 100644 --- a/e-suite.Modules.RoleManager/e-suite.Modules.RoleManager.UnitTests/e-suite.Modules.RoleManager.UnitTests.csproj +++ b/e-suite.Modules.RoleManager/e-suite.Modules.RoleManager.UnitTests/e-suite.Modules.RoleManager.UnitTests.csproj @@ -11,7 +11,7 @@ - + diff --git a/e-suite.Modules.RunningActivityManager/repository/ActivityRepository.cs b/e-suite.Modules.RunningActivityManager/repository/ActivityRepository.cs index 79a45d1..519732a 100644 --- a/e-suite.Modules.RunningActivityManager/repository/ActivityRepository.cs +++ b/e-suite.Modules.RunningActivityManager/repository/ActivityRepository.cs @@ -46,4 +46,13 @@ public class ActivityRepository : RepositoryBase, IActivityRepository DatabaseDbContext.ActivityTasks.AddRange(activityTasks); await DatabaseDbContext.SaveChangesAsync(auditUserDetails, cancellationToken); } + + public async Task UpdateActivityTasksAsync( + AuditUserDetails auditUserDetails, + ICollection tasks, + CancellationToken cancellationToken + ) + { + await DatabaseDbContext.SaveChangesAsync(auditUserDetails, cancellationToken); + } } \ No newline at end of file diff --git a/e-suite.Modules.SSOManager/SSOManager.UnitTests/SSOManager.UnitTests.csproj b/e-suite.Modules.SSOManager/SSOManager.UnitTests/SSOManager.UnitTests.csproj index 8f96970..ab2da07 100644 --- a/e-suite.Modules.SSOManager/SSOManager.UnitTests/SSOManager.UnitTests.csproj +++ b/e-suite.Modules.SSOManager/SSOManager.UnitTests/SSOManager.UnitTests.csproj @@ -9,7 +9,7 @@ - + diff --git a/e-suite.Modules.SequenceManager/SequenceManager.UnitTests/SequenceManager.UnitTests.csproj b/e-suite.Modules.SequenceManager/SequenceManager.UnitTests/SequenceManager.UnitTests.csproj index 97ff703..3a73566 100644 --- a/e-suite.Modules.SequenceManager/SequenceManager.UnitTests/SequenceManager.UnitTests.csproj +++ b/e-suite.Modules.SequenceManager/SequenceManager.UnitTests/SequenceManager.UnitTests.csproj @@ -11,9 +11,9 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/e-suite.Modules.SiteManager/e-suite.Modules.SiteManager.UnitTests/e-suite.Modules.SiteManager.UnitTests.csproj b/e-suite.Modules.SiteManager/e-suite.Modules.SiteManager.UnitTests/e-suite.Modules.SiteManager.UnitTests.csproj index a022076..af1c799 100644 --- a/e-suite.Modules.SiteManager/e-suite.Modules.SiteManager.UnitTests/e-suite.Modules.SiteManager.UnitTests.csproj +++ b/e-suite.Modules.SiteManager/e-suite.Modules.SiteManager.UnitTests/e-suite.Modules.SiteManager.UnitTests.csproj @@ -11,7 +11,7 @@ - + diff --git a/e-suite.Modules.SpecificationManager/e-suite.Modules.SpecificationManager.UnitTests/e-suite.Modules.SpecificationManager.UnitTests.csproj b/e-suite.Modules.SpecificationManager/e-suite.Modules.SpecificationManager.UnitTests/e-suite.Modules.SpecificationManager.UnitTests.csproj index 7072966..819e066 100644 --- a/e-suite.Modules.SpecificationManager/e-suite.Modules.SpecificationManager.UnitTests/e-suite.Modules.SpecificationManager.UnitTests.csproj +++ b/e-suite.Modules.SpecificationManager/e-suite.Modules.SpecificationManager.UnitTests/e-suite.Modules.SpecificationManager.UnitTests.csproj @@ -11,7 +11,7 @@ - +
diff --git a/e-suite.Modules.UserManager/UserManager.UnitTests/UserManager.UnitTests.csproj b/e-suite.Modules.UserManager/UserManager.UnitTests/UserManager.UnitTests.csproj index ca998a0..5719cf5 100644 --- a/e-suite.Modules.UserManager/UserManager.UnitTests/UserManager.UnitTests.csproj +++ b/e-suite.Modules.UserManager/UserManager.UnitTests/UserManager.UnitTests.csproj @@ -9,7 +9,7 @@ - + diff --git a/e-suite.Modules.UserManager/e-suite.Modules.UserManager/e-suite.Modules.UserManager.csproj b/e-suite.Modules.UserManager/e-suite.Modules.UserManager/e-suite.Modules.UserManager.csproj index 5b4dcfd..ef063bf 100644 --- a/e-suite.Modules.UserManager/e-suite.Modules.UserManager/e-suite.Modules.UserManager.csproj +++ b/e-suite.Modules.UserManager/e-suite.Modules.UserManager/e-suite.Modules.UserManager.csproj @@ -9,9 +9,9 @@ - - - + + + diff --git a/e-suite.Nuget.PasswordHasher/e-suite.Nuget.PasswordHasher.UnitTests/e-suite.Nuget.PasswordHasher.UnitTests.csproj b/e-suite.Nuget.PasswordHasher/e-suite.Nuget.PasswordHasher.UnitTests/e-suite.Nuget.PasswordHasher.UnitTests.csproj index dc6c174..32950a1 100644 --- a/e-suite.Nuget.PasswordHasher/e-suite.Nuget.PasswordHasher.UnitTests/e-suite.Nuget.PasswordHasher.UnitTests.csproj +++ b/e-suite.Nuget.PasswordHasher/e-suite.Nuget.PasswordHasher.UnitTests/e-suite.Nuget.PasswordHasher.UnitTests.csproj @@ -9,7 +9,7 @@ - + diff --git a/e-suite.Scheduler/e-suite.Scheduler.UnitTests/e-suite.Scheduler.UnitTests.csproj b/e-suite.Scheduler/e-suite.Scheduler.UnitTests/e-suite.Scheduler.UnitTests.csproj index e845639..1cd9adc 100644 --- a/e-suite.Scheduler/e-suite.Scheduler.UnitTests/e-suite.Scheduler.UnitTests.csproj +++ b/e-suite.Scheduler/e-suite.Scheduler.UnitTests/e-suite.Scheduler.UnitTests.csproj @@ -10,7 +10,7 @@ - + diff --git a/e-suite.Scheduler/e-suite.Scheduler/e-suite.Scheduler.csproj b/e-suite.Scheduler/e-suite.Scheduler/e-suite.Scheduler.csproj index ce329b9..cd8a314 100644 --- a/e-suite.Scheduler/e-suite.Scheduler/e-suite.Scheduler.csproj +++ b/e-suite.Scheduler/e-suite.Scheduler/e-suite.Scheduler.csproj @@ -10,7 +10,7 @@ - + diff --git a/e-suite.Service.CustomFieldValidation/e-suite.Service.CustomFieldValidationUnitTests/e-suite.Service.CustomFieldValidation.UnitTests.csproj b/e-suite.Service.CustomFieldValidation/e-suite.Service.CustomFieldValidationUnitTests/e-suite.Service.CustomFieldValidation.UnitTests.csproj index b1e0b5c..9e53bc1 100644 --- a/e-suite.Service.CustomFieldValidation/e-suite.Service.CustomFieldValidationUnitTests/e-suite.Service.CustomFieldValidation.UnitTests.csproj +++ b/e-suite.Service.CustomFieldValidation/e-suite.Service.CustomFieldValidationUnitTests/e-suite.Service.CustomFieldValidation.UnitTests.csproj @@ -10,7 +10,7 @@ - + diff --git a/e-suite.Service.EFlowSync/e-suite.Service.EFlowSync.UnitTests/e-suite.Service.EFlowSync.UnitTests.csproj b/e-suite.Service.EFlowSync/e-suite.Service.EFlowSync.UnitTests/e-suite.Service.EFlowSync.UnitTests.csproj index e149fd6..5f4f7bf 100644 --- a/e-suite.Service.EFlowSync/e-suite.Service.EFlowSync.UnitTests/e-suite.Service.EFlowSync.UnitTests.csproj +++ b/e-suite.Service.EFlowSync/e-suite.Service.EFlowSync.UnitTests/e-suite.Service.EFlowSync.UnitTests.csproj @@ -10,7 +10,7 @@ - + diff --git a/e-suite.Service.EFlowSync/e-suite.Service.EFlowSync/e-suite.Service.EFlowSync.csproj b/e-suite.Service.EFlowSync/e-suite.Service.EFlowSync/e-suite.Service.EFlowSync.csproj index 49aed3b..43fac67 100644 --- a/e-suite.Service.EFlowSync/e-suite.Service.EFlowSync/e-suite.Service.EFlowSync.csproj +++ b/e-suite.Service.EFlowSync/e-suite.Service.EFlowSync/e-suite.Service.EFlowSync.csproj @@ -18,7 +18,7 @@ - + diff --git a/e-suite.Service.Mail/e-suite.Service.Mail.UnitTests/e-suite.Service.Mail.UnitTests.csproj b/e-suite.Service.Mail/e-suite.Service.Mail.UnitTests/e-suite.Service.Mail.UnitTests.csproj index ece4e13..112a8e9 100644 --- a/e-suite.Service.Mail/e-suite.Service.Mail.UnitTests/e-suite.Service.Mail.UnitTests.csproj +++ b/e-suite.Service.Mail/e-suite.Service.Mail.UnitTests/e-suite.Service.Mail.UnitTests.csproj @@ -11,7 +11,7 @@ - + diff --git a/e-suite.Service.Mail/e-suite.Service.Mail/e-suite.Service.Mail.csproj b/e-suite.Service.Mail/e-suite.Service.Mail/e-suite.Service.Mail.csproj index 827795f..cfaf796 100644 --- a/e-suite.Service.Mail/e-suite.Service.Mail/e-suite.Service.Mail.csproj +++ b/e-suite.Service.Mail/e-suite.Service.Mail/e-suite.Service.Mail.csproj @@ -8,7 +8,7 @@ - + diff --git a/e-suite.Service.Performance/e-suite.Service.Performance.UnitTests/e-suite.Service.Performance.UnitTests.csproj b/e-suite.Service.Performance/e-suite.Service.Performance.UnitTests/e-suite.Service.Performance.UnitTests.csproj index 0a83374..09c0534 100644 --- a/e-suite.Service.Performance/e-suite.Service.Performance.UnitTests/e-suite.Service.Performance.UnitTests.csproj +++ b/e-suite.Service.Performance/e-suite.Service.Performance.UnitTests/e-suite.Service.Performance.UnitTests.csproj @@ -12,9 +12,9 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/e-suite.Service.Sentinel/Sentinel.UnitTests/Sentinel.UnitTests.csproj b/e-suite.Service.Sentinel/Sentinel.UnitTests/Sentinel.UnitTests.csproj index 7ecd8eb..0bb6dcd 100644 --- a/e-suite.Service.Sentinel/Sentinel.UnitTests/Sentinel.UnitTests.csproj +++ b/e-suite.Service.Sentinel/Sentinel.UnitTests/Sentinel.UnitTests.csproj @@ -9,7 +9,7 @@ - + diff --git a/e-suite.Service.SigmaImporter/SigmaImporter.UnitTests/SigmaImporter.UnitTests.csproj b/e-suite.Service.SigmaImporter/SigmaImporter.UnitTests/SigmaImporter.UnitTests.csproj index 9585395..5399325 100644 --- a/e-suite.Service.SigmaImporter/SigmaImporter.UnitTests/SigmaImporter.UnitTests.csproj +++ b/e-suite.Service.SigmaImporter/SigmaImporter.UnitTests/SigmaImporter.UnitTests.csproj @@ -9,7 +9,7 @@ - + diff --git a/e-suite.Service.SigmaImporter/e-suite.Service.SigmaImporter/e-suite.Service.SigmaImporter.csproj b/e-suite.Service.SigmaImporter/e-suite.Service.SigmaImporter/e-suite.Service.SigmaImporter.csproj index ab63198..cdf7529 100644 --- a/e-suite.Service.SigmaImporter/e-suite.Service.SigmaImporter/e-suite.Service.SigmaImporter.csproj +++ b/e-suite.Service.SigmaImporter/e-suite.Service.SigmaImporter/e-suite.Service.SigmaImporter.csproj @@ -21,7 +21,7 @@ - + diff --git a/e-suite.Service.WorkflowProcessor/WorkflowProcessor.cs b/e-suite.Service.WorkflowProcessor/WorkflowProcessor.cs index e2d3d8c..276c7eb 100644 --- a/e-suite.Service.WorkflowProcessor/WorkflowProcessor.cs +++ b/e-suite.Service.WorkflowProcessor/WorkflowProcessor.cs @@ -2,7 +2,7 @@ using e_suite.Database.Audit; using e_suite.Database.Core.Tables.Activity; using e_suite.Workflow.Core; -using e_suite.Workflow.Core.Interfaces; +using e_suite.Workflow.Core.Extensions; using eSuite.Core.Clock; using eSuite.Core.Enums; using eSuite.Core.Miscellaneous; @@ -58,9 +58,10 @@ public class WorkflowProcessor : IWorkflowProcessor var workflowVersion = _workflowConverter.DeserialiseFromDatabase(activityInstance.WorkflowVersion); + bool hasCompletedTask = false; + await _activityRepository.TransactionAsync(async () => { - ICollection tasks; if (activityInstance.ActivityState == ActivityState.Pending) { @@ -69,14 +70,37 @@ public class WorkflowProcessor : IWorkflowProcessor cancellationToken); tasks = await PlanTaskExecution(auditUserDetails, activityInstance, workflowVersion, cancellationToken); - } - else - { - tasks = activityInstance.Tasks; - } - //Invoke startable tasks. + await StartInitialTasks(auditUserDetails, tasks, workflowVersion, cancellationToken); + + if (tasks.Any(task => task.ActivityState == ActivityState.ReadyToComplete)) + { + hasCompletedTask = true; + } + } }); + + if (hasCompletedTask) + { + //send workflow progress message here. + } + } + + private async Task StartInitialTasks(AuditUserDetails auditUserDetails, ICollection tasks, WorkflowVersion workflowVersion, CancellationToken cancellationToken) + { + var startTasks = workflowVersion.GetStartTasks().ToList(); + var startTaskGuids = startTasks.Select(t => t.Guid).ToHashSet(); + + foreach (var task in tasks) + { + if (startTaskGuids.Contains(task.TaskGuid)) + { + var taskDefinition = workflowVersion.FindTask(task.TaskGuid)!; + await taskDefinition.StartTask(task, _clock); + } + } + + await _activityRepository.UpdateActivityTasksAsync(auditUserDetails, tasks, cancellationToken); } private async Task> PlanTaskExecution(AuditUserDetails auditUserDetails, Activity activityInstance, WorkflowVersion workflowVersion, CancellationToken cancellationToken) @@ -94,8 +118,10 @@ public class WorkflowProcessor : IWorkflowProcessor Activity = activityInstance, ActivityState = ActivityState.Pending, TaskGuid = task.Guid, - ActivityOrdinal = activityOrdinalCounter++, + TaskType = task.GetType().FullName!, TaskName = task.Name, + ActivityOrdinal = activityOrdinalCounter++, + }; activityTasks.Add(activityTask); diff --git a/e-suite.Service.WorkflowProcessor/e-suite.Service.WorkflowProcessor.csproj b/e-suite.Service.WorkflowProcessor/e-suite.Service.WorkflowProcessor.csproj index 87e1697..d53fb97 100644 --- a/e-suite.Service.WorkflowProcessor/e-suite.Service.WorkflowProcessor.csproj +++ b/e-suite.Service.WorkflowProcessor/e-suite.Service.WorkflowProcessor.csproj @@ -8,7 +8,7 @@ - + diff --git a/e-suite.UnitTest.Core/e-suite.UnitTestCore/e-suite.UnitTestCore.csproj b/e-suite.UnitTest.Core/e-suite.UnitTestCore/e-suite.UnitTestCore.csproj index 2354bc0..2d1a160 100644 --- a/e-suite.UnitTest.Core/e-suite.UnitTestCore/e-suite.UnitTestCore.csproj +++ b/e-suite.UnitTest.Core/e-suite.UnitTestCore/e-suite.UnitTestCore.csproj @@ -8,7 +8,7 @@ - + diff --git a/e-suite.Utilities.Pagination/e-suite.Utilities.Pagination.UnitTests/e-suite.Utilities.Pagination.UnitTests.csproj b/e-suite.Utilities.Pagination/e-suite.Utilities.Pagination.UnitTests/e-suite.Utilities.Pagination.UnitTests.csproj index a2df472..1cb3a8b 100644 --- a/e-suite.Utilities.Pagination/e-suite.Utilities.Pagination.UnitTests/e-suite.Utilities.Pagination.UnitTests.csproj +++ b/e-suite.Utilities.Pagination/e-suite.Utilities.Pagination.UnitTests/e-suite.Utilities.Pagination.UnitTests.csproj @@ -11,7 +11,7 @@ - + diff --git a/e-suite.Utilities.Pagination/e-suite.Utilities.Pagination/e-suite.Utilities.Pagination.csproj b/e-suite.Utilities.Pagination/e-suite.Utilities.Pagination/e-suite.Utilities.Pagination.csproj index a2b9c3c..480bd75 100644 --- a/e-suite.Utilities.Pagination/e-suite.Utilities.Pagination/e-suite.Utilities.Pagination.csproj +++ b/e-suite.Utilities.Pagination/e-suite.Utilities.Pagination/e-suite.Utilities.Pagination.csproj @@ -8,7 +8,7 @@ - + diff --git a/e-suite.Workflow.Core/Enums/DefaultOutcome.cs b/e-suite.Workflow.Core/Enums/DefaultOutcome.cs new file mode 100644 index 0000000..bfc0009 --- /dev/null +++ b/e-suite.Workflow.Core/Enums/DefaultOutcome.cs @@ -0,0 +1,6 @@ +namespace e_suite.Workflow.Core.Enums; + +public enum DefaultOutcome +{ + Complete +} \ No newline at end of file diff --git a/e-suite.Workflow.Core/Extensions/ObjectExtensions.cs b/e-suite.Workflow.Core/Extensions/ObjectExtensions.cs index 37bdfea..fc23b0c 100644 --- a/e-suite.Workflow.Core/Extensions/ObjectExtensions.cs +++ b/e-suite.Workflow.Core/Extensions/ObjectExtensions.cs @@ -2,8 +2,11 @@ public static class ObjectExtensions { - public static bool In(this T obj, params T[] args) + extension(T obj) { - return args.Contains(obj); + public bool In(params T[] args) + { + return args.Contains(obj); + } } } \ No newline at end of file diff --git a/e-suite.Workflow.Core/Extensions/StageExtensions.cs b/e-suite.Workflow.Core/Extensions/StageExtensions.cs index cb4ec2d..5df949e 100644 --- a/e-suite.Workflow.Core/Extensions/StageExtensions.cs +++ b/e-suite.Workflow.Core/Extensions/StageExtensions.cs @@ -1,6 +1,8 @@ -using System.Collections.Concurrent; -using e_suite.Workflow.Core.Attributes; +using e_suite.Workflow.Core.Attributes; using e_suite.Workflow.Core.Interfaces; +using e_suite.Workflow.Core.Tasks; +using System.Collections.Concurrent; +using static System.Net.Mime.MediaTypeNames; namespace e_suite.Workflow.Core.Extensions; @@ -92,10 +94,44 @@ public static class StageExtensions }); } - public static IEnumerable AllowedTasks(this IStage stage) - where T : TaskTypeAttribute + extension(IStage stage) where T : TaskTypeAttribute { - var attributeType = typeof(T); - return GetAllowedTaskTypes(attributeType); + public IEnumerable AllowedTasks() + { + var attributeType = typeof(T); + return GetAllowedTaskTypes(attributeType); + } + } + + extension(IStage stage) + { + public IEnumerable GetAllTargets() + { + return stage.Tasks.SelectMany(t => t.GetTargetGuids()).Distinct(); + } + + public IEnumerable GetStartTasks() + { + var allTargets = stage.GetAllTargets().ToHashSet(); + return stage.Tasks.Where(t => !allTargets.Contains(t.Guid)); + } + + public ITask? FindTask(Guid taskGuid, bool deepScan = true) + { + foreach (var task in stage.Tasks) + { + if (task.Guid == taskGuid) + return task; + + if (!deepScan || task is not IStage nestedStage) + continue; + + var found = nestedStage.FindTask(taskGuid, deepScan); + if (found != null) + return found; + } + + return null; + } } } \ No newline at end of file diff --git a/e-suite.Workflow.Core/Extensions/TaskExtensions.cs b/e-suite.Workflow.Core/Extensions/TaskExtensions.cs index d0eb4e5..d9c42c5 100644 --- a/e-suite.Workflow.Core/Extensions/TaskExtensions.cs +++ b/e-suite.Workflow.Core/Extensions/TaskExtensions.cs @@ -1,38 +1,41 @@ using e_suite.Database.Core.Models; -using e_suite.Database.Core.Tables.Contacts; -using e_suite.Database.Core.Tables.Domain; +using e_suite.Database.Core.Tables.Activity; using e_suite.Workflow.Core.Attributes; using e_suite.Workflow.Core.Interfaces; -using eSuite.Core.Miscellaneous; +using eSuite.Core.Clock; +using eSuite.Core.Enums; +using System.Collections; using System.Reflection; using System.Text.Json; -using System.Text.Json.Serialization; namespace e_suite.Workflow.Core.Extensions; public static class TaskExtensions { - private static Dictionary ToConfigDictionary(this ITask task) + extension(ITask task) { - var dictionary = new Dictionary(); - - var type = task.GetType(); - var properties = type.GetProperties(BindingFlags.Public | BindingFlags.Instance); - - foreach (var prop in properties) + private Dictionary ToConfigDictionary() { - if (!prop.CanRead) - continue; + var dictionary = new Dictionary(); - if (!prop.CanWrite) - continue; + var type = task.GetType(); + var properties = type.GetProperties(BindingFlags.Public | BindingFlags.Instance); - var value = prop.GetValue(task); + foreach (var prop in properties) + { + if (!prop.CanRead) + continue; - dictionary[prop.Name] = value; + if (!prop.CanWrite) + continue; + + var value = prop.GetValue(task); + + dictionary[prop.Name] = value; + } + + return dictionary; } - - return dictionary; } public static ITask ToTask(this TaskDefinition definition, JsonSerializerOptions jsonSerializerOptions) @@ -87,37 +90,7 @@ public static class TaskExtensions prop.SetValue(obj, value); } } - - public static TaskDefinition ToDefinition(this ITask task) - { - if (task is null) - throw new NullReferenceException(); - - - return new TaskDefinition - { - Type = task.GetType().FullName, - Config = task.ToConfigDictionary() - }; - } - - //public static TaskDefinition ToDefinition(this ITask task) - //{ - // if (task is ITemplateValidatable v) - // { - // var errors = v.ValidateForTemplate().ToList(); - // if (errors.Count != 0) - // throw new InvalidOperationException( - // $"Task {task.GetType().Name} is invalid: {string.Join("; ", errors)}"); - // } - - // return new TaskDefinition - // { - // Type = task.GetType().FullName!, - // Config = ExtractConfig(task) - // }; - //} - + private static Dictionary ExtractConfig(object task) { var dict = new Dictionary(); @@ -136,6 +109,48 @@ public static class TaskExtensions return dict; } + + extension(ITask task) + { + public TaskDefinition ToDefinition() + { + if (task is null) + throw new NullReferenceException(); + + + return new TaskDefinition + { + Type = task.GetType().FullName!, + Config = task.ToConfigDictionary()! + }; + } + + public IEnumerable GetTargetGuids() + { + var outcomeInterface = task.GetType() + .GetInterfaces() + .FirstOrDefault(i => i.IsGenericType && + i.GetGenericTypeDefinition() == typeof(IOutcome<>)); + + if (outcomeInterface == null) + return Enumerable.Empty(); + + var prop = outcomeInterface.GetProperty("OutcomeActions"); + var dict = (IDictionary)prop.GetValue(task); + + return dict!.Values.Cast(); + } + + public async Task StartTask(ActivityTask activityTask, IClock clock) + { + activityTask.ActivityState = ActivityState.Active; + activityTask.StartDateTime = clock.GetNow; + + await task.OnStartedAsync(activityTask); + } + + } + //public static ITask ToTask(this TaskDefinition def) //{ diff --git a/e-suite.Workflow.Core/Interfaces/IJoin.cs b/e-suite.Workflow.Core/Interfaces/IJoin.cs new file mode 100644 index 0000000..ea784b2 --- /dev/null +++ b/e-suite.Workflow.Core/Interfaces/IJoin.cs @@ -0,0 +1,6 @@ +namespace e_suite.Workflow.Core.Interfaces; + +public interface IJoin +{ + List WaitFor { get; } +} \ No newline at end of file diff --git a/e-suite.Workflow.Core/Interfaces/IOutcome.cs b/e-suite.Workflow.Core/Interfaces/IOutcome.cs index b069490..eb6c9d5 100644 --- a/e-suite.Workflow.Core/Interfaces/IOutcome.cs +++ b/e-suite.Workflow.Core/Interfaces/IOutcome.cs @@ -9,5 +9,4 @@ public interface IOutcome //public T? TaskOutcome { get; set; } Dictionary OutcomeActions { get; set; } - bool OverrideDefaultTaskProgression { get; set; } } \ No newline at end of file diff --git a/e-suite.Workflow.Core/Interfaces/IStage.cs b/e-suite.Workflow.Core/Interfaces/IStage.cs index 587b606..c11c81d 100644 --- a/e-suite.Workflow.Core/Interfaces/IStage.cs +++ b/e-suite.Workflow.Core/Interfaces/IStage.cs @@ -3,12 +3,17 @@ using e_suite.Workflow.Core.Attributes; namespace e_suite.Workflow.Core.Interfaces; -[TaskCapability] -public interface IStage where T : TaskTypeAttribute +public interface IStage { /// /// Tasks that need to be completed before this stage of a workflow is considered complete. /// [Required] ICollection Tasks { get; } +} + + +[TaskCapability] +public interface IStage : IStage where T : TaskTypeAttribute +{ } \ 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 8694e89..7607ac0 100644 --- a/e-suite.Workflow.Core/Interfaces/ITask.cs +++ b/e-suite.Workflow.Core/Interfaces/ITask.cs @@ -1,4 +1,5 @@ -using e_suite.Workflow.Core.Attributes; +using e_suite.Database.Core.Tables.Activity; +using e_suite.Workflow.Core.Attributes; namespace e_suite.Workflow.Core.Interfaces; @@ -31,25 +32,19 @@ public interface ITask public TimeSpan Duration { get; set; } /// - /// List of tasks that need to be completed before this on can start. (If empty, will start when the workflow starts) + /// Called when the task status has been progressed from Pending to Active. + /// + /// Note: You can use this method to set the TaskStatus to ReadyToComplete if there is no manual processing needed for this task. + /// After this method is completed, the TaskStatus must be either Active or ReadyToComplete. /// - List Predecessors { get; set; } + /// + public Task OnStartedAsync(ActivityTask activityTask); - //Todo can only be on a run-time instance - ///// - ///// Called when the task status has been progressed from Pending to Active. - ///// - ///// Note: You can use this method to set the TaskStatus to ReadyToComplete if there is no manual processing needed for this task. - ///// After this method is completed, the TaskStatus must be either Active or ReadyToComplete. - ///// - ///// - //Task OnActivateAsync(); - - ///// - ///// Called when the task status has been progressed from ReadyToComplete to Completed - ///// - ///// True when the task completes successfully, false when it is considered failed. - //Task OnCompleteAsync(); + /// + /// Called when the task status has been progressed from ReadyToComplete to Completed + /// + /// True when the task completes successfully, false when it is considered failed. + public Task OnCompleteAsync(ActivityTask activityTask); //Todo add support for events (soap, rest, sftp, e-mail) } \ No newline at end of file diff --git a/e-suite.Workflow.Core/TaskBase.cs b/e-suite.Workflow.Core/TaskBase.cs index ec71ec2..2dbd49e 100644 --- a/e-suite.Workflow.Core/TaskBase.cs +++ b/e-suite.Workflow.Core/TaskBase.cs @@ -1,9 +1,10 @@ -using e_suite.Workflow.Core.Enums; +using e_suite.Database.Core.Tables.Activity; +using e_suite.Workflow.Core.Enums; using e_suite.Workflow.Core.Interfaces; namespace e_suite.Workflow.Core; -public abstract class TaskBase : ITask, IBudget, ITags +public abstract class TaskBase : ITask, IBudget, ITags, IJoin { public Guid Guid { get; set; } = Guid.CreateVersion7(); public required ITask Parent { get; set; } @@ -19,14 +20,15 @@ public abstract class TaskBase : ITask, IBudget, ITags public Priority Priority { get; set; } = Priority.Normal; public IList Tags { get; set; } = new List(); - //Todo can only be on a run-time instance - //public virtual Task OnActivateAsync() - //{ - // return Task.CompletedTask; - //} + public List WaitFor { get; } - //public virtual Task OnCompleteAsync() - //{ - // return Task.FromResult(true); - //} + public virtual Task OnStartedAsync(ActivityTask activityTask) + { + return Task.CompletedTask; + } + + public virtual Task OnCompleteAsync(ActivityTask activityTask) + { + return Task.CompletedTask; + } } \ No newline at end of file diff --git a/e-suite.Workflow.Core/Tasks/AdhocApprovalTask.cs b/e-suite.Workflow.Core/Tasks/AdhocApprovalTask.cs index f0f4be3..9ae9999 100644 --- a/e-suite.Workflow.Core/Tasks/AdhocApprovalTask.cs +++ b/e-suite.Workflow.Core/Tasks/AdhocApprovalTask.cs @@ -9,6 +9,6 @@ public class AdhocApprovalTask : TaskBase, IAssignees, IOu { public List Assignees { get; set; } = []; public ApprovalVerdict TaskOutcome { get; set; } - public Dictionary OutcomeActions { get; set; } + public Dictionary OutcomeActions { get; set; } = []; public bool OverrideDefaultTaskProgression { get; set; } } \ No newline at end of file diff --git a/e-suite.Workflow.Core/Tasks/ApprovalStep.cs b/e-suite.Workflow.Core/Tasks/ApprovalStep.cs index 3c52f03..febadb2 100644 --- a/e-suite.Workflow.Core/Tasks/ApprovalStep.cs +++ b/e-suite.Workflow.Core/Tasks/ApprovalStep.cs @@ -1,11 +1,13 @@ using e_suite.Workflow.Core.Attributes; +using e_suite.Workflow.Core.Enums; using e_suite.Workflow.Core.Interfaces; namespace e_suite.Workflow.Core.Tasks; [ApprovalTask] -public class ApprovalStep : TaskBase, IAssignees +public class ApprovalStep : TaskBase, IAssignees, IOutcome { public List Assignees { get; set; } = []; + public Dictionary OutcomeActions { get; set; } = []; } \ No newline at end of file diff --git a/e-suite.Workflow.Core/Tasks/ApprovalTask.cs b/e-suite.Workflow.Core/Tasks/ApprovalTask.cs index fe50fbd..4bd4ff1 100644 --- a/e-suite.Workflow.Core/Tasks/ApprovalTask.cs +++ b/e-suite.Workflow.Core/Tasks/ApprovalTask.cs @@ -9,6 +9,6 @@ public class ApprovalTask : TaskBase, IStage, IOutcome Tasks { get; } = new List(); public ApprovalVerdict TaskOutcome { get; set; } - public Dictionary OutcomeActions { get; set; } + public Dictionary OutcomeActions { get; set; } = []; public bool OverrideDefaultTaskProgression { get; set; } } \ No newline at end of file diff --git a/e-suite.Workflow.Core/Tasks/AssetUploadTask.cs b/e-suite.Workflow.Core/Tasks/AssetUploadTask.cs index 89a6075..7925313 100644 --- a/e-suite.Workflow.Core/Tasks/AssetUploadTask.cs +++ b/e-suite.Workflow.Core/Tasks/AssetUploadTask.cs @@ -1,8 +1,11 @@ using e_suite.Workflow.Core.Attributes; +using e_suite.Workflow.Core.Enums; +using e_suite.Workflow.Core.Interfaces; namespace e_suite.Workflow.Core.Tasks; [GeneralTask] -public class AssetUploadTask : TaskBase +public class AssetUploadTask : TaskBase, IOutcome { + public Dictionary OutcomeActions { get; set; } = []; } \ No newline at end of file diff --git a/e-suite.Workflow.Core/Tasks/BasicTask.cs b/e-suite.Workflow.Core/Tasks/BasicTask.cs index 04748b6..cbde244 100644 --- a/e-suite.Workflow.Core/Tasks/BasicTask.cs +++ b/e-suite.Workflow.Core/Tasks/BasicTask.cs @@ -1,5 +1,6 @@ using System.ComponentModel; using e_suite.Workflow.Core.Attributes; +using e_suite.Workflow.Core.Enums; using e_suite.Workflow.Core.Interfaces; namespace e_suite.Workflow.Core.Tasks; @@ -8,7 +9,8 @@ namespace e_suite.Workflow.Core.Tasks; /// A user has to open this task, manually set it to ready to complete /// [GeneralTask] -public class BasicTask : TaskBase, IAssignees +public class BasicTask : TaskBase, IAssignees, IOutcome { public List Assignees { get; set; } = []; + public Dictionary OutcomeActions { get; set; } = []; } \ No newline at end of file diff --git a/e-suite.Workflow.Core/Tasks/ContentCollationTask.cs b/e-suite.Workflow.Core/Tasks/ContentCollationTask.cs index eb5722f..563c983 100644 --- a/e-suite.Workflow.Core/Tasks/ContentCollationTask.cs +++ b/e-suite.Workflow.Core/Tasks/ContentCollationTask.cs @@ -1,4 +1,5 @@ using e_suite.Workflow.Core.Attributes; +using e_suite.Workflow.Core.Enums; using e_suite.Workflow.Core.Interfaces; namespace e_suite.Workflow.Core.Tasks; @@ -7,7 +8,8 @@ namespace e_suite.Workflow.Core.Tasks; /// Create a table of field data for output to PDF or AdobeIllustrator /// [GeneralTask] -public class ContentCollationTask : TaskBase, IAssignees +public class ContentCollationTask : TaskBase, IAssignees, IOutcome { public List Assignees { get; set; } = []; + public Dictionary OutcomeActions { get; set; } = []; } \ No newline at end of file diff --git a/e-suite.Workflow.Core/Tasks/FileReleaseTask.cs b/e-suite.Workflow.Core/Tasks/FileReleaseTask.cs index 9d5792d..00d031b 100644 --- a/e-suite.Workflow.Core/Tasks/FileReleaseTask.cs +++ b/e-suite.Workflow.Core/Tasks/FileReleaseTask.cs @@ -1,4 +1,6 @@ using e_suite.Workflow.Core.Attributes; +using e_suite.Workflow.Core.Enums; +using e_suite.Workflow.Core.Interfaces; namespace e_suite.Workflow.Core.Tasks; @@ -6,7 +8,7 @@ namespace e_suite.Workflow.Core.Tasks; /// This task will allow Asset files to be released, and automatically uploaded to an external source /// [GeneralTask(allowMultiple: false)] -public class FileReleaseTask : TaskBase +public class FileReleaseTask : TaskBase, IOutcome { - + public Dictionary OutcomeActions { get; set; } = []; } \ No newline at end of file diff --git a/e-suite.Workflow.Core/Tasks/FormDataInputTask.cs b/e-suite.Workflow.Core/Tasks/FormDataInputTask.cs index c5a9586..85b343b 100644 --- a/e-suite.Workflow.Core/Tasks/FormDataInputTask.cs +++ b/e-suite.Workflow.Core/Tasks/FormDataInputTask.cs @@ -1,11 +1,12 @@ using e_suite.Workflow.Core.Attributes; +using e_suite.Workflow.Core.Enums; using e_suite.Workflow.Core.Interfaces; using eSuite.Core.Miscellaneous; namespace e_suite.Workflow.Core.Tasks; [GeneralTask] -public class FormDataInputTask : TaskBase, IAssignees, IFormTemplate +public class FormDataInputTask : TaskBase, IAssignees, IFormTemplate, IOutcome { public List Assignees { get; set; } = []; public bool IsMultiple { get; set; } @@ -16,4 +17,6 @@ public class FormDataInputTask : TaskBase, IAssignees, IFormTempla if (FormIdRef == null) yield return "FormIdRef is required."; } + + public Dictionary OutcomeActions { get; set; } = []; } \ No newline at end of file diff --git a/e-suite.Workflow.Core/Tasks/LinkActivityTask.cs b/e-suite.Workflow.Core/Tasks/LinkActivityTask.cs index 072bba2..d71c625 100644 --- a/e-suite.Workflow.Core/Tasks/LinkActivityTask.cs +++ b/e-suite.Workflow.Core/Tasks/LinkActivityTask.cs @@ -1,9 +1,11 @@ using e_suite.Workflow.Core.Attributes; +using e_suite.Workflow.Core.Enums; +using e_suite.Workflow.Core.Interfaces; namespace e_suite.Workflow.Core.Tasks; [GeneralTask] -public class LinkActivityTask : TaskBase +public class LinkActivityTask : TaskBase, IOutcome { - + public Dictionary OutcomeActions { get; set; } = []; } \ No newline at end of file diff --git a/e-suite.Workflow.Core/Tasks/MilestoneTask.cs b/e-suite.Workflow.Core/Tasks/MilestoneTask.cs index 801928b..1c8ed09 100644 --- a/e-suite.Workflow.Core/Tasks/MilestoneTask.cs +++ b/e-suite.Workflow.Core/Tasks/MilestoneTask.cs @@ -1,4 +1,8 @@ -using e_suite.Workflow.Core.Attributes; +using e_suite.Database.Core.Tables.Activity; +using e_suite.Workflow.Core.Attributes; +using e_suite.Workflow.Core.Enums; +using e_suite.Workflow.Core.Interfaces; +using eSuite.Core.Enums; namespace e_suite.Workflow.Core.Tasks; @@ -6,12 +10,14 @@ namespace e_suite.Workflow.Core.Tasks; /// A Milestone task does not have any specific processing, so is ready to complete as soon at it starts. /// [GeneralTask] -public class MilestoneTask : TaskBase +public class MilestoneTask : TaskBase, IOutcome { - //Todo can only be on a run-time instance - //public override async Task OnActivateAsync() - //{ - // await base.OnActivateAsync(); - // TaskState = TaskState.ReadyToComplete; - //} + public Dictionary OutcomeActions { get; set; } = []; + + public override async Task OnStartedAsync(ActivityTask activityTask) + { + await base.OnStartedAsync(activityTask); + activityTask.ActivityState = ActivityState.ReadyToComplete; + //TODO need to set the outcome of completed here + } } diff --git a/e-suite.Workflow.Core/Tasks/StageTask.cs b/e-suite.Workflow.Core/Tasks/StageTask.cs index 7e6a7f0..ce7d2fa 100644 --- a/e-suite.Workflow.Core/Tasks/StageTask.cs +++ b/e-suite.Workflow.Core/Tasks/StageTask.cs @@ -1,12 +1,14 @@ using e_suite.Workflow.Core.Attributes; +using e_suite.Workflow.Core.Enums; using e_suite.Workflow.Core.Interfaces; namespace e_suite.Workflow.Core.Tasks; [GeneralTask] -public class StageTask : TaskBase, IStage, IBypassable +public class StageTask : TaskBase, IStage, IBypassable, IOutcome { public ICollection Tasks { get; } = new List(); public bool Bypassable { get; set; } + public Dictionary OutcomeActions { get; set; } = []; } \ No newline at end of file diff --git a/e-suite.Workflow.Core/Tasks/VisualBriefReviewTask.cs b/e-suite.Workflow.Core/Tasks/VisualBriefReviewTask.cs index 5916c6f..663a8c7 100644 --- a/e-suite.Workflow.Core/Tasks/VisualBriefReviewTask.cs +++ b/e-suite.Workflow.Core/Tasks/VisualBriefReviewTask.cs @@ -1,9 +1,11 @@ using e_suite.Workflow.Core.Attributes; +using e_suite.Workflow.Core.Enums; +using e_suite.Workflow.Core.Interfaces; namespace e_suite.Workflow.Core.Tasks; [GeneralTask] -public class VisualBriefReviewTask : TaskBase +public class VisualBriefReviewTask : TaskBase, IOutcome { - + public Dictionary OutcomeActions { get; set; } = []; } \ No newline at end of file diff --git a/e-suite.Workflow.Core/Tasks/VisualBriefUploadTask.cs b/e-suite.Workflow.Core/Tasks/VisualBriefUploadTask.cs index 693be51..840b112 100644 --- a/e-suite.Workflow.Core/Tasks/VisualBriefUploadTask.cs +++ b/e-suite.Workflow.Core/Tasks/VisualBriefUploadTask.cs @@ -1,9 +1,11 @@ using e_suite.Workflow.Core.Attributes; +using e_suite.Workflow.Core.Enums; +using e_suite.Workflow.Core.Interfaces; namespace e_suite.Workflow.Core.Tasks; [GeneralTask] -public class VisualBriefUploadTask : TaskBase +public class VisualBriefUploadTask : TaskBase, IOutcome { - + public Dictionary OutcomeActions { get; set; } = []; } \ No newline at end of file diff --git a/e-suite.Workflow.Core/obj/e-suite.Workflow.Core.csproj.nuget.g.props b/e-suite.Workflow.Core/obj/e-suite.Workflow.Core.csproj.nuget.g.props index 34cdfde..02a5a98 100644 --- a/e-suite.Workflow.Core/obj/e-suite.Workflow.Core.csproj.nuget.g.props +++ b/e-suite.Workflow.Core/obj/e-suite.Workflow.Core.csproj.nuget.g.props @@ -14,6 +14,6 @@ - + \ No newline at end of file diff --git a/e-suite.Workflow.Core/obj/e-suite.Workflow.Core.csproj.nuget.g.targets b/e-suite.Workflow.Core/obj/e-suite.Workflow.Core.csproj.nuget.g.targets index 89055c1..3d8b966 100644 --- a/e-suite.Workflow.Core/obj/e-suite.Workflow.Core.csproj.nuget.g.targets +++ b/e-suite.Workflow.Core/obj/e-suite.Workflow.Core.csproj.nuget.g.targets @@ -1,8 +1,8 @@  - - - + + + \ No newline at end of file