Skip to content

Commit

Permalink
Merge pull request #318 from DFE-Digital/124178/project-created-on-date
Browse files Browse the repository at this point in the history
Adds a CreatedOn column to the AcademyTransfersProject table
  • Loading branch information
Tim Wilde authored Mar 24, 2023
2 parents d49c5b0 + bb032da commit 8aa09fe
Show file tree
Hide file tree
Showing 6 changed files with 926 additions and 353 deletions.
110 changes: 60 additions & 50 deletions TramsDataApi.Test/Factories/AcademyTransferProjectFactoryTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,9 @@ public void ReturnsUpdatedAcademyTransferProject_WhenUpdating_IfRequestHasUpdate
HasTargetDateForTransfer = academyTransferProject.HasTargetDateForTransfer,
AssignedUserEmailAddress = academyTransferProject.AssignedUserEmailAddress,
AssignedUserFullName = academyTransferProject.AssignedUserFullName,
AssignedUserId = academyTransferProject.AssignedUserId
AssignedUserId = academyTransferProject.AssignedUserId,

CreatedOn = academyTransferProject.CreatedOn
};

var result = AcademyTransferProjectFactory.Update(academyTransferProject, updateRequest);
Expand Down Expand Up @@ -364,7 +366,9 @@ public void ReturnsUpdatedAcademyTransferProject_WhenUpdating_AndUpdatesTheListO
HasTargetDateForTransfer = academyTransferProject.HasTargetDateForTransfer,
AssignedUserEmailAddress = academyTransferProject.AssignedUserEmailAddress,
AssignedUserFullName = academyTransferProject.AssignedUserFullName,
AssignedUserId = academyTransferProject.AssignedUserId
AssignedUserId = academyTransferProject.AssignedUserId,

CreatedOn = academyTransferProject.CreatedOn
};

var result = AcademyTransferProjectFactory.Update(academyTransferProject, updateRequest);
Expand Down Expand Up @@ -451,7 +455,9 @@ public void ReturnsUpdatedAcademyTransferProject_WhenUpdating_IfRequestHasUpdate
HasTargetDateForTransfer = academyTransferProject.HasTargetDateForTransfer,
AssignedUserEmailAddress = academyTransferProject.AssignedUserEmailAddress,
AssignedUserFullName = academyTransferProject.AssignedUserFullName,
AssignedUserId = academyTransferProject.AssignedUserId
AssignedUserId = academyTransferProject.AssignedUserId,

CreatedOn = academyTransferProject.CreatedOn
};

var result = AcademyTransferProjectFactory.Update(academyTransferProject, updateRequest);
Expand All @@ -478,56 +484,58 @@ public void ReturnsUpdatedAcademyTransferProject_WhenUpdating_IfRequestIsToSetDa

