Skip to content

Commit

Permalink
Grad release 1.14.0
Browse files Browse the repository at this point in the history
Grad release 1.14.0
  • Loading branch information
kamal-mohammed authored Feb 6, 2024
2 parents 778ea23 + d2814b1 commit 26feb3e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>ca.bc.gov.educ</groupId>
<artifactId>educ-grad-graduation-api</artifactId>
<version>1.8.51</version>
<version>1.8.52</version>
<name>educ-grad-graduation-api</name>
<description>Ministry of Education GRAD GRADUATION API</description>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,13 +384,13 @@ private List<Student> processStudentList(List<GraduationStudentRecord> gradStudL
gradData.setGraduationDate(gsr.getProgramCompletionDate() != null ? EducGraduationApiUtils.parsingTraxDateLocalDate(gsr.getProgramCompletionDate()) : null);
gradData.setHonorsFlag(gsr.getHonoursStanding() != null && gsr.getHonoursStanding().equalsIgnoreCase("Y"));
std.setGraduationData(gradData);
std.setNonGradReasons(getNonGradReasons(gsr.getNonGradReasons()));
std.setNonGradReasons(getNonGradReasons(gsr.getProgram(), gsr.getNonGradReasons()));
stdPrjList.add(std);
} else {
std.setGraduationData(new ca.bc.gov.educ.api.graduation.model.report.GraduationData());
if (gsr.getStudentProjectedGradData() != null) {
ProjectedRunClob projectedClob = (ProjectedRunClob)jsonTransformer.unmarshall(gsr.getStudentProjectedGradData(), ProjectedRunClob.class);
std.setNonGradReasons(getNonGradReasons(projectedClob.getNonGradReasons()));
std.setNonGradReasons(getNonGradReasons(gsr.getProgram(), projectedClob.getNonGradReasons()));
if (!projectedClob.isGraduated())
stdPrjList.add(std);
}
Expand All @@ -399,7 +399,8 @@ private List<Student> processStudentList(List<GraduationStudentRecord> gradStudL
return stdPrjList;
}

private List<NonGradReason> getNonGradReasons(List<GradRequirement> nonGradReasons) {
private List<NonGradReason> getNonGradReasons(String gradProgramCode, List<GradRequirement> nonGradReasons) {
nonGradReasons.removeIf(a -> ("506".equalsIgnoreCase(a.getTranscriptRule()) || "506".equalsIgnoreCase(a.getRule())) && (StringUtils.isNotBlank(gradProgramCode) && gradProgramCode.contains("1950")));
List<NonGradReason> nList = new ArrayList<>();
if (nonGradReasons != null) {
for (GradRequirement gR : nonGradReasons) {
Expand Down Expand Up @@ -468,16 +469,12 @@ private byte[] getSchoolReportNonGradRegReport(ReportData data, String mincode,

}

@Generated
private void createAndSaveSchoolReportNonGradRegReport(ReportData data, String mincode, String accessToken) {

byte[] bytesSAR = getSchoolReportNonGradRegReport(data, mincode, accessToken);

String encodedPdf = getEncodedPdfFromBytes(bytesSAR);

SchoolReports requestObj = getSchoolReports(mincode, encodedPdf, NONGRADREG);

updateSchoolReport(accessToken, requestObj);

}

private byte[] getSchoolReportStudentNonGradPrjReport(ReportData data, String mincode, String accessToken) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ private List<NonGradReason> getNonGradReasons(String gradProgramCode, List<ca.bc
populateTraxReqCodesMap(programReqCodes, traxReqCodes);
}
nonGradReasons.removeIf(a -> applyFilters && "505".equalsIgnoreCase(a.getTranscriptRule()) && (StringUtils.isNotBlank(gradProgramCode) && gradProgramCode.contains("1950")));
nonGradReasons.removeIf(a -> ("506".equalsIgnoreCase(a.getTranscriptRule()) || "506".equalsIgnoreCase(a.getRule())) && (StringUtils.isNotBlank(gradProgramCode) && gradProgramCode.contains("1950")));
for (ca.bc.gov.educ.api.graduation.model.dto.GradRequirement gR : nonGradReasons) {
String code = xml ? traxReqCodes.get(gR.getRule()) : gR.getTranscriptRule();
NonGradReason obj = new NonGradReason();
Expand Down Expand Up @@ -1269,14 +1270,14 @@ private List<OptionalProgram> getOptionalProgramAchvReport(String gradProgramCod
op.setHasRequirementMet(" Check with School");
if (existingData != null && existingData.getOptionalRequirementsMet() != null) {
op.setHasRequirementMet("The Following Requirements Are Met");
op.setRequirementMet(getRequirementsMetAchvReport(existingData.getOptionalRequirementsMet(), existingData.getOptionalStudentCourses(), op.getNonGradReasons()));
op.setRequirementMet(getRequirementsMetAchvReport(gradProgramCode, existingData.getOptionalRequirementsMet(), existingData.getOptionalStudentCourses(), op.getNonGradReasons()));
}
opList.add(op);
}
return opList;
}

private List<GradRequirement> getRequirementsMetAchvReport(List<ca.bc.gov.educ.api.graduation.model.dto.GradRequirement> optionalRequirementsMet, StudentCourses optionalStudentCourses, List<NonGradReason> nonGradReasons) {
private List<GradRequirement> getRequirementsMetAchvReport(String gradProgramCode, List<ca.bc.gov.educ.api.graduation.model.dto.GradRequirement> optionalRequirementsMet, StudentCourses optionalStudentCourses, List<NonGradReason> nonGradReasons) {
List<GradRequirement> grList = new ArrayList<>();
for (ca.bc.gov.educ.api.graduation.model.dto.GradRequirement gr : optionalRequirementsMet) {
if (!gr.isProjected()) {
Expand Down Expand Up @@ -1306,6 +1307,7 @@ private List<GradRequirement> getRequirementsMetAchvReport(List<ca.bc.gov.educ.a
nonGradReasons.add(obj);
}
}
nonGradReasons.removeIf(a -> "506".equalsIgnoreCase(a.getCode()) && (StringUtils.isNotBlank(gradProgramCode) && gradProgramCode.contains("1950")));
return grList;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2030,7 +2030,7 @@ public void testCreateAndStoreSchoolReports() {
Mockito.when(gradStatusService.getStudentListByMinCode(mincode, "accessToken")).thenReturn(sList);
Mockito.when(schoolService.getSchoolDetails(mincode, "accessToken", exception)).thenReturn(sTrax);
int numberOfRecord = graduationService.createAndStoreSchoolReports(uniqueList,"REGALG","accessToken");
assertEquals(2,numberOfRecord);
assertEquals(1,numberOfRecord);
}

@Test
Expand Down

0 comments on commit 26feb3e

Please sign in to comment.