class CmsPsuConfirmationOfFundsServiceInternal implements CmsPsuConfirmationOfFundsService {

    @Override
    @Transactional
    public @NotNull Optional<CmsConfirmationOfFundsConsent> getConsent(@NotNull PsuIdData psuIdData,
                                                                       @NotNull String consentId,
                                                                       @NotNull String instanceId) {
        return consentJpaRepository.findOne(confirmationOfFundsConsentSpecification.byConsentIdAndInstanceId(consentId, instanceId))
                   .map(this::mapToCmsConsentWithAuthorisations);
    }

}