var expected = new AcademyTransferProjects
{
Id = academyTransferProject.Id,
Urn = academyTransferProject.Urn,
ProjectReference = academyTransferProject.ProjectReference,
OutgoingTrustUkprn = academyTransferProject.OutgoingTrustUkprn,
ProjectRationale = academyTransferProject.ProjectRationale,
TransferringAcademies = academyTransferProject.TransferringAcademies,
WhoInitiatedTheTransfer = academyTransferProject.WhoInitiatedTheTransfer,
TargetDateForTransfer = null,
RddOrEsfaIntervention = academyTransferProject.RddOrEsfaIntervention,
RddOrEsfaInterventionDetail = academyTransferProject.RddOrEsfaInterventionDetail,
TypeOfTransfer = academyTransferProject.TypeOfTransfer,
OtherTransferTypeDescription = academyTransferProject.OtherTransferTypeDescription,
TransferFirstDiscussed = null,
HtbDate = null,
TrustSponsorRationale = academyTransferProject.TrustSponsorRationale,
State = academyTransferProject.State,
Status = academyTransferProject.Status,
Author = academyTransferProject.Author,
Recommendation = academyTransferProject.Recommendation,
AnyRisks = academyTransferProject.AnyRisks,
HighProfileShouldBeConsidered = academyTransferProject.HighProfileShouldBeConsidered,
HighProfileFurtherSpecification = academyTransferProject.HighProfileFurtherSpecification,
ComplexLandAndBuildingShouldBeConsidered =
Id = academyTransferProject.Id,
Urn = academyTransferProject.Urn,
ProjectReference = academyTransferProject.ProjectReference,
OutgoingTrustUkprn = academyTransferProject.OutgoingTrustUkprn,
ProjectRationale = academyTransferProject.ProjectRationale,
TransferringAcademies = academyTransferProject.TransferringAcademies,
WhoInitiatedTheTransfer = academyTransferProject.WhoInitiatedTheTransfer,
TargetDateForTransfer = null,
RddOrEsfaIntervention = academyTransferProject.RddOrEsfaIntervention,
RddOrEsfaInterventionDetail = academyTransferProject.RddOrEsfaInterventionDetail,
TypeOfTransfer = academyTransferProject.TypeOfTransfer,
OtherTransferTypeDescription = academyTransferProject.OtherTransferTypeDescription,
TransferFirstDiscussed = null,
HtbDate = null,
TrustSponsorRationale = academyTransferProject.TrustSponsorRationale,
State = academyTransferProject.State,
Status = academyTransferProject.Status,
Author = academyTransferProject.Author,
Recommendation = academyTransferProject.Recommendation,
AnyRisks = academyTransferProject.AnyRisks,
HighProfileShouldBeConsidered = academyTransferProject.HighProfileShouldBeConsidered,
HighProfileFurtherSpecification = academyTransferProject.HighProfileFurtherSpecification,
ComplexLandAndBuildingShouldBeConsidered =
academyTransferProject.ComplexLandAndBuildingShouldBeConsidered,
ComplexLandAndBuildingFurtherSpecification =
ComplexLandAndBuildingFurtherSpecification =
academyTransferProject.ComplexLandAndBuildingFurtherSpecification,
FinanceAndDebtShouldBeConsidered = academyTransferProject.FinanceAndDebtShouldBeConsidered,
FinanceAndDebtFurtherSpecification = academyTransferProject.FinanceAndDebtFurtherSpecification,
OtherRisksShouldBeConsidered = academyTransferProject.OtherRisksShouldBeConsidered,
OtherRisksFurtherSpecification = academyTransferProject.OtherRisksFurtherSpecification,
OtherBenefitValue = academyTransferProject.OtherBenefitValue,
EqualitiesImpactAssessmentConsidered = academyTransferProject.EqualitiesImpactAssessmentConsidered,
IncomingTrustAgreement = academyTransferProject.IncomingTrustAgreement,
DiocesanConsent = academyTransferProject.DiocesanConsent,
OutgoingTrustConsent = academyTransferProject.OutgoingTrustConsent,
FeatureSectionIsCompleted = academyTransferProject.FeatureSectionIsCompleted,
BenefitsSectionIsCompleted = academyTransferProject.BenefitsSectionIsCompleted,
LegalRequirementsSectionIsCompleted = academyTransferProject.LegalRequirementsSectionIsCompleted,
RationaleSectionIsCompleted = academyTransferProject.RationaleSectionIsCompleted,
AcademyTransferProjectIntendedTransferBenefits =
FinanceAndDebtShouldBeConsidered = academyTransferProject.FinanceAndDebtShouldBeConsidered,
FinanceAndDebtFurtherSpecification = academyTransferProject.FinanceAndDebtFurtherSpecification,
OtherRisksShouldBeConsidered = academyTransferProject.OtherRisksShouldBeConsidered,
OtherRisksFurtherSpecification = academyTransferProject.OtherRisksFurtherSpecification,
OtherBenefitValue = academyTransferProject.OtherBenefitValue,
EqualitiesImpactAssessmentConsidered = academyTransferProject.EqualitiesImpactAssessmentConsidered,
IncomingTrustAgreement = academyTransferProject.IncomingTrustAgreement,
DiocesanConsent = academyTransferProject.DiocesanConsent,
OutgoingTrustConsent = academyTransferProject.OutgoingTrustConsent,
FeatureSectionIsCompleted = academyTransferProject.FeatureSectionIsCompleted,
BenefitsSectionIsCompleted = academyTransferProject.BenefitsSectionIsCompleted,
LegalRequirementsSectionIsCompleted = academyTransferProject.LegalRequirementsSectionIsCompleted,
RationaleSectionIsCompleted = academyTransferProject.RationaleSectionIsCompleted,
AcademyTransferProjectIntendedTransferBenefits =
academyTransferProject.AcademyTransferProjectIntendedTransferBenefits,
HasTransferFirstDiscussedDate = false,
HasHtbDate = false,
HasTargetDateForTransfer = false,
AssignedUserEmailAddress = academyTransferProject.AssignedUserEmailAddress,
AssignedUserFullName = academyTransferProject.AssignedUserFullName,
AssignedUserId = academyTransferProject.AssignedUserId
HasTransferFirstDiscussedDate = false,
HasHtbDate = false,
HasTargetDateForTransfer = false,
AssignedUserEmailAddress = academyTransferProject.AssignedUserEmailAddress,
AssignedUserFullName = academyTransferProject.AssignedUserFullName,
AssignedUserId = academyTransferProject.AssignedUserId,

CreatedOn = academyTransferProject.CreatedOn
};

