Skip to content

Commit

Permalink
Merge pull request #315 from bcgov/feature/GRAD2-2500
Browse files Browse the repository at this point in the history
GRAD2-2500: graduated student from TRAX & UTG is all dropped.
  • Loading branch information
infstar authored Feb 16, 2024
2 parents 1fda67f + 6668d48 commit e710f75
Show file tree
Hide file tree
Showing 15 changed files with 266 additions and 6,361 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package ca.bc.gov.educ.api.dataconversion.model;

import ca.bc.gov.educ.api.dataconversion.constant.ConversionResultType;
import ca.bc.gov.educ.api.dataconversion.constant.StudentLoadType;
import ca.bc.gov.educ.api.dataconversion.model.tsw.School;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Builder;
Expand Down Expand Up @@ -43,17 +41,6 @@ public class ConvGradStudent {
// program codes for optional / career program
private List<String> programCodes;

// grad or non-grad
private StudentLoadType studentLoadType;
private StudentLoadType originalStudentLoadType;
private Date distributionDate;
private String transcriptSchoolCategoryCode;
private String certificateSchoolCategoryCode;
private School transcriptSchool;
private School certificateSchool;
// tsw
private TranscriptStudentDemog transcriptStudentDemog;
private List<TranscriptStudentCourse> transcriptStudentCourses;
// 1950 "AD"
private boolean adult19Rule;

Expand Down

This file was deleted.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package ca.bc.gov.educ.api.dataconversion.processor;

import ca.bc.gov.educ.api.dataconversion.constant.ConversionResultType;
import ca.bc.gov.educ.api.dataconversion.constant.StudentLoadType;
import ca.bc.gov.educ.api.dataconversion.model.ConvGradStudent;
import ca.bc.gov.educ.api.dataconversion.model.ConversionAlert;
import ca.bc.gov.educ.api.dataconversion.model.ConversionStudentSummaryDTO;
Expand Down Expand Up @@ -42,14 +41,7 @@ public ConvGradStudent process(String pen) throws Exception {
responseStudent = students.get(0);
if (responseStudent.getResult() != null &&
responseStudent.getResult().equals(ConversionResultType.FAILURE)) {
String reason = "";
if (responseStudent.getStudentLoadType() == StudentLoadType.NONE) {
reason = "ERROR-Bad data: student is not in [ungrad, grad_one, grad_two]";
} else if (responseStudent.getStudentLoadType() == StudentLoadType.NO_UTG) {
reason = "ERROR-Bad data: [graduated - two programs] UTG data is not found";
} else {
reason = "ERROR-Bad data: unknown error from TRAX";
}
String reason = "ERROR-Bad data: unknown error from TRAX";
summaryDTO.setErroredCount(summaryDTO.getErroredCount() + 1L);
restUtils.saveTraxStudentNo(new TraxStudentNo(pen, "F", reason), summaryDTO.getAccessToken());
return null;
Expand All @@ -65,7 +57,7 @@ public ConvGradStudent process(String pen) throws Exception {
error.setReason("Unexpected Exception is occurred: " + e.getLocalizedMessage());
summaryDTO.getErrors().add(error);

LOGGER.error("unknown exception: " + e.getLocalizedMessage());
LOGGER.error("unknown exception: {}", e.getLocalizedMessage());
if (responseStudent == null) {
responseStudent = ConvGradStudent.builder().pen(pen).result(ConversionResultType.FAILURE).build();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package ca.bc.gov.educ.api.dataconversion.service.student;

import ca.bc.gov.educ.api.dataconversion.constant.ConversionResultType;
import ca.bc.gov.educ.api.dataconversion.constant.StudentLoadType;
import ca.bc.gov.educ.api.dataconversion.model.ConvGradStudent;
import ca.bc.gov.educ.api.dataconversion.model.ConversionAlert;
import ca.bc.gov.educ.api.dataconversion.model.ConversionStudentSummaryDTO;
Expand All @@ -20,10 +19,6 @@ public class StudentBaseService {
public static final String STUDENT_STATUS_MERGED = "MER";
public static final String STUDENT_STATUS_TERMINATED = "TER";

// GRAD Messages
public static final String TSW_PF_GRAD_MSG = "Student has successfully completed the Programme Francophone.";
public static final String TSW_FI_GRAD_MSG = "Student has successfully completed the French Immersion program.";

// Optional Program Codes
private static final List<String> OPTIONAL_PROGRAM_CODES = Arrays.asList("AD", "BC", "BD");
private static final List<String> OPTIONAL_PROGRAM_CODES_FOR_RECREATION = Arrays.asList("AD", "BC", "BD", "CP");
Expand Down Expand Up @@ -56,12 +51,10 @@ protected String getGradStudentStatus(String traxStudentStatus, String traxArchi
}

protected boolean determineProgram(ConvGradStudent student, ConversionStudentSummaryDTO summary) {
String gradProgram = student.getStudentLoadType() == StudentLoadType.UNGRAD?
getGradProgram(student.getGraduationRequirementYear(), student.getSchoolOfRecord(), student.getFrenchDogwood()) :
getGradProgramForGraduatedStudent(student.getGraduationRequirementYear(), student.getTranscriptStudentDemog().getGradMessage());
String gradProgram = getGradProgram(student.getGraduationRequirementYear(), student.getSchoolOfRecord(), student.getFrenchDogwood());
if (StringUtils.isNotBlank(gradProgram)) {
student.setProgram(gradProgram);
updateProgramCountsInSummary(summary, gradProgram, student.getStudentLoadType() != StudentLoadType.UNGRAD);
updateProgramCountsInSummary(summary, gradProgram, false);
return true;
} else {
// error
Expand Down Expand Up @@ -114,19 +107,6 @@ protected String getGradProgram(String graduationRequirementYear, String schoolO
return gradProgram;
}

protected String getGradProgramForGraduatedStudent(String graduationRequirementYear, String gradMessage) {
String gradProgram = null;
switch (graduationRequirementYear) {
case "2018" -> gradProgram = isProgramFrancophone(gradMessage) ? "2018-PF" : "2018-EN";
case "2004" -> gradProgram = isProgramFrancophone(gradMessage) ? "2004-PF" : "2004-EN";
case "1996", "1995" -> gradProgram = isProgramFrancophone(gradMessage) ? "1996-PF" : "1996-EN";
case "1986" -> gradProgram = isProgramFrancophone(gradMessage) ? "1986-PF" : "1986-EN";
case "1950" -> gradProgram = "1950";
case "SCCP" -> gradProgram = "SCCP";
}
return gradProgram;
}

protected void populateNewBatchFlags(StudentGradDTO currentStudent) {
if (STUDENT_STATUS_ARCHIVED.equalsIgnoreCase(currentStudent.getStudentStatus())) {
// Transcript
Expand All @@ -145,15 +125,6 @@ private void updateProgramCountsInSummary(ConversionStudentSummaryDTO summary, S
}
}

public boolean isFrenchImmersion(String gradMessage) {
return StringUtils.contains(gradMessage, TSW_FI_GRAD_MSG);
}

// initial load
public boolean isProgramFrancophone(String gradMessage) {
return StringUtils.contains(gradMessage, TSW_PF_GRAD_MSG);
}

public boolean isOptionalProgramCode(String code) {
return OPTIONAL_PROGRAM_CODES.contains(code);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,24 +65,12 @@ public class EducGradDataConversionApiConstants {
@Value("${endpoint.pen-student-api.by-pen.url}")
private String penStudentApiByPenUrl;

@Value("${endpoint.grad-program-api.programs.url}")
private String gradProgramUrl;

@Value("${endpoint.grad-program-api.special-program.url}")
private String gradOptionalProgramUrl;

@Value("${endpoint.grad-program-api.optional-program-by-id.url}")
private String gradOptionalProgramByIDUrl;

@Value("${endpoint.grad-program-api.career-program.url}")
private String gradCareerProgramUrl;

@Value("${endpoint.grad-program-api.program-rules.url}")
private String gradProgramRulesUrl;

@Value("${endpoint.grad-program-api.program-rules-by-trax.url}")
private String gradProgramRulesByTraxReqNumberUrl;

@Value("${endpoint.grad-student-api.add-new-pen.url}")
private String addNewPenFromGradStudentApiUrl;

Expand Down Expand Up @@ -116,9 +104,6 @@ public class EducGradDataConversionApiConstants {
@Value("${endpoint.grad-assessment-api.assessment-requirement.url}")
private String addAssessmentRequirementApiUrl;

@Value("${endpoint.grad-assessment-api.student-assessments.by-pen-and-assessment-code.url}")
private String studentAssessmentsByPenAndAssessmentCodeApiUrl;

@Value("${endpoint.grad-assessment-api.student-assessments.by-pen.url}")
private String studentAssessmentsByPenApiUrl;

Expand Down Expand Up @@ -170,30 +155,6 @@ public class EducGradDataConversionApiConstants {
@Value("${endpoint.grad-trax-api.student.save-trax-student-no.url}")
private String saveTraxStudentNoUrl;

//Sree
@Value("${endpoint.grad-graduation-report-api.get-transcript}")
private String transcript;
@Value("${endpoint.educ-school-api.url}")
private String schoolCategoryCode;
@Value("${endpoint.grad-student-graduation-api.get-special-cases.url}")
private String specialCase;
@Value("${endpoint.grad-program-api.program_name_by_program_code.url}")
private String programNameEndpoint;
@Value("${endpoint.grad-graduation-report-api.update-grad-student-transcript.url}")
private String updateGradStudentTranscript;
@Value("${endpoint.report-api.transcript_report}")
private String transcriptReport;
@Value("${endpoint.grad-graduation-report-api.get-cert-list}")
private String certList;
@Value("${endpoint.report-api.certificate_report}")
private String certificateReport;
@Value("${endpoint.grad-graduation-report-api.update-grad-student-certificate.url}")
private String updateGradStudentCertificate;
@Value("${endpoint.grad-graduation-report-api.update-grad-student-report.url}")
private String updateGradStudentReport;
@Value("${endpoint.report-api.achievement_report}")
private String achievementReport;

// Incremental Grad Update
@Value("${grad.update.enabled}")
private boolean gradUpdateEnabled;
Expand Down
Loading

0 comments on commit e710f75

Please sign in to comment.