class AisConsentRepositoryImpl implements AisConsentVerifyingRepository {

    @Override
    @Transactional
    public Optional<ConsentEntity> getActualAisConsent(String consentId) {
        return aisConsentRepository.findByExternalId(consentId)
                   .filter(c -> !c.getConsentStatus().isFinalisedStatus());
    }

}