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

Grad release 1.12.0 #298

Merged
merged 3 commits into from
Jan 15, 2024
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
2 changes: 1 addition & 1 deletion api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>ca.bc.gov.educ</groupId>
<artifactId>educ-grad-student-graduation-api</artifactId>
<version>1.8.41</version>
<version>1.8.42</version>
<name>educ-grad-student-graduation-api</name>
<description>Ministry of Education GRAD STUDENT GRADUATION API</description>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
package ca.bc.gov.educ.api.studentgraduation.model.dto;

import java.util.UUID;

import org.springframework.stereotype.Component;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.stereotype.Component;

import jakarta.persistence.Column;
import java.util.UUID;

@Data
@EqualsAndHashCode(callSuper = false)
@Component
public class TranscriptMessage extends BaseModel{
public class TranscriptMessage extends BaseModel {

private UUID transcriptMessageID;
private String programCode;
Expand All @@ -21,7 +18,7 @@ public class TranscriptMessage extends BaseModel{
private String gradDateMessage;
private String honourNote;
private String adIBProgramMessage;
private String programCadre;
private String frenchImmersionMessage;
private String careerProgramMessage;
private String gradProjectedMessage;
private String honourProjectedNote;
Expand All @@ -37,7 +34,7 @@ public String toString() {
", gradDateMessage='" + gradDateMessage + '\'' +
", honourNote='" + honourNote + '\'' +
", adIBProgramMessage='" + adIBProgramMessage + '\'' +
", programCadre='" + programCadre + '\'' +
", frenchImmersionMessage='" + frenchImmersionMessage + '\'' +
", careerProgramMessage='" + careerProgramMessage + '\'' +
", gradProjectedMessage='" + gradProjectedMessage + '\'' +
", honourProjectedNote='" + honourProjectedNote + '\'' +
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
package ca.bc.gov.educ.api.studentgraduation.model.entity;

import java.util.UUID;

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

import org.hibernate.annotations.Immutable;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.Immutable;

import java.util.UUID;

@Data
@EqualsAndHashCode(callSuper = false)
Expand Down Expand Up @@ -41,8 +39,8 @@ public class TranscriptMessageEntity extends BaseEntity {
@Column(name = "AD_IB_PROGRAM_MESSAGE", nullable = false)
private String adIBProgramMessage;

@Column(name = "PROGRAM_CADRE", nullable = false)
private String programCadre;
@Column(name = "FRENCH_IMMERSION_MESSAGE", nullable = false)
private String frenchImmersionMessage;

@Column(name = "CAREER_PROGRAM_MESSAGE", nullable = false)
private String careerProgramMessage;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
package ca.bc.gov.educ.api.studentgraduation.model.transformer;

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

import ca.bc.gov.educ.api.studentgraduation.model.dto.TranscriptMessage;
import ca.bc.gov.educ.api.studentgraduation.model.entity.TranscriptMessageEntity;
import org.modelmapper.ModelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import ca.bc.gov.educ.api.studentgraduation.model.dto.TranscriptMessage;
import ca.bc.gov.educ.api.studentgraduation.model.entity.TranscriptMessageEntity;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;


@Component
Expand All @@ -27,13 +26,13 @@ public TranscriptMessage transformToDTO ( Optional<TranscriptMessageEntity> tran
if (transcriptMessageEntity.isPresent())
cae = transcriptMessageEntity.get();

return modelMapper.map(cae, TranscriptMessage.class);
return transformToDTO(cae);
}

public List<TranscriptMessage> transformToDTO (Iterable<TranscriptMessageEntity> gradMessagingEntities ) {
List<TranscriptMessage> gradMessagingList = new ArrayList<>();
for (TranscriptMessageEntity gradMessagingEntity : gradMessagingEntities) {
TranscriptMessage gradMessaging = modelMapper.map(gradMessagingEntity, TranscriptMessage.class);
TranscriptMessage gradMessaging = transformToDTO(gradMessagingEntity);
gradMessagingList.add(gradMessaging);
}
return gradMessagingList;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ALTER TABLE TRANSCRIPT_MESSAGE RENAME COLUMN PROGRAM_CADRE to FRENCH_IMMERSION_MESSAGE ;




Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
UPDATE TRANSCRIPT_MESSAGE
SET FRENCH_IMMERSION_MESSAGE = ''
WHERE GRADUATION_PROGRAM_CODE LIKE '%-PF' AND MESSAGE_TYPE_CODE = 'GRADUATED';
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
package ca.bc.gov.educ.api.studentgraduation.controller;

import java.sql.Date;
import java.util.ArrayList;
import java.util.List;

import ca.bc.gov.educ.api.studentgraduation.model.dto.TranscriptMessage;
import ca.bc.gov.educ.api.studentgraduation.service.TranscriptMessageService;
import ca.bc.gov.educ.api.studentgraduation.util.GradValidation;
import ca.bc.gov.educ.api.studentgraduation.util.MessageHelper;
import ca.bc.gov.educ.api.studentgraduation.util.ResponseHelper;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.jupiter.MockitoExtension;

import ca.bc.gov.educ.api.studentgraduation.model.dto.TranscriptMessage;
import ca.bc.gov.educ.api.studentgraduation.service.TranscriptMessageService;
import ca.bc.gov.educ.api.studentgraduation.util.GradValidation;
import ca.bc.gov.educ.api.studentgraduation.util.MessageHelper;
import ca.bc.gov.educ.api.studentgraduation.util.ResponseHelper;
import java.sql.Date;
import java.util.ArrayList;
import java.util.List;


@ExtendWith(MockitoExtension.class)
Expand Down Expand Up @@ -47,7 +46,7 @@ public void testGetAllMessagingCodeList() {
obj.setGradDateMessage("GD");
obj.setHonourNote("Y");
obj.setGradMainMessage("abcd");
obj.setProgramCadre("PR");
obj.setFrenchImmersionMessage("PR");
obj.setCreateUser("GRADUATION");
obj.setUpdateUser("GRADUATION");
obj.setCreateDate(new Date(System.currentTimeMillis()));
Expand All @@ -61,7 +60,7 @@ public void testGetAllMessagingCodeList() {
obj.setGradDateMessage("GD");
obj.setHonourNote("Y");
obj.setGradMainMessage("abcd");
obj.setProgramCadre("PR");
obj.setFrenchImmersionMessage("PR");
obj.setCreateUser("GRADUATION");
obj.setUpdateUser("GRADUATION");
obj.setCreateDate(new Date(System.currentTimeMillis()));
Expand All @@ -84,7 +83,7 @@ public void testGetSpecificMessagingCode() {
obj.setGradDateMessage("GD");
obj.setHonourNote("Y");
obj.setGradMainMessage("abcd");
obj.setProgramCadre("PR");
obj.setFrenchImmersionMessage("PR");
obj.setCreateUser("GRADUATION");
obj.setUpdateUser("GRADUATION");
obj.setCreateDate(new Date(System.currentTimeMillis()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void testGetAllMessagingCodeList() {
obj.setGradDateMessage("GD");
obj.setHonourNote("Y");
obj.setGradMainMessage("abcd");
obj.setProgramCadre("PR");
obj.setFrenchImmersionMessage("PR");
obj.setCreateUser("GRADUATION");
obj.setUpdateUser("GRADUATION");
obj.setCreateDate(new Date(System.currentTimeMillis()));
Expand All @@ -67,7 +67,7 @@ public void testGetAllMessagingCodeList() {
obj.setGradDateMessage("GD");
obj.setHonourNote("Y");
obj.setGradMainMessage("abcd");
obj.setProgramCadre("PR");
obj.setFrenchImmersionMessage("PR");
obj.setCreateUser("GRADUATION");
obj.setUpdateUser("GRADUATION");
obj.setCreateDate(new Date(System.currentTimeMillis()));
Expand All @@ -89,7 +89,7 @@ public void testGetSpecificTranscriptMessageCode() {
obj.setGradDateMessage("GD");
obj.setHonourNote("Y");
obj.setGradMainMessage("abcd");
obj.setProgramCadre("PR");
obj.setFrenchImmersionMessage("PR");
obj.setCreateUser("GRADUATION");
obj.setUpdateUser("GRADUATION");
obj.setCreateDate(new Date(System.currentTimeMillis()));
Expand All @@ -103,7 +103,7 @@ public void testGetSpecificTranscriptMessageCode() {
objEntity.setGradDateMessage("GD");
objEntity.setHonourNote("Y");
objEntity.setGradMainMessage("abcd");
objEntity.setProgramCadre("PR");
objEntity.setFrenchImmersionMessage("PR");
objEntity.setCreateUser("GRADUATION");
objEntity.setUpdateUser("GRADUATION");
objEntity.setCreateDate(new Date(System.currentTimeMillis()));
Expand Down
Loading