Documentation ¶
Index ¶
- type Draft
- func (u *Draft) GetId() uint64
- func (d *Draft) LineById(ctx context.Context, db *sqlx.DB, id uint64) (*DraftLine, error)
- func (d *Draft) LineByTitle(ctx context.Context, db *sqlx.DB, title string) (*DraftLine, error)
- func (d *Draft) Lines(ctx context.Context, db *sqlx.DB) (lns []*DraftLine, err error)
- func (d *Draft) Next(ctx context.Context, db *sqlx.DB, imgs pbimages.ImagesClient, ...) (int, error)
- func (d *Draft) Prev(ctx context.Context, db *sqlx.DB) error
- func (u *Draft) SQLMap() map[string]driver.Value
- func (u *Draft) SQLTable() string
- func (u *Draft) SetId(id uint64)
- func (d *Draft) ToPb() *pbproducts.Draft
- func (d *Draft) ValidateLineByStage(l *DraftLine) error
- type DraftLine
- func (ln *DraftLine) Clone() (*DraftLine, error)
- func (ln *DraftLine) Draft(ctx context.Context, db *sqlx.DB) (*Draft, error)
- func (u *DraftLine) GetId() uint64
- func (u *DraftLine) SQLMap() map[string]driver.Value
- func (u *DraftLine) SQLTable() string
- func (u *DraftLine) SetId(id uint64)
- func (ln *DraftLine) ToPb(atts []*pbproducts.AttributeData) *pbproducts.DraftLine
- type Product
- func (p *Product) ConsumeStockReserve(qt uint64) error
- func (p *Product) GetAttributes(ctx context.Context, sem pbsemantic.ProductsClient) (map[uint64]*pbproducts.Attribute, error)
- func (u *Product) GetId() uint64
- func (p *Product) Images(ctx context.Context, img pbimages.ImagesClient) (map[string]*pbimages.Image, error)
- func (p *Product) ReserveStock(qt uint64) error
- func (u *Product) SQLMap() map[string]driver.Value
- func (u *Product) SQLTable() string
- func (u *Product) SetId(id uint64)
- func (p *Product) ToPb() *pbproducts.Product
- func (p *Product) UndoStockReserve(qt uint64) error
- func (p *Product) User(ctx context.Context, users pbusers.ViewerClient) (*pbusers.User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Draft ¶
type Draft struct { Id uint64 `json:"id,omitempty"` Stage stage.Stage `json:"stage,omitempty"` UserId uint64 `json:"user_id,omitempty"` }
func FindOrCreateDraft ¶
func (*Draft) LineByTitle ¶
func (*Draft) Next ¶
func (d *Draft) Next(ctx context.Context, db *sqlx.DB, imgs pbimages.ImagesClient, sem pbsemantic.ProductsClient, accessToken string) (int, error)
func (*Draft) ToPb ¶
func (d *Draft) ToPb() *pbproducts.Draft
func (*Draft) ValidateLineByStage ¶
type DraftLine ¶
type DraftLine struct { Id uint64 `json:"id,omitempty"` DraftId uint64 `json:"draft_id,omitempty"` // First Title string `json:"title,omitempty"` CategoryId uint64 `json:"category_id,omitempty"` // Second Price currency.ARS `json:"price,omitempty"` Stock uint64 `json:"stock,omitempty"` }
func (*DraftLine) ToPb ¶
func (ln *DraftLine) ToPb(atts []*pbproducts.AttributeData) *pbproducts.DraftLine
type Product ¶
type Product struct { Id uint64 `json:"id,omitempty"` UserId uint64 `json:"user_id,omitempty"` Title string `json:"title,omitempty"` CategoryId uint64 `json:"category_id,omitempty"` Price currency.ARS `json:"price,omitempty"` Stock uint64 `json:"stock,omitempty"` ReservedStock uint64 `json:"reserved_stock,omitempty"` }
func FindProductsById ¶
func (*Product) ConsumeStockReserve ¶
func (*Product) GetAttributes ¶
func (p *Product) GetAttributes(ctx context.Context, sem pbsemantic.ProductsClient) (map[uint64]*pbproducts.Attribute, error)
func (*Product) ReserveStock ¶
func (*Product) ToPb ¶
func (p *Product) ToPb() *pbproducts.Product
func (*Product) UndoStockReserve ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.