model

package
v0.0.0-...-c722a28 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	ID          uuid.UUID    `gorm:"primaryKey" json:"id"`
	ProductName string       `gorm:"not null" json:"productName"`
	Status      ItemStatus   `gorm:"type:item_status;not null" json:"status"`
	Price       float64      `gorm:"not null" json:"price"`
	Amount      int          `gorm:"not null" json:"amount"`
	At          time.Time    `gorm:"index;not null" json:"at"`
	DeletedAt   sql.NullTime `gorm:"index" json:"-"`
}

func (*Item) BeforeCreate

func (i *Item) BeforeCreate(tx *gorm.DB) (err error)

type ItemStatus

type ItemStatus string
const (
	BUY  ItemStatus = "BUY"
	SELL ItemStatus = "SELL"
)

func (*ItemStatus) Scan

func (s *ItemStatus) Scan(value interface{}) error

func (ItemStatus) Value

func (s ItemStatus) Value() (driver.Value, error)

Jump to

Keyboard shortcuts

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