private static (string key, string name, string description) GetProfilePatternDetails(string fundingLineCode, PublishedProviderVersion latestPublishedProviderVersion, IEnumerable <FundingStreamPeriodProfilePattern> fundingStreamPeriodProfilePatterns) { string profilePatternKey = latestPublishedProviderVersion.ProfilePatternKeys? .SingleOrDefault(_ => _.FundingLineCode == fundingLineCode)?.Key; bool hasCustomProfileForFundingLine = latestPublishedProviderVersion.FundingLineHasCustomProfile(fundingLineCode); FundingStreamPeriodProfilePattern apiProfilePatternKey = fundingStreamPeriodProfilePatterns.FirstOrDefault(_ => _.ProfilePatternKey == profilePatternKey && _.FundingLineId == fundingLineCode); string profilePatternName; string profilePatternDescription; if (hasCustomProfileForFundingLine) { profilePatternName = "Custom Profile"; profilePatternDescription = "Custom Profile"; } else { profilePatternName = apiProfilePatternKey?.ProfilePatternDisplayName; profilePatternDescription = apiProfilePatternKey?.ProfilePatternDescription; } return(profilePatternKey, profilePatternName, profilePatternDescription); }
protected override bool ExtraFundingLinePredicate(PublishedProviderVersion refreshState, FundingLine fundingLine) => !refreshState.FundingLineHasCustomProfile(fundingLine.FundingLineCode);