Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { BaseModel Name string `gorm:"size:64;not null" json:"name"` Balance decimal.Decimal `gorm:"type:decimal(16, 2);default:0;not null;" json:"balance"` UserID int `gorm:"not null" json:"-"` User User `gorm:"foreignKey:UserID" json:"user"` CurrencyID int `gorm:"not null" json:"-"` Currency Currency `gorm:"foreignKey:CurrencyID" json:"currency"` }
type Currency ¶
type RevokedToken ¶
type RevokedToken struct { BaseModel Token string `gorm:"unique;index;"` ExpiredAt time.Time `gorm:"notnull;index;"` }
func (RevokedToken) TableName ¶
func (RevokedToken) TableName() string
type Transaction ¶
type Transaction struct { BaseModel Amount decimal.Decimal `json:"amount"` Type TransactionType `json:"transaction_type"` CategoryID int `json:"-"` Category TransactionCategory `gorm:"foreignKey:CategoryID" json:"category"` AccountID int `json:"-"` Account Account `gorm:"foreignKey:AccountID" json:"account"` Comment string `json:"comment"` }
func (Transaction) TableName ¶
func (Transaction) TableName() string
type TransactionCategory ¶
type TransactionCategory struct { BaseModel UserID int `json:"-"` User User `gorm:"foreignKey:UserID" json:"user"` Name string `gorm:"size:64" json:"name"` Type TransactionType `gorm:"type:transaction_types"` MonthLimit decimal.Decimal `gorm:"type:decimal(16, 2);" json:"month_limit"` }
func (TransactionCategory) TableName ¶
func (TransactionCategory) TableName() string
type TransactionType ¶
type TransactionType string
const ( Income TransactionType = "income" Expense TransactionType = "expense" )
func (*TransactionType) Scan ¶
func (t *TransactionType) Scan(value interface{}) error
Click to show internal directories.
Click to hide internal directories.