models

package
v0.0.0-...-a5e1bbd Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2023 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 BasicModel

type BasicModel struct {
	ID        string         `gorm:"primarykey" json:"id"`
	CreatedAt time.Time      `gorm:"index" json:"created_at"`
	UpdatedAt time.Time      `gorm:"index" json:"updated_at"`
	DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at"`
}

type Goods

type Goods struct {
	BasicModel
	Barcode   string  `gorm:"type:varchar(300);uniqueIndex" json:"barcode"` // 條形碼
	Name      string  `gorm:"type:varchar(600);index" json:"name"`          // 商品名稱
	Spec      string  `gorm:"type:varchar(600)" json:"spec"`                // 規格
	Cost      float64 `gorm:"type:NUMERIC(20,7)"  json:"cost"`              // 成本
	Price     float64 `gorm:"type:NUMERIC(20,7)" json:"price"`              // 價格
	Brand     string  `gorm:"type:varchar(300)" json:"brand"`               // 品牌
	MadeIn    string  `gorm:"type:varchar(600)" json:"made_in"`             // 產地
	Img       string  `gorm:"type:varchar(600)" json:"img"`                 // img
	ByAccount string  `gorm:"type:varchar(300);index" json:"by_account"`    // 創建用戶
	UpAccount string  `gorm:"type:varchar(300)" json:"up_account"`          // 更新用戶
}

Goods 商品

type History

type History struct {
	BasicModel
	Account     string      `gorm:"type:varchar(300);index" json:"account"` // 創建用戶
	HistoryType HistoryType `gorm:"type:varchar(300);index" json:"history_type"`
}

type HistoryType

type HistoryType string
const (
	HistoryTypeInventoryModify HistoryType = "inventory_modify"
	HistoryTypeInventory       HistoryType = "inventory"
)

type Inventory

type Inventory struct {
	BasicModel
	GoodsID  string  `gorm:"type:varchar(300);index" json:"goods_id"` // 商品
	Barcode  string  `gorm:"type:varchar(300);index" json:"barcode"`  // 條形碼
	Account  string  `gorm:"type:varchar(300);index" json:"account"`  // 創建用戶
	Quantity int     `json:"quantity"`                                // 库存数量
	Cost     float64 `gorm:"type:NUMERIC(20,7)" json:"cost"`          // 总成本
}

Inventory 庫存

type InventoryHistory

type InventoryHistory struct {
	BasicModel
	InventoryType  InventoryHistoryType `gorm:"type:varchar(300);index" json:"inventory_type"`
	Account        string               `gorm:"type:varchar(300);index" json:"account"` // 創建用戶
	TotalPrice     float64              `gorm:"type:NUMERIC(20,7)" json:"total_price"`  // 總價
	TotalCost      float64              `gorm:"type:NUMERIC(20,7)" json:"total_cost"`   // 縂成本
	GrossProfit    float64              `gorm:"type:NUMERIC(20,7)" json:"gross_profit"` // 毛利
	NumberProducts int                  `gorm:"type:int8" json:"number_products"`       // 商品數量
	Remark         string               `gorm:"type:varchar(700)" json:"remark"`
}

InventoryHistory 庫存記錄

type InventoryHistoryDetailed

type InventoryHistoryDetailed struct {
	BasicModel
	InventoryType  InventoryHistoryType `gorm:"type:varchar(300);index" json:"inventory_type"`
	OrderID        string               `gorm:"type:varchar(300);index" json:"order_id"` // order id
	Barcode        string               `gorm:"type:varchar(300);index" json:"barcode"`  // 條形碼
	GoodsID        string               `gorm:"type:varchar(300);index" json:"goods_id"` // 商品
	GoodsName      string               `gorm:"-" json:"goods_name"`
	Account        string               `gorm:"type:varchar(300);index" json:"account"` // 創建用戶
	TotalPrice     float64              `gorm:"type:NUMERIC(20,7)" json:"total_price"`  // 總價
	GrossProfit    float64              `gorm:"type:NUMERIC(20,7)" json:"gross_profit"` // 毛利
	TotalCost      float64              `gorm:"type:NUMERIC(20,7)" json:"total_cost"`   // 縂成本
	NumberProducts int                  `gorm:"type:int(8)" json:"number_products"`     // 商品數量
	Remark         string               `gorm:"type:varchar(700)" json:"remark"`
}

InventoryHistoryDetailed 庫存記錄詳細

type InventoryHistoryType

type InventoryHistoryType string
const (
	InventoryHistoryTypeWarehousing InventoryHistoryType = "warehousing" // 入库
	InventoryHistoryTypeDepot       InventoryHistoryType = "depot"       // 出库
)

type InventoryModify

type InventoryModify struct {
	BasicModel
	GoodsID        string  `gorm:"type:varchar(300);index" json:"goods_id"`        // 商品
	Barcode        string  `gorm:"type:varchar(300);index" json:"barcode"`         // 條形碼
	Account        string  `gorm:"type:varchar(300);index" json:"account"`         // 創建用戶
	BeforeQuantity int     `gorm:"type:varchar(300);index" json:"before_quantity"` // 库存数量
	BeforeCost     float64 `gorm:"type:NUMERIC(20,7)" json:"before_cost"`          // 成本
	Quantity       int     `gorm:"type:varchar(300);index" json:"quantity"`        // 库存数量
	Cost           float64 `gorm:"type:NUMERIC(20,7)" json:"cost"`                 // 成本
}

InventoryModify 修改库存

type StatisticsBand

type StatisticsBand struct {
	Key   string   `json:"key"`
	Value []string `json:"value"`
}

type TemporaryGoodsInventories

type TemporaryGoodsInventories struct {
	Goods
	Quantity  int     `gorm:"type:varchar(300);index" json:"quantity"` // 库存数量
	TotalCost float64 `gorm:"type:NUMERIC(20,7)" json:"total_cost"`    // 成本
}

type UserCenter

type UserCenter struct {
	BasicModel
	Storehouse string `gorm:"type:varchar(300)" json:"storehouse"`
	Account    string `gorm:"type:varchar(300);index" json:"account"`
	Password   string `gorm:"type:varchar(600)" json:"password"`
}

Jump to

Keyboard shortcuts

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