Esempio n. 1
0
        public async Task SaveEstimatesAsync(long expertId, SaveEstimatesRequest request)
        {
            var scoring = await _scoringRepository.GetByProjectIdAsync(request.ProjectId);

            var area = request.AreaType.ToDomain();

            var estimates = request.EstimateComments.Select(x => new Estimate
            {
                Score = x.Score,
                ScoringCriterionId = x.ScoringCriterionId,
                Comment            = x.Comment
            }).ToArray();

            var expertScoring = new ExpertScoring
            {
                ExpertId   = expertId,
                Area       = area,
                Conclusion = request.Conclusion,
                Estimates  = estimates
            };

            scoring.SetExpertScoring(expertId, expertScoring);
            await _scoringRepository.SaveChangesAsync();
        }
Esempio n. 2
0
        public async Task <ScoringOffer> GetOfferAsync(long projectId, AreaType areaType, long expertId)
        {
            var scoring = await _scoringRepository.GetByProjectIdAsync(projectId);

            return(scoring.GetOfferForExpertinArea(expertId, areaType));
        }