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-3181 V2 for Mincode and District Reports #162

Merged
merged 10 commits into from
Jan 6, 2025

Conversation

githubmamatha
Copy link
Contributor

v2 endpoints school reports by mincode and distcode

# 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
@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")})

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')")

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

@@ -0,0 +1,36 @@
package ca.bc.gov.educ.api.gradbusiness.model.dto.v2;

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?

return response;
}

public List<School> getSchoolDetails(String mincode) {

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

@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"),

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 {

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")})

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());

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());

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);

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

Copy link

sonarqubecloud bot commented Jan 6, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarQube Cloud

@githubmamatha githubmamatha merged commit 4944430 into grad-release Jan 6, 2025
5 of 6 checks passed
@githubmamatha githubmamatha deleted the feature/Grad2-3181 branch January 6, 2025 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants