package models

type StockInfo struct {
	ID                int64  `gorm:"column:id" json:"id"`
	GoodCode          string `gorm:"column:good_code" json:"good_code"`
	GoodName          string `gorm:"column:good_name" json:"good_name"`
	SpecificationName string `gorm:"column:specification_name" json:"specification_name"`
	GoodTypeId        int64  `gorm:"column:good_type_id" json:"good_type_id"`
	GoodUnit          int64  `gorm:"column:good_unit" json:"good_unit"`

	QueryWarehousingInfo  []QueryWarehousingInfo  `gorm:"ForeignKey:GoodId;AssociationForeignKey:ID" json:"query_warehousing_info"`
	QuerySalesReturnInfo  []QuerySalesReturnInfo  `gorm:"ForeignKey:GoodId;AssociationForeignKey:ID" json:"query_sales_return_info"`
	QueryWarehouseOutInfo []QueryWarehouseOutInfo `gorm:"ForeignKey:GoodId;AssociationForeignKey:ID" json:"query_warehouseout_info"`
	QueryCancelStockInfo  []QueryCancelStockInfo  `gorm:"ForeignKey:GoodId;AssociationForeignKey:ID" json:"query_cancel_stock_info"`
	GoodsType             GoodsType               `gorm:"ForeignKey:GoodTypeId;AssociationForeignKey:ID" json:"type"`
}

func (StockInfo) TableName() string {
	return "xt_good_information"
}

type QueryWarehousingInfo struct {
	ID               int64   `gorm:"column:id" json:"id"`
	WarehousingId    int64   `gorm:"column:warehousing_id" json:"warehousing_id"`
	GoodId           int64   `gorm:"column:good_id" json:"good_id"`
	GoodTypeId       int64   `gorm:"column:good_type_id" json:"good_type_id"`
	Number           string  `gorm:"column:number" json:"number"`
	ProductDate      int64   `gorm:"column:product_date" json:"product_date"`
	ExpiryDate       int64   `gorm:"column:expiry_date" json:"expiry_date"`
	WarehousingCount int64   `gorm:"column:warehousing_count" json:"warehousing_count"`
	Price            float64 `gorm:"column:price" json:"price"`
	TotalPrice       float64 `gorm:"column:total_price" json:"total_price"`
	Dealer           int64   `gorm:"column:dealer" json:"dealer"`
	Manufacturer     int64   `gorm:"column:manufacturer" json:"manufacturer"`
	Remark           string  `gorm:"column:remark" json:"remark"`
	Ctime            int64   `gorm:"column:ctime" json:"ctime"`
	Mtime            int64   `gorm:"column:mtime" json:"mtime"`
	Status           int64   `gorm:"column:status" json:"status"`
	OrgId            int64   `gorm:"column:org_id" json:"org_id"`
	IsReturn         int64   `gorm:"column:is_return" json:"is_return"`
	WarehousingOrder string  `gorm:"column:warehousing_order" json:"warehousing_order"`
	Type             int64   `gorm:"column:type" json:"type"`
}

func (QueryWarehousingInfo) TableName() string {
	return "xt_warehouse_info"
}

