From fe3b0b8cb10854a153c6dc53828be8279455207a Mon Sep 17 00:00:00 2001 From: AdrianBalunan Date: Mon, 13 Apr 2026 15:06:10 +0200 Subject: [PATCH] Fix: Updated contructur Database side, now fills every attribute execpt feedback (which done later) --- .../systemutvikling/team6/models/Charity.java | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/Charity.java b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/Charity.java index 357e3ec..a5768de 100644 --- a/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/Charity.java +++ b/helpmehelpapplication/src/main/java/ntnu/systemutvikling/team6/models/Charity.java @@ -29,7 +29,7 @@ public class Charity { private boolean is_pre_approved; /* Category for the charity */ - private String category; + private List category; /* Description for the charity */ private String description; @@ -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 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. */ @@ -118,7 +122,7 @@ public List getFeedbacks() { return feedbacks; } - public String getCategory() { + public List getCategory() { return category; } @@ -157,7 +161,7 @@ public void setUnverified() { } /** Setter for categories. */ - public void setCategory(String category) { + public void setCategory(List category) { this.category = category; }