-
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.
- Loading branch information
AdrianBalunan
committed
Mar 5, 2026
1 parent
e2161b7
commit 40c5bed
Showing
13 changed files
with
176 additions
and
213 deletions.
There are no files selected for viewing
8 changes: 4 additions & 4 deletions
8
helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/Main.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,7 +1,7 @@ | ||
| package ntnu.sytemutvikling.team6; | ||
|
|
||
| public class Main { | ||
| public static void main(String[] args) { | ||
| System.out.println("Hello world!"); | ||
| } | ||
| } | ||
| public static void main(String[] args) { | ||
| System.out.println("Hello world!"); | ||
| } | ||
| } |
127 changes: 60 additions & 67 deletions
127
helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Donation.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,81 +1,74 @@ | ||
| package ntnu.sytemutvikling.team6.models; | ||
|
|
||
| import ntnu.sytemutvikling.team6.models.user.User; | ||
|
|
||
| import java.time.LocalDateTime; | ||
| import java.util.UUID; | ||
| import ntnu.sytemutvikling.team6.models.user.User; | ||
|
|
||
| public class Donation { | ||
| /* UUID for uniquely identifying each donation */ | ||
| private UUID charityId; | ||
|
|
||
| /* Ammount of money donated */ | ||
| private double amount; | ||
|
|
||
| /* Date and time of the donation */ | ||
| private LocalDateTime date; | ||
|
|
||
| /* The charity that received the donation */ | ||
| private Charity charity; | ||
|
|
||
| /* The user/donor that made the donation */ | ||
| private User donor; | ||
|
|
||
| /** | ||
| * Is the donation made anonymously? | ||
| * This can be null if the donation was made anonymously. | ||
| * | ||
| */ | ||
| private boolean isAnonymous; | ||
|
|
||
| /** | ||
| * Constructor for creating a new donation. | ||
| * The charityId is generated automatically using UUID. | ||
| * If the donation is made anonymously, the isAnonymous parameter is set to true. | ||
| * @param amount | ||
| * @param date | ||
| * @param charity | ||
| * @param donor | ||
| */ | ||
| public Donation(double amount, LocalDateTime date, Charity charity, User donor) { | ||
| this.charityId = UUID.randomUUID(); | ||
| this.amount = amount; | ||
| this.date = date; | ||
| this.charity = charity; | ||
| this.donor = donor; | ||
|
|
||
|
|
||
| // ASSUMES that this is the way to get the anonymous setting from the user's settings. | ||
| if (donor.getSettings().isAnonymous() == false) { | ||
| this.isAnonymous = true; | ||
| } else { | ||
| this.isAnonymous = false; | ||
|
|
||
| } | ||
| /* UUID for uniquely identifying each donation */ | ||
| private UUID charityId; | ||
|
|
||
| /* Ammount of money donated */ | ||
| private double amount; | ||
|
|
||
| /* Date and time of the donation */ | ||
| private LocalDateTime date; | ||
|
|
||
| /* The charity that received the donation */ | ||
| private Charity charity; | ||
|
|
||
| /* The user/donor that made the donation */ | ||
| private User donor; | ||
|
|
||
| /** Is the donation made anonymously? This can be null if the donation was made anonymously. */ | ||
| private boolean isAnonymous; | ||
|
|
||
| /** | ||
| * Constructor for creating a new donation. The charityId is generated automatically using UUID. | ||
| * If the donation is made anonymously, the isAnonymous parameter is set to true. | ||
| * | ||
| * @param amount | ||
| * @param date | ||
| * @param charity | ||
| * @param donor | ||
| */ | ||
| public Donation(double amount, LocalDateTime date, Charity charity, User donor) { | ||
| this.charityId = UUID.randomUUID(); | ||
| this.amount = amount; | ||
| this.date = date; | ||
| this.charity = charity; | ||
| this.donor = donor; | ||
|
|
||
| // ASSUMES that this is the way to get the anonymous setting from the user's settings. | ||
| if (donor.getSettings().isAnonymous() == false) { | ||
| this.isAnonymous = true; | ||
| } else { | ||
| this.isAnonymous = false; | ||
| } | ||
| } | ||
|
|
||
| /* Getters for the donation's attributes */ | ||
| public boolean isAnonymous() { | ||
| return isAnonymous; | ||
| } | ||
| /* Getters for the donation's attributes */ | ||
| public boolean isAnonymous() { | ||
| return isAnonymous; | ||
| } | ||
|
|
||
| public UUID getCharityId() { | ||
| return charityId; | ||
| } | ||
| public UUID getCharityId() { | ||
| return charityId; | ||
| } | ||
|
|
||
| public double getAmount() { | ||
| return amount; | ||
| } | ||
| public double getAmount() { | ||
| return amount; | ||
| } | ||
|
|
||
| public LocalDateTime getDate() { | ||
| return date; | ||
| } | ||
| public LocalDateTime getDate() { | ||
| return date; | ||
| } | ||
|
|
||
| public Charity getCharity() { | ||
| return charity; | ||
| } | ||
| public Charity getCharity() { | ||
| return charity; | ||
| } | ||
|
|
||
| public User getDonor() { | ||
| return donor; | ||
| } | ||
| public User getDonor() { | ||
| return donor; | ||
| } | ||
| } |
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
110 changes: 55 additions & 55 deletions
110
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,62 +1,62 @@ | ||
| package ntnu.sytemutvikling.team6.models; | ||
|
|
||
| import ntnu.sytemutvikling.team6.models.user.User; | ||
|
|
||
| import java.time.LocalDateTime; | ||
| import java.util.UUID; | ||
| import ntnu.sytemutvikling.team6.models.user.User; | ||
|
|
||
| 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(); | ||
|
|
||
| this.isAnonymous = user.getSettings().isAnonymous(); | ||
| } | ||
|
|
||
| /** | ||
| * 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; | ||
| } | ||
| /* 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(); | ||
|
|
||
| this.isAnonymous = user.getSettings().isAnonymous(); | ||
| } | ||
|
|
||
| /** | ||
| * 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; | ||
| } | ||
| } |
5 changes: 1 addition & 4 deletions
5
helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/UserRegistry.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,6 +1,3 @@ | ||
| package ntnu.sytemutvikling.team6.models; | ||
|
|
||
| public class UserRegistry { | ||
|
|
||
|
|
||
| } | ||
| public class UserRegistry {} |
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
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 |
|---|---|---|
|
|
@@ -7,4 +7,4 @@ | |
| */ | ||
| public enum Language { | ||
| ENGLISH | ||
| } | ||
| } | ||
Oops, something went wrong.