From 6693f70fda96d970e3bede93d43bc1b7c5d79653 Mon Sep 17 00:00:00 2001 From: samgibsonmoj Date: Fri, 16 Aug 2024 15:12:44 +0100 Subject: [PATCH] Squash development migrations => PathwayPlan --- .../20240809101015_Objectives.Designer.cs | 2395 ---------------- .../20240813134025_Objectives_v2.Designer.cs | 2429 ---------------- .../20240813134025_Objectives_v2.cs | 75 - .../20240813163959_Objectives_v3.Designer.cs | 2429 ---------------- .../20240813163959_Objectives_v3.cs | 54 - .../20240813182343_Objectives_v4.Designer.cs | 2426 ---------------- .../20240813182343_Objectives_v4.cs | 55 - .../20240815084514_Objectives_v5.Designer.cs | 2432 ---------------- .../20240815084514_Objectives_v5.cs | 44 - .../20240815085352_Objectives_v6.Designer.cs | 2432 ---------------- .../20240815085352_Objectives_v6.cs | 39 - .../20240815090249_Objectives_v7.Designer.cs | 2435 ---------------- .../20240815090249_Objectives_v7.cs | 30 - .../20240815140110_Objectives_v8.Designer.cs | 2505 ----------------- .../20240815140110_Objectives_v8.cs | 144 - .../20240816124115_Objectives_v9.cs | 44 - ...=> 20240816141136_PathwayPlan.Designer.cs} | 52 +- ...tives.cs => 20240816141136_PathwayPlan.cs} | 87 +- 18 files changed, 131 insertions(+), 19976 deletions(-) delete mode 100644 src/Migrators/Migrators.MSSQL/Migrations/20240809101015_Objectives.Designer.cs delete mode 100644 src/Migrators/Migrators.MSSQL/Migrations/20240813134025_Objectives_v2.Designer.cs delete mode 100644 src/Migrators/Migrators.MSSQL/Migrations/20240813134025_Objectives_v2.cs delete mode 100644 src/Migrators/Migrators.MSSQL/Migrations/20240813163959_Objectives_v3.Designer.cs delete mode 100644 src/Migrators/Migrators.MSSQL/Migrations/20240813163959_Objectives_v3.cs delete mode 100644 src/Migrators/Migrators.MSSQL/Migrations/20240813182343_Objectives_v4.Designer.cs delete mode 100644 src/Migrators/Migrators.MSSQL/Migrations/20240813182343_Objectives_v4.cs delete mode 100644 src/Migrators/Migrators.MSSQL/Migrations/20240815084514_Objectives_v5.Designer.cs delete mode 100644 src/Migrators/Migrators.MSSQL/Migrations/20240815084514_Objectives_v5.cs delete mode 100644 src/Migrators/Migrators.MSSQL/Migrations/20240815085352_Objectives_v6.Designer.cs delete mode 100644 src/Migrators/Migrators.MSSQL/Migrations/20240815085352_Objectives_v6.cs delete mode 100644 src/Migrators/Migrators.MSSQL/Migrations/20240815090249_Objectives_v7.Designer.cs delete mode 100644 src/Migrators/Migrators.MSSQL/Migrations/20240815090249_Objectives_v7.cs delete mode 100644 src/Migrators/Migrators.MSSQL/Migrations/20240815140110_Objectives_v8.Designer.cs delete mode 100644 src/Migrators/Migrators.MSSQL/Migrations/20240815140110_Objectives_v8.cs delete mode 100644 src/Migrators/Migrators.MSSQL/Migrations/20240816124115_Objectives_v9.cs rename src/Migrators/Migrators.MSSQL/Migrations/{20240816124115_Objectives_v9.Designer.cs => 20240816141136_PathwayPlan.Designer.cs} (98%) rename src/Migrators/Migrators.MSSQL/Migrations/{20240809101015_Objectives.cs => 20240816141136_PathwayPlan.cs} (50%) diff --git a/src/Migrators/Migrators.MSSQL/Migrations/20240809101015_Objectives.Designer.cs b/src/Migrators/Migrators.MSSQL/Migrations/20240809101015_Objectives.Designer.cs deleted file mode 100644 index b61fe00d..00000000 --- a/src/Migrators/Migrators.MSSQL/Migrations/20240809101015_Objectives.Designer.cs +++ /dev/null @@ -1,2395 +0,0 @@ -// -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("20240809101015_Objectives")] - partial class Objectives - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.7") - .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("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.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.HasKey("Id"); - - b.HasIndex("CreatedBy"); - - b.HasIndex("LastModifiedBy"); - - b.HasIndex("TenantId"); - - b.ToTable("Document", "Document"); - }); - - 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.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("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.Objective", 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.Property("Title") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("ParticipantId"); - - b.ToTable("Objective", "Participant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Participant", b => - { - b.Property("Id") - .HasMaxLength(9) - .HasColumnType("nvarchar(9)"); - - b.Property("ConsentStatus") - .HasColumnType("int"); - - b.Property("Created") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("DateOfBirth") - .IsRequired() - .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("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("OwnerId") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("ReferralComments") - .HasColumnType("nvarchar(max)"); - - b.Property("ReferralSource") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - 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.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("Created") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("DeclarationSigned") - .HasColumnType("bit"); - - 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("MappaCategory") - .HasColumnType("int"); - - b.Property("MappaLevel") - .HasColumnType("int"); - - b.Property("NSDCase") - .HasColumnType("int"); - - b.Property("PSFRestrictions") - .HasColumnType("nvarchar(max)"); - - b.Property("PSFRestrictionsReceived") - .HasColumnType("datetime2"); - - b.Property("ParticipantId") - .IsRequired() - .HasColumnType("nvarchar(9)"); - - b.Property("ReferredOn") - .HasColumnType("datetime2"); - - b.Property("ReferrerEmail") - .HasColumnType("nvarchar(max)"); - - b.Property("ReferrerName") - .HasColumnType("nvarchar(max)"); - - b.Property("ReviewJustification") - .HasColumnType("nvarchar(max)"); - - b.Property("ReviewReason") - .HasColumnType("int"); - - b.Property("RiskToChildrenInCommunity") - .HasColumnType("int"); - - b.Property("RiskToChildrenInCustody") - .HasColumnType("int"); - - b.Property("RiskToKnownAdultInCommunity") - .HasColumnType("int"); - - b.Property("RiskToKnownAdultInCustody") - .HasColumnType("int"); - - b.Property("RiskToOtherPrisonersInCommunity") - .HasColumnType("int"); - - b.Property("RiskToOtherPrisonersInCustody") - .HasColumnType("int"); - - b.Property("RiskToPublicInCommunity") - .HasColumnType("int"); - - b.Property("RiskToPublicInCustody") - .HasColumnType("int"); - - b.Property("RiskToSelfInCommunity") - .HasColumnType("int"); - - b.Property("RiskToSelfInCustody") - .HasColumnType("int"); - - b.Property("RiskToStaffInCommunity") - .HasColumnType("int"); - - b.Property("RiskToStaffInCustody") - .HasColumnType("int"); - - b.Property("SpecificRisk") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("ParticipantId"); - - b.ToTable("Risk", "Participant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Timeline", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Created") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(36)"); - - b.Property("EventType") - .HasColumnType("int"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("Line1") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Line2") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Line3") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ParticipantId") - .IsRequired() - .HasColumnType("nvarchar(9)"); - - b.HasKey("Id"); - - b.HasIndex("CreatedBy"); - - b.HasIndex("ParticipantId"); - - b.ToTable("Timeline", "Participant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationRole", b => - { - b.Property("Id") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("NormalizedName") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RoleRank") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("Role", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Group") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RoleId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("RoleClaim", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUser", b => - { - b.Property("Id") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Created") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("DisplayName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("IsLive") - .HasColumnType("bit"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("MemorableDate") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("MemorablePlace") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("ProfilePictureDataUrl") - .HasColumnType("text"); - - b.Property("ProviderId") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RefreshToken") - .HasColumnType("nvarchar(max)"); - - b.Property("RefreshTokenExpiryTime") - .HasColumnType("datetime2"); - - b.Property("RequiresPasswordReset") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("SuperiorId") - .HasColumnType("nvarchar(36)"); - - b.Property("TenantId") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("TenantName") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.HasIndex("SuperiorId"); - - b.HasIndex("TenantId"); - - b.ToTable("User", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("UserId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("UserClaim", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserRole", b => - { - b.Property("UserId") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("RoleId") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("UserRole", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserToken", b => - { - b.Property("UserId") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("UserToken", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.UserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("UserLogin", "Identity"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("FriendlyName") - .HasColumnType("nvarchar(max)"); - - b.Property("Xml") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("DataProtectionKeys"); - }); - - modelBuilder.Entity("TenantLocation", b => - { - b.Property("LocationId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("nvarchar(50)"); - - b.HasKey("LocationId", "TenantId"); - - b.HasIndex("TenantId"); - - b.ToTable("TenantLocation", "Configuration"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Contract", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("_tenantId"); - - b.OwnsOne("Cfo.Cats.Domain.ValueObjects.Lifetime", "Lifetime", b1 => - { - b1.Property("ContractId") - .HasColumnType("nvarchar(12)"); - - b1.Property("EndDate") - .HasColumnType("datetime2") - .HasColumnName("LifetimeEnd"); - - b1.Property("StartDate") - .HasColumnType("datetime2") - .HasColumnName("LifetimeStart"); - - b1.HasKey("ContractId"); - - b1.ToTable("Contract", "Configuration"); - - b1.WithOwner() - .HasForeignKey("ContractId"); - }); - - b.Navigation("Lifetime") - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Location", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Contract", "Contract") - .WithMany("Locations") - .HasForeignKey("_contractId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", "ParentLocation") - .WithMany("ChildLocations") - .HasForeignKey("_parentLocationId") - .OnDelete(DeleteBehavior.Restrict); - - b.OwnsOne("Cfo.Cats.Domain.ValueObjects.Lifetime", "Lifetime", b1 => - { - b1.Property("LocationId") - .HasColumnType("int"); - - b1.Property("EndDate") - .HasColumnType("datetime2") - .HasColumnName("LifetimeEnd"); - - b1.Property("StartDate") - .HasColumnType("datetime2") - .HasColumnName("LifetimeStart"); - - b1.HasKey("LocationId"); - - b1.ToTable("Location", "Configuration"); - - b1.WithOwner() - .HasForeignKey("LocationId"); - }); - - b.Navigation("Contract"); - - b.Navigation("Lifetime") - .IsRequired(); - - b.Navigation("ParentLocation"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.LocationMapping", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", "Location") - .WithMany("LocationMappings") - .HasForeignKey("_locationId"); - - b.Navigation("Location"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Tenant", b => - { - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.TenantDomain", "Domains", b1 => - { - b1.Property("TenantId") - .HasColumnType("nvarchar(50)"); - - b1.Property("Domain") - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.HasKey("TenantId", "Domain"); - - b1.ToTable("TenantDomain", "Configuration"); - - b1.WithOwner() - .HasForeignKey("TenantId"); - }); - - b.Navigation("Domains"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Assessments.ParticipantAssessment", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", null) - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", null) - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.PathwayScore", "Scores", b1 => - { - b1.Property("AssessmentId") - .HasColumnType("uniqueidentifier"); - - b1.Property("Pathway") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b1.Property("Score") - .HasColumnType("float"); - - b1.HasKey("AssessmentId", "Pathway"); - - b1.ToTable("AssessmentPathwayScore", "Participant"); - - b1.WithOwner() - .HasForeignKey("AssessmentId"); - }); - - b.Navigation("Editor"); - - b.Navigation("Owner"); - - b.Navigation("Scores"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.AuditTrail", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("Owner"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Documents.Document", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("CreatedBy") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("LastModifiedBy") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId"); - - b.Navigation("Editor"); - - b.Navigation("Owner"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentEscalationQueueEntry", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", "Participant") - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("EnrolmentEscalationQueueEntryId") - .HasColumnType("uniqueidentifier"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("EnrolmentEscalationQueueEntryId"); - - b1.HasIndex("LastModifiedBy"); - - b1.ToTable("EscalationNote", "Enrolment"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.WithOwner() - .HasForeignKey("EnrolmentEscalationQueueEntryId"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Editor"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("Participant"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentPqaQueueEntry", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", "Participant") - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("EnrolmentPqaQueueEntryId") - .HasColumnType("uniqueidentifier"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("EnrolmentPqaQueueEntryId"); - - b1.HasIndex("LastModifiedBy"); - - b1.ToTable("PqaQueueNote", "Enrolment"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.WithOwner() - .HasForeignKey("EnrolmentPqaQueueEntryId"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Editor"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("Participant"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentQa1QueueEntry", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", "Participant") - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("EnrolmentQa1QueueEntryId") - .HasColumnType("uniqueidentifier"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("EnrolmentQa1QueueEntryId"); - - b1.HasIndex("LastModifiedBy"); - - b1.ToTable("Qa1QueueNote", "Enrolment"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.WithOwner() - .HasForeignKey("EnrolmentQa1QueueEntryId"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Editor"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("Participant"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentQa2QueueEntry", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", "Participant") - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("EnrolmentQa2QueueEntryId") - .HasColumnType("uniqueidentifier"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("EnrolmentQa2QueueEntryId"); - - b1.HasIndex("LastModifiedBy"); - - b1.ToTable("Qa2QueueNote", "Enrolment"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.WithOwner() - .HasForeignKey("EnrolmentQa2QueueEntryId"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Editor"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("Participant"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Objective", b => - { - b.OwnsMany("Cfo.Cats.Domain.Entities.Participants.ObjectiveTask", "Tasks", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b1.Property("Completed") - .HasColumnType("datetime2"); - - b1.Property("CompletedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Due") - .HasColumnType("datetime2"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("ObjectiveId") - .HasColumnType("uniqueidentifier"); - - b1.Property("Title") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CompletedBy"); - - b1.HasIndex("ObjectiveId"); - - b1.ToTable("ObjectiveTask", "Participant"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CompletedByUser") - .WithMany() - .HasForeignKey("CompletedBy"); - - b1.WithOwner() - .HasForeignKey("ObjectiveId"); - - b1.Navigation("CompletedByUser"); - }); - - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Participant", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", "CurrentLocation") - .WithMany() - .HasForeignKey("_currentLocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_Participant_Location"); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", "EnrolmentLocation") - .WithMany() - .HasForeignKey("_enrolmentLocationId") - .HasConstraintName("FK_Participant_EnrolmentLocation"); - - b.OwnsMany("Cfo.Cats.Domain.Entities.Participants.Consent", "Consents", b1 => - { - b1.Property("ParticipantId") - .HasColumnType("nvarchar(9)"); - - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("_documentId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DocumentId"); - - b1.HasKey("ParticipantId", "Id"); - - b1.HasIndex("_documentId"); - - b1.ToTable("Consent", "Participant"); - - b1.WithOwner() - .HasForeignKey("ParticipantId"); - - b1.HasOne("Cfo.Cats.Domain.Entities.Documents.Document", "Document") - .WithMany() - .HasForeignKey("_documentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b1.OwnsOne("Cfo.Cats.Domain.ValueObjects.Lifetime", "Lifetime", b2 => - { - b2.Property("ConsentParticipantId") - .HasColumnType("nvarchar(9)"); - - b2.Property("ConsentId") - .HasColumnType("int"); - - b2.Property("EndDate") - .HasColumnType("datetime2") - .HasColumnName("ValidTo"); - - b2.Property("StartDate") - .HasColumnType("datetime2") - .HasColumnName("ValidFrom"); - - b2.HasKey("ConsentParticipantId", "ConsentId"); - - b2.ToTable("Consent", "Participant"); - - b2.WithOwner() - .HasForeignKey("ConsentParticipantId", "ConsentId"); - }); - - b1.Navigation("Document"); - - b1.Navigation("Lifetime") - .IsRequired(); - }); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("ParticipantId") - .IsRequired() - .HasColumnType("nvarchar(9)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("LastModifiedBy"); - - b1.HasIndex("ParticipantId"); - - b1.ToTable("Note", "Participant"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.WithOwner() - .HasForeignKey("ParticipantId"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.OwnsMany("Cfo.Cats.Domain.Entities.Participants.RightToWork", "RightToWorks", b1 => - { - b1.Property("ParticipantId") - .HasColumnType("nvarchar(9)"); - - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("_documentId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DocumentId"); - - b1.HasKey("ParticipantId", "Id"); - - b1.HasIndex("_documentId"); - - b1.ToTable("RightToWork", "Participant"); - - b1.WithOwner() - .HasForeignKey("ParticipantId"); - - b1.HasOne("Cfo.Cats.Domain.Entities.Documents.Document", "Document") - .WithMany() - .HasForeignKey("_documentId"); - - b1.OwnsOne("Cfo.Cats.Domain.ValueObjects.Lifetime", "Lifetime", b2 => - { - b2.Property("RightToWorkParticipantId") - .HasColumnType("nvarchar(9)"); - - b2.Property("RightToWorkId") - .HasColumnType("int"); - - b2.Property("EndDate") - .HasColumnType("datetime2") - .HasColumnName("ValidTo"); - - b2.Property("StartDate") - .HasColumnType("datetime2") - .HasColumnName("ValidFrom"); - - b2.HasKey("RightToWorkParticipantId", "RightToWorkId"); - - b2.ToTable("RightToWork", "Participant"); - - b2.WithOwner() - .HasForeignKey("RightToWorkParticipantId", "RightToWorkId"); - }); - - b1.Navigation("Document"); - - b1.Navigation("Lifetime") - .IsRequired(); - }); - - b.Navigation("Consents"); - - b.Navigation("CurrentLocation"); - - b.Navigation("Editor"); - - b.Navigation("EnrolmentLocation"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("RightToWorks"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Risk", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", null) - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Timeline", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", null) - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CreatedByUser"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationRoleClaim", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationRole", "Role") - .WithMany("RoleClaims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Role"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUser", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Superior") - .WithMany() - .HasForeignKey("SuperiorId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.Property("UserId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("LastModifiedBy"); - - b1.HasIndex("UserId"); - - b1.ToTable("Note", "Identity"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.WithOwner() - .HasForeignKey("UserId"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Notes"); - - b.Navigation("Superior"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserClaim", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "User") - .WithMany("UserClaims") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserRole", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationRole", "Role") - .WithMany("UserRoles") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "User") - .WithMany("UserRoles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Role"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserToken", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "User") - .WithMany("Tokens") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.UserLogin", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "User") - .WithMany("Logins") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("TenantLocation", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", null) - .WithMany() - .HasForeignKey("LocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", null) - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Contract", b => - { - b.Navigation("Locations"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Location", b => - { - b.Navigation("ChildLocations"); - - b.Navigation("LocationMappings"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationRole", b => - { - b.Navigation("RoleClaims"); - - b.Navigation("UserRoles"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUser", b => - { - b.Navigation("Logins"); - - b.Navigation("Tokens"); - - b.Navigation("UserClaims"); - - b.Navigation("UserRoles"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Migrators/Migrators.MSSQL/Migrations/20240813134025_Objectives_v2.Designer.cs b/src/Migrators/Migrators.MSSQL/Migrations/20240813134025_Objectives_v2.Designer.cs deleted file mode 100644 index f879b52f..00000000 --- a/src/Migrators/Migrators.MSSQL/Migrations/20240813134025_Objectives_v2.Designer.cs +++ /dev/null @@ -1,2429 +0,0 @@ -// -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("20240813134025_Objectives_v2")] - partial class Objectives_v2 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.7") - .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("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.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.HasKey("Id"); - - b.HasIndex("CreatedBy"); - - b.HasIndex("LastModifiedBy"); - - b.HasIndex("TenantId"); - - b.ToTable("Document", "Document"); - }); - - 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.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("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.Objective", 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.Property("Title") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("ParticipantId"); - - b.ToTable("Objective", "Participant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Participant", b => - { - b.Property("Id") - .HasMaxLength(9) - .HasColumnType("nvarchar(9)"); - - b.Property("ConsentStatus") - .HasColumnType("int"); - - b.Property("Created") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("DateOfBirth") - .IsRequired() - .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("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("OwnerId") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("ReferralComments") - .HasColumnType("nvarchar(max)"); - - b.Property("ReferralSource") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - 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.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("Created") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("DeclarationSigned") - .HasColumnType("bit"); - - 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("MappaCategory") - .HasColumnType("int"); - - b.Property("MappaLevel") - .HasColumnType("int"); - - b.Property("NSDCase") - .HasColumnType("int"); - - b.Property("PSFRestrictions") - .HasColumnType("nvarchar(max)"); - - b.Property("PSFRestrictionsReceived") - .HasColumnType("datetime2"); - - b.Property("ParticipantId") - .IsRequired() - .HasColumnType("nvarchar(9)"); - - b.Property("ReferredOn") - .HasColumnType("datetime2"); - - b.Property("ReferrerEmail") - .HasColumnType("nvarchar(max)"); - - b.Property("ReferrerName") - .HasColumnType("nvarchar(max)"); - - b.Property("ReviewJustification") - .HasColumnType("nvarchar(max)"); - - b.Property("ReviewReason") - .HasColumnType("int"); - - b.Property("RiskToChildrenInCommunity") - .HasColumnType("int"); - - b.Property("RiskToChildrenInCustody") - .HasColumnType("int"); - - b.Property("RiskToKnownAdultInCommunity") - .HasColumnType("int"); - - b.Property("RiskToKnownAdultInCustody") - .HasColumnType("int"); - - b.Property("RiskToOtherPrisonersInCommunity") - .HasColumnType("int"); - - b.Property("RiskToOtherPrisonersInCustody") - .HasColumnType("int"); - - b.Property("RiskToPublicInCommunity") - .HasColumnType("int"); - - b.Property("RiskToPublicInCustody") - .HasColumnType("int"); - - b.Property("RiskToSelfInCommunity") - .HasColumnType("int"); - - b.Property("RiskToSelfInCustody") - .HasColumnType("int"); - - b.Property("RiskToStaffInCommunity") - .HasColumnType("int"); - - b.Property("RiskToStaffInCustody") - .HasColumnType("int"); - - b.Property("SpecificRisk") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("ParticipantId"); - - b.ToTable("Risk", "Participant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Timeline", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Created") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(36)"); - - b.Property("EventType") - .HasColumnType("int"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("Line1") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Line2") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Line3") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ParticipantId") - .IsRequired() - .HasColumnType("nvarchar(9)"); - - b.HasKey("Id"); - - b.HasIndex("CreatedBy"); - - b.HasIndex("ParticipantId"); - - b.ToTable("Timeline", "Participant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationRole", b => - { - b.Property("Id") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("NormalizedName") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RoleRank") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("Role", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Group") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RoleId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("RoleClaim", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUser", b => - { - b.Property("Id") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Created") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("DisplayName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("IsLive") - .HasColumnType("bit"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("MemorableDate") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("MemorablePlace") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("ProfilePictureDataUrl") - .HasColumnType("text"); - - b.Property("ProviderId") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RefreshToken") - .HasColumnType("nvarchar(max)"); - - b.Property("RefreshTokenExpiryTime") - .HasColumnType("datetime2"); - - b.Property("RequiresPasswordReset") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("SuperiorId") - .HasColumnType("nvarchar(36)"); - - b.Property("TenantId") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("TenantName") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.HasIndex("SuperiorId"); - - b.HasIndex("TenantId"); - - b.ToTable("User", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("UserId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("UserClaim", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserRole", b => - { - b.Property("UserId") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("RoleId") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("UserRole", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserToken", b => - { - b.Property("UserId") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("UserToken", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.PasswordHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("PasswordHash") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("Id"); - - b.ToTable("PasswordHistory", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.UserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("UserLogin", "Identity"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("FriendlyName") - .HasColumnType("nvarchar(max)"); - - b.Property("Xml") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("DataProtectionKeys"); - }); - - modelBuilder.Entity("TenantLocation", b => - { - b.Property("LocationId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("nvarchar(50)"); - - b.HasKey("LocationId", "TenantId"); - - b.HasIndex("TenantId"); - - b.ToTable("TenantLocation", "Configuration"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Contract", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("_tenantId"); - - b.OwnsOne("Cfo.Cats.Domain.ValueObjects.Lifetime", "Lifetime", b1 => - { - b1.Property("ContractId") - .HasColumnType("nvarchar(12)"); - - b1.Property("EndDate") - .HasColumnType("datetime2") - .HasColumnName("LifetimeEnd"); - - b1.Property("StartDate") - .HasColumnType("datetime2") - .HasColumnName("LifetimeStart"); - - b1.HasKey("ContractId"); - - b1.ToTable("Contract", "Configuration"); - - b1.WithOwner() - .HasForeignKey("ContractId"); - }); - - b.Navigation("Lifetime") - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Location", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Contract", "Contract") - .WithMany("Locations") - .HasForeignKey("_contractId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", "ParentLocation") - .WithMany("ChildLocations") - .HasForeignKey("_parentLocationId") - .OnDelete(DeleteBehavior.Restrict); - - b.OwnsOne("Cfo.Cats.Domain.ValueObjects.Lifetime", "Lifetime", b1 => - { - b1.Property("LocationId") - .HasColumnType("int"); - - b1.Property("EndDate") - .HasColumnType("datetime2") - .HasColumnName("LifetimeEnd"); - - b1.Property("StartDate") - .HasColumnType("datetime2") - .HasColumnName("LifetimeStart"); - - b1.HasKey("LocationId"); - - b1.ToTable("Location", "Configuration"); - - b1.WithOwner() - .HasForeignKey("LocationId"); - }); - - b.Navigation("Contract"); - - b.Navigation("Lifetime") - .IsRequired(); - - b.Navigation("ParentLocation"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.LocationMapping", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", "Location") - .WithMany("LocationMappings") - .HasForeignKey("_locationId"); - - b.Navigation("Location"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Tenant", b => - { - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.TenantDomain", "Domains", b1 => - { - b1.Property("TenantId") - .HasColumnType("nvarchar(50)"); - - b1.Property("Domain") - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.HasKey("TenantId", "Domain"); - - b1.ToTable("TenantDomain", "Configuration"); - - b1.WithOwner() - .HasForeignKey("TenantId"); - }); - - b.Navigation("Domains"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Assessments.ParticipantAssessment", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", null) - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", null) - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.PathwayScore", "Scores", b1 => - { - b1.Property("AssessmentId") - .HasColumnType("uniqueidentifier"); - - b1.Property("Pathway") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b1.Property("Score") - .HasColumnType("float"); - - b1.HasKey("AssessmentId", "Pathway"); - - b1.ToTable("AssessmentPathwayScore", "Participant"); - - b1.WithOwner() - .HasForeignKey("AssessmentId"); - }); - - b.Navigation("Editor"); - - b.Navigation("Owner"); - - b.Navigation("Scores"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.AuditTrail", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("Owner"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Documents.Document", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("CreatedBy") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("LastModifiedBy") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId"); - - b.Navigation("Editor"); - - b.Navigation("Owner"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentEscalationQueueEntry", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", "Participant") - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("EnrolmentEscalationQueueEntryId") - .HasColumnType("uniqueidentifier"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("EnrolmentEscalationQueueEntryId"); - - b1.HasIndex("LastModifiedBy"); - - b1.ToTable("EscalationNote", "Enrolment"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.WithOwner() - .HasForeignKey("EnrolmentEscalationQueueEntryId"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Editor"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("Participant"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentPqaQueueEntry", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", "Participant") - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("EnrolmentPqaQueueEntryId") - .HasColumnType("uniqueidentifier"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("EnrolmentPqaQueueEntryId"); - - b1.HasIndex("LastModifiedBy"); - - b1.ToTable("PqaQueueNote", "Enrolment"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.WithOwner() - .HasForeignKey("EnrolmentPqaQueueEntryId"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Editor"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("Participant"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentQa1QueueEntry", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", "Participant") - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("EnrolmentQa1QueueEntryId") - .HasColumnType("uniqueidentifier"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("EnrolmentQa1QueueEntryId"); - - b1.HasIndex("LastModifiedBy"); - - b1.ToTable("Qa1QueueNote", "Enrolment"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.WithOwner() - .HasForeignKey("EnrolmentQa1QueueEntryId"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Editor"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("Participant"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentQa2QueueEntry", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", "Participant") - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("EnrolmentQa2QueueEntryId") - .HasColumnType("uniqueidentifier"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("EnrolmentQa2QueueEntryId"); - - b1.HasIndex("LastModifiedBy"); - - b1.ToTable("Qa2QueueNote", "Enrolment"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.WithOwner() - .HasForeignKey("EnrolmentQa2QueueEntryId"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Editor"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("Participant"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Objective", b => - { - b.OwnsMany("Cfo.Cats.Domain.Entities.Participants.ObjectiveTask", "Tasks", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b1.Property("Cancelled") - .HasColumnType("datetime2"); - - b1.Property("CancelledBy") - .HasColumnType("nvarchar(max)"); - - b1.Property("CancelledReason") - .HasColumnType("nvarchar(max)"); - - b1.Property("Completed") - .HasColumnType("datetime2"); - - b1.Property("CompletedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Due") - .HasColumnType("datetime2"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("ObjectiveId") - .HasColumnType("uniqueidentifier"); - - b1.Property("Title") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CompletedBy"); - - b1.HasIndex("ObjectiveId"); - - b1.ToTable("ObjectiveTask", "Participant"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CompletedByUser") - .WithMany() - .HasForeignKey("CompletedBy"); - - b1.WithOwner() - .HasForeignKey("ObjectiveId"); - - b1.Navigation("CompletedByUser"); - }); - - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Participant", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", "CurrentLocation") - .WithMany() - .HasForeignKey("_currentLocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_Participant_Location"); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", "EnrolmentLocation") - .WithMany() - .HasForeignKey("_enrolmentLocationId") - .HasConstraintName("FK_Participant_EnrolmentLocation"); - - b.OwnsMany("Cfo.Cats.Domain.Entities.Participants.Consent", "Consents", b1 => - { - b1.Property("ParticipantId") - .HasColumnType("nvarchar(9)"); - - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("_documentId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DocumentId"); - - b1.HasKey("ParticipantId", "Id"); - - b1.HasIndex("_documentId"); - - b1.ToTable("Consent", "Participant"); - - b1.WithOwner() - .HasForeignKey("ParticipantId"); - - b1.HasOne("Cfo.Cats.Domain.Entities.Documents.Document", "Document") - .WithMany() - .HasForeignKey("_documentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b1.OwnsOne("Cfo.Cats.Domain.ValueObjects.Lifetime", "Lifetime", b2 => - { - b2.Property("ConsentParticipantId") - .HasColumnType("nvarchar(9)"); - - b2.Property("ConsentId") - .HasColumnType("int"); - - b2.Property("EndDate") - .HasColumnType("datetime2") - .HasColumnName("ValidTo"); - - b2.Property("StartDate") - .HasColumnType("datetime2") - .HasColumnName("ValidFrom"); - - b2.HasKey("ConsentParticipantId", "ConsentId"); - - b2.ToTable("Consent", "Participant"); - - b2.WithOwner() - .HasForeignKey("ConsentParticipantId", "ConsentId"); - }); - - b1.Navigation("Document"); - - b1.Navigation("Lifetime") - .IsRequired(); - }); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("ParticipantId") - .IsRequired() - .HasColumnType("nvarchar(9)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("LastModifiedBy"); - - b1.HasIndex("ParticipantId"); - - b1.ToTable("Note", "Participant"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.WithOwner() - .HasForeignKey("ParticipantId"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.OwnsMany("Cfo.Cats.Domain.Entities.Participants.RightToWork", "RightToWorks", b1 => - { - b1.Property("ParticipantId") - .HasColumnType("nvarchar(9)"); - - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("_documentId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DocumentId"); - - b1.HasKey("ParticipantId", "Id"); - - b1.HasIndex("_documentId"); - - b1.ToTable("RightToWork", "Participant"); - - b1.WithOwner() - .HasForeignKey("ParticipantId"); - - b1.HasOne("Cfo.Cats.Domain.Entities.Documents.Document", "Document") - .WithMany() - .HasForeignKey("_documentId"); - - b1.OwnsOne("Cfo.Cats.Domain.ValueObjects.Lifetime", "Lifetime", b2 => - { - b2.Property("RightToWorkParticipantId") - .HasColumnType("nvarchar(9)"); - - b2.Property("RightToWorkId") - .HasColumnType("int"); - - b2.Property("EndDate") - .HasColumnType("datetime2") - .HasColumnName("ValidTo"); - - b2.Property("StartDate") - .HasColumnType("datetime2") - .HasColumnName("ValidFrom"); - - b2.HasKey("RightToWorkParticipantId", "RightToWorkId"); - - b2.ToTable("RightToWork", "Participant"); - - b2.WithOwner() - .HasForeignKey("RightToWorkParticipantId", "RightToWorkId"); - }); - - b1.Navigation("Document"); - - b1.Navigation("Lifetime") - .IsRequired(); - }); - - b.Navigation("Consents"); - - b.Navigation("CurrentLocation"); - - b.Navigation("Editor"); - - b.Navigation("EnrolmentLocation"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("RightToWorks"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Risk", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", null) - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Timeline", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", null) - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CreatedByUser"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationRoleClaim", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationRole", "Role") - .WithMany("RoleClaims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Role"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUser", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Superior") - .WithMany() - .HasForeignKey("SuperiorId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.Property("UserId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("LastModifiedBy"); - - b1.HasIndex("UserId"); - - b1.ToTable("Note", "Identity"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.WithOwner() - .HasForeignKey("UserId"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Notes"); - - b.Navigation("Superior"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserClaim", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "User") - .WithMany("UserClaims") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserRole", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationRole", "Role") - .WithMany("UserRoles") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "User") - .WithMany("UserRoles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Role"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserToken", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "User") - .WithMany("Tokens") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.UserLogin", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "User") - .WithMany("Logins") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("TenantLocation", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", null) - .WithMany() - .HasForeignKey("LocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", null) - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Contract", b => - { - b.Navigation("Locations"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Location", b => - { - b.Navigation("ChildLocations"); - - b.Navigation("LocationMappings"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationRole", b => - { - b.Navigation("RoleClaims"); - - b.Navigation("UserRoles"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUser", b => - { - b.Navigation("Logins"); - - b.Navigation("Tokens"); - - b.Navigation("UserClaims"); - - b.Navigation("UserRoles"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Migrators/Migrators.MSSQL/Migrations/20240813134025_Objectives_v2.cs b/src/Migrators/Migrators.MSSQL/Migrations/20240813134025_Objectives_v2.cs deleted file mode 100644 index 4e2878e6..00000000 --- a/src/Migrators/Migrators.MSSQL/Migrations/20240813134025_Objectives_v2.cs +++ /dev/null @@ -1,75 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Cfo.Cats.Migrators.MSSQL.Migrations -{ - /// - public partial class Objectives_v2 : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "Due", - schema: "Participant", - table: "ObjectiveTask", - type: "datetime2", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - oldClrType: typeof(DateTime), - oldType: "datetime2", - oldNullable: true); - - migrationBuilder.AddColumn( - name: "Cancelled", - schema: "Participant", - table: "ObjectiveTask", - type: "datetime2", - nullable: true); - - migrationBuilder.AddColumn( - name: "CancelledBy", - schema: "Participant", - table: "ObjectiveTask", - type: "nvarchar(max)", - nullable: true); - - migrationBuilder.AddColumn( - name: "CancelledReason", - schema: "Participant", - table: "ObjectiveTask", - type: "nvarchar(max)", - nullable: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "Cancelled", - schema: "Participant", - table: "ObjectiveTask"); - - migrationBuilder.DropColumn( - name: "CancelledBy", - schema: "Participant", - table: "ObjectiveTask"); - - migrationBuilder.DropColumn( - name: "CancelledReason", - schema: "Participant", - table: "ObjectiveTask"); - - migrationBuilder.AlterColumn( - name: "Due", - schema: "Participant", - table: "ObjectiveTask", - type: "datetime2", - nullable: true, - oldClrType: typeof(DateTime), - oldType: "datetime2"); - } - } -} diff --git a/src/Migrators/Migrators.MSSQL/Migrations/20240813163959_Objectives_v3.Designer.cs b/src/Migrators/Migrators.MSSQL/Migrations/20240813163959_Objectives_v3.Designer.cs deleted file mode 100644 index ca1172f6..00000000 --- a/src/Migrators/Migrators.MSSQL/Migrations/20240813163959_Objectives_v3.Designer.cs +++ /dev/null @@ -1,2429 +0,0 @@ -// -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("20240813163959_Objectives_v3")] - partial class Objectives_v3 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.7") - .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("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.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.HasKey("Id"); - - b.HasIndex("CreatedBy"); - - b.HasIndex("LastModifiedBy"); - - b.HasIndex("TenantId"); - - b.ToTable("Document", "Document"); - }); - - 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.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("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.Objective", 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.Property("Title") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("ParticipantId"); - - b.ToTable("Objective", "Participant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Participant", b => - { - b.Property("Id") - .HasMaxLength(9) - .HasColumnType("nvarchar(9)"); - - b.Property("ConsentStatus") - .HasColumnType("int"); - - b.Property("Created") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("DateOfBirth") - .IsRequired() - .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("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("OwnerId") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("ReferralComments") - .HasColumnType("nvarchar(max)"); - - b.Property("ReferralSource") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - 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.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("Created") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("DeclarationSigned") - .HasColumnType("bit"); - - 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("MappaCategory") - .HasColumnType("int"); - - b.Property("MappaLevel") - .HasColumnType("int"); - - b.Property("NSDCase") - .HasColumnType("int"); - - b.Property("PSFRestrictions") - .HasColumnType("nvarchar(max)"); - - b.Property("PSFRestrictionsReceived") - .HasColumnType("datetime2"); - - b.Property("ParticipantId") - .IsRequired() - .HasColumnType("nvarchar(9)"); - - b.Property("ReferredOn") - .HasColumnType("datetime2"); - - b.Property("ReferrerEmail") - .HasColumnType("nvarchar(max)"); - - b.Property("ReferrerName") - .HasColumnType("nvarchar(max)"); - - b.Property("ReviewJustification") - .HasColumnType("nvarchar(max)"); - - b.Property("ReviewReason") - .HasColumnType("int"); - - b.Property("RiskToChildrenInCommunity") - .HasColumnType("int"); - - b.Property("RiskToChildrenInCustody") - .HasColumnType("int"); - - b.Property("RiskToKnownAdultInCommunity") - .HasColumnType("int"); - - b.Property("RiskToKnownAdultInCustody") - .HasColumnType("int"); - - b.Property("RiskToOtherPrisonersInCommunity") - .HasColumnType("int"); - - b.Property("RiskToOtherPrisonersInCustody") - .HasColumnType("int"); - - b.Property("RiskToPublicInCommunity") - .HasColumnType("int"); - - b.Property("RiskToPublicInCustody") - .HasColumnType("int"); - - b.Property("RiskToSelfInCommunity") - .HasColumnType("int"); - - b.Property("RiskToSelfInCustody") - .HasColumnType("int"); - - b.Property("RiskToStaffInCommunity") - .HasColumnType("int"); - - b.Property("RiskToStaffInCustody") - .HasColumnType("int"); - - b.Property("SpecificRisk") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("ParticipantId"); - - b.ToTable("Risk", "Participant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Timeline", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Created") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(36)"); - - b.Property("EventType") - .HasColumnType("int"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("Line1") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Line2") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Line3") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ParticipantId") - .IsRequired() - .HasColumnType("nvarchar(9)"); - - b.HasKey("Id"); - - b.HasIndex("CreatedBy"); - - b.HasIndex("ParticipantId"); - - b.ToTable("Timeline", "Participant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationRole", b => - { - b.Property("Id") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("NormalizedName") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RoleRank") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("Role", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Group") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RoleId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("RoleClaim", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUser", b => - { - b.Property("Id") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Created") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("DisplayName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("IsLive") - .HasColumnType("bit"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("MemorableDate") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("MemorablePlace") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("ProfilePictureDataUrl") - .HasColumnType("text"); - - b.Property("ProviderId") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RefreshToken") - .HasColumnType("nvarchar(max)"); - - b.Property("RefreshTokenExpiryTime") - .HasColumnType("datetime2"); - - b.Property("RequiresPasswordReset") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("SuperiorId") - .HasColumnType("nvarchar(36)"); - - b.Property("TenantId") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("TenantName") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.HasIndex("SuperiorId"); - - b.HasIndex("TenantId"); - - b.ToTable("User", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("UserId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("UserClaim", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserRole", b => - { - b.Property("UserId") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("RoleId") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("UserRole", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserToken", b => - { - b.Property("UserId") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("UserToken", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.PasswordHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("PasswordHash") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("Id"); - - b.ToTable("PasswordHistory", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.UserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("UserLogin", "Identity"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("FriendlyName") - .HasColumnType("nvarchar(max)"); - - b.Property("Xml") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("DataProtectionKeys"); - }); - - modelBuilder.Entity("TenantLocation", b => - { - b.Property("LocationId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("nvarchar(50)"); - - b.HasKey("LocationId", "TenantId"); - - b.HasIndex("TenantId"); - - b.ToTable("TenantLocation", "Configuration"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Contract", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("_tenantId"); - - b.OwnsOne("Cfo.Cats.Domain.ValueObjects.Lifetime", "Lifetime", b1 => - { - b1.Property("ContractId") - .HasColumnType("nvarchar(12)"); - - b1.Property("EndDate") - .HasColumnType("datetime2") - .HasColumnName("LifetimeEnd"); - - b1.Property("StartDate") - .HasColumnType("datetime2") - .HasColumnName("LifetimeStart"); - - b1.HasKey("ContractId"); - - b1.ToTable("Contract", "Configuration"); - - b1.WithOwner() - .HasForeignKey("ContractId"); - }); - - b.Navigation("Lifetime") - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Location", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Contract", "Contract") - .WithMany("Locations") - .HasForeignKey("_contractId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", "ParentLocation") - .WithMany("ChildLocations") - .HasForeignKey("_parentLocationId") - .OnDelete(DeleteBehavior.Restrict); - - b.OwnsOne("Cfo.Cats.Domain.ValueObjects.Lifetime", "Lifetime", b1 => - { - b1.Property("LocationId") - .HasColumnType("int"); - - b1.Property("EndDate") - .HasColumnType("datetime2") - .HasColumnName("LifetimeEnd"); - - b1.Property("StartDate") - .HasColumnType("datetime2") - .HasColumnName("LifetimeStart"); - - b1.HasKey("LocationId"); - - b1.ToTable("Location", "Configuration"); - - b1.WithOwner() - .HasForeignKey("LocationId"); - }); - - b.Navigation("Contract"); - - b.Navigation("Lifetime") - .IsRequired(); - - b.Navigation("ParentLocation"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.LocationMapping", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", "Location") - .WithMany("LocationMappings") - .HasForeignKey("_locationId"); - - b.Navigation("Location"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Tenant", b => - { - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.TenantDomain", "Domains", b1 => - { - b1.Property("TenantId") - .HasColumnType("nvarchar(50)"); - - b1.Property("Domain") - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.HasKey("TenantId", "Domain"); - - b1.ToTable("TenantDomain", "Configuration"); - - b1.WithOwner() - .HasForeignKey("TenantId"); - }); - - b.Navigation("Domains"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Assessments.ParticipantAssessment", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", null) - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", null) - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.PathwayScore", "Scores", b1 => - { - b1.Property("AssessmentId") - .HasColumnType("uniqueidentifier"); - - b1.Property("Pathway") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b1.Property("Score") - .HasColumnType("float"); - - b1.HasKey("AssessmentId", "Pathway"); - - b1.ToTable("AssessmentPathwayScore", "Participant"); - - b1.WithOwner() - .HasForeignKey("AssessmentId"); - }); - - b.Navigation("Editor"); - - b.Navigation("Owner"); - - b.Navigation("Scores"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.AuditTrail", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("Owner"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Documents.Document", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("CreatedBy") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("LastModifiedBy") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId"); - - b.Navigation("Editor"); - - b.Navigation("Owner"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentEscalationQueueEntry", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", "Participant") - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("EnrolmentEscalationQueueEntryId") - .HasColumnType("uniqueidentifier"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("EnrolmentEscalationQueueEntryId"); - - b1.HasIndex("LastModifiedBy"); - - b1.ToTable("EscalationNote", "Enrolment"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.WithOwner() - .HasForeignKey("EnrolmentEscalationQueueEntryId"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Editor"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("Participant"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentPqaQueueEntry", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", "Participant") - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("EnrolmentPqaQueueEntryId") - .HasColumnType("uniqueidentifier"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("EnrolmentPqaQueueEntryId"); - - b1.HasIndex("LastModifiedBy"); - - b1.ToTable("PqaQueueNote", "Enrolment"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.WithOwner() - .HasForeignKey("EnrolmentPqaQueueEntryId"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Editor"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("Participant"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentQa1QueueEntry", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", "Participant") - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("EnrolmentQa1QueueEntryId") - .HasColumnType("uniqueidentifier"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("EnrolmentQa1QueueEntryId"); - - b1.HasIndex("LastModifiedBy"); - - b1.ToTable("Qa1QueueNote", "Enrolment"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.WithOwner() - .HasForeignKey("EnrolmentQa1QueueEntryId"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Editor"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("Participant"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentQa2QueueEntry", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", "Participant") - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("EnrolmentQa2QueueEntryId") - .HasColumnType("uniqueidentifier"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("EnrolmentQa2QueueEntryId"); - - b1.HasIndex("LastModifiedBy"); - - b1.ToTable("Qa2QueueNote", "Enrolment"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.WithOwner() - .HasForeignKey("EnrolmentQa2QueueEntryId"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Editor"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("Participant"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Objective", b => - { - b.OwnsMany("Cfo.Cats.Domain.Entities.Participants.ObjectiveTask", "Tasks", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b1.Property("Closed") - .HasColumnType("datetime2"); - - b1.Property("ClosedBy") - .HasColumnType("nvarchar(max)"); - - b1.Property("Completed") - .HasColumnType("datetime2"); - - b1.Property("CompletedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Due") - .HasColumnType("datetime2"); - - b1.Property("Justification") - .HasColumnType("nvarchar(max)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("ObjectiveId") - .HasColumnType("uniqueidentifier"); - - b1.Property("Title") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CompletedBy"); - - b1.HasIndex("ObjectiveId"); - - b1.ToTable("ObjectiveTask", "Participant"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CompletedByUser") - .WithMany() - .HasForeignKey("CompletedBy"); - - b1.WithOwner() - .HasForeignKey("ObjectiveId"); - - b1.Navigation("CompletedByUser"); - }); - - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Participant", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", "CurrentLocation") - .WithMany() - .HasForeignKey("_currentLocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_Participant_Location"); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", "EnrolmentLocation") - .WithMany() - .HasForeignKey("_enrolmentLocationId") - .HasConstraintName("FK_Participant_EnrolmentLocation"); - - b.OwnsMany("Cfo.Cats.Domain.Entities.Participants.Consent", "Consents", b1 => - { - b1.Property("ParticipantId") - .HasColumnType("nvarchar(9)"); - - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("_documentId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DocumentId"); - - b1.HasKey("ParticipantId", "Id"); - - b1.HasIndex("_documentId"); - - b1.ToTable("Consent", "Participant"); - - b1.WithOwner() - .HasForeignKey("ParticipantId"); - - b1.HasOne("Cfo.Cats.Domain.Entities.Documents.Document", "Document") - .WithMany() - .HasForeignKey("_documentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b1.OwnsOne("Cfo.Cats.Domain.ValueObjects.Lifetime", "Lifetime", b2 => - { - b2.Property("ConsentParticipantId") - .HasColumnType("nvarchar(9)"); - - b2.Property("ConsentId") - .HasColumnType("int"); - - b2.Property("EndDate") - .HasColumnType("datetime2") - .HasColumnName("ValidTo"); - - b2.Property("StartDate") - .HasColumnType("datetime2") - .HasColumnName("ValidFrom"); - - b2.HasKey("ConsentParticipantId", "ConsentId"); - - b2.ToTable("Consent", "Participant"); - - b2.WithOwner() - .HasForeignKey("ConsentParticipantId", "ConsentId"); - }); - - b1.Navigation("Document"); - - b1.Navigation("Lifetime") - .IsRequired(); - }); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("ParticipantId") - .IsRequired() - .HasColumnType("nvarchar(9)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("LastModifiedBy"); - - b1.HasIndex("ParticipantId"); - - b1.ToTable("Note", "Participant"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.WithOwner() - .HasForeignKey("ParticipantId"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.OwnsMany("Cfo.Cats.Domain.Entities.Participants.RightToWork", "RightToWorks", b1 => - { - b1.Property("ParticipantId") - .HasColumnType("nvarchar(9)"); - - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("_documentId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DocumentId"); - - b1.HasKey("ParticipantId", "Id"); - - b1.HasIndex("_documentId"); - - b1.ToTable("RightToWork", "Participant"); - - b1.WithOwner() - .HasForeignKey("ParticipantId"); - - b1.HasOne("Cfo.Cats.Domain.Entities.Documents.Document", "Document") - .WithMany() - .HasForeignKey("_documentId"); - - b1.OwnsOne("Cfo.Cats.Domain.ValueObjects.Lifetime", "Lifetime", b2 => - { - b2.Property("RightToWorkParticipantId") - .HasColumnType("nvarchar(9)"); - - b2.Property("RightToWorkId") - .HasColumnType("int"); - - b2.Property("EndDate") - .HasColumnType("datetime2") - .HasColumnName("ValidTo"); - - b2.Property("StartDate") - .HasColumnType("datetime2") - .HasColumnName("ValidFrom"); - - b2.HasKey("RightToWorkParticipantId", "RightToWorkId"); - - b2.ToTable("RightToWork", "Participant"); - - b2.WithOwner() - .HasForeignKey("RightToWorkParticipantId", "RightToWorkId"); - }); - - b1.Navigation("Document"); - - b1.Navigation("Lifetime") - .IsRequired(); - }); - - b.Navigation("Consents"); - - b.Navigation("CurrentLocation"); - - b.Navigation("Editor"); - - b.Navigation("EnrolmentLocation"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("RightToWorks"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Risk", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", null) - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Timeline", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", null) - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CreatedByUser"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationRoleClaim", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationRole", "Role") - .WithMany("RoleClaims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Role"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUser", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Superior") - .WithMany() - .HasForeignKey("SuperiorId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.Property("UserId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("LastModifiedBy"); - - b1.HasIndex("UserId"); - - b1.ToTable("Note", "Identity"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.WithOwner() - .HasForeignKey("UserId"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Notes"); - - b.Navigation("Superior"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserClaim", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "User") - .WithMany("UserClaims") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserRole", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationRole", "Role") - .WithMany("UserRoles") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "User") - .WithMany("UserRoles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Role"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserToken", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "User") - .WithMany("Tokens") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.UserLogin", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "User") - .WithMany("Logins") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("TenantLocation", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", null) - .WithMany() - .HasForeignKey("LocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", null) - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Contract", b => - { - b.Navigation("Locations"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Location", b => - { - b.Navigation("ChildLocations"); - - b.Navigation("LocationMappings"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationRole", b => - { - b.Navigation("RoleClaims"); - - b.Navigation("UserRoles"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUser", b => - { - b.Navigation("Logins"); - - b.Navigation("Tokens"); - - b.Navigation("UserClaims"); - - b.Navigation("UserRoles"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Migrators/Migrators.MSSQL/Migrations/20240813163959_Objectives_v3.cs b/src/Migrators/Migrators.MSSQL/Migrations/20240813163959_Objectives_v3.cs deleted file mode 100644 index 8b3c1931..00000000 --- a/src/Migrators/Migrators.MSSQL/Migrations/20240813163959_Objectives_v3.cs +++ /dev/null @@ -1,54 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Cfo.Cats.Migrators.MSSQL.Migrations -{ - /// - public partial class Objectives_v3 : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameColumn( - name: "CancelledReason", - schema: "Participant", - table: "ObjectiveTask", - newName: "Justification"); - - migrationBuilder.RenameColumn( - name: "CancelledBy", - schema: "Participant", - table: "ObjectiveTask", - newName: "ClosedBy"); - - migrationBuilder.RenameColumn( - name: "Cancelled", - schema: "Participant", - table: "ObjectiveTask", - newName: "Closed"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.RenameColumn( - name: "Justification", - schema: "Participant", - table: "ObjectiveTask", - newName: "CancelledReason"); - - migrationBuilder.RenameColumn( - name: "ClosedBy", - schema: "Participant", - table: "ObjectiveTask", - newName: "CancelledBy"); - - migrationBuilder.RenameColumn( - name: "Closed", - schema: "Participant", - table: "ObjectiveTask", - newName: "Cancelled"); - } - } -} diff --git a/src/Migrators/Migrators.MSSQL/Migrations/20240813182343_Objectives_v4.Designer.cs b/src/Migrators/Migrators.MSSQL/Migrations/20240813182343_Objectives_v4.Designer.cs deleted file mode 100644 index e9ae6da0..00000000 --- a/src/Migrators/Migrators.MSSQL/Migrations/20240813182343_Objectives_v4.Designer.cs +++ /dev/null @@ -1,2426 +0,0 @@ -// -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("20240813182343_Objectives_v4")] - partial class Objectives_v4 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.7") - .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("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.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.HasKey("Id"); - - b.HasIndex("CreatedBy"); - - b.HasIndex("LastModifiedBy"); - - b.HasIndex("TenantId"); - - b.ToTable("Document", "Document"); - }); - - 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.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("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.Objective", 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.Property("Title") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("ParticipantId"); - - b.ToTable("Objective", "Participant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Participant", b => - { - b.Property("Id") - .HasMaxLength(9) - .HasColumnType("nvarchar(9)"); - - b.Property("ConsentStatus") - .HasColumnType("int"); - - b.Property("Created") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("DateOfBirth") - .IsRequired() - .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("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("OwnerId") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("ReferralComments") - .HasColumnType("nvarchar(max)"); - - b.Property("ReferralSource") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - 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.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("Created") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("DeclarationSigned") - .HasColumnType("bit"); - - 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("MappaCategory") - .HasColumnType("int"); - - b.Property("MappaLevel") - .HasColumnType("int"); - - b.Property("NSDCase") - .HasColumnType("int"); - - b.Property("PSFRestrictions") - .HasColumnType("nvarchar(max)"); - - b.Property("PSFRestrictionsReceived") - .HasColumnType("datetime2"); - - b.Property("ParticipantId") - .IsRequired() - .HasColumnType("nvarchar(9)"); - - b.Property("ReferredOn") - .HasColumnType("datetime2"); - - b.Property("ReferrerEmail") - .HasColumnType("nvarchar(max)"); - - b.Property("ReferrerName") - .HasColumnType("nvarchar(max)"); - - b.Property("ReviewJustification") - .HasColumnType("nvarchar(max)"); - - b.Property("ReviewReason") - .HasColumnType("int"); - - b.Property("RiskToChildrenInCommunity") - .HasColumnType("int"); - - b.Property("RiskToChildrenInCustody") - .HasColumnType("int"); - - b.Property("RiskToKnownAdultInCommunity") - .HasColumnType("int"); - - b.Property("RiskToKnownAdultInCustody") - .HasColumnType("int"); - - b.Property("RiskToOtherPrisonersInCommunity") - .HasColumnType("int"); - - b.Property("RiskToOtherPrisonersInCustody") - .HasColumnType("int"); - - b.Property("RiskToPublicInCommunity") - .HasColumnType("int"); - - b.Property("RiskToPublicInCustody") - .HasColumnType("int"); - - b.Property("RiskToSelfInCommunity") - .HasColumnType("int"); - - b.Property("RiskToSelfInCustody") - .HasColumnType("int"); - - b.Property("RiskToStaffInCommunity") - .HasColumnType("int"); - - b.Property("RiskToStaffInCustody") - .HasColumnType("int"); - - b.Property("SpecificRisk") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("ParticipantId"); - - b.ToTable("Risk", "Participant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Timeline", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Created") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(36)"); - - b.Property("EventType") - .HasColumnType("int"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("Line1") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Line2") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Line3") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ParticipantId") - .IsRequired() - .HasColumnType("nvarchar(9)"); - - b.HasKey("Id"); - - b.HasIndex("CreatedBy"); - - b.HasIndex("ParticipantId"); - - b.ToTable("Timeline", "Participant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationRole", b => - { - b.Property("Id") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("NormalizedName") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RoleRank") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("Role", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Group") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RoleId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("RoleClaim", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUser", b => - { - b.Property("Id") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Created") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("DisplayName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("IsLive") - .HasColumnType("bit"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("MemorableDate") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("MemorablePlace") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("ProfilePictureDataUrl") - .HasColumnType("text"); - - b.Property("ProviderId") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RefreshToken") - .HasColumnType("nvarchar(max)"); - - b.Property("RefreshTokenExpiryTime") - .HasColumnType("datetime2"); - - b.Property("RequiresPasswordReset") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("SuperiorId") - .HasColumnType("nvarchar(36)"); - - b.Property("TenantId") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("TenantName") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.HasIndex("SuperiorId"); - - b.HasIndex("TenantId"); - - b.ToTable("User", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("UserId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("UserClaim", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserRole", b => - { - b.Property("UserId") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("RoleId") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("UserRole", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserToken", b => - { - b.Property("UserId") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("UserToken", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.PasswordHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("PasswordHash") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("Id"); - - b.ToTable("PasswordHistory", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.UserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("UserLogin", "Identity"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("FriendlyName") - .HasColumnType("nvarchar(max)"); - - b.Property("Xml") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("DataProtectionKeys"); - }); - - modelBuilder.Entity("TenantLocation", b => - { - b.Property("LocationId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("nvarchar(50)"); - - b.HasKey("LocationId", "TenantId"); - - b.HasIndex("TenantId"); - - b.ToTable("TenantLocation", "Configuration"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Contract", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("_tenantId"); - - b.OwnsOne("Cfo.Cats.Domain.ValueObjects.Lifetime", "Lifetime", b1 => - { - b1.Property("ContractId") - .HasColumnType("nvarchar(12)"); - - b1.Property("EndDate") - .HasColumnType("datetime2") - .HasColumnName("LifetimeEnd"); - - b1.Property("StartDate") - .HasColumnType("datetime2") - .HasColumnName("LifetimeStart"); - - b1.HasKey("ContractId"); - - b1.ToTable("Contract", "Configuration"); - - b1.WithOwner() - .HasForeignKey("ContractId"); - }); - - b.Navigation("Lifetime") - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Location", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Contract", "Contract") - .WithMany("Locations") - .HasForeignKey("_contractId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", "ParentLocation") - .WithMany("ChildLocations") - .HasForeignKey("_parentLocationId") - .OnDelete(DeleteBehavior.Restrict); - - b.OwnsOne("Cfo.Cats.Domain.ValueObjects.Lifetime", "Lifetime", b1 => - { - b1.Property("LocationId") - .HasColumnType("int"); - - b1.Property("EndDate") - .HasColumnType("datetime2") - .HasColumnName("LifetimeEnd"); - - b1.Property("StartDate") - .HasColumnType("datetime2") - .HasColumnName("LifetimeStart"); - - b1.HasKey("LocationId"); - - b1.ToTable("Location", "Configuration"); - - b1.WithOwner() - .HasForeignKey("LocationId"); - }); - - b.Navigation("Contract"); - - b.Navigation("Lifetime") - .IsRequired(); - - b.Navigation("ParentLocation"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.LocationMapping", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", "Location") - .WithMany("LocationMappings") - .HasForeignKey("_locationId"); - - b.Navigation("Location"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Tenant", b => - { - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.TenantDomain", "Domains", b1 => - { - b1.Property("TenantId") - .HasColumnType("nvarchar(50)"); - - b1.Property("Domain") - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.HasKey("TenantId", "Domain"); - - b1.ToTable("TenantDomain", "Configuration"); - - b1.WithOwner() - .HasForeignKey("TenantId"); - }); - - b.Navigation("Domains"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Assessments.ParticipantAssessment", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", null) - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", null) - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.PathwayScore", "Scores", b1 => - { - b1.Property("AssessmentId") - .HasColumnType("uniqueidentifier"); - - b1.Property("Pathway") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b1.Property("Score") - .HasColumnType("float"); - - b1.HasKey("AssessmentId", "Pathway"); - - b1.ToTable("AssessmentPathwayScore", "Participant"); - - b1.WithOwner() - .HasForeignKey("AssessmentId"); - }); - - b.Navigation("Editor"); - - b.Navigation("Owner"); - - b.Navigation("Scores"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.AuditTrail", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("Owner"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Documents.Document", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("CreatedBy") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("LastModifiedBy") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId"); - - b.Navigation("Editor"); - - b.Navigation("Owner"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentEscalationQueueEntry", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", "Participant") - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("EnrolmentEscalationQueueEntryId") - .HasColumnType("uniqueidentifier"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("EnrolmentEscalationQueueEntryId"); - - b1.HasIndex("LastModifiedBy"); - - b1.ToTable("EscalationNote", "Enrolment"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.WithOwner() - .HasForeignKey("EnrolmentEscalationQueueEntryId"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Editor"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("Participant"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentPqaQueueEntry", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", "Participant") - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("EnrolmentPqaQueueEntryId") - .HasColumnType("uniqueidentifier"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("EnrolmentPqaQueueEntryId"); - - b1.HasIndex("LastModifiedBy"); - - b1.ToTable("PqaQueueNote", "Enrolment"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.WithOwner() - .HasForeignKey("EnrolmentPqaQueueEntryId"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Editor"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("Participant"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentQa1QueueEntry", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", "Participant") - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("EnrolmentQa1QueueEntryId") - .HasColumnType("uniqueidentifier"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("EnrolmentQa1QueueEntryId"); - - b1.HasIndex("LastModifiedBy"); - - b1.ToTable("Qa1QueueNote", "Enrolment"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.WithOwner() - .HasForeignKey("EnrolmentQa1QueueEntryId"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Editor"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("Participant"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentQa2QueueEntry", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", "Participant") - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("EnrolmentQa2QueueEntryId") - .HasColumnType("uniqueidentifier"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("EnrolmentQa2QueueEntryId"); - - b1.HasIndex("LastModifiedBy"); - - b1.ToTable("Qa2QueueNote", "Enrolment"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.WithOwner() - .HasForeignKey("EnrolmentQa2QueueEntryId"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Editor"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("Participant"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Objective", b => - { - b.OwnsMany("Cfo.Cats.Domain.Entities.Participants.ObjectiveTask", "Tasks", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b1.Property("Completed") - .HasColumnType("datetime2"); - - b1.Property("CompletedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("CompletedStatus") - .HasColumnType("int"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Due") - .HasColumnType("datetime2"); - - b1.Property("Justification") - .HasColumnType("nvarchar(max)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("ObjectiveId") - .HasColumnType("uniqueidentifier"); - - b1.Property("Title") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CompletedBy"); - - b1.HasIndex("ObjectiveId"); - - b1.ToTable("ObjectiveTask", "Participant"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CompletedByUser") - .WithMany() - .HasForeignKey("CompletedBy"); - - b1.WithOwner() - .HasForeignKey("ObjectiveId"); - - b1.Navigation("CompletedByUser"); - }); - - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Participant", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", "CurrentLocation") - .WithMany() - .HasForeignKey("_currentLocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_Participant_Location"); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", "EnrolmentLocation") - .WithMany() - .HasForeignKey("_enrolmentLocationId") - .HasConstraintName("FK_Participant_EnrolmentLocation"); - - b.OwnsMany("Cfo.Cats.Domain.Entities.Participants.Consent", "Consents", b1 => - { - b1.Property("ParticipantId") - .HasColumnType("nvarchar(9)"); - - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("_documentId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DocumentId"); - - b1.HasKey("ParticipantId", "Id"); - - b1.HasIndex("_documentId"); - - b1.ToTable("Consent", "Participant"); - - b1.WithOwner() - .HasForeignKey("ParticipantId"); - - b1.HasOne("Cfo.Cats.Domain.Entities.Documents.Document", "Document") - .WithMany() - .HasForeignKey("_documentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b1.OwnsOne("Cfo.Cats.Domain.ValueObjects.Lifetime", "Lifetime", b2 => - { - b2.Property("ConsentParticipantId") - .HasColumnType("nvarchar(9)"); - - b2.Property("ConsentId") - .HasColumnType("int"); - - b2.Property("EndDate") - .HasColumnType("datetime2") - .HasColumnName("ValidTo"); - - b2.Property("StartDate") - .HasColumnType("datetime2") - .HasColumnName("ValidFrom"); - - b2.HasKey("ConsentParticipantId", "ConsentId"); - - b2.ToTable("Consent", "Participant"); - - b2.WithOwner() - .HasForeignKey("ConsentParticipantId", "ConsentId"); - }); - - b1.Navigation("Document"); - - b1.Navigation("Lifetime") - .IsRequired(); - }); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("ParticipantId") - .IsRequired() - .HasColumnType("nvarchar(9)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("LastModifiedBy"); - - b1.HasIndex("ParticipantId"); - - b1.ToTable("Note", "Participant"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.WithOwner() - .HasForeignKey("ParticipantId"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.OwnsMany("Cfo.Cats.Domain.Entities.Participants.RightToWork", "RightToWorks", b1 => - { - b1.Property("ParticipantId") - .HasColumnType("nvarchar(9)"); - - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("_documentId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DocumentId"); - - b1.HasKey("ParticipantId", "Id"); - - b1.HasIndex("_documentId"); - - b1.ToTable("RightToWork", "Participant"); - - b1.WithOwner() - .HasForeignKey("ParticipantId"); - - b1.HasOne("Cfo.Cats.Domain.Entities.Documents.Document", "Document") - .WithMany() - .HasForeignKey("_documentId"); - - b1.OwnsOne("Cfo.Cats.Domain.ValueObjects.Lifetime", "Lifetime", b2 => - { - b2.Property("RightToWorkParticipantId") - .HasColumnType("nvarchar(9)"); - - b2.Property("RightToWorkId") - .HasColumnType("int"); - - b2.Property("EndDate") - .HasColumnType("datetime2") - .HasColumnName("ValidTo"); - - b2.Property("StartDate") - .HasColumnType("datetime2") - .HasColumnName("ValidFrom"); - - b2.HasKey("RightToWorkParticipantId", "RightToWorkId"); - - b2.ToTable("RightToWork", "Participant"); - - b2.WithOwner() - .HasForeignKey("RightToWorkParticipantId", "RightToWorkId"); - }); - - b1.Navigation("Document"); - - b1.Navigation("Lifetime") - .IsRequired(); - }); - - b.Navigation("Consents"); - - b.Navigation("CurrentLocation"); - - b.Navigation("Editor"); - - b.Navigation("EnrolmentLocation"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("RightToWorks"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Risk", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", null) - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Timeline", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", null) - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CreatedByUser"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationRoleClaim", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationRole", "Role") - .WithMany("RoleClaims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Role"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUser", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Superior") - .WithMany() - .HasForeignKey("SuperiorId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.Property("UserId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("LastModifiedBy"); - - b1.HasIndex("UserId"); - - b1.ToTable("Note", "Identity"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.WithOwner() - .HasForeignKey("UserId"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Notes"); - - b.Navigation("Superior"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserClaim", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "User") - .WithMany("UserClaims") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserRole", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationRole", "Role") - .WithMany("UserRoles") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "User") - .WithMany("UserRoles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Role"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserToken", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "User") - .WithMany("Tokens") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.UserLogin", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "User") - .WithMany("Logins") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("TenantLocation", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", null) - .WithMany() - .HasForeignKey("LocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", null) - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Contract", b => - { - b.Navigation("Locations"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Location", b => - { - b.Navigation("ChildLocations"); - - b.Navigation("LocationMappings"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationRole", b => - { - b.Navigation("RoleClaims"); - - b.Navigation("UserRoles"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUser", b => - { - b.Navigation("Logins"); - - b.Navigation("Tokens"); - - b.Navigation("UserClaims"); - - b.Navigation("UserRoles"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Migrators/Migrators.MSSQL/Migrations/20240813182343_Objectives_v4.cs b/src/Migrators/Migrators.MSSQL/Migrations/20240813182343_Objectives_v4.cs deleted file mode 100644 index ee51bebf..00000000 --- a/src/Migrators/Migrators.MSSQL/Migrations/20240813182343_Objectives_v4.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Cfo.Cats.Migrators.MSSQL.Migrations -{ - /// - public partial class Objectives_v4 : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "Closed", - schema: "Participant", - table: "ObjectiveTask"); - - migrationBuilder.DropColumn( - name: "ClosedBy", - schema: "Participant", - table: "ObjectiveTask"); - - migrationBuilder.AddColumn( - name: "CompletedStatus", - schema: "Participant", - table: "ObjectiveTask", - type: "int", - nullable: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "CompletedStatus", - schema: "Participant", - table: "ObjectiveTask"); - - migrationBuilder.AddColumn( - name: "Closed", - schema: "Participant", - table: "ObjectiveTask", - type: "datetime2", - nullable: true); - - migrationBuilder.AddColumn( - name: "ClosedBy", - schema: "Participant", - table: "ObjectiveTask", - type: "nvarchar(max)", - nullable: true); - } - } -} diff --git a/src/Migrators/Migrators.MSSQL/Migrations/20240815084514_Objectives_v5.Designer.cs b/src/Migrators/Migrators.MSSQL/Migrations/20240815084514_Objectives_v5.Designer.cs deleted file mode 100644 index e53e9314..00000000 --- a/src/Migrators/Migrators.MSSQL/Migrations/20240815084514_Objectives_v5.Designer.cs +++ /dev/null @@ -1,2432 +0,0 @@ -// -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("20240815084514_Objectives_v5")] - partial class Objectives_v5 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.7") - .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("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.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.HasKey("Id"); - - b.HasIndex("CreatedBy"); - - b.HasIndex("LastModifiedBy"); - - b.HasIndex("TenantId"); - - b.ToTable("Document", "Document"); - }); - - 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.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("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.Objective", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Completed") - .HasColumnType("datetime2"); - - b.Property("CompletedStatus") - .HasColumnType("int"); - - 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("Title") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("ParticipantId"); - - b.ToTable("Objective", "Participant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Participant", b => - { - b.Property("Id") - .HasMaxLength(9) - .HasColumnType("nvarchar(9)"); - - b.Property("ConsentStatus") - .HasColumnType("int"); - - b.Property("Created") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("DateOfBirth") - .IsRequired() - .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("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("OwnerId") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("ReferralComments") - .HasColumnType("nvarchar(max)"); - - b.Property("ReferralSource") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - 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.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("Created") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("DeclarationSigned") - .HasColumnType("bit"); - - 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("MappaCategory") - .HasColumnType("int"); - - b.Property("MappaLevel") - .HasColumnType("int"); - - b.Property("NSDCase") - .HasColumnType("int"); - - b.Property("PSFRestrictions") - .HasColumnType("nvarchar(max)"); - - b.Property("PSFRestrictionsReceived") - .HasColumnType("datetime2"); - - b.Property("ParticipantId") - .IsRequired() - .HasColumnType("nvarchar(9)"); - - b.Property("ReferredOn") - .HasColumnType("datetime2"); - - b.Property("ReferrerEmail") - .HasColumnType("nvarchar(max)"); - - b.Property("ReferrerName") - .HasColumnType("nvarchar(max)"); - - b.Property("ReviewJustification") - .HasColumnType("nvarchar(max)"); - - b.Property("ReviewReason") - .HasColumnType("int"); - - b.Property("RiskToChildrenInCommunity") - .HasColumnType("int"); - - b.Property("RiskToChildrenInCustody") - .HasColumnType("int"); - - b.Property("RiskToKnownAdultInCommunity") - .HasColumnType("int"); - - b.Property("RiskToKnownAdultInCustody") - .HasColumnType("int"); - - b.Property("RiskToOtherPrisonersInCommunity") - .HasColumnType("int"); - - b.Property("RiskToOtherPrisonersInCustody") - .HasColumnType("int"); - - b.Property("RiskToPublicInCommunity") - .HasColumnType("int"); - - b.Property("RiskToPublicInCustody") - .HasColumnType("int"); - - b.Property("RiskToSelfInCommunity") - .HasColumnType("int"); - - b.Property("RiskToSelfInCustody") - .HasColumnType("int"); - - b.Property("RiskToStaffInCommunity") - .HasColumnType("int"); - - b.Property("RiskToStaffInCustody") - .HasColumnType("int"); - - b.Property("SpecificRisk") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("ParticipantId"); - - b.ToTable("Risk", "Participant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Timeline", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Created") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(36)"); - - b.Property("EventType") - .HasColumnType("int"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("Line1") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Line2") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Line3") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ParticipantId") - .IsRequired() - .HasColumnType("nvarchar(9)"); - - b.HasKey("Id"); - - b.HasIndex("CreatedBy"); - - b.HasIndex("ParticipantId"); - - b.ToTable("Timeline", "Participant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationRole", b => - { - b.Property("Id") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("NormalizedName") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RoleRank") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("Role", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Group") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RoleId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("RoleClaim", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUser", b => - { - b.Property("Id") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Created") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("DisplayName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("IsLive") - .HasColumnType("bit"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("MemorableDate") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("MemorablePlace") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("ProfilePictureDataUrl") - .HasColumnType("text"); - - b.Property("ProviderId") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RefreshToken") - .HasColumnType("nvarchar(max)"); - - b.Property("RefreshTokenExpiryTime") - .HasColumnType("datetime2"); - - b.Property("RequiresPasswordReset") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("SuperiorId") - .HasColumnType("nvarchar(36)"); - - b.Property("TenantId") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("TenantName") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.HasIndex("SuperiorId"); - - b.HasIndex("TenantId"); - - b.ToTable("User", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("UserId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("UserClaim", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserRole", b => - { - b.Property("UserId") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("RoleId") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("UserRole", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserToken", b => - { - b.Property("UserId") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("UserToken", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.PasswordHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("PasswordHash") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("Id"); - - b.ToTable("PasswordHistory", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.UserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("UserLogin", "Identity"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("FriendlyName") - .HasColumnType("nvarchar(max)"); - - b.Property("Xml") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("DataProtectionKeys"); - }); - - modelBuilder.Entity("TenantLocation", b => - { - b.Property("LocationId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("nvarchar(50)"); - - b.HasKey("LocationId", "TenantId"); - - b.HasIndex("TenantId"); - - b.ToTable("TenantLocation", "Configuration"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Contract", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("_tenantId"); - - b.OwnsOne("Cfo.Cats.Domain.ValueObjects.Lifetime", "Lifetime", b1 => - { - b1.Property("ContractId") - .HasColumnType("nvarchar(12)"); - - b1.Property("EndDate") - .HasColumnType("datetime2") - .HasColumnName("LifetimeEnd"); - - b1.Property("StartDate") - .HasColumnType("datetime2") - .HasColumnName("LifetimeStart"); - - b1.HasKey("ContractId"); - - b1.ToTable("Contract", "Configuration"); - - b1.WithOwner() - .HasForeignKey("ContractId"); - }); - - b.Navigation("Lifetime") - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Location", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Contract", "Contract") - .WithMany("Locations") - .HasForeignKey("_contractId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", "ParentLocation") - .WithMany("ChildLocations") - .HasForeignKey("_parentLocationId") - .OnDelete(DeleteBehavior.Restrict); - - b.OwnsOne("Cfo.Cats.Domain.ValueObjects.Lifetime", "Lifetime", b1 => - { - b1.Property("LocationId") - .HasColumnType("int"); - - b1.Property("EndDate") - .HasColumnType("datetime2") - .HasColumnName("LifetimeEnd"); - - b1.Property("StartDate") - .HasColumnType("datetime2") - .HasColumnName("LifetimeStart"); - - b1.HasKey("LocationId"); - - b1.ToTable("Location", "Configuration"); - - b1.WithOwner() - .HasForeignKey("LocationId"); - }); - - b.Navigation("Contract"); - - b.Navigation("Lifetime") - .IsRequired(); - - b.Navigation("ParentLocation"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.LocationMapping", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", "Location") - .WithMany("LocationMappings") - .HasForeignKey("_locationId"); - - b.Navigation("Location"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Tenant", b => - { - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.TenantDomain", "Domains", b1 => - { - b1.Property("TenantId") - .HasColumnType("nvarchar(50)"); - - b1.Property("Domain") - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.HasKey("TenantId", "Domain"); - - b1.ToTable("TenantDomain", "Configuration"); - - b1.WithOwner() - .HasForeignKey("TenantId"); - }); - - b.Navigation("Domains"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Assessments.ParticipantAssessment", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", null) - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", null) - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.PathwayScore", "Scores", b1 => - { - b1.Property("AssessmentId") - .HasColumnType("uniqueidentifier"); - - b1.Property("Pathway") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b1.Property("Score") - .HasColumnType("float"); - - b1.HasKey("AssessmentId", "Pathway"); - - b1.ToTable("AssessmentPathwayScore", "Participant"); - - b1.WithOwner() - .HasForeignKey("AssessmentId"); - }); - - b.Navigation("Editor"); - - b.Navigation("Owner"); - - b.Navigation("Scores"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.AuditTrail", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("Owner"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Documents.Document", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("CreatedBy") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("LastModifiedBy") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId"); - - b.Navigation("Editor"); - - b.Navigation("Owner"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentEscalationQueueEntry", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", "Participant") - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("EnrolmentEscalationQueueEntryId") - .HasColumnType("uniqueidentifier"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("EnrolmentEscalationQueueEntryId"); - - b1.HasIndex("LastModifiedBy"); - - b1.ToTable("EscalationNote", "Enrolment"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.WithOwner() - .HasForeignKey("EnrolmentEscalationQueueEntryId"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Editor"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("Participant"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentPqaQueueEntry", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", "Participant") - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("EnrolmentPqaQueueEntryId") - .HasColumnType("uniqueidentifier"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("EnrolmentPqaQueueEntryId"); - - b1.HasIndex("LastModifiedBy"); - - b1.ToTable("PqaQueueNote", "Enrolment"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.WithOwner() - .HasForeignKey("EnrolmentPqaQueueEntryId"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Editor"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("Participant"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentQa1QueueEntry", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", "Participant") - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("EnrolmentQa1QueueEntryId") - .HasColumnType("uniqueidentifier"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("EnrolmentQa1QueueEntryId"); - - b1.HasIndex("LastModifiedBy"); - - b1.ToTable("Qa1QueueNote", "Enrolment"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.WithOwner() - .HasForeignKey("EnrolmentQa1QueueEntryId"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Editor"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("Participant"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentQa2QueueEntry", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", "Participant") - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("EnrolmentQa2QueueEntryId") - .HasColumnType("uniqueidentifier"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("EnrolmentQa2QueueEntryId"); - - b1.HasIndex("LastModifiedBy"); - - b1.ToTable("Qa2QueueNote", "Enrolment"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.WithOwner() - .HasForeignKey("EnrolmentQa2QueueEntryId"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Editor"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("Participant"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Objective", b => - { - b.OwnsMany("Cfo.Cats.Domain.Entities.Participants.ObjectiveTask", "Tasks", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b1.Property("Completed") - .HasColumnType("datetime2"); - - b1.Property("CompletedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("CompletedStatus") - .HasColumnType("int"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Due") - .HasColumnType("datetime2"); - - b1.Property("Justification") - .HasColumnType("nvarchar(max)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("ObjectiveId") - .HasColumnType("uniqueidentifier"); - - b1.Property("Title") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CompletedBy"); - - b1.HasIndex("ObjectiveId"); - - b1.ToTable("ObjectiveTask", "Participant"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CompletedByUser") - .WithMany() - .HasForeignKey("CompletedBy"); - - b1.WithOwner() - .HasForeignKey("ObjectiveId"); - - b1.Navigation("CompletedByUser"); - }); - - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Participant", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", "CurrentLocation") - .WithMany() - .HasForeignKey("_currentLocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_Participant_Location"); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", "EnrolmentLocation") - .WithMany() - .HasForeignKey("_enrolmentLocationId") - .HasConstraintName("FK_Participant_EnrolmentLocation"); - - b.OwnsMany("Cfo.Cats.Domain.Entities.Participants.Consent", "Consents", b1 => - { - b1.Property("ParticipantId") - .HasColumnType("nvarchar(9)"); - - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("_documentId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DocumentId"); - - b1.HasKey("ParticipantId", "Id"); - - b1.HasIndex("_documentId"); - - b1.ToTable("Consent", "Participant"); - - b1.WithOwner() - .HasForeignKey("ParticipantId"); - - b1.HasOne("Cfo.Cats.Domain.Entities.Documents.Document", "Document") - .WithMany() - .HasForeignKey("_documentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b1.OwnsOne("Cfo.Cats.Domain.ValueObjects.Lifetime", "Lifetime", b2 => - { - b2.Property("ConsentParticipantId") - .HasColumnType("nvarchar(9)"); - - b2.Property("ConsentId") - .HasColumnType("int"); - - b2.Property("EndDate") - .HasColumnType("datetime2") - .HasColumnName("ValidTo"); - - b2.Property("StartDate") - .HasColumnType("datetime2") - .HasColumnName("ValidFrom"); - - b2.HasKey("ConsentParticipantId", "ConsentId"); - - b2.ToTable("Consent", "Participant"); - - b2.WithOwner() - .HasForeignKey("ConsentParticipantId", "ConsentId"); - }); - - b1.Navigation("Document"); - - b1.Navigation("Lifetime") - .IsRequired(); - }); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("ParticipantId") - .IsRequired() - .HasColumnType("nvarchar(9)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("LastModifiedBy"); - - b1.HasIndex("ParticipantId"); - - b1.ToTable("Note", "Participant"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.WithOwner() - .HasForeignKey("ParticipantId"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.OwnsMany("Cfo.Cats.Domain.Entities.Participants.RightToWork", "RightToWorks", b1 => - { - b1.Property("ParticipantId") - .HasColumnType("nvarchar(9)"); - - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("_documentId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DocumentId"); - - b1.HasKey("ParticipantId", "Id"); - - b1.HasIndex("_documentId"); - - b1.ToTable("RightToWork", "Participant"); - - b1.WithOwner() - .HasForeignKey("ParticipantId"); - - b1.HasOne("Cfo.Cats.Domain.Entities.Documents.Document", "Document") - .WithMany() - .HasForeignKey("_documentId"); - - b1.OwnsOne("Cfo.Cats.Domain.ValueObjects.Lifetime", "Lifetime", b2 => - { - b2.Property("RightToWorkParticipantId") - .HasColumnType("nvarchar(9)"); - - b2.Property("RightToWorkId") - .HasColumnType("int"); - - b2.Property("EndDate") - .HasColumnType("datetime2") - .HasColumnName("ValidTo"); - - b2.Property("StartDate") - .HasColumnType("datetime2") - .HasColumnName("ValidFrom"); - - b2.HasKey("RightToWorkParticipantId", "RightToWorkId"); - - b2.ToTable("RightToWork", "Participant"); - - b2.WithOwner() - .HasForeignKey("RightToWorkParticipantId", "RightToWorkId"); - }); - - b1.Navigation("Document"); - - b1.Navigation("Lifetime") - .IsRequired(); - }); - - b.Navigation("Consents"); - - b.Navigation("CurrentLocation"); - - b.Navigation("Editor"); - - b.Navigation("EnrolmentLocation"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("RightToWorks"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Risk", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", null) - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Timeline", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", null) - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CreatedByUser"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationRoleClaim", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationRole", "Role") - .WithMany("RoleClaims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Role"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUser", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Superior") - .WithMany() - .HasForeignKey("SuperiorId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.Property("UserId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("LastModifiedBy"); - - b1.HasIndex("UserId"); - - b1.ToTable("Note", "Identity"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.WithOwner() - .HasForeignKey("UserId"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Notes"); - - b.Navigation("Superior"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserClaim", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "User") - .WithMany("UserClaims") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserRole", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationRole", "Role") - .WithMany("UserRoles") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "User") - .WithMany("UserRoles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Role"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserToken", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "User") - .WithMany("Tokens") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.UserLogin", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "User") - .WithMany("Logins") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("TenantLocation", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", null) - .WithMany() - .HasForeignKey("LocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", null) - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Contract", b => - { - b.Navigation("Locations"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Location", b => - { - b.Navigation("ChildLocations"); - - b.Navigation("LocationMappings"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationRole", b => - { - b.Navigation("RoleClaims"); - - b.Navigation("UserRoles"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUser", b => - { - b.Navigation("Logins"); - - b.Navigation("Tokens"); - - b.Navigation("UserClaims"); - - b.Navigation("UserRoles"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Migrators/Migrators.MSSQL/Migrations/20240815084514_Objectives_v5.cs b/src/Migrators/Migrators.MSSQL/Migrations/20240815084514_Objectives_v5.cs deleted file mode 100644 index e5506d0b..00000000 --- a/src/Migrators/Migrators.MSSQL/Migrations/20240815084514_Objectives_v5.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Cfo.Cats.Migrators.MSSQL.Migrations -{ - /// - public partial class Objectives_v5 : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "Completed", - schema: "Participant", - table: "Objective", - type: "datetime2", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - - migrationBuilder.AddColumn( - name: "CompletedStatus", - schema: "Participant", - table: "Objective", - type: "int", - nullable: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "Completed", - schema: "Participant", - table: "Objective"); - - migrationBuilder.DropColumn( - name: "CompletedStatus", - schema: "Participant", - table: "Objective"); - } - } -} diff --git a/src/Migrators/Migrators.MSSQL/Migrations/20240815085352_Objectives_v6.Designer.cs b/src/Migrators/Migrators.MSSQL/Migrations/20240815085352_Objectives_v6.Designer.cs deleted file mode 100644 index 716dc440..00000000 --- a/src/Migrators/Migrators.MSSQL/Migrations/20240815085352_Objectives_v6.Designer.cs +++ /dev/null @@ -1,2432 +0,0 @@ -// -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("20240815085352_Objectives_v6")] - partial class Objectives_v6 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.7") - .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("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.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.HasKey("Id"); - - b.HasIndex("CreatedBy"); - - b.HasIndex("LastModifiedBy"); - - b.HasIndex("TenantId"); - - b.ToTable("Document", "Document"); - }); - - 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.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("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.Objective", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Completed") - .HasColumnType("datetime2"); - - b.Property("CompletedStatus") - .HasColumnType("int"); - - 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("Title") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("ParticipantId"); - - b.ToTable("Objective", "Participant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Participant", b => - { - b.Property("Id") - .HasMaxLength(9) - .HasColumnType("nvarchar(9)"); - - b.Property("ConsentStatus") - .HasColumnType("int"); - - b.Property("Created") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("DateOfBirth") - .IsRequired() - .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("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("OwnerId") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("ReferralComments") - .HasColumnType("nvarchar(max)"); - - b.Property("ReferralSource") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - 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.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("Created") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("DeclarationSigned") - .HasColumnType("bit"); - - 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("MappaCategory") - .HasColumnType("int"); - - b.Property("MappaLevel") - .HasColumnType("int"); - - b.Property("NSDCase") - .HasColumnType("int"); - - b.Property("PSFRestrictions") - .HasColumnType("nvarchar(max)"); - - b.Property("PSFRestrictionsReceived") - .HasColumnType("datetime2"); - - b.Property("ParticipantId") - .IsRequired() - .HasColumnType("nvarchar(9)"); - - b.Property("ReferredOn") - .HasColumnType("datetime2"); - - b.Property("ReferrerEmail") - .HasColumnType("nvarchar(max)"); - - b.Property("ReferrerName") - .HasColumnType("nvarchar(max)"); - - b.Property("ReviewJustification") - .HasColumnType("nvarchar(max)"); - - b.Property("ReviewReason") - .HasColumnType("int"); - - b.Property("RiskToChildrenInCommunity") - .HasColumnType("int"); - - b.Property("RiskToChildrenInCustody") - .HasColumnType("int"); - - b.Property("RiskToKnownAdultInCommunity") - .HasColumnType("int"); - - b.Property("RiskToKnownAdultInCustody") - .HasColumnType("int"); - - b.Property("RiskToOtherPrisonersInCommunity") - .HasColumnType("int"); - - b.Property("RiskToOtherPrisonersInCustody") - .HasColumnType("int"); - - b.Property("RiskToPublicInCommunity") - .HasColumnType("int"); - - b.Property("RiskToPublicInCustody") - .HasColumnType("int"); - - b.Property("RiskToSelfInCommunity") - .HasColumnType("int"); - - b.Property("RiskToSelfInCustody") - .HasColumnType("int"); - - b.Property("RiskToStaffInCommunity") - .HasColumnType("int"); - - b.Property("RiskToStaffInCustody") - .HasColumnType("int"); - - b.Property("SpecificRisk") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("ParticipantId"); - - b.ToTable("Risk", "Participant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Timeline", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Created") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(36)"); - - b.Property("EventType") - .HasColumnType("int"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("Line1") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Line2") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Line3") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ParticipantId") - .IsRequired() - .HasColumnType("nvarchar(9)"); - - b.HasKey("Id"); - - b.HasIndex("CreatedBy"); - - b.HasIndex("ParticipantId"); - - b.ToTable("Timeline", "Participant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationRole", b => - { - b.Property("Id") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("NormalizedName") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RoleRank") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("Role", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Group") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RoleId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("RoleClaim", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUser", b => - { - b.Property("Id") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Created") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("DisplayName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("IsLive") - .HasColumnType("bit"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("MemorableDate") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("MemorablePlace") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("ProfilePictureDataUrl") - .HasColumnType("text"); - - b.Property("ProviderId") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RefreshToken") - .HasColumnType("nvarchar(max)"); - - b.Property("RefreshTokenExpiryTime") - .HasColumnType("datetime2"); - - b.Property("RequiresPasswordReset") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("SuperiorId") - .HasColumnType("nvarchar(36)"); - - b.Property("TenantId") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("TenantName") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.HasIndex("SuperiorId"); - - b.HasIndex("TenantId"); - - b.ToTable("User", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("UserId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("UserClaim", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserRole", b => - { - b.Property("UserId") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("RoleId") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("UserRole", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserToken", b => - { - b.Property("UserId") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("UserToken", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.PasswordHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("PasswordHash") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("Id"); - - b.ToTable("PasswordHistory", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.UserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("UserLogin", "Identity"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("FriendlyName") - .HasColumnType("nvarchar(max)"); - - b.Property("Xml") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("DataProtectionKeys"); - }); - - modelBuilder.Entity("TenantLocation", b => - { - b.Property("LocationId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("nvarchar(50)"); - - b.HasKey("LocationId", "TenantId"); - - b.HasIndex("TenantId"); - - b.ToTable("TenantLocation", "Configuration"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Contract", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("_tenantId"); - - b.OwnsOne("Cfo.Cats.Domain.ValueObjects.Lifetime", "Lifetime", b1 => - { - b1.Property("ContractId") - .HasColumnType("nvarchar(12)"); - - b1.Property("EndDate") - .HasColumnType("datetime2") - .HasColumnName("LifetimeEnd"); - - b1.Property("StartDate") - .HasColumnType("datetime2") - .HasColumnName("LifetimeStart"); - - b1.HasKey("ContractId"); - - b1.ToTable("Contract", "Configuration"); - - b1.WithOwner() - .HasForeignKey("ContractId"); - }); - - b.Navigation("Lifetime") - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Location", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Contract", "Contract") - .WithMany("Locations") - .HasForeignKey("_contractId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", "ParentLocation") - .WithMany("ChildLocations") - .HasForeignKey("_parentLocationId") - .OnDelete(DeleteBehavior.Restrict); - - b.OwnsOne("Cfo.Cats.Domain.ValueObjects.Lifetime", "Lifetime", b1 => - { - b1.Property("LocationId") - .HasColumnType("int"); - - b1.Property("EndDate") - .HasColumnType("datetime2") - .HasColumnName("LifetimeEnd"); - - b1.Property("StartDate") - .HasColumnType("datetime2") - .HasColumnName("LifetimeStart"); - - b1.HasKey("LocationId"); - - b1.ToTable("Location", "Configuration"); - - b1.WithOwner() - .HasForeignKey("LocationId"); - }); - - b.Navigation("Contract"); - - b.Navigation("Lifetime") - .IsRequired(); - - b.Navigation("ParentLocation"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.LocationMapping", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", "Location") - .WithMany("LocationMappings") - .HasForeignKey("_locationId"); - - b.Navigation("Location"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Tenant", b => - { - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.TenantDomain", "Domains", b1 => - { - b1.Property("TenantId") - .HasColumnType("nvarchar(50)"); - - b1.Property("Domain") - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.HasKey("TenantId", "Domain"); - - b1.ToTable("TenantDomain", "Configuration"); - - b1.WithOwner() - .HasForeignKey("TenantId"); - }); - - b.Navigation("Domains"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Assessments.ParticipantAssessment", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", null) - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", null) - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.PathwayScore", "Scores", b1 => - { - b1.Property("AssessmentId") - .HasColumnType("uniqueidentifier"); - - b1.Property("Pathway") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b1.Property("Score") - .HasColumnType("float"); - - b1.HasKey("AssessmentId", "Pathway"); - - b1.ToTable("AssessmentPathwayScore", "Participant"); - - b1.WithOwner() - .HasForeignKey("AssessmentId"); - }); - - b.Navigation("Editor"); - - b.Navigation("Owner"); - - b.Navigation("Scores"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.AuditTrail", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("Owner"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Documents.Document", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("CreatedBy") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("LastModifiedBy") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId"); - - b.Navigation("Editor"); - - b.Navigation("Owner"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentEscalationQueueEntry", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", "Participant") - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("EnrolmentEscalationQueueEntryId") - .HasColumnType("uniqueidentifier"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("EnrolmentEscalationQueueEntryId"); - - b1.HasIndex("LastModifiedBy"); - - b1.ToTable("EscalationNote", "Enrolment"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.WithOwner() - .HasForeignKey("EnrolmentEscalationQueueEntryId"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Editor"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("Participant"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentPqaQueueEntry", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", "Participant") - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("EnrolmentPqaQueueEntryId") - .HasColumnType("uniqueidentifier"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("EnrolmentPqaQueueEntryId"); - - b1.HasIndex("LastModifiedBy"); - - b1.ToTable("PqaQueueNote", "Enrolment"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.WithOwner() - .HasForeignKey("EnrolmentPqaQueueEntryId"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Editor"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("Participant"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentQa1QueueEntry", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", "Participant") - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("EnrolmentQa1QueueEntryId") - .HasColumnType("uniqueidentifier"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("EnrolmentQa1QueueEntryId"); - - b1.HasIndex("LastModifiedBy"); - - b1.ToTable("Qa1QueueNote", "Enrolment"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.WithOwner() - .HasForeignKey("EnrolmentQa1QueueEntryId"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Editor"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("Participant"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentQa2QueueEntry", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", "Participant") - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("EnrolmentQa2QueueEntryId") - .HasColumnType("uniqueidentifier"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("EnrolmentQa2QueueEntryId"); - - b1.HasIndex("LastModifiedBy"); - - b1.ToTable("Qa2QueueNote", "Enrolment"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.WithOwner() - .HasForeignKey("EnrolmentQa2QueueEntryId"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Editor"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("Participant"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Objective", b => - { - b.OwnsMany("Cfo.Cats.Domain.Entities.Participants.ObjectiveTask", "Tasks", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b1.Property("Completed") - .HasColumnType("datetime2"); - - b1.Property("CompletedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("CompletedStatus") - .HasColumnType("int"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Due") - .HasColumnType("datetime2"); - - b1.Property("Justification") - .HasColumnType("nvarchar(max)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("ObjectiveId") - .HasColumnType("uniqueidentifier"); - - b1.Property("Title") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CompletedBy"); - - b1.HasIndex("ObjectiveId"); - - b1.ToTable("ObjectiveTask", "Participant"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CompletedByUser") - .WithMany() - .HasForeignKey("CompletedBy"); - - b1.WithOwner() - .HasForeignKey("ObjectiveId"); - - b1.Navigation("CompletedByUser"); - }); - - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Participant", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", "CurrentLocation") - .WithMany() - .HasForeignKey("_currentLocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_Participant_Location"); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", "EnrolmentLocation") - .WithMany() - .HasForeignKey("_enrolmentLocationId") - .HasConstraintName("FK_Participant_EnrolmentLocation"); - - b.OwnsMany("Cfo.Cats.Domain.Entities.Participants.Consent", "Consents", b1 => - { - b1.Property("ParticipantId") - .HasColumnType("nvarchar(9)"); - - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("_documentId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DocumentId"); - - b1.HasKey("ParticipantId", "Id"); - - b1.HasIndex("_documentId"); - - b1.ToTable("Consent", "Participant"); - - b1.WithOwner() - .HasForeignKey("ParticipantId"); - - b1.HasOne("Cfo.Cats.Domain.Entities.Documents.Document", "Document") - .WithMany() - .HasForeignKey("_documentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b1.OwnsOne("Cfo.Cats.Domain.ValueObjects.Lifetime", "Lifetime", b2 => - { - b2.Property("ConsentParticipantId") - .HasColumnType("nvarchar(9)"); - - b2.Property("ConsentId") - .HasColumnType("int"); - - b2.Property("EndDate") - .HasColumnType("datetime2") - .HasColumnName("ValidTo"); - - b2.Property("StartDate") - .HasColumnType("datetime2") - .HasColumnName("ValidFrom"); - - b2.HasKey("ConsentParticipantId", "ConsentId"); - - b2.ToTable("Consent", "Participant"); - - b2.WithOwner() - .HasForeignKey("ConsentParticipantId", "ConsentId"); - }); - - b1.Navigation("Document"); - - b1.Navigation("Lifetime") - .IsRequired(); - }); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("ParticipantId") - .IsRequired() - .HasColumnType("nvarchar(9)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("LastModifiedBy"); - - b1.HasIndex("ParticipantId"); - - b1.ToTable("Note", "Participant"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.WithOwner() - .HasForeignKey("ParticipantId"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.OwnsMany("Cfo.Cats.Domain.Entities.Participants.RightToWork", "RightToWorks", b1 => - { - b1.Property("ParticipantId") - .HasColumnType("nvarchar(9)"); - - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("_documentId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DocumentId"); - - b1.HasKey("ParticipantId", "Id"); - - b1.HasIndex("_documentId"); - - b1.ToTable("RightToWork", "Participant"); - - b1.WithOwner() - .HasForeignKey("ParticipantId"); - - b1.HasOne("Cfo.Cats.Domain.Entities.Documents.Document", "Document") - .WithMany() - .HasForeignKey("_documentId"); - - b1.OwnsOne("Cfo.Cats.Domain.ValueObjects.Lifetime", "Lifetime", b2 => - { - b2.Property("RightToWorkParticipantId") - .HasColumnType("nvarchar(9)"); - - b2.Property("RightToWorkId") - .HasColumnType("int"); - - b2.Property("EndDate") - .HasColumnType("datetime2") - .HasColumnName("ValidTo"); - - b2.Property("StartDate") - .HasColumnType("datetime2") - .HasColumnName("ValidFrom"); - - b2.HasKey("RightToWorkParticipantId", "RightToWorkId"); - - b2.ToTable("RightToWork", "Participant"); - - b2.WithOwner() - .HasForeignKey("RightToWorkParticipantId", "RightToWorkId"); - }); - - b1.Navigation("Document"); - - b1.Navigation("Lifetime") - .IsRequired(); - }); - - b.Navigation("Consents"); - - b.Navigation("CurrentLocation"); - - b.Navigation("Editor"); - - b.Navigation("EnrolmentLocation"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("RightToWorks"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Risk", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", null) - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Timeline", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", null) - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CreatedByUser"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationRoleClaim", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationRole", "Role") - .WithMany("RoleClaims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Role"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUser", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Superior") - .WithMany() - .HasForeignKey("SuperiorId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.Property("UserId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("LastModifiedBy"); - - b1.HasIndex("UserId"); - - b1.ToTable("Note", "Identity"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.WithOwner() - .HasForeignKey("UserId"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Notes"); - - b.Navigation("Superior"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserClaim", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "User") - .WithMany("UserClaims") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserRole", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationRole", "Role") - .WithMany("UserRoles") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "User") - .WithMany("UserRoles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Role"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserToken", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "User") - .WithMany("Tokens") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.UserLogin", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "User") - .WithMany("Logins") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("TenantLocation", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", null) - .WithMany() - .HasForeignKey("LocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", null) - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Contract", b => - { - b.Navigation("Locations"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Location", b => - { - b.Navigation("ChildLocations"); - - b.Navigation("LocationMappings"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationRole", b => - { - b.Navigation("RoleClaims"); - - b.Navigation("UserRoles"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUser", b => - { - b.Navigation("Logins"); - - b.Navigation("Tokens"); - - b.Navigation("UserClaims"); - - b.Navigation("UserRoles"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Migrators/Migrators.MSSQL/Migrations/20240815085352_Objectives_v6.cs b/src/Migrators/Migrators.MSSQL/Migrations/20240815085352_Objectives_v6.cs deleted file mode 100644 index c4ab472f..00000000 --- a/src/Migrators/Migrators.MSSQL/Migrations/20240815085352_Objectives_v6.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Cfo.Cats.Migrators.MSSQL.Migrations -{ - /// - public partial class Objectives_v6 : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "Completed", - schema: "Participant", - table: "Objective", - type: "datetime2", - nullable: true, - oldClrType: typeof(DateTime), - oldType: "datetime2"); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "Completed", - schema: "Participant", - table: "Objective", - type: "datetime2", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - oldClrType: typeof(DateTime), - oldType: "datetime2", - oldNullable: true); - } - } -} diff --git a/src/Migrators/Migrators.MSSQL/Migrations/20240815090249_Objectives_v7.Designer.cs b/src/Migrators/Migrators.MSSQL/Migrations/20240815090249_Objectives_v7.Designer.cs deleted file mode 100644 index 3ec92a95..00000000 --- a/src/Migrators/Migrators.MSSQL/Migrations/20240815090249_Objectives_v7.Designer.cs +++ /dev/null @@ -1,2435 +0,0 @@ -// -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("20240815090249_Objectives_v7")] - partial class Objectives_v7 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.7") - .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("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.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.HasKey("Id"); - - b.HasIndex("CreatedBy"); - - b.HasIndex("LastModifiedBy"); - - b.HasIndex("TenantId"); - - b.ToTable("Document", "Document"); - }); - - 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.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("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.Objective", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("Completed") - .HasColumnType("datetime2"); - - b.Property("CompletedStatus") - .HasColumnType("int"); - - b.Property("Created") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("Justification") - .HasColumnType("nvarchar(max)"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("ParticipantId") - .IsRequired() - .HasMaxLength(9) - .HasColumnType("nvarchar(9)"); - - b.Property("Title") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("ParticipantId"); - - b.ToTable("Objective", "Participant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Participant", b => - { - b.Property("Id") - .HasMaxLength(9) - .HasColumnType("nvarchar(9)"); - - b.Property("ConsentStatus") - .HasColumnType("int"); - - b.Property("Created") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("DateOfBirth") - .IsRequired() - .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("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("OwnerId") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("ReferralComments") - .HasColumnType("nvarchar(max)"); - - b.Property("ReferralSource") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - 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.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("Created") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("DeclarationSigned") - .HasColumnType("bit"); - - 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("MappaCategory") - .HasColumnType("int"); - - b.Property("MappaLevel") - .HasColumnType("int"); - - b.Property("NSDCase") - .HasColumnType("int"); - - b.Property("PSFRestrictions") - .HasColumnType("nvarchar(max)"); - - b.Property("PSFRestrictionsReceived") - .HasColumnType("datetime2"); - - b.Property("ParticipantId") - .IsRequired() - .HasColumnType("nvarchar(9)"); - - b.Property("ReferredOn") - .HasColumnType("datetime2"); - - b.Property("ReferrerEmail") - .HasColumnType("nvarchar(max)"); - - b.Property("ReferrerName") - .HasColumnType("nvarchar(max)"); - - b.Property("ReviewJustification") - .HasColumnType("nvarchar(max)"); - - b.Property("ReviewReason") - .HasColumnType("int"); - - b.Property("RiskToChildrenInCommunity") - .HasColumnType("int"); - - b.Property("RiskToChildrenInCustody") - .HasColumnType("int"); - - b.Property("RiskToKnownAdultInCommunity") - .HasColumnType("int"); - - b.Property("RiskToKnownAdultInCustody") - .HasColumnType("int"); - - b.Property("RiskToOtherPrisonersInCommunity") - .HasColumnType("int"); - - b.Property("RiskToOtherPrisonersInCustody") - .HasColumnType("int"); - - b.Property("RiskToPublicInCommunity") - .HasColumnType("int"); - - b.Property("RiskToPublicInCustody") - .HasColumnType("int"); - - b.Property("RiskToSelfInCommunity") - .HasColumnType("int"); - - b.Property("RiskToSelfInCustody") - .HasColumnType("int"); - - b.Property("RiskToStaffInCommunity") - .HasColumnType("int"); - - b.Property("RiskToStaffInCustody") - .HasColumnType("int"); - - b.Property("SpecificRisk") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("ParticipantId"); - - b.ToTable("Risk", "Participant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Timeline", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Created") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(36)"); - - b.Property("EventType") - .HasColumnType("int"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("Line1") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Line2") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Line3") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ParticipantId") - .IsRequired() - .HasColumnType("nvarchar(9)"); - - b.HasKey("Id"); - - b.HasIndex("CreatedBy"); - - b.HasIndex("ParticipantId"); - - b.ToTable("Timeline", "Participant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationRole", b => - { - b.Property("Id") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("NormalizedName") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RoleRank") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("Role", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Group") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RoleId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("RoleClaim", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUser", b => - { - b.Property("Id") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Created") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("DisplayName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("IsLive") - .HasColumnType("bit"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("MemorableDate") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("MemorablePlace") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("ProfilePictureDataUrl") - .HasColumnType("text"); - - b.Property("ProviderId") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RefreshToken") - .HasColumnType("nvarchar(max)"); - - b.Property("RefreshTokenExpiryTime") - .HasColumnType("datetime2"); - - b.Property("RequiresPasswordReset") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("SuperiorId") - .HasColumnType("nvarchar(36)"); - - b.Property("TenantId") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("TenantName") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.HasIndex("SuperiorId"); - - b.HasIndex("TenantId"); - - b.ToTable("User", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("UserId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("UserClaim", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserRole", b => - { - b.Property("UserId") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("RoleId") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("UserRole", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserToken", b => - { - b.Property("UserId") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("UserToken", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.PasswordHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("PasswordHash") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("Id"); - - b.ToTable("PasswordHistory", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.UserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("UserLogin", "Identity"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("FriendlyName") - .HasColumnType("nvarchar(max)"); - - b.Property("Xml") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("DataProtectionKeys"); - }); - - modelBuilder.Entity("TenantLocation", b => - { - b.Property("LocationId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("nvarchar(50)"); - - b.HasKey("LocationId", "TenantId"); - - b.HasIndex("TenantId"); - - b.ToTable("TenantLocation", "Configuration"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Contract", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("_tenantId"); - - b.OwnsOne("Cfo.Cats.Domain.ValueObjects.Lifetime", "Lifetime", b1 => - { - b1.Property("ContractId") - .HasColumnType("nvarchar(12)"); - - b1.Property("EndDate") - .HasColumnType("datetime2") - .HasColumnName("LifetimeEnd"); - - b1.Property("StartDate") - .HasColumnType("datetime2") - .HasColumnName("LifetimeStart"); - - b1.HasKey("ContractId"); - - b1.ToTable("Contract", "Configuration"); - - b1.WithOwner() - .HasForeignKey("ContractId"); - }); - - b.Navigation("Lifetime") - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Location", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Contract", "Contract") - .WithMany("Locations") - .HasForeignKey("_contractId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", "ParentLocation") - .WithMany("ChildLocations") - .HasForeignKey("_parentLocationId") - .OnDelete(DeleteBehavior.Restrict); - - b.OwnsOne("Cfo.Cats.Domain.ValueObjects.Lifetime", "Lifetime", b1 => - { - b1.Property("LocationId") - .HasColumnType("int"); - - b1.Property("EndDate") - .HasColumnType("datetime2") - .HasColumnName("LifetimeEnd"); - - b1.Property("StartDate") - .HasColumnType("datetime2") - .HasColumnName("LifetimeStart"); - - b1.HasKey("LocationId"); - - b1.ToTable("Location", "Configuration"); - - b1.WithOwner() - .HasForeignKey("LocationId"); - }); - - b.Navigation("Contract"); - - b.Navigation("Lifetime") - .IsRequired(); - - b.Navigation("ParentLocation"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.LocationMapping", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", "Location") - .WithMany("LocationMappings") - .HasForeignKey("_locationId"); - - b.Navigation("Location"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Tenant", b => - { - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.TenantDomain", "Domains", b1 => - { - b1.Property("TenantId") - .HasColumnType("nvarchar(50)"); - - b1.Property("Domain") - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.HasKey("TenantId", "Domain"); - - b1.ToTable("TenantDomain", "Configuration"); - - b1.WithOwner() - .HasForeignKey("TenantId"); - }); - - b.Navigation("Domains"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Assessments.ParticipantAssessment", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", null) - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", null) - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.PathwayScore", "Scores", b1 => - { - b1.Property("AssessmentId") - .HasColumnType("uniqueidentifier"); - - b1.Property("Pathway") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b1.Property("Score") - .HasColumnType("float"); - - b1.HasKey("AssessmentId", "Pathway"); - - b1.ToTable("AssessmentPathwayScore", "Participant"); - - b1.WithOwner() - .HasForeignKey("AssessmentId"); - }); - - b.Navigation("Editor"); - - b.Navigation("Owner"); - - b.Navigation("Scores"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.AuditTrail", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("Owner"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Documents.Document", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("CreatedBy") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("LastModifiedBy") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId"); - - b.Navigation("Editor"); - - b.Navigation("Owner"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentEscalationQueueEntry", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", "Participant") - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("EnrolmentEscalationQueueEntryId") - .HasColumnType("uniqueidentifier"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("EnrolmentEscalationQueueEntryId"); - - b1.HasIndex("LastModifiedBy"); - - b1.ToTable("EscalationNote", "Enrolment"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.WithOwner() - .HasForeignKey("EnrolmentEscalationQueueEntryId"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Editor"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("Participant"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentPqaQueueEntry", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", "Participant") - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("EnrolmentPqaQueueEntryId") - .HasColumnType("uniqueidentifier"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("EnrolmentPqaQueueEntryId"); - - b1.HasIndex("LastModifiedBy"); - - b1.ToTable("PqaQueueNote", "Enrolment"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.WithOwner() - .HasForeignKey("EnrolmentPqaQueueEntryId"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Editor"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("Participant"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentQa1QueueEntry", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", "Participant") - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("EnrolmentQa1QueueEntryId") - .HasColumnType("uniqueidentifier"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("EnrolmentQa1QueueEntryId"); - - b1.HasIndex("LastModifiedBy"); - - b1.ToTable("Qa1QueueNote", "Enrolment"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.WithOwner() - .HasForeignKey("EnrolmentQa1QueueEntryId"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Editor"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("Participant"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentQa2QueueEntry", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", "Participant") - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("EnrolmentQa2QueueEntryId") - .HasColumnType("uniqueidentifier"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("EnrolmentQa2QueueEntryId"); - - b1.HasIndex("LastModifiedBy"); - - b1.ToTable("Qa2QueueNote", "Enrolment"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.WithOwner() - .HasForeignKey("EnrolmentQa2QueueEntryId"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Editor"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("Participant"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Objective", b => - { - b.OwnsMany("Cfo.Cats.Domain.Entities.Participants.ObjectiveTask", "Tasks", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b1.Property("Completed") - .HasColumnType("datetime2"); - - b1.Property("CompletedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("CompletedStatus") - .HasColumnType("int"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Due") - .HasColumnType("datetime2"); - - b1.Property("Justification") - .HasColumnType("nvarchar(max)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("ObjectiveId") - .HasColumnType("uniqueidentifier"); - - b1.Property("Title") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CompletedBy"); - - b1.HasIndex("ObjectiveId"); - - b1.ToTable("ObjectiveTask", "Participant"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CompletedByUser") - .WithMany() - .HasForeignKey("CompletedBy"); - - b1.WithOwner() - .HasForeignKey("ObjectiveId"); - - b1.Navigation("CompletedByUser"); - }); - - b.Navigation("Tasks"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Participant", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", "CurrentLocation") - .WithMany() - .HasForeignKey("_currentLocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_Participant_Location"); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", "EnrolmentLocation") - .WithMany() - .HasForeignKey("_enrolmentLocationId") - .HasConstraintName("FK_Participant_EnrolmentLocation"); - - b.OwnsMany("Cfo.Cats.Domain.Entities.Participants.Consent", "Consents", b1 => - { - b1.Property("ParticipantId") - .HasColumnType("nvarchar(9)"); - - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("_documentId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DocumentId"); - - b1.HasKey("ParticipantId", "Id"); - - b1.HasIndex("_documentId"); - - b1.ToTable("Consent", "Participant"); - - b1.WithOwner() - .HasForeignKey("ParticipantId"); - - b1.HasOne("Cfo.Cats.Domain.Entities.Documents.Document", "Document") - .WithMany() - .HasForeignKey("_documentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b1.OwnsOne("Cfo.Cats.Domain.ValueObjects.Lifetime", "Lifetime", b2 => - { - b2.Property("ConsentParticipantId") - .HasColumnType("nvarchar(9)"); - - b2.Property("ConsentId") - .HasColumnType("int"); - - b2.Property("EndDate") - .HasColumnType("datetime2") - .HasColumnName("ValidTo"); - - b2.Property("StartDate") - .HasColumnType("datetime2") - .HasColumnName("ValidFrom"); - - b2.HasKey("ConsentParticipantId", "ConsentId"); - - b2.ToTable("Consent", "Participant"); - - b2.WithOwner() - .HasForeignKey("ConsentParticipantId", "ConsentId"); - }); - - b1.Navigation("Document"); - - b1.Navigation("Lifetime") - .IsRequired(); - }); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("ParticipantId") - .IsRequired() - .HasColumnType("nvarchar(9)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("LastModifiedBy"); - - b1.HasIndex("ParticipantId"); - - b1.ToTable("Note", "Participant"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.WithOwner() - .HasForeignKey("ParticipantId"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.OwnsMany("Cfo.Cats.Domain.Entities.Participants.RightToWork", "RightToWorks", b1 => - { - b1.Property("ParticipantId") - .HasColumnType("nvarchar(9)"); - - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("_documentId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DocumentId"); - - b1.HasKey("ParticipantId", "Id"); - - b1.HasIndex("_documentId"); - - b1.ToTable("RightToWork", "Participant"); - - b1.WithOwner() - .HasForeignKey("ParticipantId"); - - b1.HasOne("Cfo.Cats.Domain.Entities.Documents.Document", "Document") - .WithMany() - .HasForeignKey("_documentId"); - - b1.OwnsOne("Cfo.Cats.Domain.ValueObjects.Lifetime", "Lifetime", b2 => - { - b2.Property("RightToWorkParticipantId") - .HasColumnType("nvarchar(9)"); - - b2.Property("RightToWorkId") - .HasColumnType("int"); - - b2.Property("EndDate") - .HasColumnType("datetime2") - .HasColumnName("ValidTo"); - - b2.Property("StartDate") - .HasColumnType("datetime2") - .HasColumnName("ValidFrom"); - - b2.HasKey("RightToWorkParticipantId", "RightToWorkId"); - - b2.ToTable("RightToWork", "Participant"); - - b2.WithOwner() - .HasForeignKey("RightToWorkParticipantId", "RightToWorkId"); - }); - - b1.Navigation("Document"); - - b1.Navigation("Lifetime") - .IsRequired(); - }); - - b.Navigation("Consents"); - - b.Navigation("CurrentLocation"); - - b.Navigation("Editor"); - - b.Navigation("EnrolmentLocation"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("RightToWorks"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Risk", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", null) - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Timeline", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", null) - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CreatedByUser"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationRoleClaim", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationRole", "Role") - .WithMany("RoleClaims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Role"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUser", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Superior") - .WithMany() - .HasForeignKey("SuperiorId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.Property("UserId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("LastModifiedBy"); - - b1.HasIndex("UserId"); - - b1.ToTable("Note", "Identity"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.WithOwner() - .HasForeignKey("UserId"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Notes"); - - b.Navigation("Superior"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserClaim", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "User") - .WithMany("UserClaims") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserRole", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationRole", "Role") - .WithMany("UserRoles") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "User") - .WithMany("UserRoles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Role"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserToken", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "User") - .WithMany("Tokens") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.UserLogin", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "User") - .WithMany("Logins") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("TenantLocation", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", null) - .WithMany() - .HasForeignKey("LocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", null) - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Contract", b => - { - b.Navigation("Locations"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Location", b => - { - b.Navigation("ChildLocations"); - - b.Navigation("LocationMappings"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationRole", b => - { - b.Navigation("RoleClaims"); - - b.Navigation("UserRoles"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUser", b => - { - b.Navigation("Logins"); - - b.Navigation("Tokens"); - - b.Navigation("UserClaims"); - - b.Navigation("UserRoles"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Migrators/Migrators.MSSQL/Migrations/20240815090249_Objectives_v7.cs b/src/Migrators/Migrators.MSSQL/Migrations/20240815090249_Objectives_v7.cs deleted file mode 100644 index f09309c5..00000000 --- a/src/Migrators/Migrators.MSSQL/Migrations/20240815090249_Objectives_v7.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Cfo.Cats.Migrators.MSSQL.Migrations -{ - /// - public partial class Objectives_v7 : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "Justification", - schema: "Participant", - table: "Objective", - type: "nvarchar(max)", - nullable: true); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "Justification", - schema: "Participant", - table: "Objective"); - } - } -} diff --git a/src/Migrators/Migrators.MSSQL/Migrations/20240815140110_Objectives_v8.Designer.cs b/src/Migrators/Migrators.MSSQL/Migrations/20240815140110_Objectives_v8.Designer.cs deleted file mode 100644 index cdbf3eb6..00000000 --- a/src/Migrators/Migrators.MSSQL/Migrations/20240815140110_Objectives_v8.Designer.cs +++ /dev/null @@ -1,2505 +0,0 @@ -// -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("20240815140110_Objectives_v8")] - partial class Objectives_v8 - { - /// - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "8.0.7") - .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("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.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.HasKey("Id"); - - b.HasIndex("CreatedBy"); - - b.HasIndex("LastModifiedBy"); - - b.HasIndex("TenantId"); - - b.ToTable("Document", "Document"); - }); - - 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.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("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("ConsentStatus") - .HasColumnType("int"); - - b.Property("Created") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("DateOfBirth") - .IsRequired() - .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("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("OwnerId") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("ReferralComments") - .HasColumnType("nvarchar(max)"); - - b.Property("ReferralSource") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - 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("Created") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("DeclarationSigned") - .HasColumnType("bit"); - - 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("MappaCategory") - .HasColumnType("int"); - - b.Property("MappaLevel") - .HasColumnType("int"); - - b.Property("NSDCase") - .HasColumnType("int"); - - b.Property("PSFRestrictions") - .HasColumnType("nvarchar(max)"); - - b.Property("PSFRestrictionsReceived") - .HasColumnType("datetime2"); - - b.Property("ParticipantId") - .IsRequired() - .HasColumnType("nvarchar(9)"); - - b.Property("ReferredOn") - .HasColumnType("datetime2"); - - b.Property("ReferrerEmail") - .HasColumnType("nvarchar(max)"); - - b.Property("ReferrerName") - .HasColumnType("nvarchar(max)"); - - b.Property("ReviewJustification") - .HasColumnType("nvarchar(max)"); - - b.Property("ReviewReason") - .HasColumnType("int"); - - b.Property("RiskToChildrenInCommunity") - .HasColumnType("int"); - - b.Property("RiskToChildrenInCustody") - .HasColumnType("int"); - - b.Property("RiskToKnownAdultInCommunity") - .HasColumnType("int"); - - b.Property("RiskToKnownAdultInCustody") - .HasColumnType("int"); - - b.Property("RiskToOtherPrisonersInCommunity") - .HasColumnType("int"); - - b.Property("RiskToOtherPrisonersInCustody") - .HasColumnType("int"); - - b.Property("RiskToPublicInCommunity") - .HasColumnType("int"); - - b.Property("RiskToPublicInCustody") - .HasColumnType("int"); - - b.Property("RiskToSelfInCommunity") - .HasColumnType("int"); - - b.Property("RiskToSelfInCustody") - .HasColumnType("int"); - - b.Property("RiskToStaffInCommunity") - .HasColumnType("int"); - - b.Property("RiskToStaffInCustody") - .HasColumnType("int"); - - b.Property("SpecificRisk") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.HasIndex("ParticipantId"); - - b.ToTable("Risk", "Participant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Timeline", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("Created") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .HasColumnType("nvarchar(36)"); - - b.Property("EventType") - .HasColumnType("int"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("Line1") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Line2") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("Line3") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("ParticipantId") - .IsRequired() - .HasColumnType("nvarchar(9)"); - - b.HasKey("Id"); - - b.HasIndex("CreatedBy"); - - b.HasIndex("ParticipantId"); - - b.ToTable("Timeline", "Participant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationRole", b => - { - b.Property("Id") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("NormalizedName") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RoleRank") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex"); - - b.ToTable("Role", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("Group") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RoleId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("RoleClaim", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUser", b => - { - b.Property("Id") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Created") - .HasColumnType("datetime2"); - - b.Property("CreatedBy") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("DisplayName") - .IsRequired() - .HasMaxLength(100) - .HasColumnType("nvarchar(100)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("IsActive") - .HasColumnType("bit"); - - b.Property("IsLive") - .HasColumnType("bit"); - - b.Property("LastModified") - .HasColumnType("datetime2"); - - b.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("MemorableDate") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("MemorablePlace") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("ProfilePictureDataUrl") - .HasColumnType("text"); - - b.Property("ProviderId") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("RefreshToken") - .HasColumnType("nvarchar(max)"); - - b.Property("RefreshTokenExpiryTime") - .HasColumnType("datetime2"); - - b.Property("RequiresPasswordReset") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("SuperiorId") - .HasColumnType("nvarchar(36)"); - - b.Property("TenantId") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("TenantName") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.HasIndex("SuperiorId"); - - b.HasIndex("TenantId"); - - b.ToTable("User", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("Description") - .IsRequired() - .HasMaxLength(200) - .HasColumnType("nvarchar(200)"); - - b.Property("UserId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("UserClaim", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserRole", b => - { - b.Property("UserId") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("RoleId") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("UserRole", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserToken", b => - { - b.Property("UserId") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("UserToken", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.PasswordHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("CreatedAt") - .HasColumnType("datetime2"); - - b.Property("PasswordHash") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("Id"); - - b.ToTable("PasswordHistory", "Identity"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.UserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("UserLogin", "Identity"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.DataProtection.EntityFrameworkCore.DataProtectionKey", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id")); - - b.Property("FriendlyName") - .HasColumnType("nvarchar(max)"); - - b.Property("Xml") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("DataProtectionKeys"); - }); - - modelBuilder.Entity("TenantLocation", b => - { - b.Property("LocationId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("nvarchar(50)"); - - b.HasKey("LocationId", "TenantId"); - - b.HasIndex("TenantId"); - - b.ToTable("TenantLocation", "Configuration"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Contract", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("_tenantId"); - - b.OwnsOne("Cfo.Cats.Domain.ValueObjects.Lifetime", "Lifetime", b1 => - { - b1.Property("ContractId") - .HasColumnType("nvarchar(12)"); - - b1.Property("EndDate") - .HasColumnType("datetime2") - .HasColumnName("LifetimeEnd"); - - b1.Property("StartDate") - .HasColumnType("datetime2") - .HasColumnName("LifetimeStart"); - - b1.HasKey("ContractId"); - - b1.ToTable("Contract", "Configuration"); - - b1.WithOwner() - .HasForeignKey("ContractId"); - }); - - b.Navigation("Lifetime") - .IsRequired(); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Location", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Contract", "Contract") - .WithMany("Locations") - .HasForeignKey("_contractId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", "ParentLocation") - .WithMany("ChildLocations") - .HasForeignKey("_parentLocationId") - .OnDelete(DeleteBehavior.Restrict); - - b.OwnsOne("Cfo.Cats.Domain.ValueObjects.Lifetime", "Lifetime", b1 => - { - b1.Property("LocationId") - .HasColumnType("int"); - - b1.Property("EndDate") - .HasColumnType("datetime2") - .HasColumnName("LifetimeEnd"); - - b1.Property("StartDate") - .HasColumnType("datetime2") - .HasColumnName("LifetimeStart"); - - b1.HasKey("LocationId"); - - b1.ToTable("Location", "Configuration"); - - b1.WithOwner() - .HasForeignKey("LocationId"); - }); - - b.Navigation("Contract"); - - b.Navigation("Lifetime") - .IsRequired(); - - b.Navigation("ParentLocation"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.LocationMapping", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", "Location") - .WithMany("LocationMappings") - .HasForeignKey("_locationId"); - - b.Navigation("Location"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Tenant", b => - { - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.TenantDomain", "Domains", b1 => - { - b1.Property("TenantId") - .HasColumnType("nvarchar(50)"); - - b1.Property("Domain") - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.HasKey("TenantId", "Domain"); - - b1.ToTable("TenantDomain", "Configuration"); - - b1.WithOwner() - .HasForeignKey("TenantId"); - }); - - b.Navigation("Domains"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Assessments.ParticipantAssessment", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", null) - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", null) - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.PathwayScore", "Scores", b1 => - { - b1.Property("AssessmentId") - .HasColumnType("uniqueidentifier"); - - b1.Property("Pathway") - .HasMaxLength(50) - .HasColumnType("nvarchar(50)"); - - b1.Property("Score") - .HasColumnType("float"); - - b1.HasKey("AssessmentId", "Pathway"); - - b1.ToTable("AssessmentPathwayScore", "Participant"); - - b1.WithOwner() - .HasForeignKey("AssessmentId"); - }); - - b.Navigation("Editor"); - - b.Navigation("Owner"); - - b.Navigation("Scores"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.AuditTrail", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.SetNull); - - b.Navigation("Owner"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Documents.Document", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("CreatedBy") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("LastModifiedBy") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId"); - - b.Navigation("Editor"); - - b.Navigation("Owner"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentEscalationQueueEntry", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", "Participant") - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("EnrolmentEscalationQueueEntryId") - .HasColumnType("uniqueidentifier"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("EnrolmentEscalationQueueEntryId"); - - b1.HasIndex("LastModifiedBy"); - - b1.ToTable("EscalationNote", "Enrolment"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.WithOwner() - .HasForeignKey("EnrolmentEscalationQueueEntryId"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Editor"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("Participant"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentPqaQueueEntry", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", "Participant") - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("EnrolmentPqaQueueEntryId") - .HasColumnType("uniqueidentifier"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("EnrolmentPqaQueueEntryId"); - - b1.HasIndex("LastModifiedBy"); - - b1.ToTable("PqaQueueNote", "Enrolment"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.WithOwner() - .HasForeignKey("EnrolmentPqaQueueEntryId"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Editor"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("Participant"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentQa1QueueEntry", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", "Participant") - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("EnrolmentQa1QueueEntryId") - .HasColumnType("uniqueidentifier"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("EnrolmentQa1QueueEntryId"); - - b1.HasIndex("LastModifiedBy"); - - b1.ToTable("Qa1QueueNote", "Enrolment"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.WithOwner() - .HasForeignKey("EnrolmentQa1QueueEntryId"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Editor"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("Participant"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.EnrolmentQa2QueueEntry", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", "Participant") - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("EnrolmentQa2QueueEntryId") - .HasColumnType("uniqueidentifier"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("EnrolmentQa2QueueEntryId"); - - b1.HasIndex("LastModifiedBy"); - - b1.ToTable("Qa2QueueNote", "Enrolment"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.WithOwner() - .HasForeignKey("EnrolmentQa2QueueEntryId"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Editor"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("Participant"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Participant", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Editor") - .WithMany() - .HasForeignKey("EditorId"); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") - .WithMany() - .HasForeignKey("OwnerId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", "CurrentLocation") - .WithMany() - .HasForeignKey("_currentLocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired() - .HasConstraintName("FK_Participant_Location"); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", "EnrolmentLocation") - .WithMany() - .HasForeignKey("_enrolmentLocationId") - .HasConstraintName("FK_Participant_EnrolmentLocation"); - - b.OwnsMany("Cfo.Cats.Domain.Entities.Participants.Consent", "Consents", b1 => - { - b1.Property("ParticipantId") - .HasColumnType("nvarchar(9)"); - - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("_documentId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DocumentId"); - - b1.HasKey("ParticipantId", "Id"); - - b1.HasIndex("_documentId"); - - b1.ToTable("Consent", "Participant"); - - b1.WithOwner() - .HasForeignKey("ParticipantId"); - - b1.HasOne("Cfo.Cats.Domain.Entities.Documents.Document", "Document") - .WithMany() - .HasForeignKey("_documentId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b1.OwnsOne("Cfo.Cats.Domain.ValueObjects.Lifetime", "Lifetime", b2 => - { - b2.Property("ConsentParticipantId") - .HasColumnType("nvarchar(9)"); - - b2.Property("ConsentId") - .HasColumnType("int"); - - b2.Property("EndDate") - .HasColumnType("datetime2") - .HasColumnName("ValidTo"); - - b2.Property("StartDate") - .HasColumnType("datetime2") - .HasColumnName("ValidFrom"); - - b2.HasKey("ConsentParticipantId", "ConsentId"); - - b2.ToTable("Consent", "Participant"); - - b2.WithOwner() - .HasForeignKey("ConsentParticipantId", "ConsentId"); - }); - - b1.Navigation("Document"); - - b1.Navigation("Lifetime") - .IsRequired(); - }); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b1.Property("ParticipantId") - .IsRequired() - .HasColumnType("nvarchar(9)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("LastModifiedBy"); - - b1.HasIndex("ParticipantId"); - - b1.ToTable("Note", "Participant"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.WithOwner() - .HasForeignKey("ParticipantId"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.OwnsMany("Cfo.Cats.Domain.Entities.Participants.RightToWork", "RightToWorks", b1 => - { - b1.Property("ParticipantId") - .HasColumnType("nvarchar(9)"); - - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("_documentId") - .HasColumnType("uniqueidentifier") - .HasColumnName("DocumentId"); - - b1.HasKey("ParticipantId", "Id"); - - b1.HasIndex("_documentId"); - - b1.ToTable("RightToWork", "Participant"); - - b1.WithOwner() - .HasForeignKey("ParticipantId"); - - b1.HasOne("Cfo.Cats.Domain.Entities.Documents.Document", "Document") - .WithMany() - .HasForeignKey("_documentId"); - - b1.OwnsOne("Cfo.Cats.Domain.ValueObjects.Lifetime", "Lifetime", b2 => - { - b2.Property("RightToWorkParticipantId") - .HasColumnType("nvarchar(9)"); - - b2.Property("RightToWorkId") - .HasColumnType("int"); - - b2.Property("EndDate") - .HasColumnType("datetime2") - .HasColumnName("ValidTo"); - - b2.Property("StartDate") - .HasColumnType("datetime2") - .HasColumnName("ValidFrom"); - - b2.HasKey("RightToWorkParticipantId", "RightToWorkId"); - - b2.ToTable("RightToWork", "Participant"); - - b2.WithOwner() - .HasForeignKey("RightToWorkParticipantId", "RightToWorkId"); - }); - - b1.Navigation("Document"); - - b1.Navigation("Lifetime") - .IsRequired(); - }); - - b.Navigation("Consents"); - - b.Navigation("CurrentLocation"); - - b.Navigation("Editor"); - - b.Navigation("EnrolmentLocation"); - - b.Navigation("Notes"); - - b.Navigation("Owner"); - - b.Navigation("RightToWorks"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.PathwayPlan", b => - { - b.OwnsMany("Cfo.Cats.Domain.Entities.Participants.Objective", "Objectives", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b1.Property("Completed") - .HasColumnType("datetime2"); - - b1.Property("CompletedStatus") - .HasColumnType("int"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Justification") - .HasColumnType("nvarchar(max)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("PathwayPlanId") - .HasColumnType("uniqueidentifier"); - - b1.Property("Title") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.HasKey("Id"); - - b1.HasIndex("PathwayPlanId"); - - b1.ToTable("Objective", "Participant"); - - b1.WithOwner() - .HasForeignKey("PathwayPlanId"); - - b1.OwnsMany("Cfo.Cats.Domain.Entities.Participants.ObjectiveTask", "Tasks", b2 => - { - b2.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b2.Property("Completed") - .HasColumnType("datetime2"); - - b2.Property("CompletedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b2.Property("CompletedStatus") - .HasColumnType("int"); - - b2.Property("Created") - .HasColumnType("datetime2"); - - b2.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b2.Property("Due") - .HasColumnType("datetime2"); - - b2.Property("Justification") - .HasColumnType("nvarchar(max)"); - - b2.Property("LastModified") - .HasColumnType("datetime2"); - - b2.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b2.Property("ObjectiveId") - .HasColumnType("uniqueidentifier"); - - b2.Property("Title") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b2.HasKey("Id"); - - b2.HasIndex("CompletedBy"); - - b2.HasIndex("ObjectiveId"); - - b2.ToTable("ObjectiveTask", "Participant"); - - b2.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CompletedByUser") - .WithMany() - .HasForeignKey("CompletedBy"); - - b2.WithOwner() - .HasForeignKey("ObjectiveId"); - - b2.Navigation("CompletedByUser"); - }); - - b1.Navigation("Tasks"); - }); - - b.OwnsMany("Cfo.Cats.Domain.Entities.Participants.PathwayPlanReviewHistory", "ReviewHistories", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("PathwayPlanId") - .HasColumnType("uniqueidentifier"); - - b1.HasKey("Id"); - - b1.HasIndex("PathwayPlanId"); - - b1.ToTable("PathwayPlanReviewHistory", "Participant"); - - b1.WithOwner() - .HasForeignKey("PathwayPlanId"); - }); - - b.Navigation("Objectives"); - - b.Navigation("ReviewHistories"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Risk", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", null) - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Participants.Timeline", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy") - .OnDelete(DeleteBehavior.Restrict); - - b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", null) - .WithMany() - .HasForeignKey("ParticipantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("CreatedByUser"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationRoleClaim", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationRole", "Role") - .WithMany("RoleClaims") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Role"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUser", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Superior") - .WithMany() - .HasForeignKey("SuperiorId"); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.OwnsMany("Cfo.Cats.Domain.ValueObjects.Note", "Notes", b1 => - { - b1.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int"); - - SqlServerPropertyBuilderExtensions.UseIdentityColumn(b1.Property("Id")); - - b1.Property("CallReference") - .HasMaxLength(20) - .HasColumnType("nvarchar(20)"); - - b1.Property("Created") - .HasColumnType("datetime2"); - - b1.Property("CreatedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("LastModified") - .HasColumnType("datetime2"); - - b1.Property("LastModifiedBy") - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.Property("Message") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("nvarchar(255)"); - - b1.Property("TenantId") - .IsRequired() - .HasColumnType("nvarchar(max)"); - - b1.Property("UserId") - .IsRequired() - .HasMaxLength(36) - .HasColumnType("nvarchar(36)"); - - b1.HasKey("Id"); - - b1.HasIndex("CreatedBy"); - - b1.HasIndex("LastModifiedBy"); - - b1.HasIndex("UserId"); - - b1.ToTable("Note", "Identity"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "CreatedByUser") - .WithMany() - .HasForeignKey("CreatedBy"); - - b1.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "LastModifiedByUser") - .WithMany() - .HasForeignKey("LastModifiedBy"); - - b1.WithOwner() - .HasForeignKey("UserId"); - - b1.Navigation("CreatedByUser"); - - b1.Navigation("LastModifiedByUser"); - }); - - b.Navigation("Notes"); - - b.Navigation("Superior"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserClaim", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "User") - .WithMany("UserClaims") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserRole", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationRole", "Role") - .WithMany("UserRoles") - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "User") - .WithMany("UserRoles") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Role"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUserToken", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "User") - .WithMany("Tokens") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.UserLogin", b => - { - b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "User") - .WithMany("Logins") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("TenantLocation", b => - { - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Location", null) - .WithMany() - .HasForeignKey("LocationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Cfo.Cats.Domain.Entities.Administration.Tenant", null) - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Contract", b => - { - b.Navigation("Locations"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Entities.Administration.Location", b => - { - b.Navigation("ChildLocations"); - - b.Navigation("LocationMappings"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationRole", b => - { - b.Navigation("RoleClaims"); - - b.Navigation("UserRoles"); - }); - - modelBuilder.Entity("Cfo.Cats.Domain.Identity.ApplicationUser", b => - { - b.Navigation("Logins"); - - b.Navigation("Tokens"); - - b.Navigation("UserClaims"); - - b.Navigation("UserRoles"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/Migrators/Migrators.MSSQL/Migrations/20240815140110_Objectives_v8.cs b/src/Migrators/Migrators.MSSQL/Migrations/20240815140110_Objectives_v8.cs deleted file mode 100644 index 9d56304f..00000000 --- a/src/Migrators/Migrators.MSSQL/Migrations/20240815140110_Objectives_v8.cs +++ /dev/null @@ -1,144 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Cfo.Cats.Migrators.MSSQL.Migrations -{ - /// - public partial class Objectives_v8 : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_Objective_ParticipantId", - schema: "Participant", - table: "Objective"); - - migrationBuilder.DropColumn( - name: "ParticipantId", - schema: "Participant", - table: "Objective"); - - migrationBuilder.AddColumn( - name: "PathwayPlanId", - schema: "Participant", - table: "Objective", - type: "uniqueidentifier", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); - - migrationBuilder.CreateTable( - name: "PathwayPlan", - schema: "Participant", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - ParticipantId = table.Column(type: "nvarchar(9)", maxLength: 9, nullable: false), - Created = table.Column(type: "datetime2", nullable: true), - CreatedBy = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), - LastModified = table.Column(type: "datetime2", nullable: true), - LastModifiedBy = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_PathwayPlan", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "PathwayPlanReviewHistory", - schema: "Participant", - columns: table => new - { - Id = table.Column(type: "uniqueidentifier", nullable: false), - PathwayPlanId = table.Column(type: "uniqueidentifier", nullable: false), - Created = table.Column(type: "datetime2", nullable: true), - CreatedBy = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), - LastModified = table.Column(type: "datetime2", nullable: true), - LastModifiedBy = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_PathwayPlanReviewHistory", x => x.Id); - table.ForeignKey( - name: "FK_PathwayPlanReviewHistory_PathwayPlan_PathwayPlanId", - column: x => x.PathwayPlanId, - principalSchema: "Participant", - principalTable: "PathwayPlan", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_Objective_PathwayPlanId", - schema: "Participant", - table: "Objective", - column: "PathwayPlanId"); - - migrationBuilder.CreateIndex( - name: "IX_PathwayPlan_ParticipantId", - schema: "Participant", - table: "PathwayPlan", - column: "ParticipantId"); - - migrationBuilder.CreateIndex( - name: "IX_PathwayPlanReviewHistory_PathwayPlanId", - schema: "Participant", - table: "PathwayPlanReviewHistory", - column: "PathwayPlanId"); - - migrationBuilder.AddForeignKey( - name: "FK_Objective_PathwayPlan_PathwayPlanId", - schema: "Participant", - table: "Objective", - column: "PathwayPlanId", - principalSchema: "Participant", - principalTable: "PathwayPlan", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Objective_PathwayPlan_PathwayPlanId", - schema: "Participant", - table: "Objective"); - - migrationBuilder.DropTable( - name: "PathwayPlanReviewHistory", - schema: "Participant"); - - migrationBuilder.DropTable( - name: "PathwayPlan", - schema: "Participant"); - - migrationBuilder.DropIndex( - name: "IX_Objective_PathwayPlanId", - schema: "Participant", - table: "Objective"); - - migrationBuilder.DropColumn( - name: "PathwayPlanId", - schema: "Participant", - table: "Objective"); - - migrationBuilder.AddColumn( - name: "ParticipantId", - schema: "Participant", - table: "Objective", - type: "nvarchar(9)", - maxLength: 9, - nullable: false, - defaultValue: ""); - - migrationBuilder.CreateIndex( - name: "IX_Objective_ParticipantId", - schema: "Participant", - table: "Objective", - column: "ParticipantId"); - } - } -} diff --git a/src/Migrators/Migrators.MSSQL/Migrations/20240816124115_Objectives_v9.cs b/src/Migrators/Migrators.MSSQL/Migrations/20240816124115_Objectives_v9.cs deleted file mode 100644 index 116e272e..00000000 --- a/src/Migrators/Migrators.MSSQL/Migrations/20240816124115_Objectives_v9.cs +++ /dev/null @@ -1,44 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Cfo.Cats.Migrators.MSSQL.Migrations -{ - /// - public partial class Objectives_v9 : Migration - { - /// - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "Index", - schema: "Participant", - table: "ObjectiveTask", - type: "int", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "Index", - schema: "Participant", - table: "Objective", - type: "int", - nullable: false, - defaultValue: 0); - } - - /// - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "Index", - schema: "Participant", - table: "ObjectiveTask"); - - migrationBuilder.DropColumn( - name: "Index", - schema: "Participant", - table: "Objective"); - } - } -} diff --git a/src/Migrators/Migrators.MSSQL/Migrations/20240816124115_Objectives_v9.Designer.cs b/src/Migrators/Migrators.MSSQL/Migrations/20240816141136_PathwayPlan.Designer.cs similarity index 98% rename from src/Migrators/Migrators.MSSQL/Migrations/20240816124115_Objectives_v9.Designer.cs rename to src/Migrators/Migrators.MSSQL/Migrations/20240816141136_PathwayPlan.Designer.cs index 68326e44..db163a32 100644 --- a/src/Migrators/Migrators.MSSQL/Migrations/20240816124115_Objectives_v9.Designer.cs +++ b/src/Migrators/Migrators.MSSQL/Migrations/20240816141136_PathwayPlan.Designer.cs @@ -12,8 +12,8 @@ namespace Cfo.Cats.Migrators.MSSQL.Migrations { [DbContext(typeof(ApplicationDbContext))] - [Migration("20240816124115_Objectives_v9")] - partial class Objectives_v9 + [Migration("20240816141136_PathwayPlan")] + partial class PathwayPlan { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -278,6 +278,45 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) 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("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") @@ -1474,6 +1513,15 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Navigation("Owner"); }); + modelBuilder.Entity("Cfo.Cats.Domain.Entities.Bios.ParticipantBio", b => + { + b.HasOne("Cfo.Cats.Domain.Entities.Participants.Participant", null) + .WithMany() + .HasForeignKey("ParticipantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + modelBuilder.Entity("Cfo.Cats.Domain.Entities.Documents.Document", b => { b.HasOne("Cfo.Cats.Domain.Identity.ApplicationUser", "Owner") diff --git a/src/Migrators/Migrators.MSSQL/Migrations/20240809101015_Objectives.cs b/src/Migrators/Migrators.MSSQL/Migrations/20240816141136_PathwayPlan.cs similarity index 50% rename from src/Migrators/Migrators.MSSQL/Migrations/20240809101015_Objectives.cs rename to src/Migrators/Migrators.MSSQL/Migrations/20240816141136_PathwayPlan.cs index 0e719cab..dfa145a4 100644 --- a/src/Migrators/Migrators.MSSQL/Migrations/20240809101015_Objectives.cs +++ b/src/Migrators/Migrators.MSSQL/Migrations/20240816141136_PathwayPlan.cs @@ -6,19 +6,40 @@ namespace Cfo.Cats.Migrators.MSSQL.Migrations { /// - public partial class Objectives : Migration + public partial class PathwayPlan : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( - name: "Objective", + name: "PathwayPlan", schema: "Participant", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), ParticipantId = table.Column(type: "nvarchar(9)", maxLength: 9, nullable: false), + Created = table.Column(type: "datetime2", nullable: true), + CreatedBy = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + LastModified = table.Column(type: "datetime2", nullable: true), + LastModifiedBy = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_PathwayPlan", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Objective", + schema: "Participant", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + Completed = table.Column(type: "datetime2", nullable: true), + CompletedStatus = table.Column(type: "int", nullable: true), + Index = table.Column(type: "int", nullable: false), + PathwayPlanId = table.Column(type: "uniqueidentifier", nullable: false), Title = table.Column(type: "nvarchar(max)", nullable: false), + Justification = table.Column(type: "nvarchar(max)", nullable: true), Created = table.Column(type: "datetime2", nullable: true), CreatedBy = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), LastModified = table.Column(type: "datetime2", nullable: true), @@ -27,6 +48,37 @@ protected override void Up(MigrationBuilder migrationBuilder) constraints: table => { table.PrimaryKey("PK_Objective", x => x.Id); + table.ForeignKey( + name: "FK_Objective_PathwayPlan_PathwayPlanId", + column: x => x.PathwayPlanId, + principalSchema: "Participant", + principalTable: "PathwayPlan", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "PathwayPlanReviewHistory", + schema: "Participant", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + PathwayPlanId = table.Column(type: "uniqueidentifier", nullable: false), + Created = table.Column(type: "datetime2", nullable: true), + CreatedBy = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), + LastModified = table.Column(type: "datetime2", nullable: true), + LastModifiedBy = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_PathwayPlanReviewHistory", x => x.Id); + table.ForeignKey( + name: "FK_PathwayPlanReviewHistory_PathwayPlan_PathwayPlanId", + column: x => x.PathwayPlanId, + principalSchema: "Participant", + principalTable: "PathwayPlan", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( @@ -35,11 +87,14 @@ protected override void Up(MigrationBuilder migrationBuilder) columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), - Due = table.Column(type: "datetime2", nullable: true), + Due = table.Column(type: "datetime2", nullable: false), Completed = table.Column(type: "datetime2", nullable: true), CompletedBy = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), - Title = table.Column(type: "nvarchar(max)", nullable: false), + CompletedStatus = table.Column(type: "int", nullable: true), + Index = table.Column(type: "int", nullable: false), + Justification = table.Column(type: "nvarchar(max)", nullable: true), ObjectiveId = table.Column(type: "uniqueidentifier", nullable: false), + Title = table.Column(type: "nvarchar(max)", nullable: false), Created = table.Column(type: "datetime2", nullable: true), CreatedBy = table.Column(type: "nvarchar(36)", maxLength: 36, nullable: true), LastModified = table.Column(type: "datetime2", nullable: true), @@ -64,10 +119,10 @@ protected override void Up(MigrationBuilder migrationBuilder) }); migrationBuilder.CreateIndex( - name: "IX_Objective_ParticipantId", + name: "IX_Objective_PathwayPlanId", schema: "Participant", table: "Objective", - column: "ParticipantId"); + column: "PathwayPlanId"); migrationBuilder.CreateIndex( name: "IX_ObjectiveTask_CompletedBy", @@ -80,6 +135,18 @@ protected override void Up(MigrationBuilder migrationBuilder) schema: "Participant", table: "ObjectiveTask", column: "ObjectiveId"); + + migrationBuilder.CreateIndex( + name: "IX_PathwayPlan_ParticipantId", + schema: "Participant", + table: "PathwayPlan", + column: "ParticipantId"); + + migrationBuilder.CreateIndex( + name: "IX_PathwayPlanReviewHistory_PathwayPlanId", + schema: "Participant", + table: "PathwayPlanReviewHistory", + column: "PathwayPlanId"); } /// @@ -89,9 +156,17 @@ protected override void Down(MigrationBuilder migrationBuilder) name: "ObjectiveTask", schema: "Participant"); + migrationBuilder.DropTable( + name: "PathwayPlanReviewHistory", + schema: "Participant"); + migrationBuilder.DropTable( name: "Objective", schema: "Participant"); + + migrationBuilder.DropTable( + name: "PathwayPlan", + schema: "Participant"); } } }