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

Grad release 1.22 #335

Merged
merged 11 commits into from
Jul 9, 2024
2 changes: 1 addition & 1 deletion .github/workflows/build.from.main.branch.deploy.to.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ on:
jobs:
openshift-ci-cd:
name: Build and deploy to OpenShift DEV
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
environment: dev

steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.from.release.branch.deploy.to.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ on:
jobs:
openshift-ci-cd:
name: Build and deploy to OpenShift DEV from release branch
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
environment: dev

steps:
Expand Down Expand Up @@ -147,4 +147,4 @@ jobs:
- name: ZAP Scan
uses: zaproxy/[email protected]
with:
target: 'https://${{ env.REPO_NAME }}-${{ env.OPENSHIFT_NAMESPACE }}.apps.silver.devops.gov.bc.ca/api/v1/api-docs'
target: 'https://${{ env.REPO_NAME }}-${{ env.OPENSHIFT_NAMESPACE }}.apps.silver.devops.gov.bc.ca/api/v1/api-docs'
2 changes: 1 addition & 1 deletion .github/workflows/create_tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ on:
jobs:
tag_image:
name: Tag Image
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
environment: dev

outputs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.to.dev.jinil.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ on:
jobs:
openshift-ci-cd:
name: Build and deploy to OpenShift DEV from developer branch
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
environment: dev

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy_prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ on:
jobs:
deploy-to-openshift-prod:
name: Deploy to OpenShift PROD
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
environment: prod

outputs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ on:
jobs:
deploy-to-openshift-test:
name: Deploy to OpenShift TEST
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
environment: test

outputs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/on.pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
quality_profile:

runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

defaults:
run:
Expand Down
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
Loading
Loading