Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Category ¶
type Category struct { entity.Base EntityID uuid.UUID `gorm:"not null"` Name string `gorm:"not null"` Parent *Category Child *Category }
Category self referencing
func (*Category) MarshalBinary ¶
MarshalBinary for redis
func (*Category) UnmarshalBinary ¶
UnmarshalBinary for redis
type Inventory ¶
type Inventory struct { entity.Base EntityID uuid.UUID `gorm:"not null"` ProductID uuid.UUID `gorm:"not null;index:inventory_product"` Warehouse string Amount uint64 }
Inventory product inventory
func (*Inventory) MarshalBinary ¶
MarshalBinary for redis
func (*Inventory) ToKeyValueDTO ¶
func (i *Inventory) ToKeyValueDTO() *module.KeyValuePair
ToKeyValueDTO key value dto
func (*Inventory) UnmarshalBinary ¶
UnmarshalBinary for redis
type Product ¶
type Product struct { entity.Base EntityID uuid.UUID `gorm:"not null;index: entityid"` Name string Description string Brand string ImageURL string UnitPrice float32 `gorm:"not null;default: 0"` MAP float32 `gorm:"not null;default: -1"` Ingredient pq.StringArray `gorm:"type:text[]"` //KeyValuePair Nutrients pq.StringArray `gorm:"type:text[]"` //KeyvaluePair UPC string SKUNumber string IsActive bool `gorm:"not null;default:false"` CategoryInfo *Category InventoryInfo []*Inventory `gorm:"foreignkey:ProductID"` }
Product by entityID
func (*Product) MarshalBinary ¶
MarshalBinary for redis
func (*Product) ToDTO ¶
func (p *Product) ToDTO() (*module.DetailedProductDTO, error)
ToDTO in protobuf
func (*Product) UnmarshalBinary ¶
UnmarshalBinary for redis
Click to show internal directories.
Click to hide internal directories.