var result = AcademyTransferProjectFactory.Update(academyTransferProject, updateRequest);
var result = AcademyTransferProjectFactory.Update(academyTransferProject, updateRequest);

result.Should().BeEquivalentTo(expected);
}
Expand Down Expand Up @@ -604,10 +612,12 @@ public void ReturnsOriginalAcademyTransferProjectWithDatesSetToNull_WhenUpdating
HasTargetDateForTransfer = false,
AssignedUserEmailAddress = academyTransferProject.AssignedUserEmailAddress,
AssignedUserFullName = academyTransferProject.AssignedUserFullName,
AssignedUserId = academyTransferProject.AssignedUserId
AssignedUserId = academyTransferProject.AssignedUserId,

CreatedOn = academyTransferProject.CreatedOn
};

var result = AcademyTransferProjectFactory.Update(academyTransferProject, updateRequest);
AcademyTransferProjects result = AcademyTransferProjectFactory.Update(academyTransferProject, updateRequest);

result.Should().BeEquivalentTo(expected);
}
Expand Down
6 changes: 3 additions & 3 deletions TramsDataApi.Test/integration_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"AllowedHosts": "*",
"ApiKeys": ["{\"userName\": \"Test User\", \"apiKey\": \"testing-api-key\"}"],
"ConnectionStrings": {
"DefaultConnection": "Server=127.0.0.1,1433;Database=sip;User Id=sa;TrustServerCertificate=True;Password=Your_password123"
}
"ConnectionStrings": {
"DefaultConnection": "Server=127.0.0.1,1433;Database=sip;User Id=sa;TrustServerCertificate=True;Password=StrongPassword905"
}
}
4 changes: 3 additions & 1 deletion TramsDataApi/DatabaseModels/AcademyTransferProjects.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public AcademyTransferProjects()
public bool? LegalRequirementsSectionIsCompleted { get; set; }
public bool? FeatureSectionIsCompleted { get; set; }
public bool? BenefitsSectionIsCompleted { get; set; }
public bool? RationaleSectionIsCompleted { get; set; }
public bool? RationaleSectionIsCompleted { get; set; }
public string AssignedUserFullName { get; set; }
public string AssignedUserEmailAddress { get; set; }
public Guid? AssignedUserId { get; set; }
Expand All @@ -70,5 +70,7 @@ public virtual ICollection<AcademyTransferProjectIntendedTransferBenefits>
AcademyTransferProjectIntendedTransferBenefits { get; set; }

public virtual ICollection<TransferringAcademies> TransferringAcademies { get; set; }

public DateTime CreatedOn { get; set; }
}
}
Loading

0 comments on commit 8aa09fe

Please sign in to comment.