diff options
Diffstat (limited to 'backend/internal/api/v1')
-rw-r--r-- | backend/internal/api/v1/goals/goals.go | 26 | ||||
-rw-r--r-- | backend/internal/api/v1/loans/loans.go | 25 |
2 files changed, 50 insertions, 1 deletions
diff --git a/backend/internal/api/v1/goals/goals.go b/backend/internal/api/v1/goals/goals.go index 1d2cd6f..4f99468 100644 --- a/backend/internal/api/v1/goals/goals.go +++ b/backend/internal/api/v1/goals/goals.go @@ -1,7 +1,7 @@ package goals import ( - "finance/backend/handlers" + "finance/backend/internal/api/handlers" "github.com/gin-gonic/gin" ) @@ -41,3 +41,27 @@ func UpdateGoalProgress() gin.HandlerFunc { handler := handlers.NewGoalHandler() return handler.UpdateGoalProgress } + +// GetGoalProgressDetails returns goal with enhanced progress tracking details +func GetGoalProgressDetails() gin.HandlerFunc { + handler := handlers.NewGoalHandler() + return handler.GetGoalProgressDetails +} + +// GetAllGoalsProgressDetails returns all goals with enhanced progress tracking details +func GetAllGoalsProgressDetails() gin.HandlerFunc { + handler := handlers.NewGoalHandler() + return handler.GetAllGoalsProgressDetails +} + +// LinkTransactionToGoal links a transaction to a goal for progress tracking +func LinkTransactionToGoal() gin.HandlerFunc { + handler := handlers.NewGoalHandler() + return handler.LinkTransactionToGoal +} + +// RecalculateGoalProgress recalculates the progress of a goal based on its transactions +func RecalculateGoalProgress() gin.HandlerFunc { + handler := handlers.NewGoalHandler() + return handler.RecalculateGoalProgress +} diff --git a/backend/internal/api/v1/loans/loans.go b/backend/internal/api/v1/loans/loans.go index 1366b3b..49ab320 100644 --- a/backend/internal/api/v1/loans/loans.go +++ b/backend/internal/api/v1/loans/loans.go @@ -5,6 +5,7 @@ import ( "strconv" "time" + "finance/backend/internal/api/handlers" "finance/backend/internal/database" "finance/backend/internal/models" @@ -246,3 +247,27 @@ func DeleteLoan() gin.HandlerFunc { c.JSON(http.StatusOK, gin.H{"message": "Loan deleted successfully"}) } } + +// GetLoanPayments returns all payments for a specific loan +func GetLoanPayments() gin.HandlerFunc { + handler := handlers.NewLoanHandler() + return handler.GetLoanPayments +} + +// CreateLoanPayment creates a new payment for a loan +func CreateLoanPayment() gin.HandlerFunc { + handler := handlers.NewLoanHandler() + return handler.CreateLoanPayment +} + +// DeleteLoanPayment deletes a loan payment +func DeleteLoanPayment() gin.HandlerFunc { + handler := handlers.NewLoanHandler() + return handler.DeleteLoanPayment +} + +// GetLoanPaymentSchedule generates an estimated payment schedule for a loan +func GetLoanPaymentSchedule() gin.HandlerFunc { + handler := handlers.NewLoanHandler() + return handler.GetLoanPaymentSchedule +} |