-
Notifications
You must be signed in to change notification settings - Fork 1
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-3181 V2 for Mincode and District Reports #162
Conversation
# Conflicts: # api/src/main/java/ca/bc/gov/educ/api/gradbusiness/util/EducGradBusinessApiConstants.java # api/src/main/resources/application.yaml # api/src/test/resources/application.yaml
api/src/main/java/ca/bc/gov/educ/api/gradbusiness/controller/v2/DistrictController.java
Outdated
Show resolved
Hide resolved
@GetMapping(EducGradBusinessApiConstants.SCHOOL_REPORT_PDF_DISTCODE_V2) | ||
@PreAuthorize("hasAuthority('SCOPE_READ_GRAD_SCHOOL_REPORT')") | ||
@Operation(summary = "Get School Report pdf from graduation by distcode and report type", description = "Get School Report pdf from graduation by distcode and report type", tags = { "Graduation Data" }) | ||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK")}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rename all the schoolReport references to districtReport for the district endpoints?
} | ||
|
||
@GetMapping(EducGradBusinessApiConstants.SCHOOL_REPORT_PDF_DISTCODE_V2) | ||
@PreAuthorize("hasAuthority('SCOPE_READ_GRAD_SCHOOL_REPORT')") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This scope should stay the same as the old endpoint SCOPE_GET_GRADUATION_DATA
api/src/main/java/ca/bc/gov/educ/api/gradbusiness/controller/v2/SchoolController.java
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,36 @@ | |||
package ca.bc.gov.educ.api.gradbusiness.model.dto.v2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This object looks identical to the existing school object, so we don't need it. Can you verify?
api/src/main/java/ca/bc/gov/educ/api/gradbusiness/service/v2/DistrictService.java
Outdated
Show resolved
Hide resolved
api/src/main/java/ca/bc/gov/educ/api/gradbusiness/service/v2/DistrictService.java
Outdated
Show resolved
Hide resolved
api/src/main/java/ca/bc/gov/educ/api/gradbusiness/service/v2/DistrictService.java
Outdated
Show resolved
Hide resolved
return response; | ||
} | ||
|
||
public List<School> getSchoolDetails(String mincode) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be called from the existing SchoolService class. A v2 version isn't needed
api/src/main/java/ca/bc/gov/educ/api/gradbusiness/util/EducGradBusinessApiConstants.java
Outdated
Show resolved
Hide resolved
api/src/main/java/ca/bc/gov/educ/api/gradbusiness/util/EducGradBusinessUtil.java
Outdated
Show resolved
Hide resolved
api/src/main/java/ca/bc/gov/educ/api/gradbusiness/util/EducGraduationApiConstants.java
Outdated
Show resolved
Hide resolved
@RestController | ||
@RequestMapping(EducGraduationApiConstants.GRAD_BUSINESS_API_ROOT_MAPPING) | ||
@Slf4j | ||
@OpenAPIDefinition(info = @Info(title = "API for School Data.", description = "This Read API is for Reading school data from TRAX.", version = "2"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you update the open api description
@Slf4j | ||
@OpenAPIDefinition(info = @Info(title = "API for School Data.", description = "This Read API is for Reading school data from TRAX.", version = "2"), | ||
security = {@SecurityRequirement(name = "OAUTH2", scopes = {"GET_GRADUATION_DATA"})}) | ||
public class SchoolAndDistrictController { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add report to the controller name
@GetMapping(EducGradBusinessApiConstants.SCHOOL_REPORT_PDF_MINCODE_V2) | ||
@PreAuthorize("hasAuthority('SCOPE_GET_GRADUATION_DATA')") | ||
@Operation(summary = "Get School Report pdf from graduation by mincode and report type", description = "Get School Report pdf from graduation by mincode and report type", tags = { "Graduation Data" }) | ||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK")}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add 404 to both the api repsponses annotations
@@ -323,7 +324,7 @@ void testgetAmalgamatedSchoolReportPDFByMincode() throws Exception { | |||
|
|||
byteData = gradBusinessService.getAmalgamatedSchoolReportPDFByMincode(mincode, type, "accessToken"); | |||
assertNotNull(byteData); | |||
assertNull(byteData.getBody()); | |||
//assertNull(byteData.getBody()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can delete this code
@@ -311,7 +312,7 @@ void testgetAmalgamatedSchoolReportPDFByMincode() throws Exception { | |||
|
|||
ResponseEntity<byte[]> byteData = gradBusinessService.getAmalgamatedSchoolReportPDFByMincode(mincode, type, "accessToken"); | |||
assertNotNull(byteData); | |||
assertNotNull(byteData.getBody()); | |||
//assertNotNull(byteData.getBody()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can delete this code
when(this.restService.get(any(String.class), any())).thenReturn(pdf); | ||
|
||
ResponseEntity<byte[]> byteData = gradBusinessService.getDistrictReportPDFByDistcode(distCode, type); | ||
//assertNotNull(byteData); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can delete commented out code
Quality Gate failedFailed conditions |
v2 endpoints school reports by mincode and distcode