Skip to content
Snippets Groups Projects
Commit fc2cec66 authored by Jan Tymel's avatar Jan Tymel
Browse files

Add missing relatedPhasesId attribute to questions

parent bb769837
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@ import com.example.demo.enums.QuestionType;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.ElementCollection;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
......@@ -30,6 +31,10 @@ public class Question {
private Integer penalty;
private boolean required;
// TODO this is a Potemkin village before the consultation. Proper ManyToMany relation should be used here
@ElementCollection
private List<Long> relatedPhasesId;
@Column(name = "order_in_questionnaire", nullable = false)
private Integer order;
......@@ -111,4 +116,12 @@ public class Question {
public void setChoices(List<QuestionChoice> choices) {
this.choices = choices;
}
public List<Long> getRelatedPhasesId() {
return relatedPhasesId;
}
public void setRelatedPhasesId(List<Long> relatedPhasesId) {
this.relatedPhasesId = relatedPhasesId;
}
}
......@@ -16,6 +16,7 @@ public class QuestionDto implements Serializable {
private boolean required;
private Integer order;
private List<QuestionChoiceDto> choices;
private List<Long> relatedPhasesId;
public Long getId() {
return id;
......@@ -80,4 +81,12 @@ public class QuestionDto implements Serializable {
public void setChoices(List<QuestionChoiceDto> choices) {
this.choices = choices;
}
public List<Long> getRelatedPhasesId() {
return relatedPhasesId;
}
public void setRelatedPhasesId(List<Long> relatedPhasesId) {
this.relatedPhasesId = relatedPhasesId;
}
}
......@@ -2,6 +2,8 @@ package com.example.demo.dto;
import com.example.demo.enums.QuestionType;
import java.util.List;
public class QuestionUpdateDto {
private Long id;
......@@ -10,6 +12,7 @@ public class QuestionUpdateDto {
private Integer points;
private Integer penalty;
private boolean required;
private List<Long> relatedPhasesId;
public Long getId() {
return id;
......@@ -59,6 +62,14 @@ public class QuestionUpdateDto {
this.required = required;
}
public List<Long> getRelatedPhasesId() {
return relatedPhasesId;
}
public void setRelatedPhasesId(List<Long> relatedPhasesId) {
this.relatedPhasesId = relatedPhasesId;
}
@Override
public String toString() {
return "QuestionUpdateDto{" +
......@@ -68,6 +79,7 @@ public class QuestionUpdateDto {
", points=" + points +
", penalty=" + penalty +
", required=" + required +
", relatedPhasesId=" + relatedPhasesId +
'}';
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment