product

package
v0.0.0-...-418b934 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2020 License: GPL-3.0 Imports: 7 Imported by: 0

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

func (c *Category) MarshalBinary() ([]byte, error)

MarshalBinary for redis

func (*Category) ToDTO

func (c *Category) ToDTO() *module.CategoryDTO

ToDTO dto

func (*Category) UnmarshalBinary

func (c *Category) UnmarshalBinary(data []byte) error

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

func (i *Inventory) MarshalBinary() ([]byte, error)

MarshalBinary for redis

func (*Inventory) ToDTO

func (i *Inventory) ToDTO() *module.InventoryDTO

ToDTO dto

func (*Inventory) ToKeyValueDTO

func (i *Inventory) ToKeyValueDTO() *module.KeyValuePair

ToKeyValueDTO key value dto

func (*Inventory) UnmarshalBinary

func (i *Inventory) UnmarshalBinary(data []byte) error

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

func (p *Product) MarshalBinary() ([]byte, error)

MarshalBinary for redis

func (*Product) ToDTO

func (p *Product) ToDTO() (*module.DetailedProductDTO, error)

ToDTO in protobuf

func (*Product) UnmarshalBinary

func (p *Product) UnmarshalBinary(data []byte) error

UnmarshalBinary for redis

Jump to

Keyboard shortcuts

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