Skip to content

Commit

Permalink
Merge pull request #171 from DFE-Digital/110289-DataConversionNewDbCols
Browse files Browse the repository at this point in the history
110289 data conversion new db cols
  • Loading branch information
MarkRobinsonDfe authored Dec 6, 2022
2 parents 058d73d + 5dd8476 commit 96138fa
Show file tree
Hide file tree
Showing 15 changed files with 1,305 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

/// <summary>
/// This is in the format $"A2B_{ApplicationId}"
/// Currently calculated by new UI but we need somewhere to store existing data from dynamics
/// </summary>
public string? ApplicationReference { get; set; }

public static ApplicationState MapFromDomain(IApplication application, IMapper mapper)
{
return new()
Expand All @@ -38,7 +47,8 @@ public static ApplicationState MapFromDomain(IApplication application, IMapper m
.ToHashSet(),
FormTrust = mapper.Map<FormTrustState>(application.FormTrust),
JoinTrust = mapper.Map<JoinTrustState>(application.JoinTrust),
ApplicationSubmittedDate = application.ApplicationSubmittedDate
ApplicationSubmittedDate = application.ApplicationSubmittedDate,
ApplicationReference = application.ApplicationReference
};
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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; }
}
}
Loading

0 comments on commit 96138fa

Please sign in to comment.