Exemplo n.º 1
0
        public async Task <ProjectSummaryResponse> GetSummaryAsync(long id)
        {
            var project = await _projectService.GetByIdAsync(id);

            var scoring = await _scoringService.GetByProjectIdAsync(id);

            var scoringApplication = await _scoringApplicationRepository.GetByProjectIdAsync(id);

            return(ProjectSummaryResponse.Create(project, scoring, scoringApplication, _clock.UtcNow));
        }
Exemplo n.º 2
0
        public async Task <ScoringOfferStatusResponse> GetOfferStatusAsync(GetScoringOfferStatusRequest request)
        {
            var scoring = await _scoringService.GetByProjectIdAsync(request.ProjectId);

            if (scoring == null)
            {
                throw new AppErrorException(ErrorCode.ScoringNotFound);
            }

            var offer = await _scoringService.GetOfferAsync(request.ProjectId, request.AreaType.ToDomain(), User.GetUserId());

            var offerStatus = offer?.Status.ToApi(scoring.AcceptingDeadline, scoring.ScoringDeadline, _clock.UtcNow);

            return(new ScoringOfferStatusResponse
            {
                Status = offerStatus,
                Exists = offerStatus.HasValue
            });
        }
Exemplo n.º 3
0
        public async Task <ScoringResponse> GetByProjectIdAsync(long projectId)
        {
            var scoring = await _scoringService.GetByProjectIdAsync(projectId);

            return(ScoringResponse.FromScoring(scoring, _clock.UtcNow));
        }