class ProjectServiceImpl extends AbstractProjectServiceImpl implements ProjectService {

    @Override
    @Transactional (readOnly = true)
    public ServiceResult<List<ProjectResource>> findByUserId(long userId) {
        List<ProjectUser> projectUsers = projectUserRepository.findByUserId(userId);
        return serviceSuccess(projectUsers
                .stream()
                .map(ProjectUser::getProcess)
                .distinct()
                .map(projectMapper::mapToResource)
                .collect(toList())
        );
    }

}