aboutsummaryrefslogtreecommitdiff
path: root/ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java
diff options
context:
space:
mode:
authorsowgro <tpoke.ferrari@gmail.com>2025-03-30 14:34:10 -0400
committersowgro <tpoke.ferrari@gmail.com>2025-03-30 14:34:10 -0400
commit9fba1c4af3c9b5aad206ec76469c1625125ea799 (patch)
treeb31f52745944cfd6159b6fcef60b19fe4c80a3dc /ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java
parentf23afc7f3b0b62384b3b54a0864b02abc3b48b01 (diff)
parent0c793d302c5065085ff7982a68f7ed449d84d6dc (diff)
downloadJellySolutions-9fba1c4af3c9b5aad206ec76469c1625125ea799.tar.gz
JellySolutions-9fba1c4af3c9b5aad206ec76469c1625125ea799.tar.bz2
JellySolutions-9fba1c4af3c9b5aad206ec76469c1625125ea799.zip
Merge remote-tracking branch 'origin/main' into list-and-cupboard-component-refactor
# Conflicts: # ufund-api/src/main/java/com/ufund/api/ufundapi/controller/CupboardController.java # ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java # ufund-ui/src/app/components/cupboard/cupboard.component.ts # ufund-ui/src/app/components/need-list/need-list.component.ts # ufund-ui/src/app/models/Need.ts
Diffstat (limited to 'ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java')
-rw-r--r--ufund-api/src/main/java/com/ufund/api/ufundapi/model/Need.java10
1 files changed, 7 insertions, 3 deletions
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 45f1f9a..00cd38f 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
@@ -19,7 +19,7 @@ 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 location The physical location of the need
@@ -28,7 +28,7 @@ public class Need {
* @param type The type of need (monetary, physical)
* @param urgent The urgency of the need
*/
- public Need(@JsonProperty("name") String name, @JsonProperty("location") String location, @JsonProperty("id") int id, @JsonProperty("maxGoal") double maxGoal, 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) {
this.id = id;
this.location = location;
this.name = name;
@@ -44,7 +44,7 @@ public class 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
+ * @param urgent The urgency of the need
*/
public Need(String name, String location, GoalType type, double maxGoal, boolean urgent) {
this.name = name;
@@ -106,6 +106,10 @@ public class Need {
this.current = current;
}
+ public void incrementCurrent(double incrementAmount) {
+ this.current += incrementAmount;
+ }
+
public void setFilterAttributes(String[] filterAttributes) {
this.filterAttributes = filterAttributes;
}