Skip to content

Commit 7074ac0

Browse files
authored
Merge pull request #67 from TAMULib/sprint6-b03617-idea-emails
b03617 Added emails to ideas and service requests
2 parents 3f31983 + 27a4a8c commit 7074ac0

2 files changed

Lines changed: 32 additions & 1 deletion

File tree

src/main/java/edu/tamu/app/model/Idea.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ public class Idea extends AbstractIdea {
2727
@Column(nullable = false)
2828
private IdeaState state;
2929

30+
@Column(nullable = true)
31+
private String email;
32+
3033
@ManyToOne(fetch = EAGER, cascade = { CascadeType.REFRESH, CascadeType.DETACH }, optional = true)
3134
@JsonIdentityInfo(generator = ObjectIdGenerators.PropertyGenerator.class, scope = FeatureProposal.class, property = "id")
3235
@JsonIdentityReference(alwaysAsId = true)
@@ -43,8 +46,13 @@ public Idea(String title, String description) {
4346
this.state = IdeaState.WAITING_ON_REVIEW;
4447
}
4548

49+
public Idea(String title, String description, String email) {
50+
this(title, description);
51+
this.email = email;
52+
}
53+
4654
public Idea(ServiceRequest serviceRequest) {
47-
this(serviceRequest.getTitle(), serviceRequest.getDescription());
55+
this(serviceRequest.getTitle(), serviceRequest.getDescription(), serviceRequest.getEmail());
4856
}
4957

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

76+
public String getEmail() {
77+
return email;
78+
}
79+
80+
public void setEmail(String email) {
81+
this.email = email;
82+
}
83+
6884
public FeatureProposal getFeatureProposal() {
6985
return featureProposal;
7086
}

src/main/java/edu/tamu/app/model/request/ServiceRequest.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ public class ServiceRequest extends AbstractRequest {
66

77
private Long service;
88

9+
private String email;
10+
911
public ServiceRequest() {
1012
super();
1113
}
@@ -15,6 +17,11 @@ public ServiceRequest(RequestType type, String title, String description, Long s
1517
this.service = service;
1618
}
1719

20+
public ServiceRequest(RequestType type, String title, String description, Long service, String email) {
21+
this(type, title, description, service);
22+
this.email = email;
23+
}
24+
1825
public Long getService() {
1926
return service;
2027
}
@@ -23,4 +30,12 @@ public void setService(Long service) {
2330
this.service = service;
2431
}
2532

33+
public String getEmail() {
34+
return email;
35+
}
36+
37+
public void setEmail(String email) {
38+
this.email = email;
39+
}
40+
2641
}

0 commit comments

Comments
 (0)