Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GRAD2-3164: task is complete. #364

Merged
merged 5 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,77 @@
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;

public String getSchoolName() {
return schoolName != null ? schoolName.trim(): null;
}
Copy link

@mightycox mightycox Jan 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can get rid of these?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed all unnecessary methods.


public String getDistrictName() {
return districtName != null ? districtName.trim(): null;
}

public String getAddress1() {
return address1 != null ? address1.trim(): null;
}

public String getAddress2() {
return address2 != null ? address2.trim(): null;
}

public String getCity() {
return city != null ? city.trim(): null;
}

public String getPostal() {
return postal != null ? postal.trim(): null;
}

public String getOpenFlag() {
return openFlag != null ? openFlag.trim(): null;
}

@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 @@ -282,9 +283,7 @@ 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") )
) {
&& isSchoolForProgramFrancophone(student.getSchoolOfRecordId())) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the null check still?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not supposed to have null schoolOfRecordId in GraduationStudentRecord. If so, that is critical, and intentionally good to have NPE instead of moving forward with the wrong grad program. Anyway, I will add the null check here, and monitor in PROD that schoolOfRecordId is null to have the wrong grad program in student load & ongoing updates.

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
Loading