Documentation ¶
Index ¶
Constants ¶
View Source
const ( StockRole = "stock" EmitentRole = "emitent" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Deal ¶
type Deal struct { ID uint `gorm:"primaryKey,autoIncrement"` OwnerID uint `gorm:"index:idx_owner"` Owner *User `gorm:"constraint:OnDelete:CASCADE,OnUpdate:CASCADE"` SecurityID uint Security *Security `gorm:"constraint:OnDelete:CASCADE,OnUpdate:CASCADE"` Amount uint `gorm:"check:amount > 0"` Price float64 `gorm:"check:price > 0"` Active bool Sell bool }
type InventoryItem ¶
type Transaction ¶
type Transaction struct { ID uint `gorm:"primaryKey,autoIncrement"` Buyer *User `gorm:"constraint:OnDelete:CASCADE,OnUpdate:CASCADE;"` BuyerID uint Seller *User `gorm:"constraint:OnDelete:CASCADE,OnUpdate:CASCADE;"` SellerID uint Subject *Deal `gorm:"constraint:OnDelete:CASCADE,OnUpdate:CASCADE;"` SubjectID uint Amount uint }
type User ¶
type User struct { ID uint `gorm:"primaryKey,autoIncrement"` LastName string `gorm:"not null"` Role string `gorm:"not null"` FirstName string `gorm:"not null"` Email string `gorm:"index:idx_email,unique;not null"` Password string `gorm:"not null"` Balance int `gorm:"not null"` Deals []Deal `gorm:"foreignKey:OwnerID"` Inventory []InventoryItem `gorm:"foreignKey:OwnerID"` }
Click to show internal directories.
Click to hide internal directories.