Defining the outcomes for tasks and assignments
This commit is contained in:
parent
028f40437e
commit
2d29c6de1c
@ -13,7 +13,7 @@ namespace e_suite.Database.Core.Tables.Activity;
|
||||
[DisplayName("Activity Assignment")]
|
||||
[Table("ActivityAssignments", Schema = "Activity")]
|
||||
[Index(nameof(Guid), IsUnique = true)]
|
||||
public class ActivityAssignment : IGeneralId, ISoftDeletable
|
||||
public class ActivityAssignment : IGeneralId, ISoftDeletable, IRuntimeOutcomes
|
||||
{
|
||||
[Key]
|
||||
public long Id { get; set; }
|
||||
@ -50,4 +50,11 @@ public class ActivityAssignment : IGeneralId, ISoftDeletable
|
||||
|
||||
[ForeignKey(nameof(UserId))]
|
||||
public virtual User User { get; set; } = null!;
|
||||
|
||||
public List<string> Outcomes { get; set; }
|
||||
public DateTimeOffset? StartDateTime { get; set; }
|
||||
public DateTimeOffset? FinishDateTime { get; set; }
|
||||
public string Comments { get; set; }
|
||||
public long? CompletedByUserId { get; set; }
|
||||
public string? CompletedByUserDisplayName { get; set; }
|
||||
}
|
||||
@ -12,7 +12,7 @@ namespace e_suite.Database.Core.Tables.Activity;
|
||||
[Table("ActivityTasks", Schema = "Activity")]
|
||||
[Index(nameof(Guid), IsUnique = true)]
|
||||
[Index(nameof(ActivityId), nameof(ActivityOrdinal), IsUnique = true)]
|
||||
public class ActivityTask : IGeneralId, ISoftDeletable
|
||||
public class ActivityTask : IGeneralId, ISoftDeletable, IRuntimeOutcomes
|
||||
{
|
||||
[Key]
|
||||
public long Id { get; set; }
|
||||
@ -53,6 +53,10 @@ public class ActivityTask : IGeneralId, ISoftDeletable
|
||||
/// </summary>
|
||||
public DateTimeOffset? FinishDateTime { get; set; }
|
||||
|
||||
public string Comments { get; set; }
|
||||
public long? CompletedByUserId { get; set; }
|
||||
public string? CompletedByUserDisplayName { get; set; }
|
||||
|
||||
[AuditSoftDelete(true)]
|
||||
[Required]
|
||||
[DefaultValue(false)]
|
||||
|
||||
@ -0,0 +1,21 @@
|
||||
namespace e_suite.Database.Core.Tables.Activity;
|
||||
|
||||
public interface IRuntimeOutcomes
|
||||
{
|
||||
public List<string> Outcomes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Contains the date and time when the task was changed from Pending to Active
|
||||
/// </summary>
|
||||
public DateTimeOffset? StartDateTime { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Contains the date and time when the task was changed from Active to Completed
|
||||
/// </summary>
|
||||
public DateTimeOffset? FinishDateTime { get; set; }
|
||||
|
||||
public string Comments { get; set; }
|
||||
|
||||
public long? CompletedByUserId { get; set; }
|
||||
public string? CompletedByUserDisplayName { get; set; }
|
||||
}
|
||||
2332
e-suite.Database.SqlServer/e-suite.Database.SqlServer/Migrations/20260316102257_runtime outcomes.Designer.cs
generated
Normal file
2332
e-suite.Database.SqlServer/e-suite.Database.SqlServer/Migrations/20260316102257_runtime outcomes.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,130 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace esuite.Database.SqlServer.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class runtimeoutcomes : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Comments",
|
||||
schema: "Activity",
|
||||
table: "ActivityTasks",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "CompletedByUserDisplayName",
|
||||
schema: "Activity",
|
||||
table: "ActivityTasks",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<long>(
|
||||
name: "CompletedByUserId",
|
||||
schema: "Activity",
|
||||
table: "ActivityTasks",
|
||||
type: "bigint",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Comments",
|
||||
schema: "Activity",
|
||||
table: "ActivityAssignments",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "CompletedByUserDisplayName",
|
||||
schema: "Activity",
|
||||
table: "ActivityAssignments",
|
||||
type: "nvarchar(max)",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<long>(
|
||||
name: "CompletedByUserId",
|
||||
schema: "Activity",
|
||||
table: "ActivityAssignments",
|
||||
type: "bigint",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<DateTimeOffset>(
|
||||
name: "FinishDateTime",
|
||||
schema: "Activity",
|
||||
table: "ActivityAssignments",
|
||||
type: "datetimeoffset",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Outcomes",
|
||||
schema: "Activity",
|
||||
table: "ActivityAssignments",
|
||||
type: "nvarchar(max)",
|
||||
nullable: false,
|
||||
defaultValue: "[]");
|
||||
|
||||
migrationBuilder.AddColumn<DateTimeOffset>(
|
||||
name: "StartDateTime",
|
||||
schema: "Activity",
|
||||
table: "ActivityAssignments",
|
||||
type: "datetimeoffset",
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Comments",
|
||||
schema: "Activity",
|
||||
table: "ActivityTasks");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CompletedByUserDisplayName",
|
||||
schema: "Activity",
|
||||
table: "ActivityTasks");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CompletedByUserId",
|
||||
schema: "Activity",
|
||||
table: "ActivityTasks");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Comments",
|
||||
schema: "Activity",
|
||||
table: "ActivityAssignments");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CompletedByUserDisplayName",
|
||||
schema: "Activity",
|
||||
table: "ActivityAssignments");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "CompletedByUserId",
|
||||
schema: "Activity",
|
||||
table: "ActivityAssignments");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "FinishDateTime",
|
||||
schema: "Activity",
|
||||
table: "ActivityAssignments");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "Outcomes",
|
||||
schema: "Activity",
|
||||
table: "ActivityAssignments");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "StartDateTime",
|
||||
schema: "Activity",
|
||||
table: "ActivityAssignments");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -168,21 +168,41 @@ namespace esuite.Database.SqlServer.Migrations
|
||||
b.Property<bool>("Bypassable")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<string>("Comments")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("CompletedByUserDisplayName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<long?>("CompletedByUserId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<bool>("Deleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
b.Property<DateTimeOffset?>("FinishDateTime")
|
||||
.HasColumnType("datetimeoffset");
|
||||
|
||||
b.Property<Guid>("Guid")
|
||||
.HasColumnType("uniqueidentifier");
|
||||
|
||||
b.Property<DateTimeOffset>("LastUpdated")
|
||||
.HasColumnType("datetimeoffset");
|
||||
|
||||
b.PrimitiveCollection<string>("Outcomes")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<int>("Raci")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<long?>("RoleId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<DateTimeOffset?>("StartDateTime")
|
||||
.HasColumnType("datetimeoffset");
|
||||
|
||||
b.Property<long>("TaskId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
@ -220,6 +240,16 @@ namespace esuite.Database.SqlServer.Migrations
|
||||
b.Property<int>("ActivityState")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("Comments")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<string>("CompletedByUserDisplayName")
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
||||
b.Property<long?>("CompletedByUserId")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<bool>("Deleted")
|
||||
.HasColumnType("bit");
|
||||
|
||||
@ -1840,8 +1870,8 @@ namespace esuite.Database.SqlServer.Migrations
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId");
|
||||
|
||||
b.HasOne("e_suite.Database.Core.Tables.Activity.ActivityTask", "task")
|
||||
.WithMany()
|
||||
b.HasOne("e_suite.Database.Core.Tables.Activity.ActivityTask", "Task")
|
||||
.WithMany("Assignments")
|
||||
.HasForeignKey("TaskId")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
@ -1852,9 +1882,9 @@ namespace esuite.Database.SqlServer.Migrations
|
||||
|
||||
b.Navigation("Role");
|
||||
|
||||
b.Navigation("User");
|
||||
b.Navigation("Task");
|
||||
|
||||
b.Navigation("task");
|
||||
b.Navigation("User");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("e_suite.Database.Core.Tables.Activity.ActivityTask", b =>
|
||||
@ -2257,6 +2287,8 @@ namespace esuite.Database.SqlServer.Migrations
|
||||
|
||||
modelBuilder.Entity("e_suite.Database.Core.Tables.Activity.ActivityTask", b =>
|
||||
{
|
||||
b.Navigation("Assignments");
|
||||
|
||||
b.Navigation("Tasks");
|
||||
});
|
||||
|
||||
|
||||
@ -6,9 +6,12 @@ namespace e_suite.Workflow.Core.Enums;
|
||||
public enum ApprovalVerdict
|
||||
{
|
||||
None,
|
||||
Pending,
|
||||
Approved,
|
||||
ApprovedWithComments,
|
||||
Rejected,
|
||||
Rejected
|
||||
}
|
||||
|
||||
[Description("Visual brief review")]
|
||||
public enum VisualBriefReview
|
||||
{
|
||||
Reviewed
|
||||
}
|
||||
@ -5,7 +5,7 @@ using e_suite.Workflow.Core.Interfaces;
|
||||
namespace e_suite.Workflow.Core.Tasks;
|
||||
|
||||
[GeneralTask]
|
||||
public class VisualBriefReviewTask : TaskBase, IOutcome<DefaultOutcome>
|
||||
public class VisualBriefReviewTask : TaskBase, IOutcome<VisualBriefReview>
|
||||
{
|
||||
public List<OutcomeAction<DefaultOutcome>> OutcomeActions { get; set; } = [];
|
||||
public List<OutcomeAction<VisualBriefReview>> OutcomeActions { get; set; } = [];
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user