Skip to content

Commit

Permalink
Merge pull request #102 from CSCfi/qa
Browse files Browse the repository at this point in the history
Modify fundingcall continous period
  • Loading branch information
sarkikos authored Nov 20, 2023
2 parents 246c8f8 + 127b9cc commit 1fd7f23
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
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

0 comments on commit 1fd7f23

Please sign in to comment.