예제 #1
0
        public async Task <ScoringOffer> GetOfferAsync(long projectId, AreaType areaType, long expertId)
        {
            var scoring = await _scoringRepository.GetByProjectIdAsync(projectId);

            return(scoring.GetOfferForExpertinArea(expertId, areaType));
        }
예제 #2
0
        public async Task <IReadOnlyCollection <ScoringCriterionPrompt> > GetCriterionPromptsAsync(long projectId, AreaType areaType)
        {
            var scoringApplication = await _scoringApplicationRepository.GetByProjectIdAsync(projectId);

            var criteriaPromps = await _scoringCriterionRepository.GetScoringCriterionPromptsAsync(scoringApplication.Id, areaType);

            switch (areaType)
            {
            case AreaType.Hr:
                await AddHrCriterionPromptExceptions(scoringApplication.Id, criteriaPromps);

                break;

            case AreaType.Marketer:
                var socialNetworks = (await _scoringApplicationRepository.GetByIdAsync(scoringApplication.Id)).SocialNetworks;

                foreach (var id in _criterionsWithSocialNetworksPrompts)
                {
                    criteriaPromps.Add(new ScoringCriterionPrompt
                    {
                        CriterionId    = id,
                        SocialNetworks = socialNetworks,
                        PromptType     = ScoringCriterionPromptType.SocialNetwork
                    });
                }

                break;
            }

            return(criteriaPromps.ToArray());
        }