Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 protected override bool ExtraFundingLinePredicate(PublishedProviderVersion refreshState,
                                                   FundingLine fundingLine)
 => !refreshState.FundingLineHasCustomProfile(fundingLine.FundingLineCode);