class AspspDataServiceInternal implements AspspDataService {

    @Override
    @Transactional
    public boolean deleteAspspConsentData(@NotNull String externalId) {
        if (!securityDataService.isConsentIdEncrypted(externalId)) {
            return deleteAspspConsentDataIfExist(externalId);
        }

        return securityDataService.decryptId(externalId)
                   .map(this::deleteAspspConsentDataIfExist)
                   .orElseGet(() -> {
                       log.info("External Consent ID: [{}]. Delete aspsp consent data failed, couldn't decrypt consent id",
                                externalId);
                       return false;
                   });
    }

}