use of gov.cms.qpp.conversion.api.model.UnprocessedCpcFileData in project qpp-conversion-tool by CMSgov.
the class CpcFileControllerV1Test method createMockedUnprocessedDataList.
List<UnprocessedCpcFileData> createMockedUnprocessedDataList() {
Metadata metadata = new Metadata();
metadata.setSubmissionLocator("Test");
metadata.setFileName("TestFile.xml");
metadata.setApm("TestApmEntity");
metadata.setCreatedDate(Instant.now());
metadata.setOverallStatus(true);
UnprocessedCpcFileData unprocessedCpcFileData = new UnprocessedCpcFileData(metadata);
List<UnprocessedCpcFileData> unprocessedCpcFileDataList = new ArrayList<>();
unprocessedCpcFileDataList.add(unprocessedCpcFileData);
return unprocessedCpcFileDataList;
}
use of gov.cms.qpp.conversion.api.model.UnprocessedCpcFileData in project qpp-conversion-tool by CMSgov.
the class CpcFileControllerV1 method getUnprocessedCpcPlusFiles.
/**
* Endpoint to transform an uploaded file into a valid or error json response
*
* @return Valid json or error json content
*/
@GetMapping(value = "/unprocessed-files", headers = { "Accept=" + Constants.V1_API_ACCEPT })
public ResponseEntity<List<UnprocessedCpcFileData>> getUnprocessedCpcPlusFiles() {
API_LOG.info("CPC+ unprocessed files request received");
if (blockCpcPlusApi()) {
API_LOG.info(BLOCKED_BY_FEATURE_FLAG);
return new ResponseEntity<>(null, null, HttpStatus.FORBIDDEN);
}
List<UnprocessedCpcFileData> unprocessedCpcFileDataList = cpcFileService.getUnprocessedCpcPlusFiles();
API_LOG.info("CPC+ unprocessed files request succeeded");
HttpHeaders httpHeaders = new HttpHeaders();
httpHeaders.setContentType(MediaType.APPLICATION_JSON_UTF8);
return new ResponseEntity<>(unprocessedCpcFileDataList, httpHeaders, HttpStatus.OK);
}
Aggregations