class ConsentServiceImpl implements ConsentService {

    @Override
    @Transactional
    public List<String> generateConsents(List<AisConsent> consents) {
        List<String> consentIds = consents.stream()
                                      .map(mapper::mapToCmsConsent)
                                      .map(this::doCreateConsent)
                                      .filter(Objects::nonNull)
                                      .map(CmsResponse::getPayload)
                                      .map(CmsCreateConsentResponse::getConsentId)
                                      .collect(Collectors.toList());
        return updateConsentsStatus(consentIds);
    }

}