class ProfileServiceImpl extends BaseTransactionalService implements ProfileService {

    @Override
    public ServiceResult<ProfileSkillsResource> getProfileSkills(long userId) {
        return find(userRepository.findById(userId), notFoundError(User.class, userId))
                .andOnSuccess(user -> {
                    ProfileSkillsResource profileSkillsResource = new ProfileSkillsResource();
                    profileSkillsResource.setUser(user.getId());
                    Optional<Profile> profile = profileRepository.findById(user.getProfileId());
                    if (profile.isPresent()) {
                        profileSkillsResource.setInnovationAreas(simpleMap(profile.get().getInnovationAreas(),
                                innovationArea -> innovationAreaMapper.mapToResource(innovationArea)));
                        profileSkillsResource.setBusinessType(profile.get().getBusinessType());
                        profileSkillsResource.setSkillsAreas(profile.get().getSkillsAreas());
                    }
                    return serviceSuccess(profileSkillsResource);
                });
    }

}