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")]
|
[DisplayName("Activity Assignment")]
|
||||||
[Table("ActivityAssignments", Schema = "Activity")]
|
[Table("ActivityAssignments", Schema = "Activity")]
|
||||||
[Index(nameof(Guid), IsUnique = true)]
|
[Index(nameof(Guid), IsUnique = true)]
|
||||||
public class ActivityAssignment : IGeneralId, ISoftDeletable
|
public class ActivityAssignment : IGeneralId, ISoftDeletable, IRuntimeOutcomes
|
||||||
{
|
{
|
||||||
[Key]
|
[Key]
|
||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
@ -50,4 +50,11 @@ public class ActivityAssignment : IGeneralId, ISoftDeletable
|
|||||||
|
|
||||||
[ForeignKey(nameof(UserId))]
|
[ForeignKey(nameof(UserId))]
|
||||||
public virtual User User { get; set; } = null!;
|
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")]
|
[Table("ActivityTasks", Schema = "Activity")]
|
||||||
[Index(nameof(Guid), IsUnique = true)]
|
[Index(nameof(Guid), IsUnique = true)]
|
||||||
[Index(nameof(ActivityId), nameof(ActivityOrdinal), IsUnique = true)]
|
[Index(nameof(ActivityId), nameof(ActivityOrdinal), IsUnique = true)]
|
||||||
public class ActivityTask : IGeneralId, ISoftDeletable
|
public class ActivityTask : IGeneralId, ISoftDeletable, IRuntimeOutcomes
|
||||||
{
|
{
|
||||||
[Key]
|
[Key]
|
||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
@ -53,6 +53,10 @@ public class ActivityTask : IGeneralId, ISoftDeletable
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public DateTimeOffset? FinishDateTime { get; set; }
|
public DateTimeOffset? FinishDateTime { get; set; }
|
||||||
|
|
||||||
|
public string Comments { get; set; }
|
||||||
|
public long? CompletedByUserId { get; set; }
|
||||||
|
public string? CompletedByUserDisplayName { get; set; }
|
||||||
|
|
||||||
[AuditSoftDelete(true)]
|
[AuditSoftDelete(true)]
|
||||||
[Required]
|
[Required]
|
||||||
[DefaultValue(false)]
|
[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")
|
b.Property<bool>("Bypassable")
|
||||||
.HasColumnType("bit");
|
.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")
|
b.Property<bool>("Deleted")
|
||||||
.HasColumnType("bit");
|
.HasColumnType("bit");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset?>("FinishDateTime")
|
||||||
|
.HasColumnType("datetimeoffset");
|
||||||
|
|
||||||
b.Property<Guid>("Guid")
|
b.Property<Guid>("Guid")
|
||||||
.HasColumnType("uniqueidentifier");
|
.HasColumnType("uniqueidentifier");
|
||||||
|
|
||||||
b.Property<DateTimeOffset>("LastUpdated")
|
b.Property<DateTimeOffset>("LastUpdated")
|
||||||
.HasColumnType("datetimeoffset");
|
.HasColumnType("datetimeoffset");
|
||||||
|
|
||||||
|
b.PrimitiveCollection<string>("Outcomes")
|
||||||
|
.IsRequired()
|
||||||
|
.HasColumnType("nvarchar(max)");
|
||||||
|
|
||||||
b.Property<int>("Raci")
|
b.Property<int>("Raci")
|
||||||
.HasColumnType("int");
|
.HasColumnType("int");
|
||||||
|
|
||||||
b.Property<long?>("RoleId")
|
b.Property<long?>("RoleId")
|
||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<DateTimeOffset?>("StartDateTime")
|
||||||
|
.HasColumnType("datetimeoffset");
|
||||||
|
|
||||||
b.Property<long>("TaskId")
|
b.Property<long>("TaskId")
|
||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
@ -220,6 +240,16 @@ namespace esuite.Database.SqlServer.Migrations
|
|||||||
b.Property<int>("ActivityState")
|
b.Property<int>("ActivityState")
|
||||||
.HasColumnType("int");
|
.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")
|
b.Property<bool>("Deleted")
|
||||||
.HasColumnType("bit");
|
.HasColumnType("bit");
|
||||||
|
|
||||||
@ -1840,8 +1870,8 @@ namespace esuite.Database.SqlServer.Migrations
|
|||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("RoleId");
|
.HasForeignKey("RoleId");
|
||||||
|
|
||||||
b.HasOne("e_suite.Database.Core.Tables.Activity.ActivityTask", "task")
|
b.HasOne("e_suite.Database.Core.Tables.Activity.ActivityTask", "Task")
|
||||||
.WithMany()
|
.WithMany("Assignments")
|
||||||
.HasForeignKey("TaskId")
|
.HasForeignKey("TaskId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
@ -1852,9 +1882,9 @@ namespace esuite.Database.SqlServer.Migrations
|
|||||||
|
|
||||||
b.Navigation("Role");
|
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 =>
|
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 =>
|
modelBuilder.Entity("e_suite.Database.Core.Tables.Activity.ActivityTask", b =>
|
||||||
{
|
{
|
||||||
|
b.Navigation("Assignments");
|
||||||
|
|
||||||
b.Navigation("Tasks");
|
b.Navigation("Tasks");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -6,9 +6,12 @@ namespace e_suite.Workflow.Core.Enums;
|
|||||||
public enum ApprovalVerdict
|
public enum ApprovalVerdict
|
||||||
{
|
{
|
||||||
None,
|
None,
|
||||||
Pending,
|
|
||||||
Approved,
|
Approved,
|
||||||
ApprovedWithComments,
|
Rejected
|
||||||
Rejected,
|
}
|
||||||
|
|
||||||
|
[Description("Visual brief review")]
|
||||||
|
public enum VisualBriefReview
|
||||||
|
{
|
||||||
Reviewed
|
Reviewed
|
||||||
}
|
}
|
||||||
@ -5,7 +5,7 @@ using e_suite.Workflow.Core.Interfaces;
|
|||||||
namespace e_suite.Workflow.Core.Tasks;
|
namespace e_suite.Workflow.Core.Tasks;
|
||||||
|
|
||||||
[GeneralTask]
|
[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