Discover Packages
github.com/azizanhakim/items-api-fiber
internal
model
package
Version:
v0.0.0-...-c33ab3d
Opens a new window with list of versions in this module.
Published: Jan 30, 2024
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
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 struct {
gorm .Model
ID uint `json:"salesID" gorm:"primaryKey;autoIncrement"`
Price int `json:"price"`
Notes string `json:"notes"`
}
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 struct {
gorm .Model
ID uint `json:"typeID" gorm:"primaryKey;autoIncrement"`
Name string `json:"name"`
IsHeavy bool `json:"isHeavy"`
}
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"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.