Skip to content

Commit

Permalink
GRAD2-1704 (#295)
Browse files Browse the repository at this point in the history
Rename column in API Student Graduation TRANSCRIPT_MESSAGE
  • Loading branch information
arybakov-cgi authored Jan 5, 2024
1 parent 00def42 commit ad04b47
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 39 deletions.
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
@@ -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

0 comments on commit ad04b47

Please sign in to comment.