products

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*common.Client
}

func NewClient

func NewClient(client *common.Client) *Client

func (*Client) GetProductBrands

func (cli *Client) GetProductBrands(ctx context.Context, filters map[string]string) ([]ProductBrand, error)

func (*Client) GetProductCategories

func (cli *Client) GetProductCategories(ctx context.Context, filters map[string]string) ([]ProductCategory, error)

func (*Client) GetProductGroups

func (cli *Client) GetProductGroups(ctx context.Context, filters map[string]string) ([]ProductGroup, error)

func (*Client) GetProductUnits

func (cli *Client) GetProductUnits(ctx context.Context, filters map[string]string) ([]ProductUnit, error)

func (*Client) GetProducts

func (cli *Client) GetProducts(ctx context.Context, filters map[string]string) ([]Product, error)

type GetProductUnitsResponse

type GetProductUnitsResponse struct {
	Status       common.Status `json:"status"`
	ProductUnits []ProductUnit `json:"records"`
}

GetProductUnitsResponse ...

type GetProductsResponse

type GetProductsResponse struct {
	Status   common.Status `json:"status"`
	Products []Product     `json:"records"`
}

type Manager

type Manager interface {
	GetProducts(ctx context.Context, filters map[string]string) ([]Product, error)
	GetProductUnits(ctx context.Context, filters map[string]string) ([]ProductUnit, error)
	GetProductCategories(ctx context.Context, filters map[string]string) ([]ProductCategory, error)
	GetProductBrands(ctx context.Context, filters map[string]string) ([]ProductBrand, error)
	GetProductGroups(ctx context.Context, filters map[string]string) ([]ProductGroup, error)
}

type Product

type Product struct {
	ProductID          int                `json:"productID"`
	Name               string             `json:"name"`
	NameEng            string             `json:"nameENG"`
	Code               string             `json:"code"`
	Code2              string             `json:"code2"`
	Code3              *string            `json:"code3"`
	GroupID            uint               `json:"groupID"`
	Price              float64            `json:"price"`
	DisplayedInWebshop byte               `json:"displayedInWebshop"`
	BrandID            uint               `json:"brandID"`
	Description        string             `json:"description"`
	DescriptionLong    string             `json:"longdesc"`
	DescriptionEng     string             `json:"descriptionENG"`
	DescriptionLongEng string             `json:"longdescENG"`
	Added              uint64             `json:"added"`
	LastModified       uint64             `json:"lastModified"`
	Vatrate            float64            `json:"vatrate"`
	PriceWithVat       float32            `json:"priceWithVat"`
	UnitName           *string            `json:"unitName"`
	BrandName          string             `json:"brandName"`
	GroupName          string             `json:"groupName"`
	CategoryId         uint               `json:"categoryID"`
	CategoryName       string             `json:"categoryName"`
	Status             string             `json:"status"`
	Images             []ProductImage     `json:"images"`
	ProductVariations  []string           `json:"productVariations"` // Variations of matrix product
	ParentProductID    int                `json:"parentProductID"`
	Type               string             `json:"type"`
	Warehouses         map[uint]StockInfo `json:"warehouses"`

	RelatedProducts []string          `json:"relatedProducts"`
	VariationList   []ProductVariaton `json:"variationList"`
}

Product ...

type ProductBrand

type ProductBrand struct {
	ID           uint   `json:"brandID"`
	Name         string `json:"name"`
	Added        uint64 `json:"added"`
	LastModified uint64 `json:"lastModified"`
}

type ProductCategory

type ProductCategory struct {
	ProductCategoryID   uint   `json:"productCategoryID"`
	ParentCategoryID    uint   `json:"parentCategoryID"`
	ProductCategoryName string `json:"productCategoryName"`
	Added               uint64 `json:"added"`
	LastModified        uint64 `json:"lastModified"`
}

type ProductDimensions

type ProductDimensions struct {
	Name             string `json:"name"`
	Value            string `json:"value"`
	Order            int    `json:"order"`
	DimensionID      int    `json:"dimensionID"`
	DimensionValueID int    `json:"dimensionValueID"`
}

type ProductGroup

type ProductGroup struct {
	ID              uint           `json:"productGroupID"`
	Name            string         `json:"name"`
	ShowInWebshop   string         `json:"showInWebshop"`
	NonDiscountable byte           `json:"nonDiscountable"`
	PositionNo      int            `json:"positionNo"`
	ParentGroupID   string         `json:"parentGroupID"`
	Added           uint64         `json:"added"`
	LastModified    uint64         `json:"lastModified"`
	SubGroups       []ProductGroup `json:"subGroups"`
}

type ProductImage

type ProductImage struct {
	PictureID       string  `json:"pictureID"`
	Name            string  `json:"name"`
	ThumbURL        string  `json:"thumbURL"`
	SmallURL        string  `json:"smallURL"`
	LargeURL        string  `json:"largeURL"`
	FullURL         string  `json:"fullURL"`
	External        byte    `json:"external"`
	HostingProvider string  `json:"hostingProvider"`
	Hash            *string `json:"hash"`
	Tenant          *string `json:"tenant"`
}

type ProductUnit

type ProductUnit struct {
	UnitID string `json:"unitID"`
	Name   string `json:"name"`
}

ProductUnit ...

type ProductVariaton

type ProductVariaton struct {
	ProductID  string              `json:"productID"`
	Name       string              `json:"name"`
	Code       string              `json:"code"`
	Code2      string              `json:"code2"`
	Dimensions []ProductDimensions `json:"dimensions"`
}

type StockInfo

type StockInfo struct {
	WarehouseID   uint    `json:"warehouseID"`
	Free          int     `json:"free"`
	OrderPending  int     `json:"orderPending"`
	ReorderPoint  int     `json:"reorderPoint"`
	RestockLevel  int     `json:"restockLevel"`
	FifoCost      float32 `json:"FIFOCost"`
	PurchasePrice float32 `json:"purchasePrice"`
}

Jump to

Keyboard shortcuts

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