feat: loans
This commit is contained in:
parent
f05c36e44f
commit
ac7296b06e
20 changed files with 3191 additions and 4 deletions
25
internal/model/loan.go
Normal file
25
internal/model/loan.go
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
package model
|
||||
|
||||
import "time"
|
||||
|
||||
type Loan struct {
|
||||
ID string `db:"id"`
|
||||
SpaceID string `db:"space_id"`
|
||||
Name string `db:"name"`
|
||||
Description string `db:"description"`
|
||||
OriginalAmountCents int `db:"original_amount_cents"`
|
||||
InterestRateBps int `db:"interest_rate_bps"`
|
||||
StartDate time.Time `db:"start_date"`
|
||||
EndDate *time.Time `db:"end_date"`
|
||||
IsPaidOff bool `db:"is_paid_off"`
|
||||
CreatedBy string `db:"created_by"`
|
||||
CreatedAt time.Time `db:"created_at"`
|
||||
UpdatedAt time.Time `db:"updated_at"`
|
||||
}
|
||||
|
||||
type LoanWithPaymentSummary struct {
|
||||
Loan
|
||||
TotalPaidCents int
|
||||
RemainingCents int
|
||||
ReceiptCount int
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue