Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds a CreatedOn column to the AcademyTransfersProject table #318

Merged
10 commits merged into from
Mar 24, 2023
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