diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..eafe2b1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Adrian +/vscode diff --git a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Charity.java b/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Charity.java index 92ebbf1..cf86734 100644 --- a/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Charity.java +++ b/helpmehelpapplication/src/main/java/ntnu/sytemutvikling/team6/models/Charity.java @@ -1,4 +1,78 @@ +/** + * This class represents a charity organization. It contains information about the charity such as its name, description, total donations, verification status, and category. + * + * @author Adrian Balunan + */ package ntnu.sytemutvikling.team6.models; +import java.util.UUID; + abstract class Charity { + /* UUID for uniquely identifying each charity */ + private UUID id; + + /* Name of the charity */ + private String name; + + /* Description of the charity's mission and activities */ + private String description; + + /* Total Donations received */ + private int totalDonations; + + /* Is the charity verified? */ + private boolean isVerified; + + /* Category for the charity */ + private String category; + + /** + * Konstructor for creating a new charity. + * The ID is generated automatically using UUID. + * Total donations are initialized to 0. + * The charity is unverified by default. + * + * @param name + * @param description + * @param category + */ + public Charity(String name, String description, String category) { + this.id = UUID.randomUUID(); + this.name = name; + this.description = description; + this.totalDonations = 0; + this.isVerified = false; + this.category = category; + } + + /** + * Getters for the charity's attributes. + * + * @return + */ + public UUID getId() { + return id; + } + public String getCategory() { + return category; + } + public String getName() { + return name; + } + public String getDescription() { + return description; + } + public int getTotalDonations() { + return totalDonations; + } + public boolean isVerified() { + return isVerified; + } + + public void setVerified() { + this.isVerified = true; + } + public void setUnverified() { + this.isVerified = false; + } } diff --git a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Charity.class b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Charity.class index 42f6e49..63dc161 100644 Binary files a/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Charity.class and b/helpmehelpapplication/target/classes/ntnu/sytemutvikling/team6/models/Charity.class differ