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

Updated to use new NuGet packages #625

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions Dfe.Academies.Api.Infrastructure/Caching/CacheSettings.cs

This file was deleted.

52 changes: 0 additions & 52 deletions Dfe.Academies.Api.Infrastructure/Caching/MemoryCacheService.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<ItemGroup>
<PackageReference Include="CsvHelper" Version="33.0.1" />
<PackageReference Include="Dfe.Academies.Contracts" Version="1.0.10" />
<PackageReference Include="DfE.CoreLibs.Caching" Version="1.0.7" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="8.0.8" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="8.0.8" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.8">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
using Dfe.Academies.Application.Common.Interfaces;
using Dfe.Academies.Domain.Constituencies;
using Dfe.Academies.Infrastructure;
using Dfe.Academies.Infrastructure.Caching;
using Dfe.Academies.Infrastructure.Repositories;
using Dfe.Academies.Infrastructure.Security.Authorization;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Dfe.Academies.Domain.Interfaces.Repositories;
using Dfe.Academies.Domain.Interfaces.Caching;
using Dfe.Academies.Infrastructure.QueryServices;
using Dfe.Academies.Domain.ValueObjects;

Expand Down Expand Up @@ -48,10 +46,8 @@ public static IServiceCollection AddPersonsApiInfrastructureDependencyGroup(
services.AddScoped<IEstablishmentQueryService, EstablishmentQueryService>();
services.AddScoped<ITrustQueryService, TrustQueryService>();


//Cache service
services.Configure<CacheSettings>(config.GetSection("CacheSettings"));
services.AddSingleton<ICacheService, MemoryCacheService>();
services.AddServiceCaching(config);

//Db
var connectionString = config.GetConnectionString("DefaultConnection");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using AutoMapper;
using AutoMapper.QueryableExtensions;
using Dfe.Academies.Application.Common.Models;
using Dfe.Academies.Domain.Interfaces.Caching;
using Dfe.Academies.Domain.Interfaces.Repositories;
using Dfe.Academies.Utils.Caching;
using DfE.CoreLibs.Caching.Helpers;
using DfE.CoreLibs.Caching.Interfaces;
using MediatR;
using Microsoft.EntityFrameworkCore;

Expand All @@ -14,7 +14,7 @@ public record GetMembersOfParliamentByConstituenciesQuery(List<string> Constitue
public class GetMembersOfParliamentByConstituenciesQueryHandler(
IConstituencyRepository constituencyRepository,
IMapper mapper,
ICacheService cacheService)
ICacheService<IMemoryCacheType> cacheService)
: IRequestHandler<GetMembersOfParliamentByConstituenciesQuery, List<MemberOfParliament>>
{
public async Task<List<MemberOfParliament>> Handle(GetMembersOfParliamentByConstituenciesQuery request, CancellationToken cancellationToken)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using AutoMapper;
using Dfe.Academies.Application.Common.Models;
using MediatR;
using Dfe.Academies.Utils.Caching;
using Dfe.Academies.Domain.Interfaces.Caching;
using Dfe.Academies.Domain.Interfaces.Repositories;
using DfE.CoreLibs.Caching.Helpers;
using DfE.CoreLibs.Caching.Interfaces;
using MediatR;

namespace Dfe.Academies.Application.Constituencies.Queries.GetMemberOfParliamentByConstituency
{
Expand All @@ -12,7 +12,7 @@ public record GetMemberOfParliamentByConstituencyQuery(string ConstituencyName)
public class GetMemberOfParliamentByConstituencyQueryHandler(
IConstituencyRepository constituencyRepository,
IMapper mapper,
ICacheService cacheService)
ICacheService<IMemoryCacheType> cacheService)
: IRequestHandler<GetMemberOfParliamentByConstituencyQuery, MemberOfParliament?>
{
public async Task<MemberOfParliament?> Handle(GetMemberOfParliamentByConstituencyQuery request, CancellationToken cancellationToken)
Expand Down
3 changes: 2 additions & 1 deletion Dfe.Academies.Application/Dfe.Academies.Application.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

<ItemGroup>
<PackageReference Include="AutoMapper" Version="13.0.1" />
<PackageReference Include="Dfe.Academies.Contracts" Version="1.0.10" />
<PackageReference Include="DfE.CoreLibs.Caching" Version="1.0.7" />
<PackageReference Include="DfE.CoreLibs.Contracts" Version="1.0.5" />
<PackageReference Include="FluentValidation" Version="11.9.2" />
<PackageReference Include="FluentValidation.AspNetCore" Version="11.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Dfe.Academies.Domain.Interfaces.Repositories;
using Dfe.Academies.Contracts.V1.EducationalPerformance;
using Dfe.Academies.Domain.EducationalPerformance;
using DfE.CoreLibs.Contracts.Academies.V1.EducationalPerformance;

namespace Dfe.Academies.Application.EducationalPerformance
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Dfe.Academies.Contracts.V1.EducationalPerformance;
using DfE.CoreLibs.Contracts.Academies.V1.EducationalPerformance;

namespace Dfe.Academies.Application.EducationalPerformance
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using Dfe.Academies.Contracts.V4;
using Dfe.Academies.Contracts.V4.Establishments;
using Dfe.Academies.Domain.Census;
using System;
using System.Globalization;
using Dfe.Academies.Domain.Census;
using Dfe.Academies.Utils.Extensions;
using DfE.CoreLibs.Contracts.Academies.V4;
using DfE.CoreLibs.Contracts.Academies.V4.Establishments;

namespace Dfe.Academies.Application.Establishment
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Dfe.Academies.Contracts.V4.Establishments;
using Dfe.Academies.Domain.Interfaces.Repositories;
using Dfe.Academies.Domain.Interfaces.Repositories;
using DfE.CoreLibs.Contracts.Academies.V4.Establishments;

namespace Dfe.Academies.Application.Establishment
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Dfe.Academies.Contracts.V4.Establishments;
using DfE.CoreLibs.Contracts.Academies.V4.Establishments;

namespace Dfe.Academies.Application.Establishment
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
using AutoMapper.QueryableExtensions;
using Dfe.Academies.Application.Common.Interfaces;
using Dfe.Academies.Application.Common.Models;
using Dfe.Academies.Domain.Interfaces.Caching;
using Dfe.Academies.Utils.Caching;
using DfE.CoreLibs.Caching.Helpers;
using DfE.CoreLibs.Caching.Interfaces;
using MediatR;
using Microsoft.EntityFrameworkCore;

Expand All @@ -14,7 +14,7 @@ public record GetAllPersonsAssociatedWithAcademyByUrnQuery(int Urn) : IRequest<L
public class GetAllPersonsAssociatedWithAcademyByUrnQueryHandler(
IEstablishmentQueryService establishmentQueryService,
IMapper mapper,
ICacheService cacheService)
ICacheService<IMemoryCacheType> cacheService)
: IRequestHandler<GetAllPersonsAssociatedWithAcademyByUrnQuery, List<AcademyGovernance>?>
{
public async Task<List<AcademyGovernance>?> Handle(GetAllPersonsAssociatedWithAcademyByUrnQuery request, CancellationToken cancellationToken)
Expand Down
4 changes: 2 additions & 2 deletions Dfe.Academies.Application/Trust/ITrustQueries.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Dfe.Academies.Contracts.V4.Trusts;
using Dfe.Academies.Domain.Trust;
using Dfe.Academies.Domain.Trust;
using DfE.CoreLibs.Contracts.Academies.V4.Trusts;

namespace Dfe.Academies.Application.Trust
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
using AutoMapper.QueryableExtensions;
using Dfe.Academies.Application.Common.Interfaces;
using Dfe.Academies.Application.Common.Models;
using Dfe.Academies.Domain.Interfaces.Caching;
using Dfe.Academies.Utils.Caching;
using Dfe.Academies.Utils.Enums;
using Dfe.Academies.Utils.Helpers;
using DfE.CoreLibs.Caching.Helpers;
using DfE.CoreLibs.Caching.Interfaces;
using MediatR;
using Microsoft.EntityFrameworkCore;

Expand All @@ -16,7 +16,7 @@ public record GetAllPersonsAssociatedWithTrustByTrnOrUkprnQuery(string Id) : IRe
public class GetAllPersonsAssociatedWithTrustByTrnOrUkprnQueryHandler(
ITrustQueryService trustQueryService,
IMapper mapper,
ICacheService cacheService)
ICacheService<IMemoryCacheType> cacheService)
: IRequestHandler<GetAllPersonsAssociatedWithTrustByTrnOrUkprnQuery, List<TrustGovernance>?>
{
public async Task<List<TrustGovernance>?> Handle(GetAllPersonsAssociatedWithTrustByTrnOrUkprnQuery request, CancellationToken cancellationToken)
Expand Down
6 changes: 3 additions & 3 deletions Dfe.Academies.Application/Trust/TrustQueries.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Dfe.Academies.Domain.Interfaces.Repositories;
using Dfe.Academies.Contracts.V4;
using Dfe.Academies.Contracts.V4.Trusts;
using Dfe.Academies.Domain.Trust;
using DfE.CoreLibs.Contracts.Academies.V4;
using DfE.CoreLibs.Contracts.Academies.V4.Trusts;

namespace Dfe.Academies.Application.Trust
{
Expand Down Expand Up @@ -51,7 +51,7 @@ private static TrustDto MapToTrustDto(Domain.Trust.Trust trust)
CompaniesHouseNumber = trust.CompaniesHouseNumber,
ReferenceNumber = trust.GroupID,
Ukprn = trust.UKPRN,
Type = new Contracts.V4.Establishments.NameAndCodeDto() { Code = trust.TrustType?.Code, Name = trust.TrustType?.Name },
Type = new DfE.CoreLibs.Contracts.Academies.V4.Establishments.NameAndCodeDto() { Code = trust.TrustType?.Code, Name = trust.TrustType?.Name },
Address = new AddressDto()
{
Street = trust.AddressLine1,
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.10" />
<PackageReference Include="DfE.CoreLibs.Contracts" Version="1.0.5" />
<PackageReference Include="MediatR" Version="12.4.0" />
</ItemGroup>

Expand Down
8 changes: 0 additions & 8 deletions Dfe.Academies.Domain/Interfaces/Caching/ICacheService.cs

This file was deleted.

43 changes: 0 additions & 43 deletions Dfe.Academies.Utils/Caching/CacheKeyHelper.cs

This file was deleted.

5 changes: 2 additions & 3 deletions PersonsApi/PersonsApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CsvHelper" Version="33.0.1" />
<PackageReference Include="Dfe.Academies.Contracts" Version="1.0.10" />
<PackageReference Include="Dfe.Academisation.CorrelationIdMiddleware" Version="2.0.2" />
<PackageReference Include="DfE.CoreLibs.Http" Version="1.0.5" />
<PackageReference Include="FluentValidation" Version="11.9.2" />
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.22.0" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="8.0.8" />
Expand All @@ -37,6 +35,7 @@
<PackageReference Include="Serilog.Sinks.ApplicationInsights" Version="4.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.7.3" />
<PackageReference Include="Swashbuckle.AspNetCore.Annotations" Version="6.7.3" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
<PackageReference Include="TimeZoneConverter" Version="6.1.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion PersonsApi/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Dfe.Academies.Application.MappingProfiles;
using Dfe.Academisation.CorrelationIdMiddleware;
using DfE.CoreLibs.Http.Interfaces;
using DfE.CoreLibs.Http.Middlewares.CorrelationId;
using Microsoft.AspNetCore.HttpOverrides;
using Microsoft.AspNetCore.Mvc.ApiExplorer;
using Microsoft.FeatureManagement;
Expand Down
12 changes: 7 additions & 5 deletions PersonsApi/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@
"FeatureManagement": {
},
"CacheSettings": {
"DefaultDurationInSeconds": 60,
"Durations": {
"GetMembersOfParliamentByConstituenciesQueryHandler": 86400,
"GetMemberOfParliamentByConstituencyQueryHandler": 86400,
"GetAllPersonsAssociatedWithTrustByTrnOrUkprnQueryHandler": 86400
"Memory": {
"DefaultDurationInSeconds": 60,
"Durations": {
"GetMembersOfParliamentByConstituenciesQueryHandler": 86400,
"GetMemberOfParliamentByConstituencyQueryHandler": 86400,
"GetAllPersonsAssociatedWithTrustByTrnOrUkprnQueryHandler": 86400
}
}
},
"Authorization": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using AutoFixture;
using Dfe.Academies.Application.EducationalPerformance;
using Dfe.Academies.Contracts.V1.EducationalPerformance;
using Dfe.Academies.Domain.EducationalPerformance;
using Dfe.Academies.Domain.Interfaces.Repositories;
using DfE.CoreLibs.Contracts.Academies.V1.EducationalPerformance;
using FluentAssertions;
using Moq;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using AutoFixture;
using Dfe.Academies.Application.Establishment;
using Dfe.Academies.Contracts.V4.Establishments;
using Dfe.Academies.Domain.Interfaces.Repositories;
using DfE.CoreLibs.Contracts.Academies.V4.Establishments;
using FluentAssertions;
using Moq;
using System.Globalization;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using AutoFixture;
using Dfe.Academies.Application.Trust;
using Dfe.Academies.Contracts.V4.Trusts;
using Dfe.Academies.Domain.Interfaces.Repositories;
using Dfe.Academies.Domain.Trust;
using DfE.CoreLibs.Contracts.Academies.V4.Trusts;
using FluentAssertions;
using Moq;
using Dfe.Academies.Domain.Interfaces.Repositories;

namespace Dfe.Academies.Application.Tests.Queries.Trust
{
Expand Down
Loading
Loading