Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var StockSelect = []string{"ID", " Name", "Quantity"}
View Source
var TokenSelect = []string{"ID", "token", "user_id", "valid_until", "comment", "active"}
View Source
var TransactionSelect = []string{"ID", "seller_id", "buyer_id", "stock_id", " Quantity", " Type", "Price", "currency", "Status"}
View Source
var UserSelect = []string{"ID", " Username", " Email", " Address", "Funds", "currency"}
Functions ¶
func IsTransactionStatus ¶
func IsTransactionsType ¶
Types ¶
type MonetaryUnit ¶
type StockToUser ¶
type Transaction ¶
type Transaction struct { gorm.Model ID string `gorm:"primaryKey;autoIncrement:false;not null"` SellerID string `gorm:"foreignkey:userID" json:"seller_id"` BuyerID string `gorm:"foreignkey:userID" json:"buyer_id"` StockID string `gorm:"foreignkey:stockID;not null" json:"stock_id"` Quantity int `gorm:"not null" json:"quantity"` Price float64 `gorm:"not null" json:"price"` Currency string `gorm:"not null" json:"currency"` Type string `gorm:"not null" json:"type"` Status string `gorm:"not null;default:PENDING" json:"status"` Comment string `gorm:"default:initiated" json:"comment"` }
type User ¶
type User struct { gorm.Model ID string `gorm:"primaryKey;autoIncrement:false;not null"` Username string `gorm:"unique;not null" json:"username"` Password string `gorm:"not null" json:"password"` Email string `gorm:"unique" json:"email"` Address string `json:"address"` Funds float64 `gorm:"default:0" json:"funds"` Currency string `gorm:"not null" json:"currency"` }
Click to show internal directories.
Click to hide internal directories.