diff --git a/api/src/main/java/ca/bc/gov/educ/api/gradstudent/constant/FieldName.java b/api/src/main/java/ca/bc/gov/educ/api/gradstudent/constant/FieldName.java index e72a2f41..1aec0d1c 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/gradstudent/constant/FieldName.java +++ b/api/src/main/java/ca/bc/gov/educ/api/gradstudent/constant/FieldName.java @@ -2,6 +2,7 @@ public enum FieldName { SCHOOL_OF_RECORD, + SCHOOL_OF_RECORD_ID, GRAD_PROGRAM, ADULT_START_DATE, SLP_DATE, diff --git a/api/src/main/java/ca/bc/gov/educ/api/gradstudent/constant/FieldType.java b/api/src/main/java/ca/bc/gov/educ/api/gradstudent/constant/FieldType.java index 0bfb7815..20883949 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/gradstudent/constant/FieldType.java +++ b/api/src/main/java/ca/bc/gov/educ/api/gradstudent/constant/FieldType.java @@ -2,5 +2,6 @@ public enum FieldType { STRING, - DATE + DATE, + GUID } \ No newline at end of file diff --git a/api/src/main/java/ca/bc/gov/educ/api/gradstudent/model/dto/GraduationStudentRecord.java b/api/src/main/java/ca/bc/gov/educ/api/gradstudent/model/dto/GraduationStudentRecord.java index f5061a06..c45f03e0 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/gradstudent/model/dto/GraduationStudentRecord.java +++ b/api/src/main/java/ca/bc/gov/educ/api/gradstudent/model/dto/GraduationStudentRecord.java @@ -25,6 +25,7 @@ public class GraduationStudentRecord extends BaseModel { private String honoursStanding; private String recalculateGradStatus; private String schoolOfRecord; + private UUID schoolOfRecordId; private String schoolName; private String studentGrade; private String studentStatus; diff --git a/api/src/main/java/ca/bc/gov/educ/api/gradstudent/service/DataConversionService.java b/api/src/main/java/ca/bc/gov/educ/api/gradstudent/service/DataConversionService.java index 4ed1793a..edae0d0c 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/gradstudent/service/DataConversionService.java +++ b/api/src/main/java/ca/bc/gov/educ/api/gradstudent/service/DataConversionService.java @@ -308,6 +308,10 @@ private void populate(OngoingUpdateFieldDTO field, GraduationStudentRecordEntity log.info(ONGOING_UPDATE_FIELD_STR, field, targetObject.getSchoolOfRecord()); targetObject.setSchoolOfRecord(getStringValue(field.getValue())); } + case SCHOOL_OF_RECORD_ID -> { + log.info(ONGOING_UPDATE_FIELD_STR, field, targetObject.getSchoolOfRecordId()); + targetObject.setSchoolOfRecordId(getGuidValue(field.getValue())); + } case GRAD_PROGRAM -> { log.info(ONGOING_UPDATE_FIELD_STR, field, targetObject.getProgram()); targetObject.setProgram(getStringValue(field.getValue())); @@ -353,6 +357,11 @@ private String getStringValue(Object value) { return (String) value; } + private UUID getGuidValue(Object value) { + String strGuid = getStringValue(value); + return strGuid != null? UUID.fromString(strGuid) : null; + } + private StudentOptionalProgramEntity handleExistingOptionalProgram(StudentOptionalProgramRequestDTO studentOptionalProgramReq, StudentOptionalProgramEntity gradEntity) { if (studentOptionalProgramReq.getStudentOptionalProgramData() != null) { gradEntity.setStudentOptionalProgramData(studentOptionalProgramReq.getStudentOptionalProgramData());