From cb3b7710b9e32df408b3a38383aca049fa98214e Mon Sep 17 00:00:00 2001 From: Gunther6070 Date: Mon, 24 Mar 2025 21:17:33 -0400 Subject: Fixed various bugs and began fixing auth system. Also started implementing checkout method in cupboardService --- ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java') diff --git a/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java b/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java index c0e9214..22e86e3 100644 --- a/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java +++ b/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java @@ -17,14 +17,14 @@ public class Need { @JsonProperty("current") private double current; /** - * Create a new need + * Create a new need, used by the controller * * @param name The name of the need * @param id The unique ID of the need * @param maxGoal The maximum goal for this need * @param type The type of need (monetary, physical) */ - public Need(@JsonProperty("name") String name, @JsonProperty("id") int id, @JsonProperty("maxGoal") double maxGoal, GoalType type) { + public Need(@JsonProperty("name") String name, @JsonProperty("id") int id, @JsonProperty("maxGoal") double maxGoal, @JsonProperty("type") GoalType type) { this.id = id; this.name = name; this.maxGoal = maxGoal; @@ -86,6 +86,10 @@ public class Need { this.current = current; } + public void incrementCurrent(double incrementAmount) { + this.current += incrementAmount; + } + public void setFilterAttributes(String[] filterAttributes) { this.filterAttributes = filterAttributes; } -- cgit v1.2.3 From c15aa3daab0cf9a640945d4e634d1327fb55d2db Mon Sep 17 00:00:00 2001 From: sowgro Date: Tue, 25 Mar 2025 00:03:45 -0400 Subject: Greatly improve logging and other backend clean up --- ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java') diff --git a/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java b/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java index 22e86e3..786b104 100644 --- a/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java +++ b/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java @@ -38,7 +38,7 @@ public class Need { * @param maxGoal The maximum goal for this need * @param type The type of need (monetary, physical) */ - public Need(String name, GoalType type, double maxGoal) { + public Need(String name, GoalType type, double maxGoal) { // TODO why is this needed this.name = name; this.type = type; this.maxGoal = maxGoal; -- cgit v1.2.3 From 5dfb1327c4507ae1613debb5b485fd74edff33db Mon Sep 17 00:00:00 2001 From: sowgro Date: Wed, 26 Mar 2025 19:00:04 -0400 Subject: fix expiration logic and cleanup --- ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java') diff --git a/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java b/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java index 786b104..22e86e3 100644 --- a/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java +++ b/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java @@ -38,7 +38,7 @@ public class Need { * @param maxGoal The maximum goal for this need * @param type The type of need (monetary, physical) */ - public Need(String name, GoalType type, double maxGoal) { // TODO why is this needed + public Need(String name, GoalType type, double maxGoal) { this.name = name; this.type = type; this.maxGoal = maxGoal; -- cgit v1.2.3 From e0a3f2c2c0fec40aa50c8889e343a1dbc7f9d7fb Mon Sep 17 00:00:00 2001 From: benal01 Date: Sat, 29 Mar 2025 15:01:12 -0400 Subject: API functionality for urgency and location --- .../java/com/ufund/api/ufundapi/model/Need.java | 32 ++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java') diff --git a/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java b/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java index c0e9214..45f1f9a 100644 --- a/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java +++ b/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java @@ -10,38 +10,48 @@ public class Need { } @JsonProperty("name") private String name; + @JsonProperty("location") private String location; @JsonProperty("id") private int id; @JsonProperty("filterAttributes") private String[] filterAttributes; @JsonProperty("type") final private GoalType type; @JsonProperty("maxGoal") private double maxGoal; + @JsonProperty("urgent") private boolean urgent; @JsonProperty("current") private double current; /** * Create a new need * * @param name The name of the need + * @param location The physical location of the need * @param id The unique ID of the need * @param maxGoal The maximum goal for this need * @param type The type of need (monetary, physical) + * @param urgent The urgency of the need */ - public Need(@JsonProperty("name") String name, @JsonProperty("id") int id, @JsonProperty("maxGoal") double maxGoal, GoalType type) { + public Need(@JsonProperty("name") String name, @JsonProperty("location") String location, @JsonProperty("id") int id, @JsonProperty("maxGoal") double maxGoal, GoalType type, @JsonProperty("urgent") boolean urgent) { this.id = id; + this.location = location; this.name = name; this.maxGoal = maxGoal; this.type = type; + this.urgent = urgent; } /** * Create a new need * * @param name The name of the need + * @param location The location of the need * @param maxGoal The maximum goal for this need * @param type The type of need (monetary, physical) + * @param urgency The urgency of the need */ - public Need(String name, GoalType type, double maxGoal) { + public Need(String name, String location, GoalType type, double maxGoal, boolean urgent) { this.name = name; + this.location = location; this.type = type; this.maxGoal = maxGoal; + this.urgent = urgent; } /** @@ -51,17 +61,23 @@ public class Need { */ public Need(Need other) { this.name = other.name; + this.location = other.location; this.id = other.id; this.filterAttributes = other.filterAttributes; this.type = other.type; this.maxGoal = other.maxGoal; this.current = other.current; + this.urgent = other.urgent; } public String getName() { return name; } + public String getLocation() { + return location; + } + public int getId() { return id; } @@ -82,6 +98,10 @@ public class Need { return current; } + public boolean isUrgent() { + return urgent; + } + public void setCurrent(double current) { this.current = current; } @@ -98,7 +118,15 @@ public class Need { this.name = name; } + public void setLocation(String location) { + this.location = location; + } + public void setID(int id){ this.id = id; } + + public void setUrgent(boolean urgent) { + this.urgent = urgent; + } } \ No newline at end of file -- cgit v1.2.3 From 1abdb1408159796d12ed28c73862dd8d186384f0 Mon Sep 17 00:00:00 2001 From: Gunther6070 Date: Sun, 30 Mar 2025 16:41:24 -0400 Subject: Fixed broken tests and made them more consistent --- .../main/java/com/ufund/api/ufundapi/model/Need.java | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java') diff --git a/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java b/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java index 00cd38f..55a9441 100644 --- a/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java +++ b/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java @@ -46,7 +46,7 @@ public class Need { * @param type The type of need (monetary, physical) * @param urgent The urgency of the need */ - public Need(String name, String location, GoalType type, double maxGoal, boolean urgent) { + public Need(String name, String location, double maxGoal, GoalType type, boolean urgent) { this.name = name; this.location = location; this.type = type; @@ -74,10 +74,6 @@ public class Need { return name; } - public String getLocation() { - return location; - } - public int getId() { return id; } @@ -98,10 +94,6 @@ public class Need { return current; } - public boolean isUrgent() { - return urgent; - } - public void setCurrent(double current) { this.current = current; } @@ -122,15 +114,7 @@ public class Need { this.name = name; } - public void setLocation(String location) { - this.location = location; - } - public void setID(int id){ this.id = id; } - - public void setUrgent(boolean urgent) { - this.urgent = urgent; - } } \ No newline at end of file -- cgit v1.2.3 From 227360990424abe323c44664b1d58d667b89a92f Mon Sep 17 00:00:00 2001 From: benal01 Date: Mon, 31 Mar 2025 10:10:41 -0400 Subject: backend support for description --- .../src/main/java/com/ufund/api/ufundapi/model/Need.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java') diff --git a/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java b/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java index 55a9441..35e81b3 100644 --- a/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java +++ b/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java @@ -17,6 +17,7 @@ public class Need { @JsonProperty("maxGoal") private double maxGoal; @JsonProperty("urgent") private boolean urgent; @JsonProperty("current") private double current; + @JsonProperty("description") private String description; /** * Create a new need, used by the controller @@ -27,14 +28,16 @@ public class Need { * @param maxGoal The maximum goal for this need * @param type The type of need (monetary, physical) * @param urgent The urgency of the need + * @param description The description of the need */ - public Need(@JsonProperty("name") String name, @JsonProperty("location") String location, @JsonProperty("id") int id, @JsonProperty("maxGoal") double maxGoal, @JsonProperty("type") GoalType type, @JsonProperty("urgent") boolean urgent) { + public Need(@JsonProperty("name") String name, @JsonProperty("location") String location, @JsonProperty("id") int id, @JsonProperty("maxGoal") double maxGoal, @JsonProperty("type") GoalType type, @JsonProperty("urgent") boolean urgent, @JsonProperty("Description") String description) { this.id = id; this.location = location; this.name = name; this.maxGoal = maxGoal; this.type = type; this.urgent = urgent; + this.description = description; } /** @@ -45,13 +48,15 @@ public class Need { * @param maxGoal The maximum goal for this need * @param type The type of need (monetary, physical) * @param urgent The urgency of the need + * @param description The description of the need */ - public Need(String name, String location, double maxGoal, GoalType type, boolean urgent) { + public Need(String name, String location, double maxGoal, GoalType type, boolean urgent, String description) { this.name = name; this.location = location; this.type = type; this.maxGoal = maxGoal; this.urgent = urgent; + this.description = description; } /** @@ -68,6 +73,7 @@ public class Need { this.maxGoal = other.maxGoal; this.current = other.current; this.urgent = other.urgent; + this.description = other.description; } public String getName() { @@ -94,6 +100,7 @@ public class Need { return current; } + public void setCurrent(double current) { this.current = current; } -- cgit v1.2.3 From 371caf37fb71fd9adf89e52a5557a9359d680539 Mon Sep 17 00:00:00 2001 From: benal01 Date: Mon, 31 Mar 2025 17:47:09 -0400 Subject: backend image support --- ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java') diff --git a/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java b/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java index 35e81b3..9b6170b 100644 --- a/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java +++ b/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java @@ -10,6 +10,7 @@ public class Need { } @JsonProperty("name") private String name; + @JsonProperty("image") private String image; @JsonProperty("location") private String location; @JsonProperty("id") private int id; @JsonProperty("filterAttributes") private String[] filterAttributes; @@ -30,8 +31,9 @@ public class Need { * @param urgent The urgency of the need * @param description The description of the need */ - public Need(@JsonProperty("name") String name, @JsonProperty("location") String location, @JsonProperty("id") int id, @JsonProperty("maxGoal") double maxGoal, @JsonProperty("type") GoalType type, @JsonProperty("urgent") boolean urgent, @JsonProperty("Description") String description) { + public Need(@JsonProperty("name") String name, @JsonProperty("image") String image, @JsonProperty("location") String location, @JsonProperty("id") int id, @JsonProperty("maxGoal") double maxGoal, @JsonProperty("type") GoalType type, @JsonProperty("urgent") boolean urgent, @JsonProperty("Description") String description) { this.id = id; + this.image = image; this.location = location; this.name = name; this.maxGoal = maxGoal; @@ -44,14 +46,16 @@ public class Need { * Create a new need * * @param name The name of the need + * @param image The image representation of the need * @param location The location of the need * @param maxGoal The maximum goal for this need * @param type The type of need (monetary, physical) * @param urgent The urgency of the need * @param description The description of the need */ - public Need(String name, String location, double maxGoal, GoalType type, boolean urgent, String description) { + public Need(String name, String image, String location, double maxGoal, GoalType type, boolean urgent, String description) { this.name = name; + this.image = image; this.location = location; this.type = type; this.maxGoal = maxGoal; @@ -66,6 +70,7 @@ public class Need { */ public Need(Need other) { this.name = other.name; + this.image = other.image; this.location = other.location; this.id = other.id; this.filterAttributes = other.filterAttributes; -- cgit v1.2.3