aboutsummaryrefslogtreecommitdiffstats
path: root/backend/internal/api/v1/goals/goals.go
diff options
context:
space:
mode:
Diffstat (limited to 'backend/internal/api/v1/goals/goals.go')
-rw-r--r--backend/internal/api/v1/goals/goals.go43
1 files changed, 43 insertions, 0 deletions
diff --git a/backend/internal/api/v1/goals/goals.go b/backend/internal/api/v1/goals/goals.go
new file mode 100644
index 0000000..1d2cd6f
--- /dev/null
+++ b/backend/internal/api/v1/goals/goals.go
@@ -0,0 +1,43 @@
+package goals
+
+import (
+ "finance/backend/handlers"
+
+ "github.com/gin-gonic/gin"
+)
+
+// GetGoals returns all goals for the authenticated user
+func GetGoals() gin.HandlerFunc {
+ handler := handlers.NewGoalHandler()
+ return handler.GetGoals
+}
+
+// GetGoalByID returns a specific goal by ID
+func GetGoalByID() gin.HandlerFunc {
+ handler := handlers.NewGoalHandler()
+ return handler.GetGoal
+}
+
+// CreateGoal creates a new financial goal
+func CreateGoal() gin.HandlerFunc {
+ handler := handlers.NewGoalHandler()
+ return handler.CreateGoal
+}
+
+// UpdateGoal updates an existing goal
+func UpdateGoal() gin.HandlerFunc {
+ handler := handlers.NewGoalHandler()
+ return handler.UpdateGoal
+}
+
+// DeleteGoal deletes a goal
+func DeleteGoal() gin.HandlerFunc {
+ handler := handlers.NewGoalHandler()
+ return handler.DeleteGoal
+}
+
+// UpdateGoalProgress updates just the progress (current amount) of a goal
+func UpdateGoalProgress() gin.HandlerFunc {
+ handler := handlers.NewGoalHandler()
+ return handler.UpdateGoalProgress
+}