class ProfileServiceImpl extends BaseTransactionalService implements ProfileService {

    @Override
    @Transactional
    @UserUpdate
    public ServiceResult<UserResource> updateUserProfile(Long userId, UserProfileResource profileDetails) {
        return find(userRepository.findById(userId), notFoundError(User.class, userId))
                .andOnSuccess(user -> updateUserProfileDetails(user, profileDetails))
                .andOnSuccessReturn(userMapper::mapToResource);
    }

}