Skip to content

Feature/javafx frontpage #43

Merged
merged 37 commits into from
Mar 10, 2026
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
a0e69df
Create 1
cathrkri Mar 3, 2026
9308dcc
Add files via upload
cathrkri Mar 3, 2026
c7c6a05
Delete docs/sequence_diagram/1
cathrkri Mar 3, 2026
b9c8aae
Add files via upload
cathrkri Mar 3, 2026
1362645
Delete docs/Møtedokumenter/Thursdays Meeting 5.02.2026 (With LA).pdf
cathrkri Mar 3, 2026
70efb0a
Add files via upload
cathrkri Mar 3, 2026
ab584ac
Feat: Added file (CharityTest) and repo structure for UnitTesting
Mar 3, 2026
7e62703
Feat: Added UnitTest for Charity class with JavaDoc
Mar 3, 2026
30c5e48
Feat: Added UnitTest for CharityRegistry class
Mar 4, 2026
0baccdd
Feat: Added JavaDoc for when necessary in CharityRegistry in Test class
Mar 4, 2026
7d6fe90
Attempt Feat: DonationTest but User is fully developed
Mar 4, 2026
7fa8603
Feat: Added SettingsTest
Mar 4, 2026
d3565a3
Fix: Better naming conventions
Mar 4, 2026
9b40a55
feat: added workflow
robinsp Mar 5, 2026
e3f4b4a
feat: workflow added for testing if runners are working
robinsp Mar 5, 2026
84a2b13
mv .github folder to root
robinsp Mar 5, 2026
a43a8ed
chore: changed README programming lanugauge docs to java 25
robinsp Mar 5, 2026
b5e7385
Add CI workflow
robinsp Mar 5, 2026
4ef68e8
Fix: Simpler definisjon of Anonymous
Mar 5, 2026
b13d42d
Fix: Added FeedbackTest
Mar 5, 2026
9c68af3
Merge branch 'main' of git.ntnu.no:cathrkri/systemutviklingTeam6 into…
Mar 5, 2026
b2c1072
Merge: Clean up before merge
Mar 5, 2026
e2161b7
Merge: Merge with feat/workflow
Mar 5, 2026
40c5bed
Fix: Package Placement
Mar 5, 2026
98feae9
Fix: Package Placement
Mar 5, 2026
6c3f7eb
Fix: Fixed tests based on User being able to create their own id on c…
Mar 5, 2026
2408d90
Fix: Anonymous has correct contructor
Mar 5, 2026
3ab00df
Fixes: All current Tests are valid
Mar 5, 2026
afa366b
Feature: gitignore for better workflow
Mar 5, 2026
23110a0
Fix: Hotfixes and better Anonymous handling
Mar 5, 2026
ca87572
Merge pull request #41 from cathrkri/unitTesting
apbaluna Mar 5, 2026
a8f34aa
Create maven-publish.yml
cathrkri Mar 9, 2026
7cf38d3
Update ci.yml
cathrkri Mar 9, 2026
e357c39
Update ci.yml
cathrkri Mar 9, 2026
b564126
Update ci.yml
cathrkri Mar 10, 2026
0d9ba9a
Added donationPage, and frontPage fxml files
robinsp Mar 10, 2026
a97a0a5
Added config to Main to run JavaFX.forntPage, and to pom.xml
robinsp Mar 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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