entities

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotEnoughMoney = cerr.New("account_from doesn't have enough money")
	ErrMoreThanLimit  = cerr.New("exceeds account_to limit ")
)

Functions

This section is empty.

Types

type Account

type Account struct {
	ID       int64
	UserID   int64
	Currency Currency
	Limit    int64
	Balance  int64
	Name     string
}

type Currency

type Currency string
const (
	Rub      Currency = "rub"
	Euro     Currency = "eur"
	DollarUs Currency = "usd"
)

func (Currency) String

func (c Currency) String() string

type Transaction

type Transaction struct {
	ID          int64
	AccountTo   *Account
	AccountFrom *Account
	Amount      int64
	Type        TransactionType
	Time        time.Time
}

type TransactionFilter

type TransactionFilter struct {
	DateFrom time.Time
	DateTo   time.Time

	WithIncomes  bool
	WithExpenses bool
}

type TransactionType

type TransactionType string
const (
	Transfer TransactionType = "transfer"
	Payment  TransactionType = "payment"
)

func (TransactionType) String

func (t TransactionType) String() string

Jump to

Keyboard shortcuts

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