Skip to content

Commit

Permalink
Fix: Maven clean
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianBalunan committed Mar 12, 2026
1 parent 8916a37 commit 6fc5243
Show file tree
Hide file tree
Showing 5 changed files with 201 additions and 219 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@
import javafx.scene.layout.FlowPane;

public class CharityPageController {
@FXML private FlowPane charityPage;

@FXML
public void initialize() {

}

@FXML private FlowPane charityPage;

@FXML
public void initialize() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,45 +34,43 @@ public class Charity {
/* List that contains the charity's Feedbacks */
private List<Feedback> feedbacks;



/**
* Contructor for creating a new charity. The charity is unverified by default.
* Contructor for creating a new charity. Taylored to match data given from Api. Other attributes
* will just be initialized as empty
*
* @param org_number matches from innsamlingkontrollen
* @param name matches from innsamlingkontrollen
* @param is_pre_approved name matches from innsamlingkontrollen
* @param status name matches from innsamlingkontrollen
* @param description no coreleation to innsamlingskontrollen
* @param category no coreleation to innsamlingskontrollen
*
*/
public Charity(String org_number, String name, String description, String category, boolean is_pre_approved, String status) {
public Charity(
String org_number, String link, String name, boolean is_pre_approved, String status) {
this.UUID = java.util.UUID.randomUUID();
this.org_number = org_number == null ? "" : org_number.replaceAll("\\s", "");
this.org_number = org_number.replaceAll("\\s", "");
this.name = name;
this.description = description;
this.description = "Les mer her: " + link;
this.is_pre_approved = is_pre_approved;
this.status = status;
this.feedbacks = new ArrayList<>();
this.category = category;
this.category = "";
}

/**
* Contructor for creating a new charity. Taylored to match data given from Api.
* Other attributes will just be initialized as empty
* Contructor for creating a new charity. Taylored to match data given from DATABASE. Other attributes
* will just be initialized as empty
*
* @param org_number matches from innsamlingkontrollen
* @param name matches from innsamlingkontrollen
* @param is_pre_approved name matches from innsamlingkontrollen
* @param status name matches from innsamlingkontrollen
*
*/
public Charity(String org_number, String link, String name, boolean is_pre_approved, String status) {
this.UUID = java.util.UUID.randomUUID();
public Charity(String uuid,
String org_number, String link, String name, boolean is_pre_approved, String status) {
this.UUID = UUID.fromString(uuid);
this.org_number = org_number.replaceAll("\\s", "");
this.name = name;
this.description = "Les mer her: " + link;
this.description = link;
this.is_pre_approved = is_pre_approved;
this.status = status;
this.feedbacks = new ArrayList<>();
Expand All @@ -83,6 +81,7 @@ public Charity(String org_number, String link, String name, boolean is_pre_appro
public UUID getUUID() {
return UUID;
}

public String getOrg_number() {
return org_number;
}
Expand All @@ -91,7 +90,9 @@ public String getStatus() {
return status;
}

public boolean getPreApproved(){return is_pre_approved;}
public boolean getPreApproved() {
return is_pre_approved;
}

public List<Feedback> getFeedbacks() {
return feedbacks;
Expand All @@ -118,5 +119,4 @@ public void setVerified() {
public void setUnverified() {
this.status = "Veto";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ public Optional<Charity> findCharityByOrgnumber(String org_number) {
if (org_number == null) {
throw new IllegalArgumentException("CharityId can not be null.");
}
return charities.stream().filter(charity -> org_number.equals(charity.getOrg_number())).findFirst();
return charities.stream()
.filter(charity -> org_number.equals(charity.getOrg_number()))
.findFirst();
}

public Optional<Charity> findCharityByUUID(UUID uuid) {
if (uuid == null) {
throw new IllegalArgumentException("CharityId can not be null.");
Expand All @@ -40,6 +42,7 @@ public boolean removeCharity(String org_number) {
}
return charities.removeIf(charity -> org_number.equals(charity.getOrg_number()));
}

public boolean removeCharityUUID(UUID uuid) {
if (uuid == null) {
throw new IllegalArgumentException("CharityId can not be null.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,92 +3,86 @@
import ntnu.systemutvikling.team6.database.DatabaseManager;

/**
* Represents data parsed from the IK API JSON response.
* Instances are immutable; to update any value, a new object must be created.
* <p>
* Receives data directly from {@link APICharityScraper} or {@link IKOrganizationScraper}.
* </p>
* <p>
* {@code org_number} should be a unique number, as it is used as a primary key
* in {@link DatabaseManager}.
* </p>
* Represents data parsed from the IK API JSON response. Instances are immutable; to update any
* value, a new object must be created.
*
* <p>Receives data directly from {@link APICharityScraper} or {@link IKOrganizationScraper}.
*
* <p>{@code org_number} should be a unique number, as it is used as a primary key in {@link
* DatabaseManager}.
*/

public class APICharityData {
private final String org_number;
private final String name;
private final String status;
private final String url;
private final boolean is_pre_approved;

/**
* Constructs a new APICharityData object.
* @param org_number a unique number that identifies the organization
* @param name the name of the organization
* @param status {@code approved} for approved organizations,
* {@code obs} for non-approved organizations
* @param url the URL for more info about the organization on the IK domain
* @param is_pre_approved whether the organization was pre-approved
*/

public APICharityData(String org_number, String name, String status, String url, boolean is_pre_approved) {
if (org_number == null || org_number.isBlank()) {
throw new IllegalArgumentException("ERROR: Org number cannot be null or blank");
}
this.org_number = org_number.replaceAll("\\s", "");
this.name = name;
this.status = status;
this.url = url;
this.is_pre_approved = is_pre_approved;
}

/**
* Returns the organization number. Must not be {@code null} or blank.
*
* @return the organization number
*/

public String getOrg_number() {
return this.org_number;
}

/**
* Returns the name of the organization. Whitespace removed.
*
* @return the name of the organization
*/
private final String org_number;
private final String name;
private final String status;
private final String url;
private final boolean is_pre_approved;

public String getName() {
return name;
/**
* Constructs a new APICharityData object.
*
* @param org_number a unique number that identifies the organization
* @param name the name of the organization
* @param status {@code approved} for approved organizations, {@code obs} for non-approved
* organizations
* @param url the URL for more info about the organization on the IK domain
* @param is_pre_approved whether the organization was pre-approved
*/
public APICharityData(
String org_number, String name, String status, String url, boolean is_pre_approved) {
if (org_number == null || org_number.isBlank()) {
throw new IllegalArgumentException("ERROR: Org number cannot be null or blank");
}
this.org_number = org_number.replaceAll("\\s", "");
this.name = name;
this.status = status;
this.url = url;
this.is_pre_approved = is_pre_approved;
}

/**
* Returns whether the organization is approved or not
* @return the approved status of the organization
*/

public String getStatus() {
return status;
}
/**
* Returns the organization number. Must not be {@code null} or blank.
*
* @return the organization number
*/
public String getOrg_number() {
return this.org_number;
}

/**
* Returns the URL of the organizations information page on IK
*
* @return the URL for more info about the organization
*/
/**
* Returns the name of the organization. Whitespace removed.
*
* @return the name of the organization
*/
public String getName() {
return name;
}

public String getUrl() {
return url;
}
/**
* Returns whether the organization is approved or not
*
* @return the approved status of the organization
*/
public String getStatus() {
return status;
}

/**
* Returns whether the organization was pre-approved.
*
* @return {@code true} if organization was pre-approved <br>
* {@code false} otherwise
*/
/**
* Returns the URL of the organizations information page on IK
*
* @return the URL for more info about the organization
*/
public String getUrl() {
return url;
}

public boolean getIs_pre_approved() {
return this.is_pre_approved;
}
/**
* Returns whether the organization was pre-approved.
*
* @return {@code true} if organization was pre-approved <br>
* {@code false} otherwise
*/
public boolean getIs_pre_approved() {
return this.is_pre_approved;
}
}
Loading

0 comments on commit 6fc5243

Please sign in to comment.