class CmsPsuConfirmationOfFundsController implements CmsPsuConfirmationOfFundsApi {

    @Override
    public ResponseEntity<CmsConfirmationOfFundsConsent> getConsentByConsentId(String consentId, String psuId, String psuIdType,
                                                                               String psuCorporateId, String psuCorporateIdType,
                                                                               String instanceId) {
        PsuIdData psuIdData = new PsuIdData(psuId, psuIdType, psuCorporateId, psuCorporateIdType, null);
        return cmsPsuConfirmationOfFundsService.getConsent(psuIdData, consentId, instanceId)
                   .map(consent -> new ResponseEntity<>(consent, HttpStatus.OK))
                   .orElseGet(() -> new ResponseEntity<>(HttpStatus.NOT_FOUND));
    }

}