Skip to content
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
18 changes: 17 additions & 1 deletion src/main/java/edu/tamu/app/model/Idea.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public class Idea extends AbstractIdea {
@Column(nullable = false)
private IdeaState state;

@Column(nullable = true)
private String email;

@ManyToOne(fetch = EAGER, cascade = { CascadeType.REFRESH, CascadeType.DETACH }, optional = true)
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, scope = FeatureProposal.class, property = "id")
@JsonIdentityReference(alwaysAsId = true)
Expand All @@ -43,8 +46,13 @@ public Idea(String title, String description) {
this.state = IdeaState.WAITING_ON_REVIEW;
}

public Idea(String title, String description, String email) {
this(title, description);
this.email = email;
}

public Idea(ServiceRequest serviceRequest) {
this(serviceRequest.getTitle(), serviceRequest.getDescription());
this(serviceRequest.getTitle(), serviceRequest.getDescription(), serviceRequest.getEmail());
}

public Idea(String title, String description, User author) {
Expand All @@ -65,6 +73,14 @@ public void setState(IdeaState state) {
this.state = state;
}

public String getEmail() {
return email;
}

public void setEmail(String email) {
this.email = email;
}

public FeatureProposal getFeatureProposal() {
return featureProposal;
}
Expand Down
15 changes: 15 additions & 0 deletions src/main/java/edu/tamu/app/model/request/ServiceRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ public class ServiceRequest extends AbstractRequest {

private Long service;

private String email;

public ServiceRequest() {
super();
}
Expand All @@ -15,6 +17,11 @@ public ServiceRequest(RequestType type, String title, String description, Long s
this.service = service;
}

public ServiceRequest(RequestType type, String title, String description, Long service, String email) {
this(type, title, description, service);
this.email = email;
}

public Long getService() {
return service;
}
Expand All @@ -23,4 +30,12 @@ public void setService(Long service) {
this.service = service;
}

public String getEmail() {
return email;
}

public void setEmail(String email) {
this.email = email;
}

}