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

GRAD2-2642: task is completed. #728

Merged
merged 8 commits into from
Jan 9, 2025
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 @@ -214,15 +214,15 @@ public ResponseEntity<List<StudentGradeCode>> getAllStudentGradeCodes() {
return response.GET(commonService.getAllStudentGradeCodes());
}

@GetMapping(EducGradStudentApiConstants.GET_ALL_STUDENT_REPORT_DATA_BY_MINCODE)
@GetMapping(EducGradStudentApiConstants.GET_ALL_STUDENT_REPORT_DATA_BY_SCHOOL_ID)
@PreAuthorize(PermissionsConstants.READ_GRAD_STUDENT_STATUS)
@Operation(summary = "Find a Student Graduation Data by Mininstry Code",
description = "Find a Student Graduation Data by Mininstry Code", tags = {"Student Graduation Data for School Reports"})
@Operation(summary = "Find a Student Graduation Data by Institute School Id",
description = "Find a Student Graduation Data by Institute School Id", tags = {"Student Graduation Data for School Reports"})
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK"),
@ApiResponse(responseCode = "204", description = "NO CONTENT.")})
public ResponseEntity<List<ReportGradStudentData>> getStudentReportDataByMincode(@PathVariable String mincode) {
logger.debug("getStudentReportDataByMincode : {}", mincode);
return response.GET(gradStudentReportService.getGradStudentDataByMincode(mincode));
public ResponseEntity<List<ReportGradStudentData>> getStudentReportDataBySchoolId(@PathVariable UUID schoolId) {
logger.debug("getStudentReportDataByMincode : {}", schoolId);
return response.GET(gradStudentReportService.getGradStudentDataBySchoolId(schoolId));
}

@PostMapping(EducGradStudentApiConstants.GET_ALL_STUDENT_REPORT_DATA)
Expand All @@ -247,15 +247,26 @@ public ResponseEntity<List<ReportGradStudentData>> getStudentReportDataForYearEn
return response.GET(gradStudentReportService.getGradStudentDataForNonGradYearEndReport());
}

@GetMapping(EducGradStudentApiConstants.GET_ALL_STUDENT_NON_GRAD_REPORT_DATA_MINCODE)
@GetMapping(EducGradStudentApiConstants.GET_ALL_STUDENT_NON_GRAD_REPORT_DATA_BY_SCHOOL_ID)
@PreAuthorize(PermissionsConstants.READ_GRAD_STUDENT_STATUS)
@Operation(summary = "Find a Student Graduation Data for Year End School Report",
description = "Find a Student Graduation Data for Year End School Report", tags = {"Student Graduation Data for School Reports"})
@Operation(summary = "Find a Student Graduation Data for Year End School Report by School Id",
description = "Find a Student Graduation Data for Year End School Report by School Id", tags = {"Student Graduation Data for School Reports"})
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK"),
@ApiResponse(responseCode = "204", description = "NO CONTENT.")})
public ResponseEntity<List<ReportGradStudentData>> getStudentReportDataForYearEndNonGrad(@PathVariable String mincode) {
logger.debug("getStudentReportDataForYearEndNonGrad :");
return response.GET(gradStudentReportService.getGradStudentDataForNonGradYearEndReport(mincode));
public ResponseEntity<List<ReportGradStudentData>> getStudentReportDataForYearEndNonGrad(@PathVariable UUID schoolId) {
logger.debug("getStudentReportDataForYearEndNonGrad By School");
return response.GET(gradStudentReportService.getGradStudentDataForNonGradYearEndReportBySchool(schoolId));
}

@GetMapping(EducGradStudentApiConstants.GET_ALL_STUDENT_NON_GRAD_REPORT_DATA_BY_DISTRICT_ID)
@PreAuthorize(PermissionsConstants.READ_GRAD_STUDENT_STATUS)
@Operation(summary = "Find a Student Graduation Data for Year End School Report by District Id",
description = "Find a Student Graduation Data for Year End School Report by District Id", tags = {"Student Graduation Data for School Reports"})
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK"),
@ApiResponse(responseCode = "204", description = "NO CONTENT.")})
public ResponseEntity<List<ReportGradStudentData>> getStudentReportDataForYearEndNonGradByDistrict(@PathVariable UUID districtId) {
logger.debug("getStudentReportDataForYearEndNonGrad By District:");
return response.GET(gradStudentReportService.getGradStudentDataForNonGradYearEndReportByDistrict(districtId));
}

