diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json
index d5004c0e..c9326dc2 100644
--- a/.config/dotnet-tools.json
+++ b/.config/dotnet-tools.json
@@ -15,6 +15,13 @@
"dotnet-cake"
],
"rollForward": false
+ },
+ "dotnet-outdated-tool": {
+ "version": "4.6.4",
+ "commands": [
+ "dotnet-outdated"
+ ],
+ "rollForward": false
}
}
}
\ No newline at end of file
diff --git a/src/Application/Application.csproj b/src/Application/Application.csproj
index 736a5996..956ee5cd 100644
--- a/src/Application/Application.csproj
+++ b/src/Application/Application.csproj
@@ -10,19 +10,19 @@
-
+
-
+
-
-
+
+
-
-
+
+
-
+
diff --git a/src/Application/Features/QualityAssurance/Commands/SubmitEscalationResponse.cs b/src/Application/Features/QualityAssurance/Commands/SubmitEscalationResponse.cs
index e831fe35..df12dd08 100644
--- a/src/Application/Features/QualityAssurance/Commands/SubmitEscalationResponse.cs
+++ b/src/Application/Features/QualityAssurance/Commands/SubmitEscalationResponse.cs
@@ -14,6 +14,8 @@ public class Command : IRequest
public EscalationResponse? Response { get; set; }
public string Message { get; set; } = default!;
+
+ public bool IsMessageExternal { get; set; }
public UserProfile? CurrentUser { get; set; }
}
@@ -38,7 +40,7 @@ public async Task Handle(Command request, CancellationToken cancellation
return Result.Failure("Cannot find queue item");
}
- entry.AddNote(request.Message);
+ entry.AddNote(request.Message, request.IsMessageExternal);
switch (request.Response)
{
diff --git a/src/Application/Features/QualityAssurance/Commands/SubmitQa1Response.cs b/src/Application/Features/QualityAssurance/Commands/SubmitQa1Response.cs
index 97ca17e2..4e4da1ca 100644
--- a/src/Application/Features/QualityAssurance/Commands/SubmitQa1Response.cs
+++ b/src/Application/Features/QualityAssurance/Commands/SubmitQa1Response.cs
@@ -1,4 +1,4 @@
-using Cfo.Cats.Application.Common.Security;
+using Cfo.Cats.Application.Common.Security;
using Cfo.Cats.Application.Common.Validators;
using Cfo.Cats.Application.SecurityConstants;
using Cfo.Cats.Domain.Entities.Participants;
@@ -15,6 +15,7 @@ public class Command : IRequest
public bool? Accept { get; set; }
public string Message { get; set; } = default!;
+
public UserProfile? CurrentUser { get; set; }
}
@@ -31,7 +32,7 @@ public async Task Handle(Command request, CancellationToken cancellation
return Result.Failure("Cannot find queue item");
}
- entry.AddNote(request.Message);
+ entry.AddNote(request.Message, isExternal: false);
if (request.Accept.GetValueOrDefault())
{
diff --git a/src/Application/Features/QualityAssurance/Commands/SubmitQa2Response.cs b/src/Application/Features/QualityAssurance/Commands/SubmitQa2Response.cs
index c0a170a7..802932e1 100644
--- a/src/Application/Features/QualityAssurance/Commands/SubmitQa2Response.cs
+++ b/src/Application/Features/QualityAssurance/Commands/SubmitQa2Response.cs
@@ -16,6 +16,8 @@ public class Command : IRequest
public Qa2Response? Response { get; set; }
public string Message { get; set; } = default!;
+
+ public bool IsMessageExternal { get; set; }
public UserProfile? CurrentUser { get; set; }
}
@@ -39,7 +41,7 @@ public async Task Handle(Command request, CancellationToken cancellation
return Result.Failure("Cannot find queue item");
}
- entry.AddNote(request.Message);
+ entry.AddNote(request.Message, request.IsMessageExternal);
switch (request.Response)
diff --git a/src/Application/Features/QualityAssurance/DTOs/EnrolmentQaNoteDto.cs b/src/Application/Features/QualityAssurance/DTOs/EnrolmentQaNoteDto.cs
index ab0722ca..3e756e89 100644
--- a/src/Application/Features/QualityAssurance/DTOs/EnrolmentQaNoteDto.cs
+++ b/src/Application/Features/QualityAssurance/DTOs/EnrolmentQaNoteDto.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
+using Cfo.Cats.Domain.Entities.Participants;
using Cfo.Cats.Domain.ValueObjects;
namespace Cfo.Cats.Application.Features.QualityAssurance.DTOs
@@ -13,13 +14,14 @@ public class EnrolmentQaNoteDto
public required string Message { get; set; }
public required string CreatedBy { get; set; }
public required string TenantName { get; set; }
+ public required bool IsExternal { get; set; }
private class Mapper : Profile
{
public Mapper()
{
- CreateMap()
+ CreateMap()
.ForMember(target => target.CreatedBy, options => options.MapFrom(source=>source.CreatedByUser.DisplayName))
.ForMember(target => target.Message, options => options.MapFrom(source => source.Message))
.ForMember(target => target.Created, options => options.MapFrom(source => source.Created))
diff --git a/src/Application/Features/QualityAssurance/Queries/GetEnrolmentQaNotes.cs b/src/Application/Features/QualityAssurance/Queries/GetEnrolmentQaNotes.cs
index cac92be6..9c1562ec 100644
--- a/src/Application/Features/QualityAssurance/Queries/GetEnrolmentQaNotes.cs
+++ b/src/Application/Features/QualityAssurance/Queries/GetEnrolmentQaNotes.cs
@@ -12,29 +12,33 @@ public class Query : IRequest>
{
public string? ParticipantId { get;set; }
+ public bool IncludeInternalNotes { get; set; }
+
public UserProfile? CurentUser {get;set;}
}
- public class Handler(IUnitOfWork unitOfWork, IMapper mapper) : IRequestHandler>
+ public class Handler(
+ IUnitOfWork unitOfWork,
+ IMapper mapper) : IRequestHandler>
{
public async Task> Handle(Query request, CancellationToken cancellationToken)
{
var pqa = await GetPqaNotes(request.ParticipantId!);
- var qa1 = await GetQa1Notes(request.ParticipantId!);
- var qa2 = await GetQa2Notes(request.ParticipantId!);
- var es = await GetEscalationNotes(request.ParticipantId!);
+ var qa1 = await GetQa1Notes(request.ParticipantId!, request.IncludeInternalNotes);
+ var qa2 = await GetQa2Notes(request.ParticipantId!, request.IncludeInternalNotes);
+ var es = await GetEscalationNotes(request.ParticipantId!, request.IncludeInternalNotes);
return Result.Success(pqa.Union(qa1).Union(qa2).Union(es).ToArray());
}
- private async Task GetEscalationNotes(string participantId)
+ private async Task GetEscalationNotes(string participantId, bool includeInternalNotes)
{
var query1 = unitOfWork.DbContext.EnrolmentEscalationQueue
.AsNoTracking()
.Where(c => c.ParticipantId == participantId)
- .SelectMany(c => c.Notes)
+ .SelectMany(c => c.Notes.Where(n => n.IsExternal || includeInternalNotes))
.ProjectTo(mapper.ConfigurationProvider);
@@ -55,12 +59,12 @@ private async Task GetPqaNotes(string participantId)
return results;
}
- private async Task GetQa1Notes(string participantId)
+ private async Task GetQa1Notes(string participantId, bool includeInternalNotes)
{
var query1 = unitOfWork.DbContext.EnrolmentQa1Queue
.AsNoTracking()
.Where(c => c.ParticipantId == participantId)
- .SelectMany(c => c.Notes)
+ .SelectMany(c => c.Notes.Where(n => n.IsExternal || includeInternalNotes))
.ProjectTo(mapper.ConfigurationProvider);
@@ -68,12 +72,12 @@ private async Task GetQa1Notes(string participantId)
return results;
}
- private async Task GetQa2Notes(string participantId)
+ private async Task GetQa2Notes(string participantId, bool includeInternalNotes)
{
var query1 = unitOfWork.DbContext.EnrolmentQa2Queue
.AsNoTracking()
.Where(c => c.ParticipantId == participantId)
- .SelectMany(c => c.Notes)
+ .SelectMany(c => c.Notes.Where(n => n.IsExternal || includeInternalNotes))
.ProjectTo(mapper.ConfigurationProvider);
diff --git a/src/Application/SecurityConstants/SecurityPolicies.cs b/src/Application/SecurityConstants/SecurityPolicies.cs
index 021f282e..54011ab6 100644
--- a/src/Application/SecurityConstants/SecurityPolicies.cs
+++ b/src/Application/SecurityConstants/SecurityPolicies.cs
@@ -18,6 +18,8 @@ public static class SecurityPolicies
public const string Qa2 = nameof(Qa2);
+ public const string Internal = nameof(Internal);
+
public const string SeniorInternal = nameof(SeniorInternal);
///
diff --git a/src/Domain/Domain.csproj b/src/Domain/Domain.csproj
index f3a2f98c..f40b6e68 100644
--- a/src/Domain/Domain.csproj
+++ b/src/Domain/Domain.csproj
@@ -11,10 +11,10 @@
-
-
-
-
+
+
+
+
diff --git a/src/Domain/Entities/Participants/EnrolmentQueueEntry.cs b/src/Domain/Entities/Participants/EnrolmentQueueEntry.cs
index 124854cb..009d41cc 100644
--- a/src/Domain/Entities/Participants/EnrolmentQueueEntry.cs
+++ b/src/Domain/Entities/Participants/EnrolmentQueueEntry.cs
@@ -10,7 +10,7 @@ namespace Cfo.Cats.Domain.Entities.Participants;
public abstract class EnrolmentQueueEntry : OwnerPropertyEntity, IMustHaveTenant
{
- private readonly List _notes = [];
+ private readonly List _notes = [];
public bool IsAccepted { get; protected set; }
public bool IsCompleted { get; protected set; }
@@ -32,7 +32,7 @@ protected EnrolmentQueueEntry(string participantId)
public virtual Participant? Participant { get; private set; }
public virtual Tenant? Tenant { get; private set; }
- public IReadOnlyCollection Notes => _notes.AsReadOnly();
+ public IReadOnlyCollection Notes => _notes.AsReadOnly();
public abstract EnrolmentQueueEntry Accept();
@@ -40,14 +40,15 @@ protected EnrolmentQueueEntry(string participantId)
public abstract EnrolmentQueueEntry Return();
- public EnrolmentQueueEntry AddNote(string? message)
+ public EnrolmentQueueEntry AddNote(string? message, bool isExternal = false)
{
if (string.IsNullOrWhiteSpace(message) == false)
{
- _notes.Add(new Note()
+ _notes.Add(new EnrolmentQueueEntryNote()
{
TenantId = TenantId,
- Message = message
+ Message = message,
+ IsExternal = isExternal
});
}
return this;
diff --git a/src/Domain/Entities/Participants/EnrolmentQueueEntryNote.cs b/src/Domain/Entities/Participants/EnrolmentQueueEntryNote.cs
new file mode 100644
index 00000000..331d74fb
--- /dev/null
+++ b/src/Domain/Entities/Participants/EnrolmentQueueEntryNote.cs
@@ -0,0 +1,8 @@
+using Cfo.Cats.Domain.ValueObjects;
+
+namespace Cfo.Cats.Domain.Entities.Participants;
+
+public class EnrolmentQueueEntryNote : Note
+{
+ public bool IsExternal { get; set; }
+}
diff --git a/src/Infrastructure/DependencyInjection.cs b/src/Infrastructure/DependencyInjection.cs
index 798a3d32..71667105 100644
--- a/src/Infrastructure/DependencyInjection.cs
+++ b/src/Infrastructure/DependencyInjection.cs
@@ -322,6 +322,18 @@ private static IServiceCollection AddAuthenticationService(this IServiceCollecti
policy.RequireClaim(ApplicationClaimTypes.AccountLocked, "False");
policy.RequireRole(RoleNames.SystemSupport, RoleNames.SMT, RoleNames.QAManager);
});
+
+ options.AddPolicy(SecurityPolicies.Internal, policy =>
+ {
+ policy.RequireAuthenticatedUser();
+ policy.RequireClaim(ApplicationClaimTypes.AccountLocked, "False");
+ policy.RequireRole(
+ RoleNames.SystemSupport,
+ RoleNames.SMT,
+ RoleNames.QAManager,
+ RoleNames.QAOfficer,
+ RoleNames.QASupportManager);
+ });
})
.AddAuthentication(options => {
options.DefaultScheme = IdentityConstants.ApplicationScheme;
diff --git a/src/Infrastructure/Infrastructure.csproj b/src/Infrastructure/Infrastructure.csproj
index 1b0d2e92..237cc158 100644
--- a/src/Infrastructure/Infrastructure.csproj
+++ b/src/Infrastructure/Infrastructure.csproj
@@ -12,34 +12,34 @@
-
+
-
-
-
+
+
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
-
-
-
+
+
+
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
-
+
+
-
-
-
-
+
+
+
+
-
+
diff --git a/src/Infrastructure/Persistence/Configurations/Enrolments/EnrolmentPqaQueueEntityTypeConfiguration.cs b/src/Infrastructure/Persistence/Configurations/Enrolments/EnrolmentPqaQueueEntityTypeConfiguration.cs
index 31bb2664..2a91a626 100644
--- a/src/Infrastructure/Persistence/Configurations/Enrolments/EnrolmentPqaQueueEntityTypeConfiguration.cs
+++ b/src/Infrastructure/Persistence/Configurations/Enrolments/EnrolmentPqaQueueEntityTypeConfiguration.cs
@@ -1,4 +1,4 @@
-using Cfo.Cats.Application.Common.Validators;
+using Cfo.Cats.Application.Common.Validators;
using Cfo.Cats.Domain.Entities.Participants;
using Cfo.Cats.Infrastructure.Constants.Database;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
@@ -45,9 +45,8 @@ public void Configure(EntityTypeBuilder builder)
note.Property(n => n.LastModifiedBy)
.HasMaxLength(DatabaseConstants.FieldLengths.GuidId);
-
-
-
+
+ note.Ignore(x => x.IsExternal);
});
builder.HasOne(t => t.Tenant)
diff --git a/src/Migrators/Migrators.MSSQL/Migrations/20241011130506_QaNoteExternal.Designer.cs b/src/Migrators/Migrators.MSSQL/Migrations/20241011130506_QaNoteExternal.Designer.cs
new file mode 100644
index 00000000..46a14d80
--- /dev/null
+++ b/src/Migrators/Migrators.MSSQL/Migrations/20241011130506_QaNoteExternal.Designer.cs
@@ -0,0 +1,2993 @@
+//
+using System;
+using Cfo.Cats.Infrastructure.Persistence;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace Cfo.Cats.Migrators.MSSQL.Migrations
+{
+ [DbContext(typeof(ApplicationDbContext))]
+ [Migration("20241011130506_QaNoteExternal")]
+ partial class QaNoteExternal
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "8.0.8")
+ .HasAnnotation("Relational:MaxIdentifierLength", 128);
+
+ SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
+
+ modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Contract", b =>
+ {
+ b.Property("Id")
+ .HasMaxLength(12)
+ .HasColumnType("nvarchar(12)");
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedBy")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("LastModified")
+ .HasColumnType("datetime2");
+
+ b.Property("LastModifiedBy")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("LotNumber")
+ .HasColumnType("int");
+
+ b.Property("_tenantId")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)")
+ .HasColumnName("TenantId");
+
+ b.HasKey("Id");
+
+ b.HasIndex("LotNumber")
+ .IsUnique();
+
+ b.HasIndex("_tenantId");
+
+ b.ToTable("Contract", "Configuration");
+ });
+
+ modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Location", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedBy")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("LastModified")
+ .HasColumnType("datetime2");
+
+ b.Property("LastModifiedBy")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)");
+
+ b.Property("_contractId")
+ .HasMaxLength(12)
+ .HasColumnType("nvarchar(12)")
+ .HasColumnName("ContractId");
+
+ b.Property("_genderProvisionId")
+ .HasColumnType("int")
+ .HasColumnName("GenderProvisionId");
+
+ b.Property("_locationTypeId")
+ .HasColumnType("int")
+ .HasColumnName("LocationTypeId");
+
+ b.Property("_parentLocationId")
+ .HasColumnType("int")
+ .HasColumnName("ParentLocationId");
+
+ b.HasKey("Id");
+
+ b.HasIndex("_contractId");
+
+ b.HasIndex("_parentLocationId");
+
+ b.ToTable("Location", "Configuration");
+ });
+
+ modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.LocationMapping", b =>
+ {
+ b.Property("Code")
+ .HasMaxLength(3)
+ .HasColumnType("nvarchar(3)");
+
+ b.Property("CodeType")
+ .HasMaxLength(9)
+ .HasColumnType("nvarchar(9)");
+
+ b.Property("DeliveryRegion")
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasMaxLength(200)
+ .HasColumnType("nvarchar(200)");
+
+ b.Property("_locationId")
+ .HasColumnType("int")
+ .HasColumnName("LocationId");
+
+ b.HasKey("Code", "CodeType");
+
+ b.HasIndex("_locationId");
+
+ b.ToTable("LocationMapping", "Dms");
+ });
+
+ modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Tenant", b =>
+ {
+ b.Property("Id")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedBy")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("Description")
+ .IsRequired()
+ .HasMaxLength(150)
+ .HasColumnType("nvarchar(150)");
+
+ b.Property("LastModified")
+ .HasColumnType("datetime2");
+
+ b.Property("LastModifiedBy")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.HasKey("Id");
+
+ b.ToTable("Tenant", "Configuration");
+ });
+
+ modelBuilder.Entity("Cfo.Cats.Domain.Entities.Assessments.ParticipantAssessment", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("AssessmentJson")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Completed")
+ .HasColumnType("datetime2");
+
+ b.Property("CompletedBy")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedBy")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("EditorId")
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("LastModified")
+ .HasColumnType("datetime2");
+
+ b.Property("LastModifiedBy")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("OwnerId")
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("ParticipantId")
+ .IsRequired()
+ .HasMaxLength(9)
+ .HasColumnType("nvarchar(9)");
+
+ b.Property("TenantId")
+ .HasColumnType("nvarchar(50)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("EditorId");
+
+ b.HasIndex("OwnerId");
+
+ b.HasIndex("ParticipantId");
+
+ b.HasIndex("TenantId");
+
+ b.ToTable("Assessment", "Participant");
+ });
+
+ modelBuilder.Entity("Cfo.Cats.Domain.Entities.AuditTrail", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("AffectedColumns")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("AuditType")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("DateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("NewValues")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("OldValues")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("PrimaryKey")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("TableName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("UserId")
+ .HasColumnType("nvarchar(36)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("AuditTrail", "Audit");
+ });
+
+ modelBuilder.Entity("Cfo.Cats.Domain.Entities.Bios.ParticipantBio", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("BioJson")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Completed")
+ .HasColumnType("datetime2");
+
+ b.Property("CompletedBy")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedBy")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("LastModified")
+ .HasColumnType("datetime2");
+
+ b.Property("LastModifiedBy")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("ParticipantId")
+ .IsRequired()
+ .HasMaxLength(9)
+ .HasColumnType("nvarchar(9)");
+
+ b.Property("Status")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ParticipantId");
+
+ b.ToTable("Bio", "Participant");
+ });
+
+ modelBuilder.Entity("Cfo.Cats.Domain.Entities.Documents.Document", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Content")
+ .HasMaxLength(4000)
+ .HasColumnType("nvarchar(4000)");
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedBy")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("Description")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("DocumentType")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("EditorId")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("IsPublic")
+ .HasColumnType("bit");
+
+ b.Property("LastModified")
+ .HasColumnType("datetime2");
+
+ b.Property("LastModifiedBy")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("OwnerId")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("TenantId")
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Title")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("URL")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Version")
+ .HasMaxLength(5)
+ .HasColumnType("nvarchar(5)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("CreatedBy");
+
+ b.HasIndex("LastModifiedBy");
+
+ b.HasIndex("TenantId");
+
+ b.ToTable("Document", "Document");
+ });
+
+ modelBuilder.Entity("Cfo.Cats.Domain.Entities.IdentityAuditTrail", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("ActionType")
+ .IsRequired()
+ .HasMaxLength(30)
+ .HasColumnType("nvarchar(30)");
+
+ b.Property("DateTime")
+ .HasColumnType("datetime2");
+
+ b.Property("IpAddress")
+ .HasMaxLength(30)
+ .HasColumnType("nvarchar(30)");
+
+ b.Property("PerformedBy")
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("UserName")
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("UserName", "DateTime")
+ .HasDatabaseName("idx_IdentityAudit_UserName_DateTime");
+
+ b.ToTable("IdentityAuditTrail", "Audit");
+ });
+
+ modelBuilder.Entity("Cfo.Cats.Domain.Entities.Inductions.HubInduction", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Created")
+ .IsRequired()
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedBy")
+ .IsRequired()
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("EditorId")
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("InductionDate")
+ .HasColumnType("datetime2");
+
+ b.Property("LastModified")
+ .HasColumnType("datetime2");
+
+ b.Property("LastModifiedBy")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("LocationId")
+ .HasColumnType("int");
+
+ b.Property("OwnerId")
+ .IsRequired()
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("ParticipantId")
+ .IsRequired()
+ .HasMaxLength(9)
+ .HasColumnType("nvarchar(9)");
+
+ b.HasKey("Id");
+
+ SqlServerKeyBuilderExtensions.IsClustered(b.HasKey("Id"), false);
+
+ b.HasIndex("CreatedBy");
+
+ b.HasIndex("EditorId");
+
+ b.HasIndex("LocationId");
+
+ b.HasIndex("OwnerId");
+
+ b.HasIndex("ParticipantId", "Created");
+
+ SqlServerIndexBuilderExtensions.IsClustered(b.HasIndex("ParticipantId", "Created"));
+
+ b.ToTable("HubInduction", "Induction");
+ });
+
+ modelBuilder.Entity("Cfo.Cats.Domain.Entities.Inductions.WingInduction", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Created")
+ .IsRequired()
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedBy")
+ .IsRequired()
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("EditorId")
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("InductionDate")
+ .HasColumnType("datetime2");
+
+ b.Property("LastModified")
+ .HasColumnType("datetime2");
+
+ b.Property("LastModifiedBy")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("LocationId")
+ .HasColumnType("int");
+
+ b.Property("OwnerId")
+ .IsRequired()
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("ParticipantId")
+ .IsRequired()
+ .HasMaxLength(9)
+ .HasColumnType("nvarchar(9)");
+
+ b.HasKey("Id");
+
+ SqlServerKeyBuilderExtensions.IsClustered(b.HasKey("Id"), false);
+
+ b.HasIndex("CreatedBy");
+
+ b.HasIndex("EditorId");
+
+ b.HasIndex("LocationId");
+
+ b.HasIndex("OwnerId");
+
+ b.HasIndex("ParticipantId", "Created");
+
+ SqlServerIndexBuilderExtensions.IsClustered(b.HasIndex("ParticipantId", "Created"));
+
+ b.ToTable("WingInduction", "Induction");
+ });
+
+ modelBuilder.Entity("Cfo.Cats.Domain.Entities.KeyValue", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedBy")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("Description")
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("LastModified")
+ .HasColumnType("datetime2");
+
+ b.Property("LastModifiedBy")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Text")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("Value")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.HasKey("Id");
+
+ b.ToTable("KeyValue", "Configuration");
+ });
+
+ modelBuilder.Entity("Cfo.Cats.Domain.Entities.ParticipantAccessAuditTrail", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("AccessDate")
+ .HasColumnType("datetime2");
+
+ b.Property("ParticipantId")
+ .IsRequired()
+ .HasMaxLength(9)
+ .HasColumnType("nvarchar(9)");
+
+ b.Property("RequestType")
+ .IsRequired()
+ .HasMaxLength(300)
+ .HasColumnType("nvarchar(300)");
+
+ b.Property("UserId")
+ .IsRequired()
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ParticipantId");
+
+ b.ToTable("AccessAuditTrail", "Audit");
+ });
+
+ modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentEscalationQueueEntry", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedBy")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("EditorId")
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("IsAccepted")
+ .HasColumnType("bit");
+
+ b.Property("IsCompleted")
+ .HasColumnType("bit");
+
+ b.Property("LastModified")
+ .HasColumnType("datetime2");
+
+ b.Property("LastModifiedBy")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("OwnerId")
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("ParticipantId")
+ .IsRequired()
+ .HasMaxLength(9)
+ .HasColumnType("nvarchar(9)");
+
+ b.Property("TenantId")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("EditorId");
+
+ b.HasIndex("OwnerId");
+
+ b.HasIndex("ParticipantId");
+
+ b.HasIndex("TenantId");
+
+ b.ToTable("EscalationQueue", "Enrolment");
+ });
+
+ modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentPqaQueueEntry", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedBy")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("EditorId")
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("IsAccepted")
+ .HasColumnType("bit");
+
+ b.Property("IsCompleted")
+ .HasColumnType("bit");
+
+ b.Property("LastModified")
+ .HasColumnType("datetime2");
+
+ b.Property("LastModifiedBy")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("OwnerId")
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("ParticipantId")
+ .IsRequired()
+ .HasMaxLength(9)
+ .HasColumnType("nvarchar(9)");
+
+ b.Property("TenantId")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("EditorId");
+
+ b.HasIndex("OwnerId");
+
+ b.HasIndex("ParticipantId");
+
+ b.HasIndex("TenantId");
+
+ b.ToTable("PqaQueue", "Enrolment");
+ });
+
+ modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentQa1QueueEntry", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedBy")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("EditorId")
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("IsAccepted")
+ .HasColumnType("bit");
+
+ b.Property("IsCompleted")
+ .HasColumnType("bit");
+
+ b.Property("LastModified")
+ .HasColumnType("datetime2");
+
+ b.Property("LastModifiedBy")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("OwnerId")
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("ParticipantId")
+ .IsRequired()
+ .HasMaxLength(9)
+ .HasColumnType("nvarchar(9)");
+
+ b.Property("TenantId")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("EditorId");
+
+ b.HasIndex("OwnerId");
+
+ b.HasIndex("ParticipantId");
+
+ b.HasIndex("TenantId");
+
+ b.ToTable("Qa1Queue", "Enrolment");
+ });
+
+ modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentQa2QueueEntry", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedBy")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("EditorId")
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("IsAccepted")
+ .HasColumnType("bit");
+
+ b.Property("IsCompleted")
+ .HasColumnType("bit");
+
+ b.Property("IsEscalated")
+ .HasColumnType("bit");
+
+ b.Property("LastModified")
+ .HasColumnType("datetime2");
+
+ b.Property("LastModifiedBy")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("OwnerId")
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("ParticipantId")
+ .IsRequired()
+ .HasMaxLength(9)
+ .HasColumnType("nvarchar(9)");
+
+ b.Property("TenantId")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("EditorId");
+
+ b.HasIndex("OwnerId");
+
+ b.HasIndex("ParticipantId");
+
+ b.HasIndex("TenantId");
+
+ b.ToTable("Qa2Queue", "Enrolment");
+ });
+
+ modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Participant", b =>
+ {
+ b.Property("Id")
+ .HasMaxLength(9)
+ .HasColumnType("nvarchar(9)");
+
+ b.Property("ActiveInFeed")
+ .HasColumnType("bit");
+
+ b.Property("AssessmentJustification")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ConsentStatus")
+ .HasColumnType("int");
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedBy")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("DateOfBirth")
+ .HasColumnType("date");
+
+ b.Property("EditorId")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("EnrolmentLocationJustification")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("EnrolmentStatus")
+ .HasColumnType("int");
+
+ b.Property("FirstName")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Gender")
+ .HasMaxLength(6)
+ .HasColumnType("nvarchar(6)");
+
+ b.Property("LastModified")
+ .HasColumnType("datetime2");
+
+ b.Property("LastModifiedBy")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("LastName")
+ .IsRequired()
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("MiddleName")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("Nationality")
+ .HasMaxLength(50)
+ .HasColumnType("nvarchar(50)");
+
+ b.Property("OwnerId")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("ReferralComments")
+ .HasMaxLength(1000)
+ .HasColumnType("nvarchar(1000)");
+
+ b.Property("ReferralSource")
+ .IsRequired()
+ .HasMaxLength(100)
+ .HasColumnType("nvarchar(100)");
+
+ b.Property("RegistrationDetailsJson")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("RiskDue")
+ .HasColumnType("datetime2");
+
+ b.Property("_currentLocationId")
+ .HasColumnType("int")
+ .HasColumnName("CurrentLocationId");
+
+ b.Property("_enrolmentLocationId")
+ .HasColumnType("int")
+ .HasColumnName("EnrolmentLocationId");
+
+ b.HasKey("Id");
+
+ b.HasIndex("EditorId");
+
+ b.HasIndex("OwnerId");
+
+ b.HasIndex("_currentLocationId");
+
+ b.HasIndex("_enrolmentLocationId");
+
+ b.ToTable("Participant", "Participant");
+ });
+
+ modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.ParticipantEnrolmentHistory", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedBy")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("EnrolmentStatus")
+ .HasColumnType("int");
+
+ b.Property("LastModified")
+ .HasColumnType("datetime2");
+
+ b.Property("LastModifiedBy")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("ParticipantId")
+ .IsRequired()
+ .HasMaxLength(9)
+ .HasColumnType("nvarchar(9)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ParticipantId");
+
+ b.ToTable("EnrolmentHistory", "Participant");
+ });
+
+ modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.PathwayPlan", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedBy")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("LastModified")
+ .HasColumnType("datetime2");
+
+ b.Property("LastModifiedBy")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("ParticipantId")
+ .IsRequired()
+ .HasMaxLength(9)
+ .HasColumnType("nvarchar(9)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ParticipantId");
+
+ b.ToTable("PathwayPlan", "Participant");
+ });
+
+ modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Risk", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ActivityRecommendations")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ActivityRecommendationsReceived")
+ .HasColumnType("datetime2");
+
+ b.Property("ActivityRestrictions")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ActivityRestrictionsReceived")
+ .HasColumnType("datetime2");
+
+ b.Property("AdditionalInformation")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Completed")
+ .HasColumnType("datetime2");
+
+ b.Property("CompletedBy")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("Created")
+ .HasColumnType("datetime2");
+
+ b.Property("CreatedBy")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("IsRelevantToCommunity")
+ .HasColumnType("bit");
+
+ b.Property("IsRelevantToCustody")
+ .HasColumnType("bit");
+
+ b.Property("IsSubjectToSHPO")
+ .HasColumnType("int");
+
+ b.Property("LastModified")
+ .HasColumnType("datetime2");
+
+ b.Property("LastModifiedBy")
+ .HasMaxLength(36)
+ .HasColumnType("nvarchar(36)");
+
+ b.Property("LicenseConditions")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("LicenseEnd")
+ .HasColumnType("datetime2");
+
+ b.Property