type QueryWarehouseOutInfo struct {
	ID                      int64   `gorm:"column:id" json:"id"`
	WarehouseOutId          int64   `gorm:"column:warehouse_out_id" json:"warehouse_out_id"`
	GoodId                  int64   `gorm:"column:good_id" json:"good_id"`
	GoodTypeId              int64   `gorm:"column:good_type_id" json:"good_type_id"`
	WarehousingOutTarget    int64   `gorm:"column:warehousing_out_target" json:"warehousing_out_target"`
	Count                   int64   `gorm:"column:count" json:"count"`
	Price                   float64 `gorm:"column:price" json:"price"`
	TotalPrice              float64 `gorm:"column:total_price" json:"total_price"`
	ProductDate             int64   `gorm:"column:product_date" json:"product_date"`
	ExpiryDate              int64   `gorm:"column:expiry_date" json:"expiry_date"`
	Mtime                   int64   `gorm:"column:mtime" json:"mtime"`
	Ctime                   int64   `gorm:"column:ctime" json:"ctime"`
	Status                  int64   `gorm:"column:status" json:"status"`
	OrgId                   int64   `gorm:"column:org_id" json:"org_id"`
	Remark                  string  `gorm:"column:remark" json:"remark"`
	IsCancel                int64   `gorm:"column:is_cancel" json:"is_cancel"`
	WarehouseOutOrderNumber string  `gorm:"column:warehouse_out_order_number" json:"warehouse_out_order_number"`
	Type                    int64   `gorm:"column:type" json:"type"`
	Dealer                  int64   `gorm:"column:dealer" json:"dealer"`
	Manufacturer            int64   `gorm:"column:manufacturer" json:"manufacturer"`
	IsSys                   int64   `gorm:"column:is_sys" json:"is_sys"`
	SysRecordTime           int64   `gorm:"column:sys_record_time" json:"sys_record_time"`
}

func (QueryWarehouseOutInfo) TableName() string {
	return "xt_warehouse_out_info"
}

type QuerySalesReturnInfo struct {
	ID            int64   `gorm:"column:id" json:"id"`
	GoodId        int64   `gorm:"column:good_id" json:"good_id"`
	SalesReturnId int64   `gorm:"column:sales_return_id" json:"sales_return_id"`
	GoodTypeId    int64   `gorm:"column:good_type_id" json:"good_type_id"`
	Count         int64   `gorm:"column:count" json:"count"`
	Price         float64 `gorm:"column:price" json:"price"`
	Total         float64 `gorm:"column:total" json:"total"`
	ProductDate   int64   `gorm:"column:product_date" json:"product_date"`
	ExpiryDate    int64   `gorm:"column:expiry_date" json:"expiry_date"`
	Ctime         int64   `gorm:"column:ctime" json:"ctime"`
	Mtime         int64   `gorm:"column:mtime" json:"mtime"`
	Status        int64   `gorm:"column:status" json:"status"`
	OrgId         int64   `gorm:"column:org_id" json:"org_id"`
	OrderNumber   string  `gorm:"column:order_number" json:"order_number"`
	Type          int64   `gorm:"column:type" json:"type"`
	Dealer        int64   `gorm:"column:dealer" json:"dealer"`
	Manufacturer  int64   `gorm:"column:manufacturer" json:"manufacturer"`
}

func (QuerySalesReturnInfo) TableName() string {
	return "xt_sales_return_info"
}

type QueryCancelStockInfo struct {
	ID            int64   `gorm:"column:id" json:"id"`
	GoodId        int64   `gorm:"column:good_id" json:"good_id"`
	CancelStockId int64   `gorm:"column:cancel_stock_id" json:"cancel_stock_id"`
	GoodTypeId    int64   `gorm:"column:good_type_id" json:"good_type_id"`
	Count         int64   `gorm:"column:count" json:"count"`
	Price         float64 `gorm:"column:price" json:"price"`
	Total         float64 `gorm:"column:total" json:"total"`
	ProductDate   int64   `gorm:"column:product_date" json:"product_date"`
	ExpiryDate    int64   `gorm:"column:expiry_date" json:"expiry_date"`
	Ctime         int64   `gorm:"column:ctime" json:"ctime"`
	Mtime         int64   `gorm:"column:mtime" json:"mtime"`
	Status        int64   `gorm:"column:status" json:"status"`
	OrgId         int64   `gorm:"column:org_id" json:"org_id"`
	OrderNumber   string  `gorm:"column:order_number" json:"order_number"`
	Type          int64   `gorm:"column:type" json:"type"`
	Dealer        int64   `gorm:"column:dealer" json:"dealer"`
	Manufacturer  int64   `gorm:"column:manufacturer" json:"manufacturer"`
}

func (QueryCancelStockInfo) TableName() string {
	return "xt_cancel_stock_info"
}