Skip to content

Commit

Permalink
Revert "GRAD2-2338: task is completed."
Browse files Browse the repository at this point in the history
This reverts commit 3151520.
  • Loading branch information
chris.ditcher authored and chris.ditcher committed Sep 27, 2023
1 parent 26aca9e commit 940568d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1248,7 +1248,7 @@ private void handleAdultStartRule(ConvGradStudent student, Student penStudent, G
if ("AD".equalsIgnoreCase(gradStudent.getStudentGrade())) {
adultStartDate = DateUtils.addYears(dob, student.isAdult19Rule() ? 19 : 18);
} else {
adultStartDate = getAdultStartDate(dob);
adultStartDate = DateUtils.addYears(dob, 18);
}
gradStudent.setAdultStartDate(EducGradDataConversionApiUtils.formatDate(adultStartDate)); // yyyy-MM-dd
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,11 @@
import ca.bc.gov.educ.api.dataconversion.model.ConvGradStudent;
import ca.bc.gov.educ.api.dataconversion.model.ConversionAlert;
import ca.bc.gov.educ.api.dataconversion.model.ConversionStudentSummaryDTO;
import ca.bc.gov.educ.api.dataconversion.util.EducGradDataConversionApiUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.math.NumberUtils;
import org.apache.commons.lang3.time.DateUtils;

import java.util.Arrays;
import java.util.Date;
import java.util.List;

import static ca.bc.gov.educ.api.dataconversion.util.EducGradDataConversionApiConstants.DEFAULT_DATE_FORMAT;

public class StudentBaseService {

// Student Status
Expand Down Expand Up @@ -159,19 +153,4 @@ private boolean isSchoolForProgramFrancophone(String schoolOfRecord) {
return schoolOfRecord.startsWith("093") || "09898009".equalsIgnoreCase(schoolOfRecord) || "09898047".equalsIgnoreCase(schoolOfRecord);
}

/**
*
* @param dob
* @return adultStartDate
*/
protected Date getAdultStartDate(Date dob) {
Date adultStartDate;
String year = EducGradDataConversionApiUtils.formatDate(dob, "yyyy");
if (NumberUtils.isCreatable(year) && Integer.parseInt(year) < 1994) {
adultStartDate = DateUtils.addYears(dob, 19);
} else {
adultStartDate = DateUtils.addMonths(dob, (12*18) + 1);
}
return adultStartDate;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import ca.bc.gov.educ.api.dataconversion.util.RestUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

Expand Down Expand Up @@ -178,9 +179,9 @@ private void handleProgramChange(String newGradProgram, StudentGradDTO currentSt
}

private void handleAdultStartDate(StudentGradDTO currentStudent) {
if (StringUtils.equalsIgnoreCase(currentStudent.getNewProgram(), "1950")) { // && StringUtils.isBlank(currentStudent.getAdultStartDate())) {
if (StringUtils.equalsIgnoreCase(currentStudent.getNewProgram(), "1950") && StringUtils.isBlank(currentStudent.getAdultStartDate())) {
Date dob = EducGradDataConversionApiUtils.parseDate(currentStudent.getBirthday());
Date adultStartDate = getAdultStartDate(dob);
Date adultStartDate = DateUtils.addYears(dob, 18);
currentStudent.setNewAdultStartDate(EducGradDataConversionApiUtils.formatDate(adultStartDate)); // yyyy-MM-dd
}
}
Expand Down

0 comments on commit 940568d

Please sign in to comment.