diff --git a/api/src/main/java/ca/bc/gov/educ/api/gradbusiness/service/GradBusinessService.java b/api/src/main/java/ca/bc/gov/educ/api/gradbusiness/service/GradBusinessService.java index 300270a..e678309 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/gradbusiness/service/GradBusinessService.java +++ b/api/src/main/java/ca/bc/gov/educ/api/gradbusiness/service/GradBusinessService.java @@ -6,7 +6,6 @@ import ca.bc.gov.educ.api.gradbusiness.util.EducGraduationApiConstants; import io.github.resilience4j.retry.annotation.Retry; import jakarta.transaction.Transactional; -import org.apache.commons.io.IOUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -290,11 +289,12 @@ public ResponseEntity getStudentCredentialPDFByType(String pen, String t public ResponseEntity getStudentTranscriptPDFByType(String pen, String type, String accessToken) { try { byte[] reportData = prepareReportDataByPen(pen, type, accessToken).getBody(); + boolean isPreview = (StringUtils.isNotBlank(type) && StringUtils.equalsAnyIgnoreCase(type, "xml", "interim")); StringBuilder reportRequest = new StringBuilder(); String reportOptions = "\"options\": {\n" + " \"cacheReport\": false,\n" + " \"convertTo\": \"pdf\",\n" + - " \"preview\": \""+ ((StringUtils.isNotBlank(type) && StringUtils.equalsAnyIgnoreCase(type, "xml")) ? "true" : "false") +"\",\n" + + " \"preview\": \""+ (isPreview ? "true" : "false") +"\",\n" + " \"overwrite\": false,\n" + " \"reportName\": \"transcript\",\n" + " \"reportFile\": \""+pen+" Transcript Report.pdf\"\n" +