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-2645: task is complete. #337

Merged
merged 7 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -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 @@ -182,6 +182,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 @@ -373,6 +374,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 @@ -454,6 +456,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 @@ -90,7 +90,7 @@ public void processStudent(TraxGraduationUpdateDTO updateGrad, StudentGradDTO cu
isChanged = true;
}
if (!currentStudent.isArchived() || !currentStudent.isGraduated()) {
// 1. School of record
// 1.1 School of record
if (!StringUtils.equals(updateGrad.getSchoolOfRecord(), currentStudent.getSchoolOfRecord())) {
currentStudent.setNewSchoolOfRecord(updateGrad.getSchoolOfRecord());
// Transcript
Expand All @@ -102,6 +102,18 @@ public void processStudent(TraxGraduationUpdateDTO updateGrad, StudentGradDTO cu
log.info(" => school of record : current = {}, request = {}", currentStudent.getSchoolOfRecord(), currentStudent.getNewSchoolOfRecord());
isChanged = true;
}
// 1.2 SchoolOfRecordId
if (updateGrad.getSchoolOfRecordId() != null && updateGrad.getSchoolOfRecordId() != currentStudent.getSchoolOfRecordId()) {
currentStudent.setNewSchoolOfRecordId(updateGrad.getSchoolOfRecordId());
// Transcript
currentStudent.setNewRecalculateGradStatus("Y");
if (!currentStudent.isArchived()) {
// TVR
currentStudent.setNewRecalculateProjectedGrad("Y");
}
log.info(" => school of record id : current = {}, request = {}", currentStudent.getSchoolOfRecordId(), currentStudent.getNewSchoolOfRecordId());
isChanged = true;
}
// 2. Grad Program
String gradProgram = getGradProgram(updateGrad.getGraduationRequirementYear(), currentStudent.getUpToDateSchoolOfRecord(), null);
if (!StringUtils.equals(gradProgram, currentStudent.getProgram())) {
Expand Down
Loading
Loading