class CmsConsentController implements CmsConsentApi {

    @Override
    public ResponseEntity<Object> createConsent(@RequestBody CmsConsent request) {
        CmsResponse<CmsCreateConsentResponse> cmsResponse;

        try {
            cmsResponse = consentServiceEncrypted.createConsent(request);
        } catch (WrongChecksumException e) {
            return new ResponseEntity<>(CmsError.CHECKSUM_ERROR, HttpStatus.BAD_REQUEST);
        }

        if (cmsResponse.hasError()) {
            return new ResponseEntity<>(HttpStatus.NO_CONTENT);
        }

        return new ResponseEntity<>(cmsResponse.getPayload(), HttpStatus.CREATED);
    }

}