Skip to content

Commit

Permalink
Merge pull request #335 from bcgov/grad-release
Browse files Browse the repository at this point in the history
Grad release 1.22
  • Loading branch information
githubmamatha authored Jul 9, 2024
2 parents 8ed6e22 + a8e8138 commit 1c347f4
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 300 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.57</version>
<version>1.8.58</version>
<name>educ-grad-data-conversion-api</name>
<description>Ministry of Education GRAD DATA CONVERSION API</description>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@ public void handleEvent(@NonNull final Event event) {
final TraxGraduationUpdateDTO updateGrad = JsonUtil.getJsonObjectFromString(TraxGraduationUpdateDTO.class, event.getEventPayload());
this.eventServiceMap.get(UPD_GRAD.toString()).processEvent(updateGrad, event);
break;
case "UPD_STD_STATUS": // UPD_STD_STATUS will be deprecated
log.debug("Processing UPD_STD_STATUS event record :: {} ", event);
final TraxStudentStatusUpdateDTO updateStudentStatus = JsonUtil.getJsonObjectFromString(TraxStudentStatusUpdateDTO.class, event.getEventPayload());
this.eventServiceMap.get(UPD_STD_STATUS.toString()).processEvent(updateStudentStatus, event);
break;
case "XPROGRAM":
log.debug("Processing XPROGRAM event record :: {} ", event);
final TraxXProgramDTO xprogram = JsonUtil.getJsonObjectFromString(TraxXProgramDTO.class, event.getEventPayload());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public enum EventType {
NEWSTUDENT,
UPD_DEMOG,
UPD_GRAD,
UPD_STD_STATUS, // UPD_STD_STATUS will be deprecated
XPROGRAM,
ASSESSMENT,
COURSE,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -490,14 +490,6 @@ public void saveGraduationStudent(String pen, StudentGradDTO gradStudent, EventT
requestDTO.getUpdateFields().add(field);
}
}
// UPD_STD_STATUS will be deprecated
// Student Status
if (eventType == EventType.UPD_STD_STATUS && StringUtils.isNotBlank(gradStudent.getNewStudentStatus())) {
OngoingUpdateFieldDTO field = OngoingUpdateFieldDTO.builder()
.type(FieldType.STRING).name(FieldName.STUDENT_STATUS).value(gradStudent.getNewStudentStatus())
.build();
requestDTO.getUpdateFields().add(field);
}

// Others ======================================================
// Batch Flags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ protected String getGradStudentStatus(String traxStudentStatus, String traxArchi
return STUDENT_STATUS_DECEASED;
} else if (StringUtils.equalsIgnoreCase(traxStudentStatus, "M")) {
return STUDENT_STATUS_MERGED;
} else if (StringUtils.equalsIgnoreCase(traxStudentStatus, "T") &&
(StringUtils.equalsIgnoreCase(traxArchiveFlag, "A") || StringUtils.equalsIgnoreCase(traxArchiveFlag, "I")) ) {
} else if (StringUtils.equalsIgnoreCase(traxStudentStatus, "T") && StringUtils.equalsIgnoreCase(traxArchiveFlag, "A")) {
return STUDENT_STATUS_TERMINATED;
} else if (StringUtils.equalsIgnoreCase(traxStudentStatus, "T") && StringUtils.equalsIgnoreCase(traxArchiveFlag, "I")) {
return STUDENT_STATUS_ARCHIVED;
}
return null;
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.time.LocalDate;
import java.time.Period;
import java.time.ZoneId;
import java.util.Calendar;
import java.util.Date;

public class EducGradDataConversionApiUtils {
Expand Down Expand Up @@ -76,18 +77,14 @@ public static Date parseDate(String dateString) {

public static String parsingNFormating(String inDate) {
String actualDate = inDate + "/01";
String sDates = null;
Date temp = EducGradDataConversionApiUtils.parseDate(actualDate, EducGradDataConversionApiConstants.SECONDARY_DATE_FORMAT);
sDates = EducGradDataConversionApiUtils.formatDate(temp, EducGradDataConversionApiConstants.DEFAULT_DATE_FORMAT);
return sDates;
Date temp = toLastDayOfMonth(EducGradDataConversionApiUtils.parseDate(actualDate, EducGradDataConversionApiConstants.SECONDARY_DATE_FORMAT));
return EducGradDataConversionApiUtils.formatDate(temp, EducGradDataConversionApiConstants.DEFAULT_DATE_FORMAT);
}

public static String parsingDateForCertificate(String sessionDate) {
String actualSessionDate = sessionDate + "/01";
String sDates = null;
Date temp = parseDate(actualSessionDate, EducGradDataConversionApiConstants.SECONDARY_DATE_FORMAT);
sDates = formatDate(temp, EducGradDataConversionApiConstants.DEFAULT_DATE_FORMAT);
return sDates;
Date temp = toLastDayOfMonth(parseDate(actualSessionDate, EducGradDataConversionApiConstants.SECONDARY_DATE_FORMAT));
return formatDate(temp, EducGradDataConversionApiConstants.DEFAULT_DATE_FORMAT);
}

public static String formatDateForReportJasper(String updatedTimestamp) {
Expand Down Expand Up @@ -163,4 +160,14 @@ public static Double getPercentage(final String percentage) {
}
return null;
}

static Date toLastDayOfMonth(Date date) {
if(date != null) {
Calendar cal = Calendar.getInstance();
cal.setTime(date);
cal.set(Calendar.DAY_OF_MONTH, cal.getActualMaximum(Calendar.DAY_OF_MONTH));
return cal.getTime();
}
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ public void testSaveGraduationStudent_whenStudentStatus_isChanged_then_returnAPI

boolean exceptionIsThrown = false;
try {
studentProcess.saveGraduationStudent(pen, requestStudent, EventType.UPD_STD_STATUS, "123");
studentProcess.saveGraduationStudent(pen, requestStudent, EventType.UPD_GRAD, "123");
} catch (Exception e) {
exceptionIsThrown = true;
}
Expand Down

This file was deleted.

0 comments on commit 1c347f4

Please sign in to comment.