diff --git a/src/main/java/edu/group5/app/model/DBRepository.java b/src/main/java/edu/group5/app/model/DBRepository.java new file mode 100644 index 0000000..0a37add --- /dev/null +++ b/src/main/java/edu/group5/app/model/DBRepository.java @@ -0,0 +1,4 @@ +package edu.group5.app.model; + +public class DBRepository { +} diff --git a/src/main/java/edu/group5/app/model/Repository.java b/src/main/java/edu/group5/app/model/Repository.java new file mode 100644 index 0000000..53971bd --- /dev/null +++ b/src/main/java/edu/group5/app/model/Repository.java @@ -0,0 +1,4 @@ +package edu.group5.app.model; + +public class Repository { +} diff --git a/src/main/java/edu/group5/app/model/donation/Donation.java b/src/main/java/edu/group5/app/model/donation/Donation.java index a127439..353827d 100644 --- a/src/main/java/edu/group5/app/model/donation/Donation.java +++ b/src/main/java/edu/group5/app/model/donation/Donation.java @@ -1,5 +1,77 @@ package edu.group5.app.model.donation; +import java.math.BigDecimal; +import java.sql.Timestamp; + +/** + * Represents a verified donation made by a user to an organization. + */ public class Donation { - + private final int donationId; + private final int userId; + private final int organizationId; + private final BigDecimal amount; + private final Timestamp date; + private final String paymentMethod; + + /** + * Constructs a new Donation. + * + * @param donationId - the unique ID of this donation + * @param userId - the ID of the user making the donation + * @param organizationId - the ID of the organization receiving the donation + * @param amount - the donation amount + * @param date - the timestamp when the donation was made + * @param paymentMethod - the payment method used + */ + public Donation(int donationId, int userId, int organizationId, BigDecimal amount, Timestamp date, String paymentMethod) { + this.donationId = donationId; + this.userId = userId; + this.organizationId = organizationId; + this.amount = amount; + this.date = date; + this.paymentMethod = paymentMethod; + } + + /** + * @return the donation ID + */ + public int getDonationId(){ + return donationId; + } + + /** + * @return the user ID of the donator + */ + public int getUserId(){ + return userId; + } + + /** + * @return the organization ID that receives the donation + */ + public int getOrganizationId() { + return organizationId; + } + + /** + * @return the donated amount + */ + public BigDecimal getAmount() { + return amount; + } + + /** + * @return the timestamp of the donation + */ + public Timestamp getDate() { + return date; + } + + /** + * @return the payment method used + */ + public String getPaymentMethod() { + return paymentMethod; + } } diff --git a/src/main/java/edu/group5/app/model/donation/DonationRepository.java b/src/main/java/edu/group5/app/model/donation/DonationRepository.java new file mode 100644 index 0000000..f179b01 --- /dev/null +++ b/src/main/java/edu/group5/app/model/donation/DonationRepository.java @@ -0,0 +1,4 @@ +package edu.group5.app.model.donation; + +public class DonationRepository { +} diff --git a/src/test/java/edu/group5/app/model/donation/DonationRepositoryTest.java b/src/test/java/edu/group5/app/model/donation/DonationRepositoryTest.java new file mode 100644 index 0000000..e06a350 --- /dev/null +++ b/src/test/java/edu/group5/app/model/donation/DonationRepositoryTest.java @@ -0,0 +1,4 @@ +package edu.group5.app.model.donation; + +public class DonationRepositoryTest { +} diff --git a/src/test/java/edu/group5/app/model/donation/DonationTest.java b/src/test/java/edu/group5/app/model/donation/DonationTest.java new file mode 100644 index 0000000..a4da95e --- /dev/null +++ b/src/test/java/edu/group5/app/model/donation/DonationTest.java @@ -0,0 +1,4 @@ +package edu.group5.app.model.donation; + +public class DonationTest { +}