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

Updating release branch with patch code #666

Merged
merged 6 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
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 @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
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_prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
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 @@ -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:
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-student-api</artifactId>
<version>1.8.60</version>
<version>1.8.61</version>
<name>educ-grad-student-api</name>
<description>Student Demographics API for GRAD team</description>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,15 @@ public ResponseEntity<List<UUID>> 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<Integer> 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" })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ public interface GraduationStudentRecordRepository extends JpaRepository<Graduat

List<GraduationStudentRecordView> findBySchoolOfRecordAndStudentStatusAndStudentGradeIn(String schoolOfRecord, String studentStatus, List<String> 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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1365,6 +1365,10 @@ public List<UUID> 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<UUID> studentIDs) {
logger.debug("updateStudentFlagReadyForBatchJobByStudentIDs");
for(UUID uuid: studentIDs) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<UUID> res = amalgamatedReports("TVRNONGRAD",false);
Expand Down
Loading