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-2389, 2390, 2412: task is complete. #590

Merged
merged 5 commits into from
Nov 30, 2023
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
@@ -0,0 +1,15 @@
package ca.bc.gov.educ.api.gradstudent.constant;

public enum FieldName {
SCHOOL_OF_RECORD,
GRAD_PROGRAM,
ADULT_START_DATE,
SLP_DATE,
STUDENT_GRADE,
CITIZENSHIP,
STUDENT_STATUS,

RECALC_GRAD_ALG,
RECALC_TVR

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package ca.bc.gov.educ.api.gradstudent.constant;

public enum FieldType {
STRING,
DATE
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package ca.bc.gov.educ.api.gradstudent.constant;

public enum TraxEventType {
/* ===========================================================
Incremental updates from Trax to Grad
=============================================================*/
/**
* Trax update type
*/
NEWSTUDENT,
UPD_DEMOG,
UPD_GRAD,
UPD_STD_STATUS,
XPROGRAM,
ASSESSMENT,
COURSE,
FI10ADD
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,20 @@ public class DataConversionController {
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK")})
public ResponseEntity<GraduationStudentRecord> saveStudentGradStatus(@PathVariable String studentID,
@RequestParam(value = "ongoingUpdate", required = false, defaultValue = "false") boolean ongoingUpdate,
@RequestBody GraduationStudentRecord graduationStatus,
@RequestHeader(name="Authorization") String accessToken) {
@RequestBody GraduationStudentRecord graduationStatus) {
logger.debug("Save Graduation Student Record for Student ID");
var result = dataConversionService.saveGraduationStudentRecord(UUID.fromString(studentID),graduationStatus, ongoingUpdate, accessToken.replace(BEARER, ""));
var result = dataConversionService.saveGraduationStudentRecord(UUID.fromString(studentID),graduationStatus, ongoingUpdate);
return response.GET(result);
}

@PostMapping(EducGradStudentApiConstants.CONV_GRADUATION_STATUS_FOR_ONGOING_UPDATES)
@PreAuthorize(PermissionsConstants.UPDATE_GRADUATION_STUDENT)
@Operation(summary = "Update Graduation Status At Field Level for Ongoing Updates", description = "Update Graduation Status At Field Level for Ongoing Updates", tags = { "Data Conversion" })
@ApiResponses(value = {@ApiResponse(responseCode = "200", description = "OK")})
public ResponseEntity<GraduationStudentRecord> updateGraduationStatusForOngoingUpdates(@RequestBody OngoingUpdateRequestDTO requestDTO,
@RequestHeader(name="Authorization") String accessToken) {
logger.debug("Save Graduation Student Record for Student ID");
var result = dataConversionService.updateGraduationStatusByFields(requestDTO, accessToken.replace(BEARER, ""));
return response.GET(result);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package ca.bc.gov.educ.api.gradstudent.model.dto;

import ca.bc.gov.educ.api.gradstudent.constant.FieldName;
import ca.bc.gov.educ.api.gradstudent.constant.FieldType;
import lombok.Builder;
import lombok.Data;

import java.util.Objects;

@Builder
@Data
public class OngoingUpdateFieldDTO {
private FieldType type;
private FieldName name;
private Object value;

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
OngoingUpdateFieldDTO that = (OngoingUpdateFieldDTO) o;
return getName() == that.getName();
}

@Override
public int hashCode() {
return Objects.hash(getName());
}

@Override
public String toString() {
return "OngoingUpdateFieldDTO{" +
"type=" + type +
", name=" + name +
", value=" + value +
'}';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package ca.bc.gov.educ.api.gradstudent.model.dto;

import ca.bc.gov.educ.api.gradstudent.constant.TraxEventType;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

@NoArgsConstructor
@Data
public class OngoingUpdateRequestDTO {
private String studentID;
private String pen;
private TraxEventType eventType;
private List<OngoingUpdateFieldDTO> updateFields = new ArrayList<>();
}
Loading
Loading