@GetMapping(EducGradStudentApiConstants.GET_ALL_SCHOOL_NON_GRAD_REPORT_DATA)
Expand All @@ -264,7 +275,7 @@ public ResponseEntity<List<ReportGradStudentData>> getStudentReportDataForYearEn
description = "Find Schools for Year End School Report", tags = {"Schools for Year End School Reports"})
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK"),
@ApiResponse(responseCode = "204", description = "NO CONTENT.")})
public ResponseEntity<List<String>> getSchoolReportDataForYearEndNonGrad() {
public ResponseEntity<List<UUID>> getSchoolReportDataForYearEndNonGrad() {
logger.debug("getSchoolReportDataForYearEndNonGrad :");
return response.GET(gradStudentReportService.getGradSchoolsForNonGradYearEndReport());
}
Expand All @@ -275,9 +286,9 @@ public ResponseEntity<List<String>> getSchoolReportDataForYearEndNonGrad() {
description = "Find Schools for Year End School Report", tags = {"Schools for Year End School Reports"})
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK"),
@ApiResponse(responseCode = "204", description = "NO CONTENT.")})
public ResponseEntity<List<String>> getDistrictReportDataForYearEndNonGrad() {
public ResponseEntity<List<UUID>> getDistrictReportDataForYearEndNonGrad(@RequestHeader(name="Authorization") String accessToken) {
logger.debug("getSchoolReportDataForYearEndNonGrad :");
return response.GET(gradStudentReportService.getGradDistrictsForNonGradYearEndReport());
return response.GET(gradStudentReportService.getGradDistrictsForNonGradYearEndReport(accessToken.replace(BEARER, "")));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use access token? We should try to get rid of these

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be handled in a new ticket.

}

@PostMapping(EducGradStudentApiConstants.GET_DECEASED_STUDENT_ID)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -366,45 +366,45 @@ public ResponseEntity<ApiResponseModel<Integer>> updateStudentGradHistoryStatusD

@GetMapping (EducGradStudentApiConstants.STUDENT_LIST_FOR_SCHOOL_REPORT)
@PreAuthorize(PermissionsConstants.READ_GRADUATION_STUDENT)
@Operation(summary = "Get Students For School Report by mincode", description = "Get Students For School Report by mincode", tags = { "Batch Algorithm" })
@Operation(summary = "Get Students For School Report by schoolId", description = "Get Students For School Report by schoolId", tags = { "Batch Algorithm" })
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK")})
public ResponseEntity<List<GraduationStudentRecord>> getStudentsForSchoolReport(@PathVariable String schoolOfRecord) {
public ResponseEntity<List<GraduationStudentRecord>> getStudentsForSchoolReport(@PathVariable UUID schoolId) {
logger.debug("getStudentsForSchoolReport:");
return response.GET(gradStatusService.getStudentsForSchoolReport(schoolOfRecord));
return response.GET(gradStatusService.getStudentsForSchoolReport(schoolId));
}

@GetMapping (EducGradStudentApiConstants.STUDENT_LIST_FOR_AMALGAMATED_SCHOOL_REPORT)
@PreAuthorize(PermissionsConstants.READ_GRADUATION_STUDENT)
@Operation(summary = "Get Students For School Report by mincode", description = "Get Students For School Report by mincode", tags = { "Business" })
@Operation(summary = "Get Students For School Report by schoolId", description = "Get Students For School Report by schoolId", tags = { "Business" })
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK")})
public ResponseEntity<List<UUID>> getStudentsForAmalgamatedSchoolReport(@PathVariable String schoolOfRecord, @PathVariable String type) {
public ResponseEntity<List<UUID>> getStudentsForAmalgamatedSchoolReport(@PathVariable UUID schoolId, @PathVariable String type) {
logger.debug("getStudentsForSchoolReport:");
return response.GET(gradStatusService.getStudentsForAmalgamatedSchoolReport(schoolOfRecord,type));
return response.GET(gradStatusService.getStudentsForAmalgamatedSchoolReport(schoolId,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" })
@Operation(summary = "Get Students Count For School Report by schoolId", description = "Get Students Count For School Report by schoolId", tags = { "Business" })
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK")})
public ResponseEntity<Integer> getStudentsCountForAmalgamatedSchoolReport(@PathVariable String schoolOfRecord) {
public ResponseEntity<Integer> getStudentsCountForAmalgamatedSchoolReport(@PathVariable UUID schoolId) {
logger.debug("getStudentsCountForAmalgamatedSchoolReport:");
return response.GET(gradStatusService.countStudentsForAmalgamatedSchoolReport(schoolOfRecord));
return response.GET(gradStatusService.countStudentsForAmalgamatedSchoolReport(schoolId));
}

@PostMapping (EducGradStudentApiConstants.STUDENT_COUNT)
@PreAuthorize(PermissionsConstants.READ_GRADUATION_STUDENT)
@Operation(summary = "Get Students Count by mincode and status", description = "Get Students Count by mincode and status", tags = { "Business" })
@Operation(summary = "Get Students Count by schoolId and status", description = "Get Students Count by schoolId and status", tags = { "Business" })
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK")})
public ResponseEntity<Long> getStudentsCount(@RequestParam(required = false) String studentStatus, @RequestBody List<String> schoolOfRecords) {
return response.GET(gradStatusService.countBySchoolOfRecordsAndStudentStatus(schoolOfRecords, studentStatus));
public ResponseEntity<Long> getStudentsCount(@RequestParam(required = false) String studentStatus, @RequestBody List<UUID> schoolIds) {
return response.GET(gradStatusService.countBySchoolOfRecordIdsAndStudentStatus(schoolIds, studentStatus));
}

@PostMapping (EducGradStudentApiConstants.STUDENT_ARCHIVE)
@PreAuthorize(PermissionsConstants.ARCHIVE_GRADUATION_STUDENT)
@Operation(summary = "Get Students 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> archiveStudents(@RequestParam long batchId, @RequestParam(required = false) String studentStatus, @RequestParam(required = false) String userName, @RequestBody List<String> schoolOfRecords) {
return response.GET(gradStatusService.archiveStudents(batchId, schoolOfRecords, studentStatus, userName));
public ResponseEntity<Integer> archiveStudents(@RequestParam long batchId, @RequestParam(required = false) String studentStatus, @RequestParam(required = false) String userName, @RequestBody List<UUID> schoolIds) {
return response.GET(gradStatusService.archiveStudents(batchId, schoolIds, studentStatus, userName));
}

@PostMapping (EducGradStudentApiConstants.UPDATE_GRAD_STUDENT_FLAG_BY_BATCH_JOB_TYPE_AND_MULTIPLE_STUDENTIDS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ private String getResponse(GradStudentRecord studentRecord) throws JsonProcessin
.program(studentRecord.getProgram())
.programCompletionDate(studentRecord.getProgramCompletionDate() != null ? EducGradStudentApiUtils.formatDate(studentRecord.getProgramCompletionDate()) : null)
.schoolOfRecord(studentRecord.getSchoolOfRecord())
.schoolOfRecordId(String.valueOf(studentRecord.getSchoolOfRecordId()))
.studentStatusCode(studentRecord.getStudentStatus())
.graduated(gradStudentService.parseGraduationStatus(studentRecord.getStudentProjectedGradData()).toString())
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ public class GradStudentRecordPayload {
private String program;
private String programCompletionDate;
private String schoolOfRecord;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we get rid of schoolOfRecord?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this is DTO EDX is using. We need a separate ticket to handle the changes in the shared interface between 2 systems.

private String schoolOfRecordId;
private String studentStatusCode;
private String graduated;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ public class BatchGraduationStudentRecord {
private UUID studentID;
private String program;
private String programCompletionDate;
private String schoolOfRecord;
private UUID schoolOfRecordId;

public BatchGraduationStudentRecord(String program, Date programCompletionDate, String schoolOfRecord, UUID studentID) {
public BatchGraduationStudentRecord(String program, Date programCompletionDate, UUID schoolOfRecordId, UUID studentID) {
this.program = program;
this.programCompletionDate = EducGradStudentApiUtils.formatDate(programCompletionDate, PROGRAM_COMPLETION_DATE_FORMAT);
this.schoolOfRecord = schoolOfRecord;
this.schoolOfRecordId = schoolOfRecordId;
this.studentID = studentID;
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.UUID;

import static ca.bc.gov.educ.api.gradstudent.util.EducGradStudentApiConstants.DEFAULT_DATE_FORMAT;

Expand All @@ -31,4 +32,5 @@ public class EdwGraduationSnapshot {
private LocalDate sessionDate;

private String schoolOfRecord;
private UUID schoolOfRecordId;
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
@JsonIgnoreProperties
public class GraduationData {
private GradSearchStudent gradStudent;
private School school;
private SchoolClob school;
private String gradMessage;
private List<GradRequirement> nonGradReasons;
private boolean dualDogwood;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,12 @@ public class GraduationStudentRecord extends BaseModel {
private String gpa;
private String honoursStanding;
private String recalculateGradStatus;
private String schoolOfRecord;
private UUID schoolOfRecordId;
private String schoolName;
private String studentGrade;
private String studentStatus;
private String studentStatusName;
private UUID studentID;
private String schoolAtGrad;
private UUID schoolAtGradId;
private String schoolAtGradName;
private String recalculateProjectedGrad;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ public class GraduationStudentRecordDistribution extends BaseModel{
private String legalFirstName;
private String legalMiddleNames;
private String legalLastName;
private String schoolOfRecord;
private String schoolAtGrad;
private UUID schoolOfRecordId;
private UUID schoolAtGradId;
private String programCompletionDate;
private String honoursStanding;
private String program;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,10 @@ public class GraduationStudentRecordHistory extends BaseModel{
private String gpa;
private String honoursStanding;
private String recalculateGradStatus;
private String schoolOfRecord;
private UUID schoolOfRecordId;
private String studentGrade;
private String studentStatus;
private UUID studentID;
private String schoolAtGrad;
private UUID schoolAtGradId;
private String recalculateProjectedGrad;
private Long batchId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class GraduationStudentRecordSearchResult {
public static final String PEN_VALIDATION_ERROR = "STUDENTs not exist in GRAD:";
public static final String STUDENT_STATUS_VALIDATION_WARNING = "WARNING: STUDENTs with status %s:";
public static final String STUDENT_STATUS_VALIDATION_ERROR = "ERROR: STUDENTs with status %s:";
public static final String MINCODE_VALIDATION_ERROR = "The following MINCODEs not exist:";
public static final String SCHOOL_VALIDATION_ERROR = "The following SCHOOLs not exist:";
public static final String DISTRICT_VALIDATION_ERROR = "The following DISTRICTs not exist:";
public static final String PROGRAM_VALIDATION_ERROR = "The following PROGRAMs not exist in GRAD:";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,9 @@ public class ReportGradStudentData implements Serializable {
private static final long serialVersionUID = 1L;

private UUID graduationStudentRecordId;
private String mincode;
private String mincodeAtGrad;
private String schoolOfRecordId;
private String schoolAtGradId;
private String distcode;
private String distcodeAtGrad;
private UUID schoolOfRecordId;
private UUID schoolAtGradId;
private UUID districtId;
private String pen;
private String firstName;
private String middleName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

@Data
@Component
public class School {
public class SchoolClob {

private String minCode;
private String schoolId;
Expand Down Expand Up @@ -50,7 +50,7 @@ public String getPostal() {

@Override
public String toString() {
return "School [minCode=" + minCode + ", schoolId=" + schoolId + ", schoolName=" + schoolName + ", schoolCategoryCode=" + schoolCategoryCode + ", schoolCategoryLegacyCode=" + schoolCategoryLegacyCode
return "SchoolClob [minCode=" + minCode + ", schoolId=" + schoolId + ", schoolName=" + schoolName + ", schoolCategoryCode=" + schoolCategoryCode + ", schoolCategoryLegacyCode=" + schoolCategoryLegacyCode
+ ", districtId=" + districtId + ", districtName=" + districtName + ", transcriptEligibility=" + transcriptEligibility + ", certificateEligibility=" + certificateEligibility
+ ", address1=" + address1 + ", address2=" + address2 + ", city=" + city + ", provCode=" + provCode + ", countryCode=" + countryCode + ", postal=" + postal + ", openFlag=" + openFlag
+ "]";
Expand Down
Loading
Loading