class CmsPsuConfirmationOfFundsController implements CmsPsuConfirmationOfFundsApi {

    @Override
    public ResponseEntity<Void> updateConsentStatus(String consentId, String status, String instanceId) {
        ConsentStatus consentStatus;
        try {
            consentStatus = ConsentStatus.valueOf(status);
        } catch (IllegalArgumentException exception) {
            log.info("Consent ID [{}], Instance ID: [{}]. Bad request: SCA status [{}] incorrect.", consentId, instanceId, status);
            return ResponseEntity.badRequest().build();
        }

        return cmsPsuConfirmationOfFundsService.updateConsentStatus(consentId, consentStatus, instanceId)
                   ? ResponseEntity.ok().build()
                   : ResponseEntity.badRequest().build();
    }

}