diff --git a/Dfe.Academies.Academisation.Data/Migrations/20230622141535_fix-casing-of-approved-with-conditions.Designer.cs b/Dfe.Academies.Academisation.Data/Migrations/20230622141535_fix-casing-of-approved-with-conditions.Designer.cs
new file mode 100644
index 000000000..16b7ca634
--- /dev/null
+++ b/Dfe.Academies.Academisation.Data/Migrations/20230622141535_fix-casing-of-approved-with-conditions.Designer.cs
@@ -0,0 +1,1466 @@
+//
+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("20230622141535_fix-casing-of-approved-with-conditions")]
+ partial class fixcasingofapprovedwithconditions
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "7.0.5")
+ .HasAnnotation("Relational:MaxIdentifierLength", 128);
+
+ SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
+
+ modelBuilder.Entity("Dfe.Academies.Academisation.Data.ConversionAdvisoryBoardDecisionAggregate.ConversionAdvisoryBoardDecisionDeclinedReasonState", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ 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"));
+
+ 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"));
+
+ 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.ProjectNoteState", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("Author")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Date")
+ .HasColumnType("datetime2");
+
+ b.Property("Note")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ProjectId")
+ .HasColumnType("int");
+
+ b.Property("Subject")
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ProjectId");
+
+ b.ToTable("ProjectNotes", "academisation");
+ });
+
+ modelBuilder.Entity("Dfe.Academies.Academisation.Data.ProjectAggregate.ProjectState", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ 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("AnnexBFormReceived")
+ .HasColumnType("bit");
+
+ b.Property("AnnexBFormUrl")
+ .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("DaoPackSentDate")
+ .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("FinancialDeficit")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Form7Received")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Form7ReceivedDate")
+ .HasColumnType("datetime2");
+
+ 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("LocalAuthority")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("LocalAuthorityInformationTemplateComments")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("LocalAuthorityInformationTemplateLink")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("LocalAuthorityInformationTemplateReturnedDate")
+ .HasColumnType("datetime2");
+
+ b.Property("LocalAuthorityInformationTemplateSectionComplete")
+ .HasColumnType("bit");
+
+ b.Property("LocalAuthorityInformationTemplateSentDate")
+ .HasColumnType("datetime2");
+
+ b.Property("MemberOfParliamentName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("MemberOfParliamentParty")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("NameOfTrust")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("OpeningDate")
+ .HasColumnType("datetime2");
+
+ b.Property("PartOfPfiScheme")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("PercentageFreeSchoolMeals")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("PercentageOfGoodOrOutstandingSchoolsInTheDiocesanTrust")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("PfiSchemeDetails")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("PreviousHeadTeacherBoardDate")
+ .HasColumnType("datetime2");
+
+ b.Property("PreviousHeadTeacherBoardDateQuestion")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("PreviousHeadTeacherBoardLink")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ProjectStatus")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ProjectedRevenueBalanceAtEndMarchNextYear")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("ProposedAcademyOpeningDate")
+ .HasColumnType("datetime2");
+
+ b.Property("PublishedAdmissionNumber")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("RationaleForProject")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("RationaleForTrust")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("RationaleSectionComplete")
+ .HasColumnType("bit");
+
+ b.Property("RecommendationForProject")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Region")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("RevenueCarryForwardAtEndMarchCurrentYear")
+ .HasColumnType("decimal(18,2)");
+
+ b.Property("RisksAndIssues")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("RisksAndIssuesSectionComplete")
+ .HasColumnType("bit");
+
+ b.Property("SchoolAndTrustInformationSectionComplete")
+ .HasColumnType("bit");
+
+ b.Property("SchoolBudgetInformationAdditionalInformation")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("SchoolBudgetInformationSectionComplete")
+ .HasColumnType("bit");
+
+ b.Property("SchoolName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("SchoolPerformanceAdditionalInformation")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("SchoolPhase")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("SchoolPupilForecastsAdditionalInformation")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("SchoolType")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("SponsorName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("SponsorReferenceNumber")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("TrustReferenceNumber")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Urn")
+ .HasColumnType("int");
+
+ b.Property("Version")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("ViabilityIssues")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("YearOneProjectedCapacity")
+ .HasColumnType("int");
+
+ b.Property("YearOneProjectedPupilNumbers")
+ .HasColumnType("int");
+
+ b.Property("YearThreeProjectedCapacity")
+ .HasColumnType("int");
+
+ b.Property("YearThreeProjectedPupilNumbers")
+ .HasColumnType("int");
+
+ b.Property("YearTwoProjectedCapacity")
+ .HasColumnType("int");
+
+ b.Property("YearTwoProjectedPupilNumbers")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("Project", "academisation");
+ });
+
+ modelBuilder.Entity("Dfe.Academies.Academisation.Domain.ApplicationAggregate.Application", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("ApplicationReference")
+ .ValueGeneratedOnAddOrUpdate()
+ .HasColumnType("nvarchar(max)")
+ .HasComputedColumnSql("'A2B_' + CAST([Id] AS NVARCHAR(255))", true);
+
+ 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")
+ .IsUnique()
+ .HasFilter("[FormTrustId] IS NOT NULL");
+
+ b.HasIndex("JoinTrustId")
+ .IsUnique()
+ .HasFilter("[JoinTrustId] IS NOT NULL");
+
+ b.ToTable("ConversionApplication", "academisation");
+ });
+
+ modelBuilder.Entity("Dfe.Academies.Academisation.Domain.ApplicationAggregate.Contributor", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("ConversionApplicationId")
+ .HasColumnType("int");
+
+ b.Property("CreatedOn")
+ .HasColumnType("datetime2");
+
+ b.Property("DynamicsApplicationId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("LastModifiedOn")
+ .HasColumnType("datetime2");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ConversionApplicationId");
+
+ b.ToTable("ConversionApplicationContributor", "academisation");
+ });
+
+ modelBuilder.Entity("Dfe.Academies.Academisation.Domain.ApplicationAggregate.Schools.Lease", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ 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.Domain.ApplicationAggregate.Schools.Loan", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ 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.Domain.ApplicationAggregate.Schools.School", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("ConversionApplicationId")
+ .HasColumnType("int");
+
+ b.Property("CreatedOn")
+ .HasColumnType("datetime2");
+
+ b.Property("DioceseFolderIdentifier")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("DioceseName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("DynamicsApplyingSchoolId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("ExemptionEndDate")
+ .HasColumnType("datetimeoffset");
+
+ b.Property("FoundationConsentFolderIdentifier")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("FoundationTrustOrBodyName")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("FurtherInformation")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("HasLeases")
+ .HasColumnType("bit");
+
+ b.Property("HasLoans")
+ .HasColumnType("bit");
+
+ b.Property("LastModifiedOn")
+ .HasColumnType("datetime2");
+
+ b.Property("LocalAuthorityClosurePlanDetails")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("LocalAuthorityReorganisationDetails")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("MainFeederSchools")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("OfstedInspectionDetails")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("PartOfFederation")
+ .HasColumnType("bit");
+
+ b.Property("ProtectedCharacteristics")
+ .HasColumnType("int");
+
+ b.Property("ResolutionConsentFolderIdentifier")
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("Safeguarding")
+ .HasColumnType("bit");
+
+ b.Property("TrustBenefitDetails")
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ConversionApplicationId");
+
+ b.ToTable("ApplicationSchool", "academisation");
+ });
+
+ modelBuilder.Entity("Dfe.Academies.Academisation.Domain.ApplicationAggregate.Trusts.FormTrust", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("CreatedOn")
+ .HasColumnType("datetime2");
+
+ b.Property("DynamicsApplicationId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("LastModifiedOn")
+ .HasColumnType("datetime2");
+
+ b.HasKey("Id");
+
+ b.ToTable("ApplicationFormTrust", "academisation");
+ });
+
+ modelBuilder.Entity("Dfe.Academies.Academisation.Domain.ApplicationAggregate.Trusts.JoinTrust", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ 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("DynamicsApplicationId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("LastModifiedOn")
+ .HasColumnType("datetime2");
+
+ b.Property("TrustName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("TrustReference")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("UKPRN")
+ .HasColumnType("int");
+
+ b.HasKey("Id");
+
+ b.ToTable("ApplicationJoinTrust", "academisation");
+ });
+
+ modelBuilder.Entity("Dfe.Academies.Academisation.Domain.ApplicationAggregate.Trusts.TrustKeyPerson", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("ApplicationFormTrustId")
+ .HasColumnType("int");
+
+ b.Property("Biography")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.Property("CreatedOn")
+ .HasColumnType("datetime2");
+
+ b.Property("DateOfBirth")
+ .HasColumnType("datetime2");
+
+ b.Property("DynamicsKeyPersonId")
+ .HasColumnType("uniqueidentifier");
+
+ b.Property("LastModifiedOn")
+ .HasColumnType("datetime2");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ApplicationFormTrustId");
+
+ b.ToTable("ApplicationFormTrustKeyPerson", "academisation");
+ });
+
+ modelBuilder.Entity("Dfe.Academies.Academisation.Domain.ApplicationAggregate.Trusts.TrustKeyPersonRole", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int");
+
+ SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"));
+
+ b.Property("ApplicationFormTrustKeyPersonRoleId")
+ .HasColumnType("int");
+
+ b.Property("CreatedOn")
+ .HasColumnType("datetime2");
+
+ b.Property("LastModifiedOn")
+ .HasColumnType("datetime2");
+
+ b.Property("Role")
+ .HasColumnType("int");
+
+ b.Property("TimeInRole")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)");
+
+ b.HasKey("Id");
+
+ b.HasIndex("ApplicationFormTrustKeyPersonRoleId");
+
+ b.ToTable("ApplicationFormTrustKeyPersonRole", "academisation");
+ });
+
+ modelBuilder.Entity("Dfe.Academies.Academisation.Data.ConversionAdvisoryBoardDecisionAggregate.ConversionAdvisoryBoardDecisionDeclinedReasonState", b =>
+ {
+ b.HasOne("Dfe.Academies.Academisation.Data.ConversionAdvisoryBoardDecisionAggregate.ConversionAdvisoryBoardDecisionState", null)
+ .WithMany("DeclinedReasons")
+ .HasForeignKey("AdvisoryBoardDecisionId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Dfe.Academies.Academisation.Data.ConversionAdvisoryBoardDecisionAggregate.ConversionAdvisoryBoardDecisionDeferredReasonState", b =>
+ {
+ b.HasOne("Dfe.Academies.Academisation.Data.ConversionAdvisoryBoardDecisionAggregate.ConversionAdvisoryBoardDecisionState", null)
+ .WithMany("DeferredReasons")
+ .HasForeignKey("AdvisoryBoardDecisionId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Dfe.Academies.Academisation.Data.ProjectAggregate.ProjectNoteState", b =>
+ {
+ b.HasOne("Dfe.Academies.Academisation.Data.ProjectAggregate.ProjectState", null)
+ .WithMany("Notes")
+ .HasForeignKey("ProjectId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Dfe.Academies.Academisation.Domain.ApplicationAggregate.Application", b =>
+ {
+ b.HasOne("Dfe.Academies.Academisation.Domain.ApplicationAggregate.Trusts.FormTrust", "FormTrust")
+ .WithOne()
+ .HasForeignKey("Dfe.Academies.Academisation.Domain.ApplicationAggregate.Application", "FormTrustId");
+
+ b.HasOne("Dfe.Academies.Academisation.Domain.ApplicationAggregate.Trusts.JoinTrust", "JoinTrust")
+ .WithOne()
+ .HasForeignKey("Dfe.Academies.Academisation.Domain.ApplicationAggregate.Application", "JoinTrustId");
+
+ b.Navigation("FormTrust");
+
+ b.Navigation("JoinTrust");
+ });
+
+ modelBuilder.Entity("Dfe.Academies.Academisation.Domain.ApplicationAggregate.Contributor", b =>
+ {
+ b.HasOne("Dfe.Academies.Academisation.Domain.ApplicationAggregate.Application", null)
+ .WithMany("Contributors")
+ .HasForeignKey("ConversionApplicationId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.OwnsOne("Dfe.Academies.Academisation.Domain.Core.ApplicationAggregate.ContributorDetails", "Details", b1 =>
+ {
+ b1.Property("ContributorId")
+ .HasColumnType("int");
+
+ b1.Property("EmailAddress")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("EmailAddress");
+
+ b1.Property("FirstName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("FirstName");
+
+ b1.Property("LastName")
+ .IsRequired()
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("LastName");
+
+ b1.Property("OtherRoleName")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("OtherRoleName");
+
+ b1.Property("Role")
+ .HasColumnType("int")
+ .HasColumnName("Role");
+
+ b1.HasKey("ContributorId");
+
+ b1.ToTable("ConversionApplicationContributor", "academisation");
+
+ b1.WithOwner()
+ .HasForeignKey("ContributorId");
+ });
+
+ b.Navigation("Details")
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Dfe.Academies.Academisation.Domain.ApplicationAggregate.Schools.Lease", b =>
+ {
+ b.HasOne("Dfe.Academies.Academisation.Domain.ApplicationAggregate.Schools.School", null)
+ .WithMany("Leases")
+ .HasForeignKey("ApplicationSchoolId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Dfe.Academies.Academisation.Domain.ApplicationAggregate.Schools.Loan", b =>
+ {
+ b.HasOne("Dfe.Academies.Academisation.Domain.ApplicationAggregate.Schools.School", null)
+ .WithMany("Loans")
+ .HasForeignKey("ApplicationSchoolId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Dfe.Academies.Academisation.Domain.ApplicationAggregate.Schools.School", b =>
+ {
+ b.HasOne("Dfe.Academies.Academisation.Domain.ApplicationAggregate.Application", null)
+ .WithMany("Schools")
+ .HasForeignKey("ConversionApplicationId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.OwnsOne("Dfe.Academies.Academisation.Domain.Core.ApplicationAggregate.SchoolDetails", "Details", b1 =>
+ {
+ b1.Property("SchoolId")
+ .HasColumnType("int");
+
+ b1.Property("ApplicationJoinTrustReason")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("JoinTrustReason");
+
+ b1.Property("ApproverContactEmail")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ApproverContactEmail");
+
+ b1.Property("ApproverContactName")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ApproverContactName");
+
+ b1.Property("CapacityAssumptions")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("CapacityAssumptions");
+
+ b1.Property("CapacityPublishedAdmissionsNumber")
+ .HasColumnType("int")
+ .HasColumnName("CapacityPublishedAdmissionsNumber");
+
+ b1.Property("ConfirmPaySupportGrantToSchool")
+ .HasColumnType("bit")
+ .HasColumnName("ConfirmPaySupportGrantToSchool");
+
+ b1.Property("ContactChairEmail")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ContactChairEmail");
+
+ b1.Property("ContactChairName")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ContactChairName");
+
+ b1.Property("ContactHeadEmail")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ContactHeadEmail");
+
+ b1.Property("ContactHeadName")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ContactHeadName");
+
+ b1.Property("ContactRole")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ContactRole");
+
+ b1.Property("ConversionChangeNamePlanned")
+ .HasColumnType("bit")
+ .HasColumnName("ConversionChangeNamePlanned");
+
+ b1.Property("ConversionTargetDate")
+ .HasColumnType("datetime2")
+ .HasColumnName("ConversionTargetDate");
+
+ b1.Property("ConversionTargetDateExplained")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("ConversionTargetDateExplained");
+
+ b1.Property("ConversionTargetDateSpecified")
+ .HasColumnType("bit")
+ .HasColumnName("ConversionTargetDateSpecified");
+
+ b1.Property("DeclarationBodyAgree")
+ .HasColumnType("bit")
+ .HasColumnName("DeclarationBodyAgree");
+
+ b1.Property("DeclarationIAmTheChairOrHeadteacher")
+ .HasColumnType("bit")
+ .HasColumnName("DeclarationIAmTheChairOrHeadteacher");
+
+ b1.Property("DeclarationSignedByName")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("DeclarationSignedByName");
+
+ b1.Property("FinanceOngoingInvestigations")
+ .HasColumnType("bit")
+ .HasColumnName("FinanceOngoingInvestigations");
+
+ b1.Property("FinancialInvestigationsExplain")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("FinancialInvestigationsExplain");
+
+ b1.Property("FinancialInvestigationsTrustAware")
+ .HasColumnType("bit")
+ .HasColumnName("FinancialInvestigationsTrustAware");
+
+ b1.Property("MainContactOtherEmail")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("MainContactOtherEmail");
+
+ b1.Property("MainContactOtherName")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("MainContactOtherName");
+
+ b1.Property("MainContactOtherRole")
+ .HasColumnType("nvarchar(max)")
+ .HasColumnName("MainContactOtherRole");
+
+ b1.Property("ProjectedPupilNumbersYear1")
+ .HasColumnType("int")
+ .HasColumnName("ProjectedPupilNumbersYear1");
+
+ b1.Property("ProjectedPupilNumbersYear2")
+ .HasColumnType("int")
+ .HasColumnName("ProjectedPupilNumbersYear2");
+
+ b1.Property