Skip to content

Commit

Permalink
Merge pull request #425 from DFE-Digital/feature/trust-v4-endpoint
Browse files Browse the repository at this point in the history
updated contracts and mapped headteacher fields, also changed date st…
  • Loading branch information
paullocknimble authored Nov 23, 2023
2 parents 0589e48 + 5d00864 commit c80e22b
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<ItemGroup>
<PackageReference Include="CsvHelper" Version="30.0.1" />
<PackageReference Include="Dfe.Academies.Contracts" Version="1.0.7" />
<PackageReference Include="Dfe.Academies.Contracts" Version="1.0.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="6.0.25" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="6.0.25">
<PrivateAssets>all</PrivateAssets>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public async Task<List<Establishment>> GetByTrust(long? trustId, CancellationTok
.ToListAsync(cancellationToken)
.ConfigureAwait(false);

var establishments = await DefaultIncludes()
var establishments = await DefaultIncludes().AsNoTracking()
.Where(e => establishmentIds.Contains(e.SK))
.ToListAsync(cancellationToken)
.ConfigureAwait(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ private bool HasMappedCorrectly(EstablishmentDto dto, Domain.Establishment.Estab
dto.Census.NumberOfPupils == establishment.NumberOfPupils &&
dto.Census.PercentageFsm == establishment.PercentageFSM &&

dto.MISEstablishment.DateOfLatestSection8Inspection == establishment.DateOfLatestShortInspection?.ToString(new CultureInfo("en-GB")) &&
dto.MISEstablishment.InspectionEndDate == establishment.InspectionEndDate?.ToString(new CultureInfo("en-GB")) &&
dto.MISEstablishment.DateOfLatestSection8Inspection == establishment.DateOfLatestShortInspection?.ToString("d", new CultureInfo("en-GB")) &&
dto.MISEstablishment.InspectionEndDate == establishment.InspectionEndDate?.ToString("d", new CultureInfo("en-GB")) &&
dto.MISEstablishment.OverallEffectiveness == establishment.OverallEffectiveness?.ToString() &&
dto.MISEstablishment.QualityOfEducation == establishment.QualityOfEducation?.ToString() &&
dto.MISEstablishment.BehaviourAndAttitudes == establishment.BehaviourAndAttitudes?.ToString() &&
Expand Down
11 changes: 8 additions & 3 deletions Dfe.Academies.Application/Builders/EstablishmentDtoBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public EstablishmentDtoBuilder WithBasicDetails(Domain.Establishment.Establishme
_dto.Ukprn = establishment?.UKPRN;
_dto.NoOfBoys = establishment?.NumberOfBoys.ToString();
_dto.NoOfGirls = establishment?.NumberOfGirls.ToString();
_dto.GiasLastChangedDate = establishment?.GiasLastChangedDate?.ToString(new CultureInfo("en-GB"));
_dto.GiasLastChangedDate = establishment?.GiasLastChangedDate?.ToString("d", new CultureInfo("en-GB"));
_dto.ReligousEthos = establishment?.ReligiousEthos;
_dto.SenUnitCapacity = establishment?.SenUnitCapacity.ToString();
_dto.SenUnitOnRoll = establishment?.SenUnitOnRoll.ToString();
Expand All @@ -32,6 +32,11 @@ public EstablishmentDtoBuilder WithBasicDetails(Domain.Establishment.Establishme
_dto.Deficit = establishment?.IfdPipeline?.ProjectTemplateInformationDeficit;
_dto.ViabilityIssue = establishment?.IfdPipeline?.ProjectTemplateInformationViabilityIssue;

_dto.HeadteacherTitle = establishment.HeadTitle;
_dto.HeadteacherFirstName = establishment.HeadFirstName;
_dto.HeadteacherLastName = establishment.HeadLastName;
_dto.HeadteacherPreferredJobTitle = establishment.HeadPreferredJobTitle;

return this;
}

Expand Down Expand Up @@ -150,8 +155,8 @@ public EstablishmentDtoBuilder WithMISEstablishment(Domain.Establishment.Establi
{
_dto.MISEstablishment = new MisEstablishmentDto
{
DateOfLatestSection8Inspection = establishment?.DateOfLatestShortInspection?.ToString(new CultureInfo("en-GB")),
InspectionEndDate = establishment?.InspectionEndDate?.ToString(new CultureInfo("en-GB")),
DateOfLatestSection8Inspection = establishment?.DateOfLatestShortInspection?.ToString("d", new CultureInfo("en-GB")),
InspectionEndDate = establishment?.InspectionEndDate?.ToString("d", new CultureInfo("en-GB")),
OverallEffectiveness = establishment?.OverallEffectiveness?.ToString(),
QualityOfEducation = establishment?.QualityOfEducation?.ToString(),
BehaviourAndAttitudes = establishment?.BehaviourAndAttitudes?.ToString(),
Expand Down
2 changes: 1 addition & 1 deletion Dfe.Academies.Application/Dfe.Academies.Application.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dfe.Academies.Contracts" Version="1.0.7" />
<PackageReference Include="Dfe.Academies.Contracts" Version="1.0.9" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Dfe.Academies.Domain/Dfe.Academies.Domain.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dfe.Academies.Contracts" Version="1.0.7" />
<PackageReference Include="Dfe.Academies.Contracts" Version="1.0.9" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion TramsDataApi.Test/TramsDataApi.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<PackageReference Include="AutoFixture.AutoMoq" Version="4.18.0" />
<PackageReference Include="AutoFixture.Idioms" Version="4.18.0" />
<PackageReference Include="AutoFixture.Xunit2" Version="4.18.0" />
<PackageReference Include="Dfe.Academies.Contracts" Version="1.0.7" />
<PackageReference Include="Dfe.Academies.Contracts" Version="1.0.9" />
<PackageReference Include="FluentAssertions" Version="6.11.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.19" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="7.0.0" />
Expand Down
2 changes: 1 addition & 1 deletion TramsDataApi/TramsDataApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CsvHelper" Version="30.0.1" />
<PackageReference Include="Dfe.Academies.Contracts" Version="1.0.7" />
<PackageReference Include="Dfe.Academies.Contracts" Version="1.0.9" />
<PackageReference Include="Dfe.Academisation.CorrelationIdMiddleware" Version="2.0.2" />
<PackageReference Include="FluentValidation" Version="11.6.0" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.21.0" />
Expand Down

0 comments on commit c80e22b

Please sign in to comment.