products

package
v1.7.5 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResponseTypeCSV = "CSV"
)

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) GetBrands added in v1.4.1

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

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) GetProductStock added in v1.7.5

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

func (*Client) GetProductStockFile added in v1.7.5

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

func (*Client) GetProductStockFileBulk added in v1.7.5

func (cli *Client) GetProductStockFileBulk(ctx context.Context, bulkFilters []map[string]interface{}, baseFilters map[string]string) (GetProductStockFileResponseBulk, 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)

func (*Client) GetProductsBulk added in v1.5.0

func (cli *Client) GetProductsBulk(ctx context.Context, bulkFilters []map[string]interface{}, baseFilters map[string]string) (GetProductsResponseBulk, error)

GetProductsBulk will list products according to specified filters sending a bulk request to fetch more products than the default limit

type GetProductStock added in v1.7.5

type GetProductStock struct {
	ProductID              int         `json:"productID"`
	AmountInStock          json.Number `json:"amountInStock"`
	AmountReserved         float64     `json:"amountReserved"`
	SuggestedPurchasePrice float64     `json:"suggestedPurchasePrice"`
	AveragePurchasePrice   float64     `json:"averagePurchasePrice"`
	AverageCost            float64     `json:"averageCost"`
	FirstPurchaseDate      string      `json:"firstPurchaseDate"`
	LastPurchaseDate       string      `json:"lastPurchaseDate"`
	LastSoldDate           string      `json:"lastSoldDate"`
	ReorderPoint           int         `json:"reorderPoint"`
	RestockLevel           int         `json:"restockLevel"`
}

type GetProductStockFile added in v1.7.5

type GetProductStockFile struct {
	ReportLink string `json:"reportLink"`
}

type GetProductStockFileResponse added in v1.7.5

type GetProductStockFileResponse struct {
	Status              sharedCommon.Status   `json:"status"`
	GetProductStockFile []GetProductStockFile `json:"records"`
}

type GetProductStockFileResponseBulk added in v1.7.5

type GetProductStockFileResponseBulk struct {
	Status    sharedCommon.Status                   `json:"status"`
	BulkItems []GetProductStockFileResponseBulkItem `json:"requests"`
}

type GetProductStockFileResponseBulkItem added in v1.7.5

type GetProductStockFileResponseBulkItem struct {
	Status               sharedCommon.StatusBulk `json:"status"`
	GetProductStockFiles []GetProductStockFile   `json:"records"`
}

type GetProductStockResponse added in v1.7.5

type GetProductStockResponse struct {
	Status          sharedCommon.Status `json:"status"`
	GetProductStock []GetProductStock   `json:"records"`
}

type GetProductUnitsResponse

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

GetProductUnitsResponse ...

type GetProductsResponse

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

type GetProductsResponseBulk added in v1.5.0

type GetProductsResponseBulk struct {
	Status    sharedCommon.Status           `json:"status"`
	BulkItems []GetProductsResponseBulkItem `json:"requests"`
}

type GetProductsResponseBulkItem added in v1.5.0

type GetProductsResponseBulkItem struct {
	Status   sharedCommon.StatusBulk `json:"status"`
	Products []Product               `json:"records"`
}

type ListingDataProvider added in v1.6.1

type ListingDataProvider struct {
	// contains filtered or unexported fields
}

func NewListingDataProvider added in v1.6.1

func NewListingDataProvider(erplyClient Manager) *ListingDataProvider

func (*ListingDataProvider) Count added in v1.6.1

func (l *ListingDataProvider) Count(ctx context.Context, filters map[string]interface{}) (int, error)

func (*ListingDataProvider) Read added in v1.6.1

func (l *ListingDataProvider) Read(ctx context.Context, bulkFilters []map[string]interface{}, callback func(item interface{})) error

type Manager

type Manager interface {
	GetProducts(ctx context.Context, filters map[string]string) ([]Product, error)
	GetProductsBulk(ctx context.Context, bulkFilters []map[string]interface{}, baseFilters map[string]string) (GetProductsResponseBulk, 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)
	GetBrands(ctx context.Context, filters map[string]string) ([]ProductBrand, error)
	GetProductGroups(ctx context.Context, filters map[string]string) ([]ProductGroup, error)
	GetProductStock(ctx context.Context, filters map[string]string) ([]GetProductStock, error)
	GetProductStockFile(ctx context.Context, filters map[string]string) ([]GetProductStockFile, error)
	GetProductStockFileBulk(ctx context.Context, bulkFilters []map[string]interface{}, baseFilters map[string]string) (GetProductStockFileResponseBulk, error)
}

type NameLanguages added in v1.7.4

type NameLanguages struct {
	Name    string `json:"name"`
	NameEng string `json:"nameENG"`
	NameSpa string `json:"nameSPA"`
	NameEst string `json:"nameEST"`
	NameGer string `json:"nameGER"`
	NameSwe string `json:"nameSWE"`
	NameFin string `json:"nameFIN"`
	NameRus string `json:"nameRUS"`
	NameLat string `json:"nameLAT"`
	NameLit string `json:"nameLIT"`
	NameGre string `json:"nameGRE"`
}

type Product

type Product struct {
	ProductID int `json:"productID"`
	Active    int `json:"active"`
	NameLanguages
	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"`
	DescriptionSpa     string             `json:"descriptionSPA"`
	DescriptionLongSpa string             `json:"longdescSPA"`
	DescriptionEst     string             `json:"descriptionEST"`
	DescriptionLongEst string             `json:"longdescEST"`
	DescriptionGer     string             `json:"descriptionGER"`
	DescriptionLongGer string             `json:"longdescGER"`
	DescriptionSwe     string             `json:"descriptionSWE"`
	DescriptionLongSwe string             `json:"longdescSWE"`
	DescriptionFin     string             `json:"descriptionFIN"`
	DescriptionLongFin string             `json:"longdescFIN"`
	DescriptionRus     string             `json:"descriptionRUS"`
	DescriptionLongRus string             `json:"longdescRUS"`
	DescriptionLat     string             `json:"descriptionLAT"`
	DescriptionLongLat string             `json:"longdescLAT"`
	DescriptionLit     string             `json:"descriptionLIT"`
	DescriptionLongLit string             `json:"longdescLIT"`
	DescriptionGre     string             `json:"descriptionGRE"`
	DescriptionLongGre string             `json:"longdescGRE"`
	Added              uint64             `json:"added"`
	LastModified       uint64             `json:"lastModified"`
	Vatrate            float64            `json:"vatrate"`
	PriceWithVat       float32            `json:"priceWithVat"`
	GrossWeight        string             `json:"grossWeight"`
	NetWeight          string             `json:"netWeight"`
	UnitName           *string            `json:"unitName"`
	BrandName          string             `json:"brandName"`
	GroupName          string             `json:"groupName"`
	CategoryId         uint               `json:"categoryID"`
	CategoryName       string             `json:"categoryName"`
	Status             string             `json:"status"`
	SupplierID         int                `json:"supplierID"`
	Images             []ProductImage     `json:"images"`
	ProductVariations  []string           `json:"productVariations"` // Variations of matrix product
	ParentProductID    int                `json:"parentProductID"`
	NonStockProduct    int                `json:"nonStockProduct"`
	TaxFree            int                `json:"taxFree"`
	Type               string             `json:"type"`
	Warehouses         map[uint]StockInfo `json:"warehouses"`

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

Payload ...

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"`
	NameLanguages
	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"`
	Attributes      []map[string]string `json:"attributes,omitempty"`
}

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          float64 `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