Skip to content

Commit

Permalink
Merge pull request #688 from bcgov/feature/GRAD2-2934
Browse files Browse the repository at this point in the history
GRAD2-2934: task is completed.
  • Loading branch information
infstar authored Sep 25, 2024
2 parents 1a5fbef + 80603dd commit 7ca05f5
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
@Service
public class DataConversionService {

public static final String NULL_VALUE = "NULL"; // NULL String => Nullify (set to NULL)
private static final String CREATE_USER = "createUser";
private static final String CREATE_DATE = "createDate";
public static final String DEFAULT_CREATED_BY = "DATA_CONV";
Expand Down Expand Up @@ -296,7 +297,7 @@ private void handleStudentAchievements(String currentProgram, String newProgram,
}

private void resetAdultStartDate(String currentProgram, String newProgram, GraduationStudentRecordEntity targetObject) {
// Only when 1950 adult program is channged to another, reset adultStartDate to null
// Only when 1950 adult program is changed to another, reset adultStartDate to null
if (!StringUtils.equalsIgnoreCase(currentProgram, newProgram) && "1950".equalsIgnoreCase(currentProgram)) {
targetObject.setAdultStartDate(null);
}
Expand Down Expand Up @@ -348,9 +349,10 @@ private void populate(OngoingUpdateFieldDTO field, GraduationStudentRecordEntity
}

private String getStringValue(Object value) {
if (value == null)
return null;
return (String) value;
if (value instanceof String str) {
return NULL_VALUE.equalsIgnoreCase(str) ? null : str;
}
return null;
}

private StudentOptionalProgramEntity handleExistingOptionalProgram(StudentOptionalProgramRequestDTO studentOptionalProgramReq, StudentOptionalProgramEntity gradEntity) {
Expand Down

0 comments on commit 7ca05f5

Please sign in to comment.