<commit_before>package com.worth.ifs.project.transactional;

import com.worth.ifs.commons.service.ServiceResult;
import com.worth.ifs.competition.domain.Competition;
import com.worth.ifs.competition.repository.CompetitionRepository;
import com.worth.ifs.project.constant.ProjectActivityStates;
import com.worth.ifs.project.domain.Project;
import com.worth.ifs.project.status.resource.CompetitionProjectsStatusResource;
import com.worth.ifs.project.status.resource.ProjectStatusResource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

@Service
public class ProjectStatusServiceImpl extends AbstractProjectServiceImpl implements ProjectStatusService {

    @Autowired
    private CompetitionRepository competitionRepository;

    @Override
    public ServiceResult<CompetitionProjectsStatusResource> getCompetitionStatus(Long competitionId) {
        Competition competition = competitionRepository.findOne(competitionId);

        List<Project> projects = projectRepository.findByApplicationCompetitionId(competitionId);

        List<ProjectStatusResource> projectStatusResources = projects.stream().map(project ->
                new ProjectStatusResource(
                        project.getName(),
                        project.getId(),
                        project.getFormattedId(),
                        project.getId(),
                        project.getApplication().getFormattedId(),
                        getProjectPartnerCount(project.getId()),
                        project.getApplication().getLeadOrganisation().getName(),
                        getProjectDetailsStatus(project),
                        getBankDetailsStatus(project),
                        getFinanceChecksStatus(project),
                        getSpendProfileStatus(project),
                        getMonitoringOfficerStatus(project),
                        getOtherDocumentsStatus(project),
                        getGrantOfferLetterStatus(project))).collect(Collectors.toList());


        CompetitionProjectsStatusResource competitionProjectsStatusResource = new CompetitionProjectsStatusResource(competition.getId(), competition.getFormattedId(), competition.getName(), projectStatusResources);

        return ServiceResult.serviceSuccess(competitionProjectsStatusResource);
    }

    private Integer getProjectPartnerCount(Long projectId){
        return getProjectUsersByProjectId(projectId).size();
    }

    private ProjectActivityStates getProjectDetailsStatus(Project project){
        return ProjectActivityStates.PENDING;
    }

    private ProjectActivityStates getBankDetailsStatus(Project project){
        return ProjectActivityStates.PENDING;
    }

    private ProjectActivityStates getFinanceChecksStatus(Project project){
        return ProjectActivityStates.PENDING;
    }

    private ProjectActivityStates getSpendProfileStatus(Project project){
        return ProjectActivityStates.PENDING;
    }

    private ProjectActivityStates getMonitoringOfficerStatus(Project project){
        return ProjectActivityStates.PENDING;
    }

    private ProjectActivityStates getOtherDocumentsStatus(Project project){
        return ProjectActivityStates.PENDING;
    }

    private ProjectActivityStates getGrantOfferLetterStatus(Project project){
        return ProjectActivityStates.PENDING;
    }
}
<commit_msg>fix bug with app id<commit_after>package com.worth.ifs.project.transactional;

import com.worth.ifs.commons.service.ServiceResult;
import com.worth.ifs.competition.domain.Competition;
import com.worth.ifs.competition.repository.CompetitionRepository;
import com.worth.ifs.project.constant.ProjectActivityStates;
import com.worth.ifs.project.domain.Project;
import com.worth.ifs.project.status.resource.CompetitionProjectsStatusResource;
import com.worth.ifs.project.status.resource.ProjectStatusResource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

@Service
public class ProjectStatusServiceImpl extends AbstractProjectServiceImpl implements ProjectStatusService {

    @Autowired
    private CompetitionRepository competitionRepository;

    @Override
    public ServiceResult<CompetitionProjectsStatusResource> getCompetitionStatus(Long competitionId) {
        Competition competition = competitionRepository.findOne(competitionId);

        List<Project> projects = projectRepository.findByApplicationCompetitionId(competitionId);

        List<ProjectStatusResource> projectStatusResources = projects.stream().map(project ->
                new ProjectStatusResource(
                        project.getName(),
                        project.getId(),
                        project.getFormattedId(),
                        project.getApplication().getId(),
                        project.getApplication().getFormattedId(),
                        getProjectPartnerCount(project.getId()),
                        project.getApplication().getLeadOrganisation().getName(),
                        getProjectDetailsStatus(project),
                        getBankDetailsStatus(project),
                        getFinanceChecksStatus(project),
                        getSpendProfileStatus(project),
                        getMonitoringOfficerStatus(project),
                        getOtherDocumentsStatus(project),
                        getGrantOfferLetterStatus(project))).collect(Collectors.toList());


        CompetitionProjectsStatusResource competitionProjectsStatusResource = new CompetitionProjectsStatusResource(competition.getId(), competition.getFormattedId(), competition.getName(), projectStatusResources);

        return ServiceResult.serviceSuccess(competitionProjectsStatusResource);
    }

    private Integer getProjectPartnerCount(Long projectId){
        return getProjectUsersByProjectId(projectId).size();
    }

    private ProjectActivityStates getProjectDetailsStatus(Project project){
        return ProjectActivityStates.PENDING;
    }

    private ProjectActivityStates getBankDetailsStatus(Project project){
        return ProjectActivityStates.PENDING;
    }

    private ProjectActivityStates getFinanceChecksStatus(Project project){
        return ProjectActivityStates.PENDING;
    }

    private ProjectActivityStates getSpendProfileStatus(Project project){
        return ProjectActivityStates.PENDING;
    }

    private ProjectActivityStates getMonitoringOfficerStatus(Project project){
        return ProjectActivityStates.PENDING;
    }

    private ProjectActivityStates getOtherDocumentsStatus(Project project){
        return ProjectActivityStates.PENDING;
    }

    private ProjectActivityStates getGrantOfferLetterStatus(Project project){
        return ProjectActivityStates.PENDING;
    }
}

{'fraction_non_alphanumeric': 0.07082071253425645, 'fraction_numerical': 0.0, 'mean_word_length': 3.4221938775510203, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1378924', 'n_tokens_mistral': 1584, 'n_tokens_neox': 1523, 'n_words': 250}