-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #490 from bcgov/feature/GRAD2-2325
GRAD2-2325: hypothetical grad algorithm support is added.
- Loading branch information
Showing
12 changed files
with
734 additions
and
21 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
api/src/main/java/ca/bc/gov/educ/api/graduation/controller/EdwSnapshotController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package ca.bc.gov.educ.api.graduation.controller; | ||
|
||
import ca.bc.gov.educ.api.graduation.model.dto.EdwGraduationSnapshot; | ||
import ca.bc.gov.educ.api.graduation.service.EdwSnapshotService; | ||
import ca.bc.gov.educ.api.graduation.util.EducGraduationApiConstants; | ||
import ca.bc.gov.educ.api.graduation.util.GradValidation; | ||
import ca.bc.gov.educ.api.graduation.util.PermissionsContants; | ||
import ca.bc.gov.educ.api.graduation.util.ResponseHelper; | ||
import io.swagger.v3.oas.annotations.OpenAPIDefinition; | ||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.info.Info; | ||
import io.swagger.v3.oas.annotations.responses.ApiResponse; | ||
import io.swagger.v3.oas.annotations.responses.ApiResponses; | ||
import io.swagger.v3.oas.annotations.security.SecurityRequirement; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.security.access.prepost.PreAuthorize; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
@CrossOrigin | ||
@RestController | ||
@RequestMapping(EducGraduationApiConstants.GRADUATION_API_ROOT_MAPPING) | ||
@OpenAPIDefinition(info = @Info(title = "API for EDW Snapshot of Graduation Status", description = "This API is for EDW Snapshot of Graduation Status.", version = "1"), security = {@SecurityRequirement(name = "OAUTH2", scopes = {"GRAD_GRADUATE_STUDENT"})}) | ||
public class EdwSnapshotController { | ||
|
||
private static final Logger LOGGER = LoggerFactory.getLogger(EdwSnapshotController.class); | ||
private static final String BEARER = "Bearer "; | ||
|
||
@Autowired | ||
EdwSnapshotService edwSnapshotService; | ||
|
||
@Autowired | ||
GradValidation validation; | ||
|
||
@Autowired | ||
ResponseHelper response; | ||
|
||
@PostMapping(EducGraduationApiConstants.EDW_GRADUATION_SNAPSHOT) | ||
@PreAuthorize(PermissionsContants.GRADUATE_STUDENT) | ||
@Operation(summary = "Run a Graduation snapshot for EDW", description = "Run a Graduation snapshot for EDW", tags = { "EDW Snapshot" }) | ||
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK")}) | ||
public ResponseEntity<EdwGraduationSnapshot> snapshotGraduationStatus(@RequestBody EdwGraduationSnapshot snapshotRequest, @RequestHeader(name="Authorization") String accessToken) { | ||
LOGGER.debug("Snapshot Graduation Status for Student - pen# {}", snapshotRequest.getPen()); | ||
return response.GET(edwSnapshotService.processSnapshot(snapshotRequest, accessToken.replace(BEARER, ""))); | ||
} | ||
|
||
} |
50 changes: 50 additions & 0 deletions
50
api/src/main/java/ca/bc/gov/educ/api/graduation/model/dto/EdwGraduationSnapshot.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package ca.bc.gov.educ.api.graduation.model.dto; | ||
|
||
import com.fasterxml.jackson.annotation.JsonFormat; | ||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.math.BigDecimal; | ||
import java.time.LocalDate; | ||
import java.util.UUID; | ||
|
||
import static ca.bc.gov.educ.api.graduation.util.EducGraduationApiConstants.DEFAULT_DATE_FORMAT; | ||
|
||
@Data | ||
@Builder | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class EdwGraduationSnapshot { | ||
private UUID studentID; | ||
|
||
private Integer gradYear; | ||
private String pen; | ||
private String graduationFlag; | ||
private String honoursStanding; | ||
private BigDecimal gpa; | ||
private String graduatedDate; | ||
|
||
private String nonGradReason1; | ||
private String nonGradReason2; | ||
private String nonGradReason3; | ||
private String nonGradReason4; | ||
private String nonGradReason5; | ||
private String nonGradReason6; | ||
private String nonGradReason7; | ||
private String nonGradReason8; | ||
private String nonGradReason9; | ||
private String nonGradReason10; | ||
private String nonGradReason11; | ||
private String nonGradReason12; | ||
|
||
@JsonFormat(pattern=DEFAULT_DATE_FORMAT) | ||
private LocalDate runDate; | ||
@JsonFormat(pattern=DEFAULT_DATE_FORMAT) | ||
private LocalDate sessionDate; | ||
|
||
private String schoolOfRecord; | ||
} |
81 changes: 81 additions & 0 deletions
81
api/src/main/java/ca/bc/gov/educ/api/graduation/model/dto/StudentNonGradReason.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
package ca.bc.gov.educ.api.graduation.model.dto; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
import java.util.UUID; | ||
|
||
@Data | ||
@Builder | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@JsonIgnoreProperties(ignoreUnknown = true) | ||
public class StudentNonGradReason { | ||
|
||
private UUID graduationStudentRecordId; | ||
private String pen; | ||
|
||
private String transcriptRule1; | ||
private String description1; | ||
private String gradRule1; | ||
private String projected1; | ||
|
||
private String transcriptRule2; | ||
private String description2; | ||
private String gradRule2; | ||
private String projected2; | ||
|
||
private String transcriptRule3; | ||
private String description3; | ||
private String gradRule3; | ||
private String projected3; | ||
|
||
private String transcriptRule4; | ||
private String description4; | ||
private String gradRule4; | ||
private String projected4; | ||
|
||
private String transcriptRule5; | ||
private String description5; | ||
private String gradRule5; | ||
private String projected5; | ||
|
||
private String transcriptRule6; | ||
private String description6; | ||
private String gradRule6; | ||
private String projected6; | ||
|
||
private String transcriptRule7; | ||
private String description7; | ||
private String gradRule7; | ||
private String projected7; | ||
|
||
private String transcriptRule8; | ||
private String description8; | ||
private String gradRule8; | ||
private String projected8; | ||
|
||
private String transcriptRule9; | ||
private String description9; | ||
private String gradRule9; | ||
private String projected9; | ||
|
||
private String transcriptRule10; | ||
private String description10; | ||
private String gradRule10; | ||
private String projected10; | ||
|
||
private String transcriptRule11; | ||
private String description11; | ||
private String gradRule11; | ||
private String projected11; | ||
|
||
private String transcriptRule12; | ||
private String description12; | ||
private String gradRule12; | ||
private String projected12; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.