Documentation ¶
Index ¶
- func MarshalBinary(str []string) (data []byte)
- func UnmarshalBinary(bff []byte) []string
- func UnmarshalProductsResume(productResByte ...[]byte) (productResume *[]ProductResume, err error)
- type Product
- func (p *Product) AddCategory(ctg category.Category) []category.Category
- func (p *Product) ApplyCategoryCodes() []string
- func (p *Product) Delete(product *Product) (err error)
- func (p *Product) FindCategory(ctg category.Category) category.Category
- func (p *Product) ForEachCategory(fn func(ctg category.Category)) []category.Category
- func (p *Product) ForEachCategoryCodes(fn func(code string)) []string
- func (p *Product) GetByUid(uid string) (product *Product, err error)
- func (p *Product) GetList() (products []Product, err error)
- func (p *Product) GetUid(uid string) (product *Product, err error)
- func (p *Product) Inject(product *Product) *Product
- func (p *Product) NewUid() string
- func (p *Product) RemoveCategory(ctg category.Category) []category.Category
- func (p *Product) Restore(product *Product) (err error)
- func (p *Product) Save(product *Product) (err error)
- func (p *Product) SetCategoryCodes(codes []string) []string
- func (p *Product) SetCode(code string) string
- func (p *Product) SetColor(color string) string
- func (p *Product) SetCreatedAt(createdAt string) string
- func (p *Product) SetDescription(description string) string
- func (p *Product) SetName(name string) string
- func (p *Product) SetPictures(pictures []string) []string
- func (p *Product) SetPrice(price int) int
- func (p *Product) SetPromotion(promotion string) string
- func (p *Product) SetStatus(status Status) Status
- func (p *Product) SetUid(uid string) string
- func (p *Product) SetUpdatedAt(updatedAt string) string
- func (p *Product) SetWeight(weight string) string
- func (p *Product) ToString() (string, error)
- func (p *Product) Update(product *Product) (err error)
- type ProductResume
- type ProductUid
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalBinary ¶
func UnmarshalBinary ¶
func UnmarshalProductsResume ¶
func UnmarshalProductsResume(productResByte ...[]byte) (productResume *[]ProductResume, err error)
Types ¶
type Product ¶
type Product struct { Uid string `json:"uid,omitempty" redis:"uid,omitempty"` Name string `json:"name,omitempty" redis:"name,omitempty"` Description string `json:"description,omitempty" redis:"description,omitempty"` Pictures []string `json:"pictures,omitempty" redis:"pictures,omitempty"` CategoryCodes []string `json:"-" redis:"category_codes,omitempty"` Categories []category.Category `json:"categories,omitempty" redis:"-"` Freights []freight.Freight `json:"freights,omitempty" redis:"freights,omitempty"` //? Lista de fretes dísponivel para esse produto Freight freight.Freight `json:"freight,omitempty" redis:"-"` //? Frete selcionado para esse produto Price int `json:"price,omitempty" redis:"price,omitempty"` Promotion string `json:"promotion,omitempty" redis:"promotion,omitempty"` Code string `json:"code,omitempty" redis:"code,omitempty"` Weight string `json:"weight,omitempty" redis:"weight,omitempty"` Color string `json:"color,omitempty" redis:"color,omitempty"` Status Status `json:"status,omitempty" redis:"status,omitempty"` CreatedAt string `json:"created_at,omitempty" redis:"created_at,omitempty"` UpdatedAt string `json:"updated_at,omitempty" redis:"updated_at,omitempty"` }
func Repository ¶
func Repository() *Product
func (*Product) AddCategory ¶
func (*Product) ApplyCategoryCodes ¶
func (*Product) FindCategory ¶
func (*Product) ForEachCategory ¶
func (*Product) ForEachCategoryCodes ¶
func (*Product) RemoveCategory ¶
func (*Product) SetCategoryCodes ¶
func (*Product) SetCreatedAt ¶
func (*Product) SetDescription ¶
func (*Product) SetPictures ¶
func (*Product) SetPromotion ¶
func (*Product) SetUpdatedAt ¶
type ProductResume ¶
type ProductResume struct { ProductUid string `json:"product_uid,omitempty" redis:"product_uid,omitempty"` FreightUid string `json:"freight_uid,omitempty" redis:"freight_uid,omitempty"` Product Product `json:"product,omitempty" redis:"product,omitempty"` Freight freight.Freight `json:"freight,omitempty" redis:"freight,omitempty"` ZipcodeReceiver string `json:"zipcode_receiver,omitempty" redis:"zipcode_receiver,omitempty"` }
type ProductUid ¶
type ProductUid struct { Uid string `json:"document,omitempty" redis:"document,omitempty"` OldUid string `json:"old_document,omitempty" redis:"old_document,omitempty"` }
func NewProductUid ¶
func NewProductUid(productUidByte ...[]byte) (productUid *ProductUid, err error)
Click to show internal directories.
Click to hide internal directories.