Skip to content

Commit

Permalink
add type field to the question class
Browse files Browse the repository at this point in the history
  • Loading branch information
YifanLiu2 committed Jul 20, 2023
1 parent 977d3a8 commit 7f71457
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/main/java/questionentities/Question.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/
public class Question {
private final int questionId;
private final String type;
private final LocalDate createAt;
private final int askedByClient;
private final LocalDate legalDeadline;
Expand All @@ -21,18 +22,23 @@ public class Question {
private int rating;
private List<Post> posts;

public static final int MISSING_RATING = -1;

public Question(int questionId, LocalDate createAt, int askedByClient, LocalDate legalDeadline) {

public Question(int questionId, String type, LocalDate createAt, int askedByClient, LocalDate legalDeadline) {
this.questionId = questionId;
this.type = type;
this.createAt = createAt;
this.askedByClient = askedByClient;
this.legalDeadline = legalDeadline;
this.rating = MISSING_RATING;
this.posts = new ArrayList<Post>();
}

public Question(int questionId, LocalDate createAt, int askedByClient, boolean isTaken, int takenByAttorney,
public Question(int questionId, String type, LocalDate createAt, int askedByClient, boolean isTaken, int takenByAttorney,
boolean isClose, int rating, List<Post> posts, LocalDate legalDeadline) {
this.questionId = questionId;
this.type = type;
this.createAt = createAt;
this.askedByClient = askedByClient;
this.isTaken = isTaken;
Expand All @@ -52,6 +58,10 @@ public int getQuestionId() {
return questionId;
}

public String getType() {
return type;
}

/**
*
* @return the client id of the client who asked the question
Expand Down

0 comments on commit 7f71457

Please sign in to comment.