1010import javax .persistence .CascadeType ;
1111import javax .persistence .Column ;
1212import javax .persistence .Entity ;
13+ import javax .persistence .EnumType ;
14+ import javax .persistence .Enumerated ;
1315import javax .persistence .JoinTable ;
1416import javax .persistence .ManyToMany ;
1517import javax .persistence .UniqueConstraint ;
2123import com .fasterxml .jackson .annotation .JsonIgnoreProperties ;
2224import com .fasterxml .jackson .annotation .ObjectIdGenerators ;
2325
26+ import edu .tamu .app .enums .FeatureProposalState ;
2427import edu .tamu .app .model .validation .FeatureProposalValidator ;
2528
2629@ Entity
@@ -39,8 +42,9 @@ public class FeatureProposal extends AbstractIdea {
3942 @ Fetch (value = SELECT )
4043 private List <User > voters ;
4144
45+ @ Enumerated (EnumType .STRING )
4246 @ Column (nullable = false )
43- private boolean submitted ;
47+ private FeatureProposalState state ;
4448
4549 public FeatureProposal () {
4650 super ();
@@ -72,7 +76,7 @@ public FeatureProposal(Idea idea) {
7276 private void setup () {
7377 this .ideas = new ArrayList <Idea >();
7478 this .voters = new ArrayList <User >();
75- this .submitted = false ;
79+ this .state = FeatureProposalState . IN_PROGRESS ;
7680 }
7781
7882 public List <Idea > getIdeas () {
@@ -126,12 +130,12 @@ public int getVotes() {
126130 return this .voters .size ();
127131 }
128132
129- public boolean isSubmitted () {
130- return submitted ;
133+ public FeatureProposalState getState () {
134+ return state ;
131135 }
132136
133- public void setSubmitted ( boolean submitted ) {
134- this .submitted = submitted ;
137+ public void setState ( FeatureProposalState state ) {
138+ this .state = state ;
135139 }
136140
137141}
0 commit comments