diff options
author | 2025-04-28 08:32:07 +0530 | |
---|---|---|
committer | 2025-04-28 08:32:07 +0530 | |
commit | d2c03d9417fb289d455f80f4c6facd7274c31d3e (patch) | |
tree | 3de135eb932ff20aa50abfb39d5a8abba4758d65 /backend/internal/models/models.go | |
parent | 538d933baef56d7ee76f78617b553d63713efa24 (diff) | |
download | finance-d2c03d9417fb289d455f80f4c6facd7274c31d3e.tar.gz finance-d2c03d9417fb289d455f80f4c6facd7274c31d3e.tar.bz2 finance-d2c03d9417fb289d455f80f4c6facd7274c31d3e.zip |
Diffstat (limited to 'backend/internal/models/models.go')
-rw-r--r-- | backend/internal/models/models.go | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/backend/internal/models/models.go b/backend/internal/models/models.go index c984012..3d409a6 100644 --- a/backend/internal/models/models.go +++ b/backend/internal/models/models.go @@ -94,4 +94,20 @@ type Goal struct { // RelatedLoanID *uint } -// Add other models below (Goal) +// LoanPayment tracks payments made towards a loan +type LoanPayment struct { + gorm.Model + UserID uint `gorm:"not null;index"` // Foreign key to User + User User // Belongs To relationship + LoanID uint `gorm:"not null;index"` // Foreign key to Loan + Loan Loan // Belongs To relationship + Amount int64 `gorm:"not null"` // In smallest currency unit + PaymentDate time.Time `gorm:"not null;index"` // Date payment was made + TransactionID *uint `gorm:"index"` // Optional link to transaction + Transaction *Transaction // Belongs To relationship + Principal int64 // Portion of payment going to principal + Interest int64 // Portion of payment going to interest + Notes string // Any payment notes +} + +// Add other models below |