class BankDetailsServiceImpl implements BankDetailsService {

    @Override
    public ServiceResult<ProjectBankDetailsStatusSummary> getProjectBankDetailsStatusSummary(Long projectId) {
        Project project = projectRepository.findById(projectId).get();
        ProcessRole leadProcessRole = project.getApplication().getLeadApplicantProcessRole();
        Organisation leadOrganisation = organisationRepository.findById(leadProcessRole.getOrganisationId()).get();
        List<Organisation> sortedOrganisations = new PrioritySorting<>(projectUsersHelper.getPartnerOrganisations(projectId), leadOrganisation, Organisation::getName).unwrap();
        final List<BankDetailsStatusResource> bankDetailsStatusResources = simpleMap(sortedOrganisations, org -> getBankDetailsStatusForOrg(project, org));

        ProjectBankDetailsStatusSummary projectBankDetailsStatusSummary
                = new ProjectBankDetailsStatusSummary(project.getApplication().getCompetition().getId(),
                project.getApplication().getCompetition().getName(), project.getId(), project.getName(), project.getApplication().getId(),
                bankDetailsStatusResources, leadOrganisation.getName());
        return serviceSuccess(projectBankDetailsStatusSummary);
    }

}