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.23 #282

Merged
merged 44 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
1d02aa0
GRAD2-2817
arybakov-cgi Jun 27, 2024
bcc61c7
GRAD2-2817
arybakov-cgi Jul 2, 2024
937ec48
GRAD2-2817
arybakov-cgi Jul 2, 2024
5da8620
GRAD2-2817
arybakov-cgi Jul 2, 2024
aa504ea
GRAD2-2817
arybakov-cgi Jul 2, 2024
4cf8297
Merge pull request #270 from bcgov/develop/alex-GRAD2-2817
arybakov-cgi Jul 10, 2024
afed4ac
GRAD2-2322
arybakov-cgi Jul 17, 2024
2d10faf
GRAD2-2322
arybakov-cgi Jul 17, 2024
35a2869
GRAD2-2322
arybakov-cgi Jul 18, 2024
c6bcb98
GRAD2-2322
arybakov-cgi Jul 18, 2024
7b3ef2d
Added FROM to delete statement
arybakov-cgi Jul 23, 2024
a56369d
Merge pull request #272 from bcgov/develop/alex-GRAD2-2322
arybakov-cgi Jul 23, 2024
aa8d51b
Updated to Ubuntu 22.04 (#273)
cditcher Aug 9, 2024
0d93da4
GRAD2-2322 (#274)
arybakov-cgi Aug 19, 2024
8f4105c
GRAD2-2817
arybakov-cgi Aug 19, 2024
fd06123
GRAD2-2817
arybakov-cgi Aug 19, 2024
a25637a
GRAD2-2817
arybakov-cgi Aug 19, 2024
131ae82
GRAD2-2817
arybakov-cgi Aug 19, 2024
3863587
GRAD2-2817
arybakov-cgi Aug 19, 2024
9b81086
GRAD2-2817
arybakov-cgi Aug 19, 2024
88c7770
Merge pull request #275 from bcgov/develop/alex-GRAD2-2817
arybakov-cgi Aug 19, 2024
351c8aa
Added application-local to gitignore
Aug 20, 2024
f62c860
GRAD2-2817
arybakov-cgi Aug 20, 2024
c55ea2a
GRAD2-2817
arybakov-cgi Aug 21, 2024
384710a
GRAD2-2817
arybakov-cgi Aug 21, 2024
7f59df3
GRAD2-2817
arybakov-cgi Aug 21, 2024
db43f88
Merge pull request #276 from bcgov/develop/alex-GRAD2-2817
arybakov-cgi Aug 22, 2024
f6674e7
Update update-configmap.sh
cditcher Aug 23, 2024
84f1d16
WARN level log events i.e., Failed to validate connection oracle.jdb…
githubmamatha Aug 26, 2024
57be853
Merge pull request #277 from bcgov/Grad2-2871
githubmamatha Aug 26, 2024
06aa0dc
GRAD2-2817
arybakov-cgi Aug 27, 2024
fa361bc
Merge branch 'grad-release' of https://github.com/bcgov/EDUC-GRAD-GRA…
arybakov-cgi Aug 28, 2024
d96374f
GRAD2-2817
arybakov-cgi Aug 28, 2024
8287313
Merge pull request #278 from bcgov/develop/alex-GRAD2-2817
arybakov-cgi Aug 28, 2024
87bdd7c
GRAD2-2817
arybakov-cgi Sep 6, 2024
a777986
GRAD2-2817
arybakov-cgi Sep 6, 2024
b8a2808
Merge pull request #279 from bcgov/develop/alex-GRAD2-2817
arybakov-cgi Sep 6, 2024
a44f90d
GRAD2-2817
arybakov-cgi Sep 6, 2024
81df80c
GRAD2-2817
arybakov-cgi Sep 6, 2024
e701d12
Merge branch 'grad-release' of https://github.com/bcgov/EDUC-GRAD-GRA…
arybakov-cgi Sep 6, 2024
0a25c31
Merge pull request #280 from bcgov/develop/alex-GRAD2-2817
arybakov-cgi Sep 6, 2024
9c802ed
GRAD2-2817 (#281)
arybakov-cgi Sep 10, 2024
d86bb26
Increased header size
Sep 12, 2024
6aef499
Update pom.xml
githubmamatha Sep 12, 2024
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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,7 @@ target/
build/

### VS Code ###
.vscode/
.vscode/

### Local dev ###
**/application-local.yaml
55 changes: 0 additions & 55 deletions api/.gitignore

This file was deleted.

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-graduation-report-api</artifactId>
<version>1.8.49</version>
<version>1.8.50</version>
<name>educ-grad-graduation-report-api</name>
<description>Grad Graduation Report API for GRAD team</description>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public ResponseEntity<Boolean> getStudentReport(@PathVariable String reportTypeC
public ResponseEntity<ApiResponseModel<GradStudentReports>> saveStudentReport(@RequestBody GradStudentReports gradStudentReports,@RequestParam(value = "isGraduated", required = false, defaultValue = "false") boolean isGraduated) {
logger.debug("Save student Grad Report for Student ID: {}",gradStudentReports.getStudentID());
validation.requiredField(gradStudentReports.getStudentID(), "Student ID");
return response.UPDATED(commonService.saveGradReports(gradStudentReports,isGraduated));
return response.UPDATED(commonService.saveGradStudentReports(gradStudentReports,isGraduated));
}

@GetMapping(EducGradReportApiConstants.STUDENT_REPORT)
Expand All @@ -80,6 +80,28 @@ public ResponseEntity<InputStreamResource> getStudentReportByType(
return commonService.getStudentReportByType(UUID.fromString(studentID),reportType,documentStatusCode);
}

@DeleteMapping(EducGradReportApiConstants.STUDENT_REPORT_BY_STUDENTID)
@PreAuthorize(PermissionsConstants.DELETE_STUDENT_REPORT)
@Operation(summary = "Delete Student Reports by Student ID and Report Type", description = "Delete Student Reports by Student ID and Report Type", tags = { "Reports" })
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK")})
public ResponseEntity<Integer> deleteStudentReportByType(
@RequestParam(value = "reportType") String reportType,
@PathVariable UUID studentID) {
logger.debug("deleteStudentReportByType");
return response.GET(commonService.deleteStudentReports(studentID, reportType));
}

@PostMapping(EducGradReportApiConstants.STUDENT_REPORTS)
@PreAuthorize(PermissionsConstants.READ_GRADUATION_STUDENT_REPORTS)
@Operation(summary = "Read Student Reports by Student ID and Report Type", description = "Read Student Reports by Student ID and Report Type", tags = { "Reports" })
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK")})
public ResponseEntity<Long> processStudentReports(
@RequestParam(value = "reportTypeCode") String reportTypeCode,
@RequestBody List<UUID> studentIDs) {
logger.debug("processStudentReports : ");
return response.GET(commonService.processStudentReports(studentIDs, reportTypeCode));
}

@GetMapping(EducGradReportApiConstants.STUDENT_CERTIFICATES)
@PreAuthorize(PermissionsConstants.READ_GRADUATION_STUDENT_CERTIFICATES)
@Operation(summary = "Read Student Certificates by Student ID", description = "Read Student Certificates by Student ID", tags = { "Reports" })
Expand Down Expand Up @@ -374,5 +396,41 @@ public ResponseEntity<InputStreamResource> getStudentCredentialByType(@PathVaria
return commonService.getStudentCredentialByType(UUID.fromString(studentID),type);
}

@PostMapping (EducGradReportApiConstants.REPORT_COUNT)
@PreAuthorize(PermissionsConstants.READ_GRADUATION_STUDENT_REPORTS)
@Operation(summary = "Get Reports Count by mincode and status", description = "Get Students Count by mincode and status", tags = { "Business" })
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK")})
public ResponseEntity<Integer> getReportsCount(@RequestParam String reportType, @RequestBody List<String> reportContainerIds) {
if(StringUtils.containsAnyIgnoreCase(reportType, "ACHV")) {
return response.GET(commonService.countByStudentGuidsAndReportType(reportContainerIds, reportType));
} else {
return response.GET(commonService.countBySchoolOfRecordsAndReportType(reportContainerIds, reportType));
}
}

@PostMapping (EducGradReportApiConstants.STUDENT_REPORTS_BY_GUIDS)
@PreAuthorize(PermissionsConstants.READ_GRADUATION_STUDENT_REPORTS)
@Operation(summary = "Get Report Students Guids by mincode and type", description = "Get Report Students Guids by mincode and type", tags = { "Business" })
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK")})
public ResponseEntity<List<UUID>> getStudentIDsByIdentityAndReportType(@RequestParam String reportType, @RequestParam Integer rowCount, @RequestBody List<String> reportContainerIds) {
return response.GET(commonService.getStudentIDsByStudentGuidsAndReportType(reportContainerIds, reportType, rowCount));
}

@PostMapping (EducGradReportApiConstants.REPORT_ARCHIVE)
@PreAuthorize(PermissionsConstants.ARCHIVE_SCHOOL_REPORT)
@Operation(summary = "Archive Reports", description = "Archive Reports", tags = { "Business" })
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK")})
public ResponseEntity<Integer> archiveReports(@RequestParam long batchId, @RequestParam String reportType, @RequestBody List<String> schoolOfRecords) {
logger.debug("Archive Reports for batch {}", batchId);
return response.GET(commonService.archiveSchoolReports(batchId, schoolOfRecords, reportType));
}

@PostMapping (EducGradReportApiConstants.REPORT_DELETE)
@PreAuthorize(PermissionsConstants.DELETE_STUDENT_REPORT)
@Operation(summary = "Delete Reports", description = "Delete Reports", tags = { "Business" })
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK")})
public ResponseEntity<Integer> deleteReports(@RequestParam long batchId, @RequestParam String reportType, @RequestBody List<UUID> studentGuids) {
logger.debug("Delete Reports for batch {}", batchId);
return response.GET(commonService.deleteStudentReports(studentGuids, reportType));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
package ca.bc.gov.educ.api.grad.report.model.dto;

import java.io.Serializable;

public class Address implements Serializable {

private static final long serialVersionUID = 2L;

private String streetLine1;
private String streetLine2;
private String streetLine3;
private String city;
private String region;
private String country;
private String code;

public String getStreetLine1() {
return streetLine1;
}

public void setStreetLine1(String value) {
this.streetLine1 = value;
}

public String getStreetLine2() {
return streetLine2;
}

public void setStreetLine2(String value) {
this.streetLine2 = value;
}

public String getStreetLine3() {
return streetLine3;
}

public void setStreetLine3(String streetLine3) {
this.streetLine3 = streetLine3;
}

public String getCity() {
return city;
}

public void setCity(String value) {
this.city = value;
}

public String getRegion() {
return region;
}

public void setRegion(String value) {
this.region = value;
}

public String getCountry() {
return country;
}

public void setCountry(String value) {
this.country = value;
}

public String getCode() {
return code;
}

public void setCode(String value) {
this.code = value;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import java.io.Serializable;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

Expand All @@ -19,12 +20,17 @@
@AllArgsConstructor
@Builder
public class StudentSearchRequest implements Serializable {
private List<String> schoolOfRecords;
private List<String> districts;
private List<String> schoolCategoryCodes;
private List<String> pens;
private List<String> programs;
private List<UUID> studentIDs;
private List<String> schoolOfRecords = new ArrayList<>();
private List<String> districts = new ArrayList<>();
private List<String> schoolCategoryCodes = new ArrayList<>();
private List<String> pens = new ArrayList<>();
private List<String> programs = new ArrayList<>();
private List<UUID> studentIDs = new ArrayList<>();
private List<String> statuses = new ArrayList<>();
private List<String> reportTypes = new ArrayList();

private String user;
private Address address;

@JsonFormat(pattern= EducGradReportApiConstants.DEFAULT_DATE_FORMAT)
LocalDate gradDateFrom;
Expand All @@ -33,5 +39,15 @@ public class StudentSearchRequest implements Serializable {

Boolean validateInput;
String activityCode;
String localDownload;

public boolean isEmpty() {
return schoolOfRecords.isEmpty() &&
districts.isEmpty() &&
schoolCategoryCodes.isEmpty() &&
pens.isEmpty() &&
studentIDs.isEmpty() &&
programs.isEmpty();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

import ca.bc.gov.educ.api.grad.report.model.dto.SchoolStudentCredentialDistribution;
import ca.bc.gov.educ.api.grad.report.model.entity.GradStudentReportsEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

Expand All @@ -17,8 +20,18 @@ public interface GradStudentReportsRepository extends JpaRepository<GradStudentR

@Query("select c from GradStudentReportsEntity c where c.gradReportTypeCode=:reportType")
List<GradStudentReportsEntity> existsByReportTypeCode(String reportType);

long deleteByStudentID(UUID studentID);

@Modifying
@Query(value="DELETE from STUDENT_REPORT where GRADUATION_STUDENT_RECORD_ID in (:studentIDs) and REPORT_TYPE_CODE = :gradReportTypeCode", nativeQuery = true)
Integer deleteByStudentIDInAndGradReportTypeCode(List<UUID> studentIDs, String gradReportTypeCode);

@Modifying
@Query(value="DELETE from STUDENT_REPORT where REPORT_TYPE_CODE = :gradReportTypeCode", nativeQuery = true)
Integer deleteByGradReportTypeCode(String gradReportTypeCode);

@Modifying
@Query(value="DELETE from STUDENT_REPORT where GRADUATION_STUDENT_RECORD_ID = :studentID and REPORT_TYPE_CODE = :gradReportTypeCode", nativeQuery = true)
Integer deleteByStudentIDAndGradReportTypeCode(UUID studentID, String gradReportTypeCode);

List<GradStudentReportsEntity> findByStudentID(UUID studentID);

Expand All @@ -30,4 +43,16 @@ public interface GradStudentReportsRepository extends JpaRepository<GradStudentR

@Query("select new ca.bc.gov.educ.api.grad.report.model.dto.SchoolStudentCredentialDistribution(c.id,c.gradReportTypeCode,c.studentID,c.documentStatusCode) from GradStudentReportsEntity c where c.reportUpdateDate is null or c.reportUpdateDate < c.updateDate")
List<SchoolStudentCredentialDistribution> findByReportUpdateDate();

@Query("select count(*) from GradStudentReportsEntity c where c.studentID IN (:studentGuids) and c.gradReportTypeCode=:reportType")
Integer countByStudentGuidsAndReportType(List<UUID> studentGuids, String reportType);

@Query("select c.studentID from GradStudentReportsEntity c where c.studentID IN (:studentGuids) and c.gradReportTypeCode=:reportType")
Page<UUID> getReportStudentIDsByStudentIDsAndReportType(List<UUID> studentGuids, String reportType, Pageable page);

@Query("select count(*) from GradStudentReportsEntity c where c.gradReportTypeCode=:reportType")
Integer countByReportType(String reportType);

@Query("select c.studentID from GradStudentReportsEntity c where c.gradReportTypeCode=:reportType")
Page<UUID> findStudentIDByGradReportTypeCode(String reportType, Pageable page);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import ca.bc.gov.educ.api.grad.report.model.entity.SchoolReportsEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

Expand All @@ -23,4 +24,35 @@ public interface SchoolReportsRepository extends JpaRepository<SchoolReportsEnti

Optional<SchoolReportsEntity> findBySchoolOfRecordAndReportTypeCodeOrderBySchoolOfRecord(String schoolOfRecord, String reportTypeCode);

@Query("select count(*) from SchoolReportsLightEntity c where c.schoolOfRecord IN (:schoolOfRecords) and c.reportTypeCode=:reportType")
Integer countBySchoolOfRecordsAndReportType(List<String> schoolOfRecords, String reportType);

@Query("select count(*) from SchoolReportsLightEntity c where c.reportTypeCode=:reportType")
Integer countByReportType(String reportType);

@Query("select c.id from SchoolReportsLightEntity c where c.schoolOfRecord IN (:schoolOfRecords) and c.reportTypeCode=:reportType")
List<UUID> getReportGuidsBySchoolOfRecordsAndReportType(List<String> schoolOfRecords, String reportType);

@Query("select c.id from SchoolReportsLightEntity c where c.reportTypeCode=:reportType")
List<UUID> getReportGuidsByReportType(String reportType);

@Query("select c.schoolOfRecord from SchoolReportsLightEntity c where c.reportTypeCode=:reportType")
List<String> getReportSchoolOfRecordsByReportType(String reportType);

@Modifying
@Query(value="update SCHOOL_REPORT set REPORT_TYPE_CODE = :reportTypeTo, update_date = SYSDATE, update_user = 'Batch ' || :batchId || ' Archive Process' where school_of_record in (:schoolOfRecords) and REPORT_TYPE_CODE = :reportTypeFrom", nativeQuery=true)
Integer archiveSchoolReports(List<String> schoolOfRecords, String reportTypeFrom, String reportTypeTo, long batchId);

@Modifying
@Query(value="update SCHOOL_REPORT set REPORT_TYPE_CODE = :reportTypeTo, update_date = SYSDATE, update_user = 'Batch ' || :batchId || ' Archive Process' where REPORT_TYPE_CODE = :reportTypeFrom", nativeQuery=true)
Integer archiveSchoolReports(String reportTypeFrom, String reportTypeTo, long batchId);

@Modifying
@Query(value="delete from SCHOOL_REPORT where SCHOOL_REPORT_ID not in (:schoolReportGuids) and school_of_record in (:schoolOfRecords) and REPORT_TYPE_CODE = :archivedReportType", nativeQuery=true)
Integer deleteSchoolOfRecordsNotMatchingSchoolReports(List<UUID> schoolReportGuids, List<String> schoolOfRecords, String archivedReportType);

@Modifying
@Query(value="delete from SCHOOL_REPORT where SCHOOL_REPORT_ID not in (:schoolReportGuids) and REPORT_TYPE_CODE = :archivedReportType", nativeQuery=true)
Integer deleteAllNotMatchingSchoolReports(List<UUID> schoolReportGuids, String archivedReportType);

}
Loading
Loading