From cffeb108ba55285d7b84f5592a4f33afbf3ec0a9 Mon Sep 17 00:00:00 2001 From: "chris.ditcher" Date: Wed, 26 Jun 2024 14:48:24 -0700 Subject: [PATCH 1/3] Updated to Ubuntu 22.04 (cherry picked from commit 0678fabe0d6adae88aadccfb77479cce76e940da) --- .github/workflows/build.from.developer.branch.deploy.to.dev.yml | 2 +- .github/workflows/build.from.main.branch.deploy.to.dev.yml | 2 +- .github/workflows/build.from.release.branch.deploy.to.dev.yml | 2 +- .github/workflows/create_tag.yml | 2 +- .github/workflows/deploy_prod.yml | 2 +- .github/workflows/deploy_test.yml | 2 +- .github/workflows/on.pr.yml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.from.developer.branch.deploy.to.dev.yml b/.github/workflows/build.from.developer.branch.deploy.to.dev.yml index 5e8fb8be..22c39ee3 100644 --- a/.github/workflows/build.from.developer.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.developer.branch.deploy.to.dev.yml @@ -49,7 +49,7 @@ jobs: openshift-ci-cd: name: Build and deploy to OpenShift DEV from developer branch # ubuntu-20.04 can also be used. - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: dev #outputs: diff --git a/.github/workflows/build.from.main.branch.deploy.to.dev.yml b/.github/workflows/build.from.main.branch.deploy.to.dev.yml index 46dfc273..6401fef0 100644 --- a/.github/workflows/build.from.main.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.main.branch.deploy.to.dev.yml @@ -37,7 +37,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: diff --git a/.github/workflows/build.from.release.branch.deploy.to.dev.yml b/.github/workflows/build.from.release.branch.deploy.to.dev.yml index 63436ee9..2b49b449 100644 --- a/.github/workflows/build.from.release.branch.deploy.to.dev.yml +++ b/.github/workflows/build.from.release.branch.deploy.to.dev.yml @@ -42,7 +42,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: diff --git a/.github/workflows/create_tag.yml b/.github/workflows/create_tag.yml index 4db4bcb1..3955ca50 100644 --- a/.github/workflows/create_tag.yml +++ b/.github/workflows/create_tag.yml @@ -26,7 +26,7 @@ on: jobs: tag_image: name: Tag Image - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: dev outputs: diff --git a/.github/workflows/deploy_prod.yml b/.github/workflows/deploy_prod.yml index dbd4ccde..71281aa4 100644 --- a/.github/workflows/deploy_prod.yml +++ b/.github/workflows/deploy_prod.yml @@ -31,7 +31,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: diff --git a/.github/workflows/deploy_test.yml b/.github/workflows/deploy_test.yml index e97d2477..2a544517 100644 --- a/.github/workflows/deploy_test.yml +++ b/.github/workflows/deploy_test.yml @@ -31,7 +31,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: diff --git a/.github/workflows/on.pr.yml b/.github/workflows/on.pr.yml index 2eae9936..4c1f2c15 100644 --- a/.github/workflows/on.pr.yml +++ b/.github/workflows/on.pr.yml @@ -10,7 +10,7 @@ on: jobs: quality_profile: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 defaults: run: From e13955378f734af91218ee28e2c2d3a44ddddf22 Mon Sep 17 00:00:00 2001 From: Alexander Rybakov <83988488+arybakov-cgi@users.noreply.github.com> Date: Fri, 5 Jul 2024 12:04:39 -0600 Subject: [PATCH 2/3] GRAD2-2855 (#665) P2 GRAD Incident: Not-Yet Graduated Report is Not Updated when ALL the students are graduated in the REGALG --- .../controller/GraduationStatusController.java | 9 +++++++++ .../repository/GraduationStudentRecordRepository.java | 3 +++ .../gradstudent/service/GraduationStatusService.java | 4 ++++ .../gradstudent/util/EducGradStudentApiConstants.java | 1 + .../controller/GraduationStatusControllerTest.java | 10 ++++++++++ .../service/GraduationStatusServiceTest.java | 9 +++++++++ 6 files changed, 36 insertions(+) diff --git a/api/src/main/java/ca/bc/gov/educ/api/gradstudent/controller/GraduationStatusController.java b/api/src/main/java/ca/bc/gov/educ/api/gradstudent/controller/GraduationStatusController.java index 69e94364..fdf11e18 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/gradstudent/controller/GraduationStatusController.java +++ b/api/src/main/java/ca/bc/gov/educ/api/gradstudent/controller/GraduationStatusController.java @@ -383,6 +383,15 @@ public ResponseEntity> getStudentsForAmalgamatedSchoolReport(@PathVar return response.GET(gradStatusService.getStudentsForAmalgamatedSchoolReport(schoolOfRecord,type)); } + @GetMapping (EducGradStudentApiConstants.STUDENT_COUNT_FOR_AMALGAMATED_SCHOOL_REPORT) + @PreAuthorize(PermissionsConstants.READ_GRADUATION_STUDENT) + @Operation(summary = "Get Students Count For School Report by mincode", description = "Get Students Count For School Report by mincode", tags = { "Business" }) + @ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK")}) + public ResponseEntity getStudentsCountForAmalgamatedSchoolReport(@PathVariable String schoolOfRecord) { + logger.debug("getStudentsCountForAmalgamatedSchoolReport:"); + return response.GET(gradStatusService.countStudentsForAmalgamatedSchoolReport(schoolOfRecord)); + } + @PostMapping (EducGradStudentApiConstants.UPDATE_GRAD_STUDENT_FLAG_BY_BATCH_JOB_TYPE_AND_MULTIPLE_STUDENTIDS) @PreAuthorize(PermissionsConstants.UPDATE_GRADUATION_STUDENT) @Operation(summary = "Update Student Flag ready for batch by Batch Job Type and Student IDs", description = "Update Student Flag ready for batch by Batch Job Type and Student IDs", tags = { "Batch Algorithm" }) diff --git a/api/src/main/java/ca/bc/gov/educ/api/gradstudent/repository/GraduationStudentRecordRepository.java b/api/src/main/java/ca/bc/gov/educ/api/gradstudent/repository/GraduationStudentRecordRepository.java index 5d34fecd..99d81b24 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/gradstudent/repository/GraduationStudentRecordRepository.java +++ b/api/src/main/java/ca/bc/gov/educ/api/gradstudent/repository/GraduationStudentRecordRepository.java @@ -49,6 +49,9 @@ public interface GraduationStudentRecordRepository extends JpaRepository findBySchoolOfRecordAndStudentStatusAndStudentGradeIn(String schoolOfRecord, String studentStatus, List studentGrade); + @Query("select count(*) from GraduationStudentRecordEntity c where c.schoolOfRecord=:schoolOfRecord and c.studentStatus='CUR' and (c.studentGrade='AD' or c.studentGrade='12')") + Integer countBySchoolOfRecordAmalgamated(String schoolOfRecord); + // Data Conversion @Modifying @Query(value="insert into STUDENT_GUID_PEN_XREF(STUDENT_GUID, STUDENT_PEN, CREATE_USER, CREATE_DATE, UPDATE_USER, UPDATE_DATE)\n" diff --git a/api/src/main/java/ca/bc/gov/educ/api/gradstudent/service/GraduationStatusService.java b/api/src/main/java/ca/bc/gov/educ/api/gradstudent/service/GraduationStatusService.java index 40322714..1541df34 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/gradstudent/service/GraduationStatusService.java +++ b/api/src/main/java/ca/bc/gov/educ/api/gradstudent/service/GraduationStatusService.java @@ -1365,6 +1365,10 @@ public List getStudentsForAmalgamatedSchoolReport(String schoolOfRecord,St return graduationStatusTransformer.tToDForAmalgamation(graduationStatusRepository.findBySchoolOfRecordAndStudentStatusAndStudentGradeIn(schoolOfRecord, "CUR", List.of("AD", "12")),type); } + public Integer countStudentsForAmalgamatedSchoolReport(String schoolOfRecord) { + return graduationStatusRepository.countBySchoolOfRecordAmalgamated(schoolOfRecord); + } + public void updateStudentFlagReadyForBatchJobByStudentIDs(String batchJobType, List studentIDs) { logger.debug("updateStudentFlagReadyForBatchJobByStudentIDs"); for(UUID uuid: studentIDs) { diff --git a/api/src/main/java/ca/bc/gov/educ/api/gradstudent/util/EducGradStudentApiConstants.java b/api/src/main/java/ca/bc/gov/educ/api/gradstudent/util/EducGradStudentApiConstants.java index aa1511d3..89bbc849 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/gradstudent/util/EducGradStudentApiConstants.java +++ b/api/src/main/java/ca/bc/gov/educ/api/gradstudent/util/EducGradStudentApiConstants.java @@ -54,6 +54,7 @@ public class EducGradStudentApiConstants { public static final String GRAD_STUDENT_BY_STUDENT_ID_FOR_BATCH_RUN = "/batch/gradstudent/studentid/{studentID}"; public static final String STUDENT_LIST_FOR_SCHOOL_REPORT = "/batch/schoolreport/{schoolOfRecord}"; public static final String STUDENT_LIST_FOR_AMALGAMATED_SCHOOL_REPORT = "/amalgamated/schoolreport/{schoolOfRecord}/type/{type}"; + public static final String STUDENT_COUNT_FOR_AMALGAMATED_SCHOOL_REPORT = "/amalgamated/schoolreport/{schoolOfRecord}/count"; public static final String STUDENT_RECORD_STUDENT_ID_BATCH_RUN = "/batch/{studentID}"; public static final String GET_STUDENT_STATUS_BY_STATUS_CODE_MAPPING = "/checkstudentstatus/{statusCode}"; public static final String UNGRAD_STUDENT = "/undocompletionstudent/studentid/{studentID}"; diff --git a/api/src/test/java/ca/bc/gov/educ/api/gradstudent/controller/GraduationStatusControllerTest.java b/api/src/test/java/ca/bc/gov/educ/api/gradstudent/controller/GraduationStatusControllerTest.java index 040e6dd7..e8905fe6 100644 --- a/api/src/test/java/ca/bc/gov/educ/api/gradstudent/controller/GraduationStatusControllerTest.java +++ b/api/src/test/java/ca/bc/gov/educ/api/gradstudent/controller/GraduationStatusControllerTest.java @@ -593,6 +593,16 @@ public void testGetStudentsForAmalgamatedSchoolReport() { Mockito.verify(graduationStatusService).getStudentsForAmalgamatedSchoolReport(mincode,"TVRNONGRAD"); } + @Test + public void testGetStudentsCountForAmalgamatedSchoolReport() { + // ID + String mincode = "123456789"; + UUID studentID = UUID.randomUUID(); + Mockito.when(graduationStatusService.countStudentsForAmalgamatedSchoolReport(mincode)).thenReturn(1); + graduationStatusController.getStudentsCountForAmalgamatedSchoolReport(mincode); + Mockito.verify(graduationStatusService).countStudentsForAmalgamatedSchoolReport(mincode); + } + @Test public void testGetStudentForBatch() { String mincode = "123456789"; diff --git a/api/src/test/java/ca/bc/gov/educ/api/gradstudent/service/GraduationStatusServiceTest.java b/api/src/test/java/ca/bc/gov/educ/api/gradstudent/service/GraduationStatusServiceTest.java index 275b7ee6..41ba286b 100644 --- a/api/src/test/java/ca/bc/gov/educ/api/gradstudent/service/GraduationStatusServiceTest.java +++ b/api/src/test/java/ca/bc/gov/educ/api/gradstudent/service/GraduationStatusServiceTest.java @@ -2882,6 +2882,15 @@ public void testGetDataForBatch_else() { assertThat(res).isNotNull(); } + @Test + public void testGetStudentsCountForAmalgamatedSchoolReport() { + Mockito.when(graduationStatusRepository.countBySchoolOfRecordAmalgamated("12345678")).thenReturn(1); + + Integer count = graduationStatusService.countStudentsForAmalgamatedSchoolReport("12345678"); + assertThat(count).isNotNull().isEqualTo(1); + + } + @Test public void testGetStudentsForAmalgamatedSchoolReport() { List res = amalgamatedReports("TVRNONGRAD",false); From bed95f184ad463ba84930e46c8f7ac5ca98c9544 Mon Sep 17 00:00:00 2001 From: githubmamatha <106563495+githubmamatha@users.noreply.github.com> Date: Fri, 5 Jul 2024 13:30:38 -0700 Subject: [PATCH 3/3] Update pom.xml --- api/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/pom.xml b/api/pom.xml index f87aceaf..8ea119d7 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -6,7 +6,7 @@ ca.bc.gov.educ educ-grad-student-api - 1.8.60 + 1.8.61 educ-grad-student-api Student Demographics API for GRAD team