class CmsPsuAisServiceInternal implements CmsPsuAisService {

    @Override
    @Transactional(rollbackFor = WrongChecksumException.class)
    public boolean confirmConsent(@NotNull String consentId, @NotNull String instanceId) throws WrongChecksumException {
        if (changeConsentStatus(consentId, VALID, instanceId)) {
            aisConsentService.findAndTerminateOldConsentsByNewConsentId(consentId);
            return true;
        }
        log.info("Consent ID [{}], Instance ID: [{}]. Confirmation of consent failed because consent has finalised status or not found",
                 consentId, instanceId);
        return false;
    }

}