Documentation ¶
Index ¶
- func MarshalBinary(str []product.ProductResume) (data []byte)
- func UnmarshalBinary(bff []byte) (data any)
- type ShopCart
- func (s *ShopCart) Add(product product.Product)
- func (s *ShopCart) ApplyProductsUid() []string
- func (s *ShopCart) CalcPercentage(price int, percentage int) int
- func (s *ShopCart) Delete(shopcart *ShopCart) (err error)
- func (s *ShopCart) ExpandProducts(productsResume []product.ProductResume) []product.Product
- func (s *ShopCart) ForEachProductsUid(fn func(uid string)) []string
- func (s *ShopCart) FreightResume() int
- func (s *ShopCart) GetByUuid(uuid string) (shopcart *ShopCart, err error)
- func (s *ShopCart) GetList() (shopcarts []ShopCart, err error)
- func (s *ShopCart) GetUuid(uuid string) (shopcart *ShopCart, err error)
- func (s *ShopCart) Inject(shopcart *ShopCart) *ShopCart
- func (s *ShopCart) Lote(products []product.Product)
- func (s *ShopCart) ReduceProducts(products []product.Product) []product.ProductResume
- func (s *ShopCart) Remove(prod product.Product)
- func (s *ShopCart) RemoveLote(products []product.Product)
- func (s *ShopCart) Restore(shopcart *ShopCart) (err error)
- func (s *ShopCart) Resume()
- func (s *ShopCart) Save(shopcart *ShopCart) (err error)
- func (s *ShopCart) Update(shopcart *ShopCart) (err error)
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalBinary ¶
func MarshalBinary(str []product.ProductResume) (data []byte)
func UnmarshalBinary ¶
Types ¶
type ShopCart ¶
type ShopCart struct { Uuid string `json:"uuid,omitempty" redis:"uuid,omitempty"` ProductsResume []product.ProductResume `json:"products_resume,omitempty" redis:"products_resume,omitempty"` Products []product.Product `json:"products,omitempty" redis:"-"` ProductsUid []string `json:"-" redis:"products_uid,omitempty"` ProductsTotal int `json:"products_total,omitempty" redis:"-"` Items int `json:"items,omitempty" redis:"-"` Taxes int `json:"taxes,omitempty" redis:"taxes,omitempty"` FreightsTotal int `json:"freights_total,omitempty" redis:"-"` SubTotal int `json:"sub_total,omitempty" redis:"-"` Total int `json:"total,omitempty" redis:"-"` DiscountPercentage int `json:"discount_percentage,omitempty" redis:"discount_percentage,omitempty"` Status Status `json:"status,omitempty" redis:"status,omitempty"` LastAcesses string `json:"last_acesses,omitempty" redis:"last_acesses,omitempty"` }
func Repository ¶
func Repository() *ShopCart
func (*ShopCart) ApplyProductsUid ¶
func (*ShopCart) ExpandProducts ¶
func (s *ShopCart) ExpandProducts(productsResume []product.ProductResume) []product.Product
func (*ShopCart) ForEachProductsUid ¶
func (*ShopCart) FreightResume ¶
func (*ShopCart) ReduceProducts ¶
func (s *ShopCart) ReduceProducts(products []product.Product) []product.ProductResume
func (*ShopCart) RemoveLote ¶
Click to show internal directories.
Click to hide internal directories.