Commit f0acf1d4 authored by Simone Vuotto's avatar Simone Vuotto

Update Requirement Model

parent f708873b
......@@ -2,6 +2,7 @@ package it.unige.ReqV.requirements;
import com.fasterxml.jackson.annotation.*;
import it.unige.ReqV.projects.Project;
import org.hibernate.annotations.ColumnDefault;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
......@@ -36,13 +37,17 @@ public class Requirement {
@JsonIgnore
private String errorDescription;
@ColumnDefault("false")
private boolean disabled;
public Requirement() { }
public Requirement(String text, Project project, State state, String errorDescription) {
public Requirement(String text, Project project, State state, String errorDescription, boolean disabled) {
this.text = text;
this.project = project;
this.state = state;
this.errorDescription = errorDescription;
this.disabled = disabled;
}
public Long getId() {
......@@ -94,4 +99,12 @@ public class Requirement {
public void setErrorDescription(String errorDescription) {
this.errorDescription = errorDescription;
}
public boolean isDisabled() {
return disabled;
}
public void setDisabled(boolean disabled) {
this.disabled = disabled;
}
}
......@@ -93,7 +93,7 @@ public class RequirementService {
// Skip empty lines and comments
if(line.isEmpty() || line.contains("#"))
continue;
Requirement req = new Requirement(line, project, Requirement.State.NOT_CHECKED, null);
Requirement req = new Requirement(line, project, Requirement.State.NOT_CHECKED, null, false);
create(req);
requirements.add(req);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment