Skip to content

Commit

Permalink
Fix: Updated contructur Database side, now fills every attribute exec…
Browse files Browse the repository at this point in the history
…pt feedback (which done later)
  • Loading branch information
AdrianBalunan committed Apr 13, 2026
1 parent 926660c commit fe3b0b8
Showing 1 changed file with 20 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class Charity {
private boolean is_pre_approved;

/* Category for the charity */
private String category;
private List<String> category;

/* Description for the charity */
private String description;
Expand Down Expand Up @@ -64,37 +64,41 @@ public Charity(
this.is_pre_approved = is_pre_approved;
this.status = status;
this.feedbacks = new ArrayList<>();
this.category = "";
this.category = new ArrayList<>();
}

/**
* Contructor for creating a new charity. Taylored to match data given from DATABASE. Other
* attributes will just be initialized as empty
* Contructor for creating a new charity. Taylored to match data given from DATABASE.
* Expects paramaters that will fill all attributes. EXECPT for feedbacks.
*
* @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 uuid,
public Charity(String uuid,
String org_number,
String link,
String name,
String url,
String status,
boolean is_pre_approved,
String status) {
List<String> categories,
String description,
String logoURL,
String keyValues,
byte[] logblob) {
this.UUID = UUID.fromString(uuid);
this.org_number = org_number.replaceAll("\\s", "");
this.name = name;
this.url = link;
this.url = url;
this.is_pre_approved = is_pre_approved;
this.status = status;
this.category = "";
this.description = "";
this.logoURL = "";
this.keyValues = "";
this.category = categories;
this.description = description;
this.logoURL = logoURL;
this.keyValues = keyValues;
this.feedbacks = new ArrayList<>();
this.logoBlob = null;
this.logoBlob = logblob;
}

/** Getters for the charity's attributes. */
Expand All @@ -118,7 +122,7 @@ public List<Feedback> getFeedbacks() {
return feedbacks;
}

public String getCategory() {
public List<String> getCategory() {
return category;
}

Expand Down Expand Up @@ -157,7 +161,7 @@ public void setUnverified() {
}

/** Setter for categories. */
public void setCategory(String category) {
public void setCategory(List<String> category) {
this.category = category;
}

Expand Down

0 comments on commit fe3b0b8

Please sign in to comment.