Documentation ¶
Overview ¶
Package entities contains global level objects accessible by other packages of the application.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { ID int `json:"-"` Name string `json:"name"` Balance decimal.Decimal `json:"balance"` Currency Currency `json:"currency"` }
Account represents a user account in the system.
func (Account) MayGoBelowZero ¶
type Currency ¶
type Currency string
Currency is a string representation of real-word currency.
const USD Currency = "usd"
type Payment ¶
type Payment struct { Account Account Counterparty Account Transaction Transaction Direction Direction Amount decimal.Decimal Currency Currency }
Payment represents a money move between two accounts in a single direction (either incoming or outgoing). Each payment has a corresponding opposite payment. Both such payments are linked by a single Transaction.
type Transaction ¶
Transaction is an object linking two related and opposite payments.
Click to show internal directories.
Click to hide internal directories.