Skip to content

Commit

Permalink
Merge pull request #43 from cathrkri/feature/javafx-frontpage
Browse files Browse the repository at this point in the history
Feature/javafx frontpage
  • Loading branch information
robinsp authored Mar 10, 2026
2 parents 654e852 + a97a0a5 commit 69dbc74
Show file tree
Hide file tree
Showing 73 changed files with 1,613 additions and 926 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: ci

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
runs-on: self-hosted

steps:
- uses: actions/checkout@v4

- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "25"
cache: maven

- working-directory: helpmehelpapplication
run: mvn -B test
34 changes: 34 additions & 0 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path

name: Maven Package

on:
release:
types: [created]

jobs:
build:

runs-on: [ self-hosted ]
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file

- name: Build with Maven
run: mvn -B package --file pom.xml

- name: Publish to GitHub Packages Apache Maven
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
env:
GITHUB_TOKEN: ${{ github.token }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Planned core functionalities (3–4 will be fully implemented):


## Technology Stack
- **Programming Language:** Java
- **Programming Language:** Java 25
- **Application Type:** Desktop application
- **UI:** JavaFX
- **Database:** Relational database
Expand Down
Binary file added docs/Møtedokumenter/Team Meeting 1.pdf
Binary file not shown.
Binary file added docs/sequence_diagram/Org_Onboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/sequence_diagram/Organization_message.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions helpmehelpapplication/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: ci

on:
push:
branches: main
pull_request:
branches: main

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribition: temurin
java-version: "25"
cache: maven
- run:
mvn -B test
2 changes: 2 additions & 0 deletions helpmehelpapplication/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea/
target/
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package ntnu.sytemutvikling.team6;

public class Main {
public static void main(String[] args) {
System.out.println("Hello world!");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/**
* 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.ArrayList;
import java.util.List;
import java.util.UUID;

public 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;

/* List that contains the charity's Feedbacks */
private List<Feedback> feedbacks;

/**
* 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.feedbacks = new ArrayList<>();
this.category = category;
}

/** Getters for the charity's attributes. */
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;
}

/** Setter for verification status. This one sets the charity as verified. */
public void setVerified() {
this.isVerified = true;
}

/** Setter for verification status. This one sets the charity as unverified. */
public void setUnverified() {
this.isVerified = false;
}

/**
* Setter for total donations. This method is used to update the total donations when a new
* donation is made.
*/
public void setTotalDonations(int amount) {
this.totalDonations += amount;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package ntnu.sytemutvikling.team6.models;

import java.util.*;

public class CharityRegistry {
private final List<Charity> charities;

public CharityRegistry() {
this.charities = new ArrayList<>();
}

public List<Charity> getAllCharities() {
return Collections.unmodifiableList(charities);
}

public Optional<Charity> findCharityById(UUID charityId) {
if (charityId == null) {
throw new IllegalArgumentException("CharityId can not be null.");
}
return charities.stream().filter(charity -> charityId.equals(charity.getId())).findFirst();
}

public void addCharity(Charity charity) {
if (charity == null) {
throw new IllegalArgumentException("Charity can not be null.");
}
charities.add(charity);
}

public boolean removeCharity(UUID charityId) {
if (charityId == null) {
throw new IllegalArgumentException("CharityId can not be null.");
}
return charities.removeIf(charity -> charityId.equals(charity.getId()));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package ntnu.sytemutvikling.team6.models;

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;
this.isAnonymous = donor.getSettings().isAnonymous();
}

/* Getters for the donation's attributes */
public boolean isAnonymous() {
return isAnonymous;
}

public UUID getCharityId() {
return charityId;
}

public double getAmount() {
return amount;
}

public LocalDateTime getDate() {
return date;
}

public Charity getCharity() {
return charity;
}

public User getDonor() {
return donor;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package ntnu.sytemutvikling.team6.models;

import java.util.*;

public class DonationRegistry {
private final List<Donation> donations;

public DonationRegistry() {
this.donations = new ArrayList<>();
}

public List<Donation> getAllDonations() {
return Collections.unmodifiableList(donations);
}

public Optional<Donation> findDonationById(UUID donationId) {
if (donationId == null) {
throw new IllegalArgumentException("DonationId can not be null.");
}
return donations.stream()
.filter(donations -> donationId.equals(donations.getCharityId()))
.findFirst();
}

public void addDonation(Donation donation) {
if (donation == null) {
throw new IllegalArgumentException("Donation can not be null.");
}
donations.add(donation);
}

public boolean removeDonation(UUID donationId) {
if (donationId == null) {
throw new IllegalArgumentException("DonationId can not be null.");
}
return donations.removeIf(donation -> donationId.equals(donation.getCharityId()));
}
}
Loading

0 comments on commit 69dbc74

Please sign in to comment.