From 274d4d038ced686bbc9532224477713a9fb9e1a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Sa=CC=88rkikoski?= Date: Fri, 17 Nov 2023 15:03:19 +0200 Subject: [PATCH] Modify fundingcall continous period --- aspnetcore/src/Repositories/FundingCallIndexRepository.cs | 4 ++-- aspnetcore/src/Repositories/Maps/FundingCallProfile.cs | 2 +- aspnetcore/test/Indexer.Tests/Maps/FundingCallProfileTest.cs | 5 ++--- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/aspnetcore/src/Repositories/FundingCallIndexRepository.cs b/aspnetcore/src/Repositories/FundingCallIndexRepository.cs index 4ae6301..c5b1d97 100644 --- a/aspnetcore/src/Repositories/FundingCallIndexRepository.cs +++ b/aspnetcore/src/Repositories/FundingCallIndexRepository.cs @@ -25,7 +25,7 @@ protected override IQueryable GetAll() return _context.DimCallProgrammes .AsNoTracking() .AsSplitQuery() - .Where(callProgramme => callProgramme.Id != -1 && callProgramme.DimOrganizations.Count > 0 && (callProgramme.DimDateIdOpen != -1 && callProgramme.DimDateIdDue != -1 || callProgramme.ContinuousApplicationPeriod == true)) + .Where(callProgramme => callProgramme.Id != -1 && callProgramme.DimOrganizations.Count > 0) .ProjectTo(_mapper.ConfigurationProvider); } @@ -37,7 +37,7 @@ protected override IQueryable GetChunk(int skipAmount, int takeAmou .Take(takeAmount) .AsNoTracking() .AsSplitQuery() - .Where(callProgramme => callProgramme.Id != -1 && callProgramme.DimOrganizations.Count > 0 && (callProgramme.DimDateIdOpen != -1 && callProgramme.DimDateIdDue != -1 || callProgramme.ContinuousApplicationPeriod == true)) + .Where(callProgramme => callProgramme.Id != -1 && callProgramme.DimOrganizations.Count > 0) .ProjectTo(_mapper.ConfigurationProvider); } diff --git a/aspnetcore/src/Repositories/Maps/FundingCallProfile.cs b/aspnetcore/src/Repositories/Maps/FundingCallProfile.cs index 30f1205..4efd4a3 100644 --- a/aspnetcore/src/Repositories/Maps/FundingCallProfile.cs +++ b/aspnetcore/src/Repositories/Maps/FundingCallProfile.cs @@ -29,7 +29,7 @@ public FundingCallProfile() .ForMember(dst => dst.ContactInformation, opt => opt.MapFrom(src => src.ContactInformation)) .ForMember(dst => dst.Categories, opt => opt.MapFrom(src => src.DimReferencedata)) .ForMember(dst => dst.Foundations, opt => opt.MapFrom(src => src.DimOrganizations)) - .ForMember(dst => dst.ContinuousApplication, opt => opt.MapFrom(src => src.ContinuousApplicationPeriod)) + .ForMember(dst => dst.ContinuousApplication, opt => opt.MapFrom(src => src.DimDateIdOpen == -1 && src.DimDateIdDue == -1)) // src.ContinuousApplicationPeriod is not populated in DB! .ForMember(dst => dst.ApplicationUrlFi, opt => opt.MapFrom(src => src.DimWebLinks.SingleOrDefault(webLink => webLink.LinkType == "ApplicationURL" && webLink.LanguageVariant == "fi"))) .ForMember(dst => dst.ApplicationUrlSv, opt => opt.MapFrom(src => src.DimWebLinks.SingleOrDefault(webLink => webLink.LinkType == "ApplicationURL" && webLink.LanguageVariant == "sv"))) .ForMember(dst => dst.ApplicationUrlEn, opt => opt.MapFrom(src => src.DimWebLinks.SingleOrDefault(webLink => webLink.LinkType == "ApplicationURL" && webLink.LanguageVariant == "en"))) diff --git a/aspnetcore/test/Indexer.Tests/Maps/FundingCallProfileTest.cs b/aspnetcore/test/Indexer.Tests/Maps/FundingCallProfileTest.cs index c048694..878c042 100644 --- a/aspnetcore/test/Indexer.Tests/Maps/FundingCallProfileTest.cs +++ b/aspnetcore/test/Indexer.Tests/Maps/FundingCallProfileTest.cs @@ -126,8 +126,7 @@ private static DimCallProgramme GetEntity() } }, ContactInformation = "contact info", - ContinuousApplicationPeriod = true - + ContinuousApplicationPeriod = null }; } @@ -150,7 +149,7 @@ private static FundingCall GetModel() ContactInformation = "contact info", CallProgrammeOpenDate = new DateTime(2020, 1, 1), CallProgrammeDueDate = new DateTime(2021, 1, 1), - ContinuousApplication = true, + ContinuousApplication = false, Categories = new List { new()