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

Modify fundingcall continous period #101

Merged
merged 2 commits into from
Nov 20, 2023
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
4 changes: 2 additions & 2 deletions aspnetcore/src/Repositories/FundingCallIndexRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ protected override IQueryable<FundingCall> 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<FundingCall>(_mapper.ConfigurationProvider);
}

Expand All @@ -37,7 +37,7 @@ protected override IQueryable<FundingCall> 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<FundingCall>(_mapper.ConfigurationProvider);
}

Expand Down
2 changes: 1 addition & 1 deletion aspnetcore/src/Repositories/Maps/FundingCallProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")))
Expand Down
5 changes: 2 additions & 3 deletions aspnetcore/test/Indexer.Tests/Maps/FundingCallProfileTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ private static DimCallProgramme GetEntity()
}
},
ContactInformation = "contact info",
ContinuousApplicationPeriod = true

ContinuousApplicationPeriod = null
};
}

Expand All @@ -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<ReferenceData>
{
new()
Expand Down