-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feedback class, added an attribute to charity that contain a list of …
…feedbacks
- Loading branch information
AdrianBalunan
committed
Feb 19, 2026
1 parent
95563c2
commit 35a6362
Showing
4 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Feedback.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,65 @@ | ||
| package ntnu.sytemutvikling.team6.models; | ||
|
|
||
| import java.time.LocalDateTime; | ||
| import java.util.UUID; | ||
|
|
||
| public class Feedback { | ||
| /* Feedback id */ | ||
| private UUID feedbackId; | ||
|
|
||
| /** | ||
| * The author of the feedback | ||
| * If annonymous the presentation of the user will be "Anonymous". | ||
| */ | ||
| private User user; | ||
|
|
||
| /* The details of the feedback*/ | ||
| private String comment; | ||
|
|
||
| /* The date and time when the feedback was given */ | ||
| private LocalDateTime date; | ||
|
|
||
| /* Is the feedback given anonymously? */ | ||
| private boolean isAnonymous; | ||
|
|
||
| /** | ||
| * Constructor for creating a new feedback. | ||
| * | ||
| * @param user The user who gives the feedback. | ||
| * @param comment The content of the feedback. | ||
| */ | ||
| public Feedback(User user, String comment) { | ||
| this.feedbackId = UUID.randomUUID(); | ||
| this.user = user; | ||
| this.comment = comment; | ||
| this.date = LocalDateTime.now(); | ||
|
|
||
| // ASSUMES that this is the way to get the anonymous setting from the user's settings. | ||
| if (user.getSettings().getAnonymous() == false) { | ||
| this.isAnonymous = true; | ||
| } else { | ||
| this.isAnonymous = false; | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * Getters for the feedback's attributes. | ||
| * | ||
| * @return The feedback's attributes. | ||
| */ | ||
| public UUID getFeedbackId() { | ||
| return feedbackId; | ||
| } | ||
| public String getComment() { | ||
| return comment; | ||
| } | ||
| public LocalDateTime getDate() { | ||
| return date; | ||
| } | ||
| public User getUser() { | ||
| return user; | ||
| } | ||
| public boolean isAnonymous() { | ||
| return isAnonymous; | ||
| } | ||
| } |
Binary file modified
BIN
+178 Bytes
(110%)
helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Charity.class
Binary file not shown.
Binary file modified
BIN
+936 Bytes
(400%)
helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Feedback.class
Binary file not shown.