Search in sources :

Example 1 with UnprocessedCpcFileData

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;
}
Also used : UnprocessedCpcFileData(gov.cms.qpp.conversion.api.model.UnprocessedCpcFileData) Metadata(gov.cms.qpp.conversion.api.model.Metadata) ArrayList(java.util.ArrayList)

Example 2 with UnprocessedCpcFileData

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);
}
Also used : HttpHeaders(org.springframework.http.HttpHeaders) ResponseEntity(org.springframework.http.ResponseEntity) UnprocessedCpcFileData(gov.cms.qpp.conversion.api.model.UnprocessedCpcFileData) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Aggregations

UnprocessedCpcFileData (gov.cms.qpp.conversion.api.model.UnprocessedCpcFileData)2 Metadata (gov.cms.qpp.conversion.api.model.Metadata)1 ArrayList (java.util.ArrayList)1 HttpHeaders (org.springframework.http.HttpHeaders)1 ResponseEntity (org.springframework.http.ResponseEntity)1 GetMapping (org.springframework.web.bind.annotation.GetMapping)1