aboutsummaryrefslogtreecommitdiffstats
path: root/backend/internal/api/v1/loans
diff options
context:
space:
mode:
authorLibravatarLibravatar Biswa Kalyan Bhuyan <biswa@surgot.in> 2025-04-28 08:32:07 +0530
committerLibravatarLibravatar Biswa Kalyan Bhuyan <biswa@surgot.in> 2025-04-28 08:32:07 +0530
commitd2c03d9417fb289d455f80f4c6facd7274c31d3e (patch)
tree3de135eb932ff20aa50abfb39d5a8abba4758d65 /backend/internal/api/v1/loans
parent538d933baef56d7ee76f78617b553d63713efa24 (diff)
downloadfinance-master.tar.gz
finance-master.tar.bz2
finance-master.zip
finance/backend: feat: Refined APIs for Loans and Goals based on frontend needsHEADmaster
Diffstat (limited to 'backend/internal/api/v1/loans')
-rw-r--r--backend/internal/api/v1/loans/loans.go25
1 files changed, 25 insertions, 0 deletions
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
+}