model

package
v0.0.0-...-c33ab3d Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: MIT Imports: 2 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 {
	gorm.Model
	ID     uint    `json:"itemID" gorm:"primaryKey;autoIncrement"`
	Name   string  `json:"name"`
	TypeID uint    `json:"typeID"`
	Type   Type    `json:"type" gorm:"foreignKey:TypeID;references:ID"`
	Price  int     `json:"price"`
	Color  *string `json:"color"`
	Qty    int     `json:"qty"`
}

type Sales

type Sales struct {
	gorm.Model
	ID    uint   `json:"salesID" gorm:"primaryKey;autoIncrement"`
	Price int    `json:"price"`
	Notes string `json:"notes"`
}

type SalesItem

type SalesItem struct {
	gorm.Model
	ID      uint  `json:"salesItemID" gorm:"primaryKey;autoIncrement"`
	ItemID  uint  `json:"itemID"`
	Item    Item  `json:"item" gorm:"foreignKey:ItemID;references:ID"`
	SalesID uint  `json:"salesID"`
	Sales   Sales `json:"sales" gorm:"foreignKey:SalesID;references:ID"`
	Qty     int   `json:"qty"`
	Price   int   `json:"price"`
}

type Type

type Type struct {
	gorm.Model
	ID      uint   `json:"typeID" gorm:"primaryKey;autoIncrement"`
	Name    string `json:"name"`
	IsHeavy bool   `json:"isHeavy"`
}

type User

type User struct {
	gorm.Model
	ID       uint   `json:"userID" gorm:"primaryKey;autoIncrement"`
	Username string `json:"username" gorm:"unique"`
	Password string `json:"password"`
	Fullname string `json:"fullname"`
}

func (*User) CheckPassword

func (u *User) CheckPassword(password string) bool

func (*User) SetPassword

func (u *User) SetPassword(password string) error

Jump to

Keyboard shortcuts

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