Skip to content

Commit

Permalink
Merge pull request #346 from bcgov/grad-release
Browse files Browse the repository at this point in the history
Grad release 1.26.2
  • Loading branch information
githubmamatha authored Nov 18, 2024
2 parents 41a4bd8 + ce20f80 commit 6d8d82a
Show file tree
Hide file tree
Showing 14 changed files with 216 additions and 20 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-data-conversion-api</artifactId>
<version>1.8.60</version>
<version>1.8.61</version>
<name>educ-grad-data-conversion-api</name>
<description>Ministry of Education GRAD DATA CONVERSION API</description>

Expand Down
Binary file added api/src/main/.DS_Store
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

public enum FieldName {
SCHOOL_OF_RECORD,
SCHOOL_OF_RECORD_ID,
GRAD_PROGRAM,
ADULT_START_DATE,
SLP_DATE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@

public enum FieldType {
STRING,
DATE
DATE,
GUID
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import java.util.Date;
import java.util.List;
import java.util.UUID;

@Data
@Builder
Expand All @@ -25,6 +26,7 @@ public class ConvGradStudent {
private String honoursStanding; // inc
private String studentGradData;
private String schoolOfRecord; // inc
private UUID schoolOfRecordId; // inc
private String schoolAtGrad; // inc
private String studentGrade; // inc
private String studentStatus; // inc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class GraduationStudentRecord extends BaseModel{
private String recalculateGradStatus;
private String recalculateProjectedGrad;
private String schoolOfRecord;
private UUID schoolOfRecordId;
private String studentGrade;
private String studentStatus;
private UUID studentID;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

@Slf4j
@Data
Expand All @@ -14,6 +15,7 @@ public class StudentCommonDTO extends StudentDemographicDTO {
private String program;
private String gradDate;
private String schoolOfRecord;
private UUID schoolOfRecordId;
private String schoolAtGrad;
private String studentGrade;
private String studentStatus;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class StudentGradDTO extends StudentCommonDTO {
private String newProgram;
private String newGradDate;
private String newSchoolOfRecord;
private UUID newSchoolOfRecordId;
private String newStudentGrade;
private String newStudentStatus;
private String newCitizenship;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.UUID;

@Data
@Builder
@AllArgsConstructor
Expand All @@ -20,6 +22,8 @@ public class TraxGraduationUpdateDTO extends TraxStudentUpdateDTO {
private String studentGrade;
// MINCODE
private String schoolOfRecord;
// SchoolId
private UUID schoolOfRecordId;
// SLP_DATE
private String slpDate;
// STUD_CITIZ
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ private void processDependencies(ConvGradStudent convGradStudent,
gradStudent.setPen(convGradStudent.getPen());

result = processOptionalPrograms(gradStudent, summary, ongoingUpdate);
if (ConversionResultType.FAILURE != result) {
if (!ongoingUpdate && ConversionResultType.FAILURE != result) {
result = processProgramCodes(gradStudent, convGradStudent.getProgramCodes(), summary);
}
if (ConversionResultType.FAILURE != result) {
Expand Down Expand Up @@ -178,6 +178,7 @@ private void convertStudentData(ConvGradStudent student, Student penStudent, Gra
gradStudent.setSchoolAtGrad(null);

gradStudent.setSchoolOfRecord(StringUtils.isNotBlank(student.getSchoolOfRecord())? student.getSchoolOfRecord() : null);
gradStudent.setSchoolOfRecordId(student.getSchoolOfRecordId());
gradStudent.setStudentGrade(student.getStudentGrade());
gradStudent.setStudentStatus(getGradStudentStatus(student.getStudentStatus(), student.getArchiveFlag()));

Expand Down Expand Up @@ -369,6 +370,7 @@ public StudentGradDTO loadStudentData(String pen, String accessToken) {
studentData.setStudentGrade(gradStudent.getStudentGrade());
studentData.setStudentStatus(gradStudent.getStudentStatus());
studentData.setSchoolOfRecord(gradStudent.getSchoolOfRecord());
studentData.setSchoolOfRecordId(gradStudent.getSchoolOfRecordId());
studentData.setSchoolAtGrad(gradStudent.getSchoolAtGrad());
studentData.setCitizenship(gradStudent.getStudentCitizenship());
studentData.setAdultStartDate(gradStudent.getAdultStartDate());
Expand Down Expand Up @@ -450,6 +452,13 @@ public void saveGraduationStudent(String pen, StudentGradDTO gradStudent, EventT
.build();
requestDTO.getUpdateFields().add(field);
}
// SchoolId
if (gradStudent.getNewSchoolOfRecordId() != null) {
OngoingUpdateFieldDTO field = OngoingUpdateFieldDTO.builder()
.type(FieldType.GUID).name(FieldName.SCHOOL_OF_RECORD_ID).value(gradStudent.getNewSchoolOfRecordId())
.build();
requestDTO.getUpdateFields().add(field);
}
// GRAD Program
if (StringUtils.isNotBlank(gradStudent.getNewProgram())) {
OngoingUpdateFieldDTO field = OngoingUpdateFieldDTO.builder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.apache.commons.lang3.time.DateUtils;

import java.util.Date;
import java.util.UUID;

public abstract class StudentGraduationUpdateBaseService extends StudentBaseService {

Expand Down Expand Up @@ -86,6 +87,44 @@ protected boolean processSchoolOfRecord(StudentGradDTO currentStudent, String va
return isChanged;
}

protected boolean processSchoolOfRecordId(StudentGradDTO currentStudent, UUID value) {
boolean isChanged = false;
switch(currentStudent.getStudentStatus()) {
case STUDENT_STATUS_CURRENT -> {
// UpdData
currentStudent.setNewSchoolOfRecordId(value);
// Transcript
currentStudent.setNewRecalculateGradStatus("Y");
// TVR
currentStudent.setNewRecalculateProjectedGrad("Y");
isChanged = true;
}
case STUDENT_STATUS_ARCHIVED -> {
if (!currentStudent.isGraduated()) {
// UpdData
currentStudent.setNewSchoolOfRecordId(value);
// Transcript
currentStudent.setNewRecalculateGradStatus("Y");
isChanged = true;
}
}
case STUDENT_STATUS_TERMINATED -> {
// UpdData
currentStudent.setNewSchoolOfRecordId(value);
// Transcript
currentStudent.setNewRecalculateGradStatus("Y");
isChanged = true;
}
default -> { // MER or DEC
// UpdData
currentStudent.setNewSchoolOfRecordId(value);
// Do not set flags to Y
isChanged = true;
}
}
return isChanged;
}

protected boolean processStudentGrade(StudentGradDTO currentStudent, String value) {
boolean isChanged = false;
switch(currentStudent.getStudentStatus()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,16 @@ public void processStudent(TraxGraduationUpdateDTO updateGrad, StudentGradDTO cu

log.info(" Process Student : studentID = {}, pen = {}", currentStudent.getStudentID(), updateGrad.getPen());
// Processing order is important for the first 3 fields below.
// 1. School of record
// 1.1 School of Record
if (!StringUtils.equals(updateGrad.getSchoolOfRecord(), currentStudent.getSchoolOfRecord())) {
isChanged = processSchoolOfRecord(currentStudent, updateGrad.getSchoolOfRecord());
log.info(" => school of record : current = {}, request = {}", currentStudent.getSchoolOfRecord(), currentStudent.getNewSchoolOfRecord());
}
// 1.2 School of Record Guid
if (updateGrad.getSchoolOfRecordId() != null && updateGrad.getSchoolOfRecordId() != currentStudent.getSchoolOfRecordId()) {
isChanged = processSchoolOfRecordId(currentStudent, updateGrad.getSchoolOfRecordId());
log.info(" => school of record id : current = {}, request = {}", currentStudent.getSchoolOfRecordId(), currentStudent.getNewSchoolOfRecordId());
}
// 2. Grad Program
String gradProgram = getGradProgram(updateGrad.getGraduationRequirementYear(), currentStudent.getUpToDateSchoolOfRecord(), null);
if (!StringUtils.equals(gradProgram, currentStudent.getProgram())) {
Expand Down
Loading

0 comments on commit 6d8d82a

Please sign in to comment.