diff --git a/Dfe.Academies.Academisation.Data/ApplicationAggregate/ApplicationSchoolState.cs b/Dfe.Academies.Academisation.Data/ApplicationAggregate/ApplicationSchoolState.cs
index 4eeb9130b..f482408db 100644
--- a/Dfe.Academies.Academisation.Data/ApplicationAggregate/ApplicationSchoolState.cs
+++ b/Dfe.Academies.Academisation.Data/ApplicationAggregate/ApplicationSchoolState.cs
@@ -138,6 +138,9 @@ public class ApplicationSchoolState : BaseEntity
// Reason for joning trust
public string? SchoolConversionReasonsForJoining { get; set; }
+ // MR:- below mods for Dynamics -> SQL server A2B external app conversion
+ public Guid? DynamicsApplyingSchoolId { get; set; }
+
public static ApplicationSchoolState MapFromDomain(ISchool applyingSchool)
{
return new()
diff --git a/Dfe.Academies.Academisation.Data/ApplicationAggregate/ApplicationState.cs b/Dfe.Academies.Academisation.Data/ApplicationAggregate/ApplicationState.cs
index af6ba580a..04fc2880a 100644
--- a/Dfe.Academies.Academisation.Data/ApplicationAggregate/ApplicationState.cs
+++ b/Dfe.Academies.Academisation.Data/ApplicationAggregate/ApplicationState.cs
@@ -21,6 +21,15 @@ public class ApplicationState : BaseEntity
public FormTrustState? FormTrust { get; set; }
public DateTime? ApplicationSubmittedDate { get; set; }
+ // MR:- below mods for Dynamics -> SQL server A2B external app conversion
+ public Guid? DynamicsApplicationId { get; set; }
+
+ ///
+ /// This is in the format $"A2B_{ApplicationId}"
+ /// Currently calculated by new UI but we need somewhere to store existing data from dynamics
+ ///
+ public string? ApplicationReference { get; set; }
+
public static ApplicationState MapFromDomain(IApplication application, IMapper mapper)
{
return new()
@@ -38,7 +47,8 @@ public static ApplicationState MapFromDomain(IApplication application, IMapper m
.ToHashSet(),
FormTrust = mapper.Map(application.FormTrust),
JoinTrust = mapper.Map(application.JoinTrust),
- ApplicationSubmittedDate = application.ApplicationSubmittedDate
+ ApplicationSubmittedDate = application.ApplicationSubmittedDate,
+ ApplicationReference = application.ApplicationReference
};
}
diff --git a/Dfe.Academies.Academisation.Data/ApplicationAggregate/FormTrustState.cs b/Dfe.Academies.Academisation.Data/ApplicationAggregate/FormTrustState.cs
index dbc2f56ae..1e65c8c2d 100644
--- a/Dfe.Academies.Academisation.Data/ApplicationAggregate/FormTrustState.cs
+++ b/Dfe.Academies.Academisation.Data/ApplicationAggregate/FormTrustState.cs
@@ -1,13 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using AutoFixture;
-using Dfe.Academies.Academisation.Domain.ApplicationAggregate.Trusts;
-using Dfe.Academies.Academisation.Domain.Core.ApplicationAggregate;
-using Dfe.Academies.Academisation.IDomain.ApplicationAggregate;
+using System.ComponentModel.DataAnnotations.Schema;
namespace Dfe.Academies.Academisation.Data.ApplicationAggregate
{
diff --git a/Dfe.Academies.Academisation.Data/ApplicationAggregate/JoinTrustState.cs b/Dfe.Academies.Academisation.Data/ApplicationAggregate/JoinTrustState.cs
index b1ef3c789..7778cbe32 100644
--- a/Dfe.Academies.Academisation.Data/ApplicationAggregate/JoinTrustState.cs
+++ b/Dfe.Academies.Academisation.Data/ApplicationAggregate/JoinTrustState.cs
@@ -1,13 +1,5 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using AutoFixture;
-using Dfe.Academies.Academisation.Domain.ApplicationAggregate.Trusts;
+using System.ComponentModel.DataAnnotations.Schema;
using Dfe.Academies.Academisation.Domain.Core.ApplicationAggregate;
-using Dfe.Academies.Academisation.IDomain.ApplicationAggregate;
namespace Dfe.Academies.Academisation.Data.ApplicationAggregate
{
diff --git a/Dfe.Academies.Academisation.Data/ApplicationAggregate/LeaseState.cs b/Dfe.Academies.Academisation.Data/ApplicationAggregate/LeaseState.cs
index 991bddd57..d05d5e834 100644
--- a/Dfe.Academies.Academisation.Data/ApplicationAggregate/LeaseState.cs
+++ b/Dfe.Academies.Academisation.Data/ApplicationAggregate/LeaseState.cs
@@ -14,7 +14,10 @@ public class LeaseState : BaseEntity
public string Purpose { get; set; }
public string ValueOfAssets { get; set; }
public string ResponsibleForAssets { get; set; }
-
+
+ // MR:- below mods for Dynamics -> SQL server A2B external app conversion
+ public Guid? DynamicsSchoolLeaseId { get; set; }
+
public static Lease MapFromDomain(ILease lease)
{
return new Lease(lease.Id, lease.LeaseTerm, lease.RepaymentAmount, lease.InterestRate, lease.PaymentsToDate, lease.Purpose, lease.ValueOfAssets, lease.ResponsibleForAssets);
diff --git a/Dfe.Academies.Academisation.Data/ApplicationAggregate/LoanState.cs b/Dfe.Academies.Academisation.Data/ApplicationAggregate/LoanState.cs
index c06b1fb55..635fb1f71 100644
--- a/Dfe.Academies.Academisation.Data/ApplicationAggregate/LoanState.cs
+++ b/Dfe.Academies.Academisation.Data/ApplicationAggregate/LoanState.cs
@@ -19,6 +19,9 @@ public class LoanState : BaseEntity
public string Schedule { get; set; }
+ // MR:- below mods for Dynamics -> SQL server A2B external app conversion
+ public Guid? DynamicsSchoolLoanId { get; set; }
+
public static Loan MapFromDomain(ILoan loan)
{
return new Loan(loan.Id, loan.Amount, loan.Purpose, loan.Provider, loan.InterestRate, loan.Schedule);
diff --git a/Dfe.Academies.Academisation.Data/ApplicationAggregate/TrustKeyPersonState.cs b/Dfe.Academies.Academisation.Data/ApplicationAggregate/TrustKeyPersonState.cs
index aa6835ad9..80dfa5a2b 100644
--- a/Dfe.Academies.Academisation.Data/ApplicationAggregate/TrustKeyPersonState.cs
+++ b/Dfe.Academies.Academisation.Data/ApplicationAggregate/TrustKeyPersonState.cs
@@ -1,9 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using System.ComponentModel.DataAnnotations.Schema;
using Dfe.Academies.Academisation.Domain.Core.ApplicationAggregate;
namespace Dfe.Academies.Academisation.Data.ApplicationAggregate
@@ -20,5 +15,8 @@ public class TrustKeyPersonState : BaseEntity
public string? ContactEmailAddress { get; set; }
public DateTime? DateOfBirth { get; set; }
public string Biography { get; set; }
+
+ // MR:- below mods for Dynamics -> SQL server A2B external app conversion
+ public Guid DynamicsKeyPersonId { get; set; }
}
}
diff --git a/Dfe.Academies.Academisation.Data/Migrations/20221205161027_DataConversionColumns.Designer.cs b/Dfe.Academies.Academisation.Data/Migrations/20221205161027_DataConversionColumns.Designer.cs
new file mode 100644
index 000000000..27c651290
--- /dev/null
+++ b/Dfe.Academies.Academisation.Data/Migrations/20221205161027_DataConversionColumns.Designer.cs
@@ -0,0 +1,1150 @@
+//
+using System;
+using Dfe.Academies.Academisation.Data;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+
+#nullable disable
+
+namespace Dfe.Academies.Academisation.Data.Migrations
+{
+ [DbContext(typeof(AcademisationContext))]
+ [Migration("20221205161027_DataConversionColumns")]
+ partial class DataConversionColumns
+ {
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasDefaultSchema("academisation")
+ .HasAnnotation("ProductVersion", "6.0.7")
+ .HasAnnotation("Relational:MaxIdentifierLength", 128);
+
+ SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1);
+
+ modelBuilder.Entity("Dfe.Academies.Academisation.Data.ApplicationAggregate.ApplicationSchoolState", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
+
+ b.Property("ApproverContactEmail")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ApproverContactName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CapacityAssumptions")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CapacityPublishedAdmissionsNumber")
+ .HasColumnType("int");
+
+ b.Property("ConfirmPaySupportGrantToSchool")
+ .HasColumnType("bit");
+
+ b.Property("ContactChairEmail")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ContactChairName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ContactChairTel")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ContactHeadEmail")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ContactHeadName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ContactHeadTel")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ContactRole")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ConversionApplicationId")
+ .HasColumnType("int");
+
+ b.Property("ConversionChangeNamePlanned")
+ .HasColumnType("bit");
+
+ b.Property("ConversionTargetDate")
+ .HasColumnType("datetime2");
+
+ b.Property("ConversionTargetDateExplained")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ConversionTargetDateSpecified")
+ .HasColumnType("bit");
+
+ b.Property("CreatedOn")
+ .HasColumnType("datetime2");
+
+ b.Property("CurrentFinancialYearCapitalCarryForward")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("CurrentFinancialYearCapitalCarryForwardExplained")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CurrentFinancialYearCapitalCarryForwardFileLink")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CurrentFinancialYearCapitalCarryForwardStatus")
+ .HasColumnType("int");
+
+ b.Property("CurrentFinancialYearEndDate")
+ .HasColumnType("datetime2");
+
+ b.Property("CurrentFinancialYearRevenue")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("CurrentFinancialYearRevenueStatus")
+ .HasColumnType("int");
+
+ b.Property("CurrentFinancialYearRevenueStatusExplained")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CurrentFinancialYearRevenueStatusFileLink")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("DeclarationBodyAgree")
+ .HasColumnType("bit");
+
+ b.Property("DeclarationIAmTheChairOrHeadteacher")
+ .HasColumnType("bit");
+
+ b.Property("DeclarationSignedByName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("DioceseFolderIdentifier")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("DioceseName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("DynamicsApplyingSchoolId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ExemptionEndDate")
+ .HasColumnType("datetimeoffset");
+
+ b.Property("FacilitiesShared")
+ .HasColumnType("bit");
+
+ b.Property("FacilitiesSharedExplained")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("FinanceOngoingInvestigations")
+ .HasColumnType("bit");
+
+ b.Property("FinancialInvestigationsExplain")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("FinancialInvestigationsTrustAware")
+ .HasColumnType("bit");
+
+ b.Property("FoundationConsentFolderIdentifier")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("FoundationTrustOrBodyName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("FurtherInformation")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Grants")
+ .HasColumnType("bit");
+
+ b.Property("GrantsAwardingBodies")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("HasLeases")
+ .HasColumnType("bit");
+
+ b.Property("HasLoans")
+ .HasColumnType("bit");
+
+ b.Property("JoinTrustReason")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("LastModifiedOn")
+ .HasColumnType("datetime2");
+
+ b.Property("LocalAuthorityClosurePlanDetails")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("LocalAuthorityReoganisationDetails")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("MainContactOtherEmail")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("MainContactOtherName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("MainContactOtherRole")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("MainContactOtherTelephone")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("MainFeederSchools")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("NextFinancialYearCapitalCarryForward")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("NextFinancialYearCapitalCarryForwardExplained")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("NextFinancialYearCapitalCarryForwardFileLink")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("NextFinancialYearCapitalCarryForwardStatus")
+ .HasColumnType("int");
+
+ b.Property("NextFinancialYearEndDate")
+ .HasColumnType("datetime2");
+
+ b.Property("NextFinancialYearRevenue")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("NextFinancialYearRevenueStatus")
+ .HasColumnType("int");
+
+ b.Property("NextFinancialYearRevenueStatusExplained")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("NextFinancialYearRevenueStatusFileLink")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("OfstedInspectionDetails")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("OwnerExplained")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("PartOfBuildingSchoolsForFutureProgramme")
+ .HasColumnType("bit");
+
+ b.Property("PartOfFederation")
+ .HasColumnType("bit");
+
+ b.Property("PartOfPfiScheme")
+ .HasColumnType("bit");
+
+ b.Property("PartOfPfiSchemeType")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("PartOfPrioritySchoolsBuildingProgramme")
+ .HasColumnType("bit");
+
+ b.Property("PreviousFinancialYearCapitalCarryForward")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("PreviousFinancialYearCapitalCarryForwardExplained")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("PreviousFinancialYearCapitalCarryForwardFileLink")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("PreviousFinancialYearCapitalCarryForwardStatus")
+ .HasColumnType("int");
+
+ b.Property("PreviousFinancialYearEndDate")
+ .HasColumnType("datetime2");
+
+ b.Property("PreviousFinancialYearRevenue")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("PreviousFinancialYearRevenueStatus")
+ .HasColumnType("int");
+
+ b.Property("PreviousFinancialYearRevenueStatusExplained")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("PreviousFinancialYearRevenueStatusFileLink")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ProjectedPupilNumbersYear1")
+ .HasColumnType("int");
+
+ b.Property("ProjectedPupilNumbersYear2")
+ .HasColumnType("int");
+
+ b.Property("ProjectedPupilNumbersYear3")
+ .HasColumnType("int");
+
+ b.Property("ProposedNewSchoolName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ProtectedCharacteristics")
+ .HasColumnType("int");
+
+ b.Property("ResolutionConsentFolderIdentifier")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("SafeguardingDetails")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("SchoolConversionReasonsForJoining")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("SchoolHasConsultedStakeholders")
+ .HasColumnType("bit");
+
+ b.Property("SchoolName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("SchoolPlanToConsultStakeholders")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("SupportGrantFundsPaidTo")
+ .HasColumnType("int");
+
+ b.Property("TrustBenefitDetails")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Urn")
+ .HasColumnType("int");
+
+ b.Property("WorksPlanned")
+ .HasColumnType("bit");
+
+ b.Property("WorksPlannedDate")
+ .HasColumnType("datetime2");
+
+ b.Property("WorksPlannedExplained")
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ConversionApplicationId");
+
+ b.ToTable("ApplicationSchool", "academisation");
+ });
+
+ modelBuilder.Entity("Dfe.Academies.Academisation.Data.ApplicationAggregate.ApplicationState", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
+
+ b.Property("ApplicationReference")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ApplicationStatus")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ApplicationSubmittedDate")
+ .HasColumnType("datetime2");
+
+ b.Property("ApplicationType")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CreatedOn")
+ .HasColumnType("datetime2");
+
+ b.Property("DynamicsApplicationId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("FormTrustId")
+ .HasColumnType("int");
+
+ b.Property("JoinTrustId")
+ .HasColumnType("int");
+
+ b.Property("LastModifiedOn")
+ .HasColumnType("datetime2");
+
+ b.HasKey("Id");
+
+ b.HasIndex("FormTrustId");
+
+ b.HasIndex("JoinTrustId");
+
+ b.ToTable("ConversionApplication", "academisation");
+ });
+
+ modelBuilder.Entity("Dfe.Academies.Academisation.Data.ApplicationAggregate.ContributorState", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
+
+ b.Property("ConversionApplicationId")
+ .HasColumnType("int");
+
+ b.Property("CreatedOn")
+ .HasColumnType("datetime2");
+
+ b.Property("EmailAddress")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("FirstName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("LastModifiedOn")
+ .HasColumnType("datetime2");
+
+ b.Property("LastName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("OtherRoleName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Role")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ConversionApplicationId");
+
+ b.ToTable("ConversionApplicationContributor", "academisation");
+ });
+
+ modelBuilder.Entity("Dfe.Academies.Academisation.Data.ApplicationAggregate.FormTrustState", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
+
+ b.Property("CreatedOn")
+ .HasColumnType("datetime2");
+
+ b.Property("FormTrustGrowthPlansYesNo")
+ .HasColumnType("bit");
+
+ b.Property("FormTrustImprovementApprovedSponsor")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("FormTrustImprovementStrategy")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("FormTrustImprovementSupport")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("FormTrustOpeningDate")
+ .HasColumnType("datetime2");
+
+ b.Property("FormTrustPlanForGrowth")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("FormTrustPlansForNoGrowth")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("FormTrustProposedNameOfTrust")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("FormTrustReasonApprovaltoConvertasSAT")
+ .HasColumnType("bit");
+
+ b.Property("FormTrustReasonApprovedPerson")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("FormTrustReasonForming")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("FormTrustReasonFreedom")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("FormTrustReasonGeoAreas")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("FormTrustReasonImproveTeaching")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("FormTrustReasonVision")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("LastModifiedOn")
+ .HasColumnType("datetime2");
+
+ b.Property("TrustApproverEmail")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("TrustApproverName")
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.ToTable("ApplicationFormTrust", "academisation");
+ });
+
+ modelBuilder.Entity("Dfe.Academies.Academisation.Data.ApplicationAggregate.JoinTrustState", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
+
+ b.Property("ChangesToLaGovernance")
+ .HasColumnType("bit");
+
+ b.Property("ChangesToLaGovernanceExplained")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ChangesToTrust")
+ .HasColumnType("int");
+
+ b.Property("ChangesToTrustExplained")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CreatedOn")
+ .HasColumnType("datetime2");
+
+ b.Property("LastModifiedOn")
+ .HasColumnType("datetime2");
+
+ b.Property("TrustName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("UKPRN")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("ApplicationJoinTrust", "academisation");
+ });
+
+ modelBuilder.Entity("Dfe.Academies.Academisation.Data.ApplicationAggregate.LeaseState", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
+
+ b.Property("ApplicationSchoolId")
+ .HasColumnType("int");
+
+ b.Property("CreatedOn")
+ .HasColumnType("datetime2");
+
+ b.Property("DynamicsSchoolLeaseId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("InterestRate")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("LastModifiedOn")
+ .HasColumnType("datetime2");
+
+ b.Property("LeaseTerm")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("PaymentsToDate")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("Purpose")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("RepaymentAmount")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("ResponsibleForAssets")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ValueOfAssets")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ApplicationSchoolId");
+
+ b.ToTable("ApplicationSchoolLease", "academisation");
+ });
+
+ modelBuilder.Entity("Dfe.Academies.Academisation.Data.ApplicationAggregate.LoanState", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
+
+ b.Property("Amount")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("ApplicationSchoolId")
+ .HasColumnType("int");
+
+ b.Property("CreatedOn")
+ .HasColumnType("datetime2");
+
+ b.Property("DynamicsSchoolLoanId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("InterestRate")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("LastModifiedOn")
+ .HasColumnType("datetime2");
+
+ b.Property("Provider")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Purpose")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Schedule")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ApplicationSchoolId");
+
+ b.ToTable("ApplicationSchoolLoan", "academisation");
+ });
+
+ modelBuilder.Entity("Dfe.Academies.Academisation.Data.ApplicationAggregate.TrustKeyPersonState", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
+
+ b.Property("ApplicationFormTrustId")
+ .HasColumnType("int");
+
+ b.Property("Biography")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ContactEmailAddress")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CreatedOn")
+ .HasColumnType("datetime2");
+
+ b.Property("DateOfBirth")
+ .HasColumnType("datetime2");
+
+ b.Property("DynamicsKeyPersonId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("FirstName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("LastModifiedOn")
+ .HasColumnType("datetime2");
+
+ b.Property("Role")
+ .HasColumnType("int");
+
+ b.Property("Surname")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("TimeInRole")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ApplicationFormTrustId");
+
+ b.ToTable("ApplicationFormTrustKeyPerson", "academisation");
+ });
+
+ modelBuilder.Entity("Dfe.Academies.Academisation.Data.ConversionAdvisoryBoardDecisionAggregate.ConversionAdvisoryBoardDecisionDeclinedReasonState", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
+
+ b.Property("AdvisoryBoardDecisionId")
+ .HasColumnType("int");
+
+ b.Property("CreatedOn")
+ .HasColumnType("datetime2");
+
+ b.Property("Details")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("LastModifiedOn")
+ .HasColumnType("datetime2");
+
+ b.Property("Reason")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AdvisoryBoardDecisionId");
+
+ b.ToTable("ConversionAdvisoryBoardDecisionDeclinedReason", "academisation");
+ });
+
+ modelBuilder.Entity("Dfe.Academies.Academisation.Data.ConversionAdvisoryBoardDecisionAggregate.ConversionAdvisoryBoardDecisionDeferredReasonState", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
+
+ b.Property("AdvisoryBoardDecisionId")
+ .HasColumnType("int");
+
+ b.Property("CreatedOn")
+ .HasColumnType("datetime2");
+
+ b.Property("Details")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("LastModifiedOn")
+ .HasColumnType("datetime2");
+
+ b.Property("Reason")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("AdvisoryBoardDecisionId");
+
+ b.ToTable("ConversionAdvisoryBoardDecisionDeferredReason", "academisation");
+ });
+
+ modelBuilder.Entity("Dfe.Academies.Academisation.Data.ConversionAdvisoryBoardDecisionAggregate.ConversionAdvisoryBoardDecisionState", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
+
+ b.Property("AdvisoryBoardDecisionDate")
+ .HasColumnType("datetime2");
+
+ b.Property("ApprovedConditionsDetails")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ApprovedConditionsSet")
+ .HasColumnType("bit");
+
+ b.Property("ConversionProjectId")
+ .HasColumnType("int");
+
+ b.Property("CreatedOn")
+ .HasColumnType("datetime2");
+
+ b.Property("Decision")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("DecisionMadeBy")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("LastModifiedOn")
+ .HasColumnType("datetime2");
+
+ b.HasKey("Id");
+
+ b.ToTable("ConversionAdvisoryBoardDecision", "academisation");
+ });
+
+ modelBuilder.Entity("Dfe.Academies.Academisation.Data.ProjectAggregate.ProjectState", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1);
+
+ b.Property("AcademyOrderRequired")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("AcademyTypeAndRoute")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ActualPupilNumbers")
+ .HasColumnType("int");
+
+ b.Property("AgeRange")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ApplicationReceivedDate")
+ .HasColumnType("datetime2");
+
+ b.Property("ApplicationReferenceNumber")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("AssignedDate")
+ .HasColumnType("datetime2");
+
+ b.Property("AssignedUserEmailAddress")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("AssignedUserFullName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("AssignedUserId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("Author")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("BaselineDate")
+ .HasColumnType("datetime2");
+
+ b.Property("Capacity")
+ .HasColumnType("int");
+
+ b.Property("CapitalCarryForwardAtEndMarchCurrentYear")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("CapitalCarryForwardAtEndMarchNextYear")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("ClearedBy")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Consultation")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ConversionSupportGrantAmount")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("ConversionSupportGrantChangeReason")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CreatedOn")
+ .HasColumnType("datetime2");
+
+ b.Property("DiocesanConsent")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("DiocesanTrust")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("DistanceFromSchoolToTrustHeadquarters")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("DistanceFromSchoolToTrustHeadquartersAdditionalInformation")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("EndOfCurrentFinancialYear")
+ .HasColumnType("datetime2");
+
+ b.Property("EndOfNextFinancialYear")
+ .HasColumnType("datetime2");
+
+ b.Property("EqualitiesImpactAssessmentConsidered")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("FinancialDeficit")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("FoundationConsent")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("GeneralInformationSectionComplete")
+ .HasColumnType("bit");
+
+ b.Property("GoverningBodyResolution")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("HeadTeacherBoardDate")
+ .HasColumnType("datetime2");
+
+ b.Property("IfdPipelineId")
+ .HasColumnType("int");
+
+ b.Property("KeyStage2PerformanceAdditionalInformation")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("KeyStage4PerformanceAdditionalInformation")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("KeyStage5PerformanceAdditionalInformation")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("LastModifiedOn")
+ .HasColumnType("datetime2");
+
+ b.Property("LegalRequirementsSectionComplete")
+ .HasColumnType("bit");
+
+ b.Property