Skip to content

Commit

Permalink
Merge pull request #364 from bcgov/feature/GRAD2-3164
Browse files Browse the repository at this point in the history
GRAD2-3164: task is complete.
  • Loading branch information
infstar authored Jan 15, 2025
2 parents d8fcdae + ca27a84 commit 0cc086d
Show file tree
Hide file tree
Showing 21 changed files with 393 additions and 212 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ public String getUpToDateSchoolOfRecord() {
return StringUtils.isNotBlank(newSchoolOfRecord)? newSchoolOfRecord : this.getSchoolOfRecord();
}

public UUID getUpToDateSchoolOfRecordId() {
return newSchoolOfRecordId != null? newSchoolOfRecordId : this.getSchoolOfRecordId();
}

@Override
public boolean isArchived() {
if (StringUtils.isNotBlank(newStudentStatus) && "ARC".equalsIgnoreCase(newStudentStatus)) { // Student Status from TRAX
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package ca.bc.gov.educ.api.dataconversion.model.institute;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.stereotype.Component;

@Data
@EqualsAndHashCode
@Component("instituteSchool")
@JsonIgnoreProperties(ignoreUnknown = true)
public class School {

private String schoolId;
private String districtId;
private String mincode;
private String independentAuthorityId;
private String schoolNumber;
private String faxNumber;
private String phoneNumber;
private String email;
private String website;
private String displayName;
private String displayNameNoSpecialChars;
private String schoolReportingRequirementCode;
private String schoolOrganizationCode;
private String schoolCategoryCode;
private String facilityTypeCode;
private String openedDate;
private String closedDate;
private boolean canIssueTranscripts;
private boolean canIssueCertificates;

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class GraduationData {
private GradSearchStudent gradStudent;
private GradAlgorithmGraduationStudentRecord gradStatus;
private List<GradAlgorithmOptionalStudentProgram> optionalGradStatus;
private School school;
private SchoolClob school;
private StudentCourses studentCourses;
private StudentAssessments studentAssessments; // nullable
private StudentExams studentExams; // nullable
Expand Down

This file was deleted.

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

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;
import org.springframework.stereotype.Component;

@Data
@Component
@JsonIgnoreProperties(ignoreUnknown = true)
public class SchoolClob implements Comparable<SchoolClob> {

private String minCode;
private String schoolId;
private String schoolName;
private String districtName;
private String transcriptEligibility;
private String certificateEligibility;
private String address1;
private String address2;
private String city;
private String provCode;
private String countryCode;
private String postal;
private String openFlag;
private String schoolCategoryCode;
private String schoolCategoryLegacyCode;

@Override
public String toString() {
return "SchoolClob [minCode=" + minCode + ", schoolId=" + schoolId + ", schoolCategoryCode=" + schoolCategoryCode + ", schoolCategoryLegacyCode=" + schoolCategoryLegacyCode
+ ", schoolName=" + schoolName + ", districtName=" + districtName + ", transcriptEligibility=" + transcriptEligibility + ", certificateEligibility=" + certificateEligibility
+ ", address1=" + address1 + ", address2=" + address2 + ", city=" + city + ", provCode=" + provCode + ", countryCode=" + countryCode + ", postal=" + postal + ", openFlag=" + openFlag
+ "]";
}

@Override
public int compareTo(SchoolClob o) {
int result = 0;
{
if (result == 0) {
result = getMinCode().compareToIgnoreCase(o.getMinCode());
}
if (result == 0) {
result = getSchoolName().compareToIgnoreCase(o.getSchoolName());
}
}
return result;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class StudentProcess extends StudentBaseService {
public StudentProcess(RestUtils restUtils,
AssessmentProcess assessmentProcess,
CourseProcess courseProcess) {
super(restUtils);
this.restUtils = restUtils;
this.assessmentProcess = assessmentProcess;
this.courseProcess = courseProcess;
Expand Down Expand Up @@ -281,10 +282,8 @@ private Pair<ConversionResultType, Boolean> handleProgramCode(String programCode
}

private ConversionResultType processSccpFrenchCertificates(GraduationStudentRecord student, ConversionStudentSummaryDTO summary) {
if (StringUtils.equals(student.getProgram(), "SCCP")
&& ( StringUtils.isNotBlank(student.getSchoolOfRecord())
&& student.getSchoolOfRecord().startsWith("093") )
) {
if (StringUtils.equals(student.getProgram(), "SCCP") && student.getSchoolOfRecordId() != null
&& isSchoolForProgramFrancophone(student.getSchoolOfRecordId())) {
return createStudentOptionalProgram("FR", student, summary);
}
return ConversionResultType.SUCCESS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public NewStudentEventService(EventRepository eventRepository,
StudentProcess studentProcess,
RestUtils restUtils,
EducGradDataConversionApiConstants constants) {
super(restUtils);
this.eventRepository = eventRepository;
this.studentProcess = studentProcess;
this.restUtils = restUtils;
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.entity.Event;
import ca.bc.gov.educ.api.dataconversion.model.ResponseObj;
import ca.bc.gov.educ.api.dataconversion.model.StudentGradDTO;
import ca.bc.gov.educ.api.dataconversion.model.TraxStudentUpdateDTO;
import ca.bc.gov.educ.api.dataconversion.process.StudentProcess;
Expand Down Expand Up @@ -34,6 +33,7 @@ public StudentAssessmentUpdateEventService(EventRepository eventRepository,
StudentProcess studentProcess,
RestUtils restUtils,
EducGradDataConversionApiConstants constants) {
super(restUtils);
this.eventRepository = eventRepository;
this.studentProcess = studentProcess;
this.restUtils = restUtils;
Expand All @@ -45,12 +45,7 @@ public <T extends Object> void processEvent(T request, Event event) {
TraxStudentUpdateDTO studentAssessmentUpdate = (TraxStudentUpdateDTO) request;
if (studentAssessmentUpdate != null && constants.isGradUpdateEnabled()) {
// Get Access Token
ResponseObj res = restUtils.getTokenResponseObject();
String accessToken = null;
if (res != null) {
accessToken = res.getAccess_token();
}

String accessToken = restUtils.fetchAccessToken();
// Load grad student
StudentGradDTO currentStudent = studentProcess.loadStudentData(studentAssessmentUpdate.getPen(), accessToken);
if (currentStudent != null) {
Expand Down
Loading

0 comments on commit 0cc086d

Please sign in to comment.