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

Develop/alex grad2 2641 #686

Open
wants to merge 2 commits into
base: grad-release
Choose a base branch
from
Open
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 @@ -20,5 +20,7 @@ public class CertificateTypeCode extends BaseEntity {
private String displayOrder;
private Date effectiveDate;
private Date expiryDate;
private String paperType;
private String language;

}
23 changes: 23 additions & 0 deletions api/src/main/java/ca/bc/gov/educ/grad/report/dto/SchoolReport.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package ca.bc.gov.educ.grad.report.dto;

import ca.bc.gov.educ.grad.report.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.stereotype.Component;

import java.util.UUID;

@Data
@EqualsAndHashCode(callSuper=false)
@Component
public class SchoolReport extends BaseEntity {

private static final long serialVersionUID = 1L;

private UUID schoolReportId;
private String report;
private String reportTypeCode;
private String schoolOfRecord;
private UUID schoolOfRecordId;

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ public class StudentReport extends BaseEntity {
private String gradutionStudentRecordId;
private String documentStatusCode;
private Date distributionDate;
private Date reportUpdateDate;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package ca.bc.gov.educ.grad.report.dto;

import ca.bc.gov.educ.grad.report.entity.BaseEntity;
import ca.bc.gov.educ.grad.report.entity.TranscriptTypeCodeEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.UUID;

@Data
@EqualsAndHashCode(callSuper=false)
@Component
public class StudentTranscript extends BaseEntity {

private UUID id;
private TranscriptTypeCodeEntity transcriptTypeCode;
private UUID graduationStudentRecordId;
private String documentStatusCode;
private Date distributionDate;
private Date transcriptUpdateDate;

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ public class TranscriptTypeCode extends BaseEntity {
private String displayOrder;
private Date effectiveDate;
private Date expiryDate;
private String paperType;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package ca.bc.gov.educ.grad.report.entity;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.Data;

import java.util.UUID;

@Data
@Entity
@Table(name = "SCHOOL_REPORT")
public class SchoolReportEntity extends BaseEntity {

private static final long serialVersionUID = 1L;

@Id
@Column(name = "SCHOOL_REPORT_ID", nullable = false)
private UUID schoolReportId;

@Column(name = "REPORT")
private String REPORT;

@Column(name = "REPORT_TYPE_CODE", nullable = false)
private String reportTypeCode;

@Column(name = "SCHOOL_OF_RECORD")
private String schoolOfRecord;

@Column(name = "SCHOOL_OF_RECORD_ID", columnDefinition = "uuid")
private UUID schoolOfRecordId;

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class StudentCertificateEntity extends BaseEntity {
private UUID studentCertificateId;

@Column(name = "CERTIFICATE")
private String CERTIFICATE;
private String certificate;

@Column(name = "CERTIFICATE_TYPE_CODE", nullable = false)
private String certificateTypeCode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class StudentReportEntity extends BaseEntity {
private UUID studentReportId;

@Column(name = "REPORT")
private String REPORT;
private String report;

@Column(name = "REPORT_TYPE_CODE", nullable = false)
private String reportTypeCode;
Expand All @@ -35,4 +35,7 @@ public class StudentReportEntity extends BaseEntity {
@Column(name = "DISTRIBUTION_DATE")
private Date distributionDate;

@Column(name = "REPORT_UPDATE_DATE")
private Date reportUpdateDate;

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
import jakarta.persistence.*;
import lombok.Data;

import java.time.LocalDate;
import java.util.Date;
import java.util.UUID;

@Data
@Entity
@Table(name = "STUDENT_TRANSCRIPT")
public class StudentTranscriptEntity {
public class StudentTranscriptEntity extends BaseEntity {

@Id
@Column(name = "STUDENT_TRANSCRIPT_ID", nullable = false, columnDefinition = "uuid")
Expand All @@ -29,16 +28,9 @@ public class StudentTranscriptEntity {
@Column(name = "DISTRIBUTION_DATE")
private Date distributionDate;

@Column(name = "CREATE_USER", nullable = false, length = 30)
private String createUser;
@Column(name = "TRANSCRIPT_UPDATE_DATE")
private Date transcriptUpdateDate;

@Column(name = "CREATE_DATE", nullable = false)
private LocalDate createDate;

@Column(name = "UPDATE_USER", nullable = false, length = 30)
private String updateUser;

@Column(name = "UPDATE_DATE", nullable = false)
private Date updateDate;

}
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,7 @@ public class TranscriptTypeCodeEntity extends BaseEntity {
@Column(name = "EXPIRY_DATE")
private Date expiryDate;

@Column(name = "PAPER_TYPE")
private String paperType;

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class GradReportCertificateTypeCodeTransformer {
ModelMapper modelMapper;

public List<CertificateTypeCode> transformToDTO (List<CertificateTypeCodeEntity> entities ) {
List<CertificateTypeCode> codes = new ArrayList<CertificateTypeCode>();
List<CertificateTypeCode> codes = new ArrayList<>();
for (CertificateTypeCodeEntity entity : entities) {
CertificateTypeCode code = modelMapper.map(entity, CertificateTypeCode.class);
codes.add(code);
Expand All @@ -25,7 +25,6 @@ public List<CertificateTypeCode> transformToDTO (List<CertificateTypeCodeEntity>
}

public CertificateTypeCode transformToDTO (CertificateTypeCodeEntity entity ) {
CertificateTypeCode code = modelMapper.map(entity, CertificateTypeCode.class);
return code;
return modelMapper.map(entity, CertificateTypeCode.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ protected GraduationStudentRecord mockGraduationStudentRecord(String pen, String
StudentTranscriptEntity studentTranscriptEntity = new StudentTranscriptEntity();
studentTranscriptEntity.setId(UUID.randomUUID());
studentTranscriptEntity.setGraduationStudentRecordId(graduationStudentRecord.getStudentID());
studentTranscriptEntity.setUpdateDate(graduationStudentRecord.getLastUpdateDate());
studentTranscriptEntity.setUpdatedTimestamp(graduationStudentRecord.getLastUpdateDate());

when(this.studentTranscriptRepository.findByGraduationStudentRecordId(graduationStudentRecord.getStudentID())).thenReturn(studentTranscriptEntity);
when(this.studentCertificateRepository.getCertificateDistributionDate(graduationStudentRecord.getStudentID())).thenReturn(Optional.of(new Date()));
Expand Down
Loading