models

package
v0.0.0-...-81673a4 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultOffset = 0
	DefaultLimit  = 100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	ID                  uuid.UUID       `sql:"id,pk,type:uuid default gen_random_uuid()" json:"id"`
	CurrencyNumericCode int             `json:"currency_numeric_code"`
	Balance             decimal.Decimal `json:"balance"`
}

Account - information about account

type Currency

type Currency struct {
	NumericCode int    `sql:"numeric_code,pk" json:"numeric_code"`
	AlphaCode   string `json:"alpha_code"`
	Minor       int32  `json:"minor"` // Number of decimal units
}

Currency - basic info about currency

type ExchangeRate

type ExchangeRate struct {
	ID                      uuid.UUID       `sql:"id,pk,type:uuid default gen_random_uuid()" json:"id"`
	CurrencyNumericCodeFrom int             `json:"currency_numeric_code_from"`
	CurrencyNumericCodeTo   int             `json:"currency_numeric_code_to"`
	Rate                    decimal.Decimal `json:"rate"`
}

ExchangeRate - information about exchange rates between two currencies

type ExchangeRateArgs

type ExchangeRateArgs struct {
	CurrencyNumericCodeFrom int
	CurrencyNumericCodeTo   int
}

type OffsetLimit

type OffsetLimit struct {
	Offset int
	Limit  int
}

OffsetLimit - used for database access

type Payment

type Payment struct {
	ID                  uuid.UUID       `sql:"id,pk,type:uuid default gen_random_uuid()" json:"id"`
	FromAccount         uuid.UUID       `json:"from_account"`
	ToAccount           uuid.UUID       `json:"to_account"`
	CurrencyNumericCode int             `json:"currency_numeric_code"`
	Amount              decimal.Decimal `json:"amount"`
	CreatedAt           time.Time       `json:"created_at"`
}

Jump to

Keyboard shortcuts

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