Skip to content

Commit

Permalink
GRAD2-2477
Browse files Browse the repository at this point in the history
GRAD2-2477
  • Loading branch information
kamal-mohammed authored Jan 23, 2024
2 parents 8a61a61 + cecd753 commit e3cce14
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
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()) && (StringUtils.isNotBlank(gradProgramCode) && gradProgramCode.contains("1950")));
List<NonGradReason> nList = new ArrayList<>();
if (nonGradReasons != null) {
for (GradRequirement gR : nonGradReasons) {
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()) && (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 e3cce14

Please sign in to comment.