loan

package
v0.0.0-...-50e7ee4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Amount

type Amount = int64

Amount is amount of cents in balance or loan log

type Balance

type Balance struct {
	// UserID is ID of related user
	UserID user.ID `json:"user_id" db:"user_id"`

	// Balance is summary of loans given to specific user and debts of that user.
	Balance Amount `json:"balance" db:"balance"`
}

Balance is dept balance (saldo) for specific user.

Basically is summary of loans given to specific user and debts of that user.

type Loan

type Loan struct {
	// LenderID is ID of user which lent money.
	LenderID user.ID `json:"lender_id" db:"lender_id"`

	// DebtorID is ID of user which borrowed money.
	DebtorID user.ID `json:"debtor_id" db:"debtor_id"`

	// Amount is loan amount in cents.
	Amount Amount `json:"amount" db:"amount"`
}

Loan describes loan amount given by lender to debtor.

type Record

type Record struct {
	Loan

	// ID is record ID in loan log.
	ID pgtype.UUID `json:"id" db:"id"`

	// CreatedAt is record creation date and time.
	CreatedAt time.Time `json:"created_at" db:"created_at"`
}

Record is loan record in log with record ID and creation date.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL