class CmsPsuAisServiceInternal implements CmsPsuAisService {

    @Override
    @Transactional
    public boolean updateAccountAccessInConsent(@NotNull String consentId, @NotNull CmsAisConsentAccessRequest accountAccessRequest, @NotNull String instanceId) {
        Optional<ConsentEntity> aisConsentOptional = getActualAisConsent(consentId, instanceId);
        if (aisConsentOptional.isPresent()) {
            return updateAccountAccessInConsent(aisConsentOptional.get(), accountAccessRequest);
        }
        log.info("Consent ID [{}], Instance ID: [{}]. Update account access in consent failed, because consent not found or has finalised status",
                 consentId, instanceId);
        return false;
    }

}