mirror of
https://github.com/retailcrm/api-client-go.git
synced 2025-04-08 03:22:03 +00:00
Prices upload, Products, Products groups & Products properties methods
This commit is contained in:
parent
9a5e502dcd
commit
116f6d5c5b
6 changed files with 333 additions and 91 deletions
72
v5/client.go
72
v5/client.go
|
@ -1462,8 +1462,8 @@ func (c *Client) Inventories(parameters InventoriesRequest) (*InventoriesRespons
|
|||
}
|
||||
|
||||
// InventoriesUpload method
|
||||
func (c *Client) InventoriesUpload(inventories []InventoryUpload, site ...string) (*InventoriesUploadResponse, int, ErrorResponse) {
|
||||
var resp InventoriesUploadResponse
|
||||
func (c *Client) InventoriesUpload(inventories []InventoryUpload, site ...string) (*StoreUploadResponse, int, ErrorResponse) {
|
||||
var resp StoreUploadResponse
|
||||
|
||||
uploadJson, _ := json.Marshal(&inventories)
|
||||
|
||||
|
@ -1482,3 +1482,71 @@ func (c *Client) InventoriesUpload(inventories []InventoryUpload, site ...string
|
|||
|
||||
return &resp, status, err
|
||||
}
|
||||
|
||||
// PricesUpload method
|
||||
func (c *Client) PricesUpload(prices []OfferPriceUpload) (*StoreUploadResponse, int, ErrorResponse) {
|
||||
var resp StoreUploadResponse
|
||||
|
||||
uploadJson, _ := json.Marshal(&prices)
|
||||
|
||||
p := url.Values{
|
||||
"prices": {string(uploadJson[:])},
|
||||
}
|
||||
|
||||
data, status, err := c.PostRequest(fmt.Sprintf("%s/store/prices/upload", versionedPrefix), p)
|
||||
if err.ErrorMsg != "" {
|
||||
return &resp, status, err
|
||||
}
|
||||
|
||||
json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, status, err
|
||||
}
|
||||
|
||||
// ProductsGroup method
|
||||
func (c *Client) ProductsGroup(parameters ProductsGroupsRequest) (*ProductsGroupsResponse, int, ErrorResponse) {
|
||||
var resp ProductsGroupsResponse
|
||||
|
||||
params, _ := query.Values(parameters)
|
||||
|
||||
data, status, err := c.GetRequest(fmt.Sprintf("%s/store/product-groups?%s", versionedPrefix, params.Encode()))
|
||||
if err.ErrorMsg != "" {
|
||||
return &resp, status, err
|
||||
}
|
||||
|
||||
json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, status, err
|
||||
}
|
||||
|
||||
// ProductsGroup method
|
||||
func (c *Client) Products(parameters ProductsRequest) (*ProductsResponse, int, ErrorResponse) {
|
||||
var resp ProductsResponse
|
||||
|
||||
params, _ := query.Values(parameters)
|
||||
|
||||
data, status, err := c.GetRequest(fmt.Sprintf("%s/store/products?%s", versionedPrefix, params.Encode()))
|
||||
if err.ErrorMsg != "" {
|
||||
return &resp, status, err
|
||||
}
|
||||
|
||||
json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, status, err
|
||||
}
|
||||
|
||||
// ProductsProperties method
|
||||
func (c *Client) ProductsProperties(parameters ProductsPropertiesRequest) (*ProductsPropertiesResponse, int, ErrorResponse) {
|
||||
var resp ProductsPropertiesResponse
|
||||
|
||||
params, _ := query.Values(parameters)
|
||||
|
||||
data, status, err := c.GetRequest(fmt.Sprintf("%s/store/products/properties?%s", versionedPrefix, params.Encode()))
|
||||
if err.ErrorMsg != "" {
|
||||
return &resp, status, err
|
||||
}
|
||||
|
||||
json.Unmarshal(data, &resp)
|
||||
|
||||
return &resp, status, err
|
||||
}
|
||||
|
|
|
@ -121,6 +121,11 @@ func TestClient_CustomerChange(t *testing.T) {
|
|||
Patronymic: "Аристархович",
|
||||
ExternalId: RandomString(8),
|
||||
Email: fmt.Sprintf("%s@example.com", RandomString(8)),
|
||||
Address: &Address{
|
||||
City: "Москва",
|
||||
Street: "Кутузовский",
|
||||
Building: "14",
|
||||
},
|
||||
}
|
||||
|
||||
cr, sc, err := c.CustomerCreate(f)
|
||||
|
@ -1757,6 +1762,22 @@ func TestClient_PackChange(t *testing.T) {
|
|||
t.Fail()
|
||||
}
|
||||
|
||||
s, status, err := c.Pack(p.Id)
|
||||
if err.ErrorMsg != "" {
|
||||
t.Errorf("%v", err.ErrorMsg)
|
||||
t.Fail()
|
||||
}
|
||||
|
||||
if status != http.StatusOK {
|
||||
t.Errorf("%v", err.ErrorMsg)
|
||||
t.Fail()
|
||||
}
|
||||
|
||||
if s.Success != true {
|
||||
t.Errorf("%v", err.ErrorMsg)
|
||||
t.Fail()
|
||||
}
|
||||
|
||||
e, status, err := c.PackEdit(Pack{Id: p.Id, Quantity: 2})
|
||||
if err.ErrorMsg != "" {
|
||||
t.Errorf("%v", err.ErrorMsg)
|
||||
|
@ -1854,3 +1875,23 @@ func TestClient_Inventories(t *testing.T) {
|
|||
t.Fail()
|
||||
}
|
||||
}
|
||||
|
||||
func TestClient_Segments(t *testing.T) {
|
||||
c := client()
|
||||
|
||||
data, status, err := c.Segments(SegmentsRequest{})
|
||||
if err.ErrorMsg != "" {
|
||||
t.Errorf("%v", err.ErrorMsg)
|
||||
t.Fail()
|
||||
}
|
||||
|
||||
if status >= http.StatusBadRequest {
|
||||
t.Errorf("%v", err.ErrorMsg)
|
||||
t.Fail()
|
||||
}
|
||||
|
||||
if data.Success != true {
|
||||
t.Errorf("%v", err.ErrorMsg)
|
||||
t.Fail()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -175,7 +175,7 @@ type UsersFilter struct {
|
|||
IsAdmin int `url:"isAdmin,omitempty"`
|
||||
CreatedAtFrom string `url:"createdAtFrom,omitempty"`
|
||||
CreatedAtTo string `url:"createdAtTo,omitempty"`
|
||||
Groups []string `url:"groups,omitempty"`
|
||||
Groups []string `url:"groups,omitempty,brackets"`
|
||||
}
|
||||
|
||||
// TasksFilter type
|
||||
|
@ -186,8 +186,8 @@ type TasksFilter struct {
|
|||
Text string `url:"text,omitempty"`
|
||||
DateFrom string `url:"dateFrom,omitempty"`
|
||||
DateTo string `url:"dateTo,omitempty"`
|
||||
Creators []int `url:"creators,omitempty"`
|
||||
Performers []int `url:"performers,omitempty"`
|
||||
Creators []int `url:"creators,omitempty,brackets"`
|
||||
Performers []int `url:"performers,omitempty,brackets"`
|
||||
}
|
||||
|
||||
// NotesFilter type
|
||||
|
@ -204,11 +204,11 @@ type NotesFilter struct {
|
|||
// SegmentsFilter type
|
||||
type SegmentsFilter struct {
|
||||
Ids []int `url:"ids,omitempty,brackets"`
|
||||
Active int `url:"active,omitempty,brackets"`
|
||||
Name string `url:"name,omitempty,brackets"`
|
||||
Type string `url:"type,omitempty,brackets"`
|
||||
MinCustomersCount int `url:"minCustomersCount,omitempty,brackets"`
|
||||
MaxCustomersCount int `url:"maxCustomersCount,omitempty,brackets"`
|
||||
Active int `url:"active,omitempty"`
|
||||
Name string `url:"name,omitempty"`
|
||||
Type string `url:"type,omitempty"`
|
||||
MinCustomersCount int `url:"minCustomersCount,omitempty"`
|
||||
MaxCustomersCount int `url:"maxCustomersCount,omitempty"`
|
||||
DateFrom string `url:"dateFrom,omitempty"`
|
||||
DateTo string `url:"dateTo,omitempty"`
|
||||
}
|
||||
|
@ -238,5 +238,48 @@ type InventoriesFilter struct {
|
|||
OfferArticle string `url:"offerArticle,omitempty"`
|
||||
ProductActive int `url:"productActive,omitempty"`
|
||||
Details int `url:"details,omitempty"`
|
||||
Sites []string `url:"sites,omitempty"`
|
||||
Sites []string `url:"sites,omitempty,brackets"`
|
||||
}
|
||||
|
||||
// ProductsGroupsFilter type
|
||||
type ProductsGroupsFilter struct {
|
||||
Ids []int `url:"ids,omitempty,brackets"`
|
||||
Sites []string `url:"sites,omitempty,brackets"`
|
||||
Active int `url:"active,omitempty"`
|
||||
ParentGroupId string `url:"parentGroupId,omitempty"`
|
||||
}
|
||||
|
||||
// ProductsFilter type
|
||||
type ProductsFilter struct {
|
||||
Ids []int `url:"ids,omitempty,brackets"`
|
||||
OfferIds []int `url:"offerIds,omitempty,brackets"`
|
||||
Active int `url:"active,omitempty"`
|
||||
Recommended int `url:"recommended,omitempty"`
|
||||
Novelty int `url:"novelty,omitempty"`
|
||||
Stock int `url:"stock,omitempty"`
|
||||
Popular int `url:"popular,omitempty"`
|
||||
MaxQuantity float32 `url:"maxQuantity,omitempty"`
|
||||
MinQuantity float32 `url:"minQuantity,omitempty"`
|
||||
MaxPurchasePrice float32 `url:"maxPurchasePrice,omitempty"`
|
||||
MinPurchasePrice float32 `url:"minPurchasePrice,omitempty"`
|
||||
MaxPrice float32 `url:"maxPrice,omitempty"`
|
||||
MinPrice float32 `url:"minPrice,omitempty"`
|
||||
Groups string `url:"groups,omitempty"`
|
||||
Name string `url:"name,omitempty"`
|
||||
ClassSegment string `url:"classSegment,omitempty"`
|
||||
XmlId string `url:"xmlId,omitempty"`
|
||||
ExternalId string `url:"externalId,omitempty"`
|
||||
Manufacturer string `url:"manufacturer,omitempty"`
|
||||
Url string `url:"url,omitempty"`
|
||||
PriceType string `url:"priceType,omitempty"`
|
||||
OfferExternalId string `url:"offerExternalId,omitempty"`
|
||||
Sites []string `url:"sites,omitempty,brackets"`
|
||||
Properties map[string]string `url:"properties,omitempty,brackets"`
|
||||
}
|
||||
|
||||
// ProductsPropertiesFilter type
|
||||
type ProductsPropertiesFilter struct {
|
||||
Code string `url:"code,omitempty"`
|
||||
Name string `url:"name,omitempty"`
|
||||
Sites []string `url:"sites,omitempty,brackets"`
|
||||
}
|
||||
|
|
|
@ -106,3 +106,24 @@ type InventoriesRequest struct {
|
|||
Limit int `url:"limit,omitempty"`
|
||||
Page int `url:"page,omitempty"`
|
||||
}
|
||||
|
||||
// ProductsGroupsRequest type
|
||||
type ProductsGroupsRequest struct {
|
||||
Filter ProductsGroupsFilter `url:"filter,omitempty"`
|
||||
Limit int `url:"limit,omitempty"`
|
||||
Page int `url:"page,omitempty"`
|
||||
}
|
||||
|
||||
// ProductsRequest type
|
||||
type ProductsRequest struct {
|
||||
Filter ProductsFilter `url:"filter,omitempty"`
|
||||
Limit int `url:"limit,omitempty"`
|
||||
Page int `url:"page,omitempty"`
|
||||
}
|
||||
|
||||
// ProductsPropertiesRequest type
|
||||
type ProductsPropertiesRequest struct {
|
||||
Filter ProductsPropertiesFilter `url:"filter,omitempty"`
|
||||
Limit int `url:"limit,omitempty"`
|
||||
Page int `url:"page,omitempty"`
|
||||
}
|
||||
|
|
|
@ -285,9 +285,30 @@ type InventoriesResponse struct {
|
|||
Offers []Offer `json:"offers,omitempty"`
|
||||
}
|
||||
|
||||
// InventoriesUploadResponse type
|
||||
type InventoriesUploadResponse struct {
|
||||
// StoreUploadResponse type
|
||||
type StoreUploadResponse struct {
|
||||
Success bool `json:"success"`
|
||||
ProcessedOffersCount int `json:"processedOffersCount,omitempty"`
|
||||
NotFoundOffers []Offer `json:"notFoundOffers,omitempty"`
|
||||
}
|
||||
|
||||
// ProductsGroupsResponse type
|
||||
type ProductsGroupsResponse struct {
|
||||
Success bool `json:"success"`
|
||||
Pagination *Pagination `json:"pagination,omitempty"`
|
||||
ProductGroup []ProductGroup `json:"productGroup,omitempty,brackets"`
|
||||
}
|
||||
|
||||
// ProductsResponse type
|
||||
type ProductsResponse struct {
|
||||
Success bool `json:"success"`
|
||||
Pagination *Pagination `json:"pagination,omitempty"`
|
||||
Products []Product `json:"products,omitempty,brackets"`
|
||||
}
|
||||
|
||||
// ProductsPropertiesResponse type
|
||||
type ProductsPropertiesResponse struct {
|
||||
Success bool `json:"success"`
|
||||
Pagination *Pagination `json:"pagination,omitempty"`
|
||||
Properties []Property `json:"properties,omitempty,brackets"`
|
||||
}
|
||||
|
|
204
v5/types.go
204
v5/types.go
|
@ -84,9 +84,10 @@ type ApiKey struct {
|
|||
|
||||
// Property type
|
||||
type Property struct {
|
||||
Code string `json:"code,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Value string `json:"value,omitempty"`
|
||||
Code string `json:"code,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Value string `json:"value,omitempty"`
|
||||
Sites []string `json:"Sites,omitempty,brackets"`
|
||||
}
|
||||
|
||||
// IdentifiersPair type
|
||||
|
@ -101,38 +102,38 @@ Customer related types
|
|||
|
||||
// Customer type
|
||||
type Customer struct {
|
||||
Id int `json:"id,omitempty"`
|
||||
ExternalId string `json:"externalId,omitempty"`
|
||||
FirstName string `json:"firstName,omitempty"`
|
||||
LastName string `json:"lastName,omitempty"`
|
||||
Patronymic string `json:"patronymic,omitempty"`
|
||||
Sex string `json:"sex,omitempty"`
|
||||
Email string `json:"email,omitempty"`
|
||||
Phones []Phone `json:"phones,brackets,omitempty"`
|
||||
Address *Address `json:"address,omitempty"`
|
||||
CreatedAt string `json:"createdAt,omitempty"`
|
||||
Birthday string `json:"birthday,omitempty"`
|
||||
ManagerId int `json:"managerId,omitempty"`
|
||||
Vip bool `json:"vip,omitempty"`
|
||||
Bad bool `json:"bad,omitempty"`
|
||||
Site string `json:"site,omitempty"`
|
||||
Source *Source `json:"source,omitempty"`
|
||||
Contragent *Contragent `json:"contragent,omitempty"`
|
||||
PersonalDiscount float32 `json:"personalDiscount,omitempty"`
|
||||
CumulativeDiscount float32 `json:"cumulativeDiscount,omitempty"`
|
||||
DiscountCardNumber string `json:"discountCardNumber,omitempty"`
|
||||
EmailMarketingUnsubscribedAt string `json:"emailMarketingUnsubscribedAt,omitempty"`
|
||||
AvgMarginSumm float32 `json:"avgMarginSumm,omitempty"`
|
||||
MarginSumm float32 `json:"marginSumm,omitempty"`
|
||||
TotalSumm float32 `json:"totalSumm,omitempty"`
|
||||
AverageSumm float32 `json:"averageSumm,omitempty"`
|
||||
OrdersCount int `json:"ordersCount,omitempty"`
|
||||
CostSumm float32 `json:"costSumm,omitempty"`
|
||||
MaturationTime int `json:"maturationTime,omitempty"`
|
||||
FirstClientId string `json:"firstClientId,omitempty"`
|
||||
LastClientId string `json:"lastClientId,omitempty"`
|
||||
BrowserId string `json:"browserId,omitempty"`
|
||||
// CustomFields []map[string]string `json:"customFields,omitempty,brackets"`
|
||||
Id int `json:"id,omitempty"`
|
||||
ExternalId string `json:"externalId,omitempty"`
|
||||
FirstName string `json:"firstName,omitempty"`
|
||||
LastName string `json:"lastName,omitempty"`
|
||||
Patronymic string `json:"patronymic,omitempty"`
|
||||
Sex string `json:"sex,omitempty"`
|
||||
Email string `json:"email,omitempty"`
|
||||
Phones []Phone `json:"phones,brackets,omitempty"`
|
||||
Address *Address `json:"address,omitempty"`
|
||||
CreatedAt string `json:"createdAt,omitempty"`
|
||||
Birthday string `json:"birthday,omitempty"`
|
||||
ManagerId int `json:"managerId,omitempty"`
|
||||
Vip bool `json:"vip,omitempty"`
|
||||
Bad bool `json:"bad,omitempty"`
|
||||
Site string `json:"site,omitempty"`
|
||||
Source *Source `json:"source,omitempty"`
|
||||
Contragent *Contragent `json:"contragent,omitempty"`
|
||||
PersonalDiscount float32 `json:"personalDiscount,omitempty"`
|
||||
CumulativeDiscount float32 `json:"cumulativeDiscount,omitempty"`
|
||||
DiscountCardNumber string `json:"discountCardNumber,omitempty"`
|
||||
EmailMarketingUnsubscribedAt string `json:"emailMarketingUnsubscribedAt,omitempty"`
|
||||
AvgMarginSumm float32 `json:"avgMarginSumm,omitempty"`
|
||||
MarginSumm float32 `json:"marginSumm,omitempty"`
|
||||
TotalSumm float32 `json:"totalSumm,omitempty"`
|
||||
AverageSumm float32 `json:"averageSumm,omitempty"`
|
||||
OrdersCount int `json:"ordersCount,omitempty"`
|
||||
CostSumm float32 `json:"costSumm,omitempty"`
|
||||
MaturationTime int `json:"maturationTime,omitempty"`
|
||||
FirstClientId string `json:"firstClientId,omitempty"`
|
||||
LastClientId string `json:"lastClientId,omitempty"`
|
||||
BrowserId string `json:"browserId,omitempty"`
|
||||
CustomFields []map[string]string `json:"customFields,omitempty,brackets"`
|
||||
}
|
||||
|
||||
// Phone type
|
||||
|
@ -207,7 +208,7 @@ type Order struct {
|
|||
Marketplace *OrderMarketplace `json:"marketplace,omitempty"`
|
||||
Items []OrderItem `json:"items,omitempty,brackets"`
|
||||
CustomFields []map[string]string `json:"customFields,omitempty,brackets"`
|
||||
// Payments []OrderPayment `json:"payments,omitempty,brackets"`
|
||||
Payments []OrderPayment `json:"payments,omitempty,brackets"`
|
||||
}
|
||||
|
||||
// OrderDelivery type
|
||||
|
@ -265,22 +266,22 @@ type OrderPayment struct {
|
|||
|
||||
// OrderItem type
|
||||
type OrderItem struct {
|
||||
Id int `json:"id,omitempty"`
|
||||
InitialPrice float32 `json:"initialPrice,omitempty"`
|
||||
PurchasePrice float32 `json:"purchasePrice,omitempty"`
|
||||
DiscountTotal float32 `json:"discountTotal,omitempty"`
|
||||
DiscountManualAmount float32 `json:"discountManualAmount,omitempty"`
|
||||
DiscountManualPercent float32 `json:"discountManualPercent,omitempty"`
|
||||
ProductName string `json:"productName,omitempty"`
|
||||
VatRate string `json:"vatRate,omitempty"`
|
||||
CreatedAt string `json:"createdAt,omitempty"`
|
||||
Quantity float32 `json:"quantity,omitempty"`
|
||||
Status string `json:"status,omitempty"`
|
||||
Comment string `json:"comment,omitempty"`
|
||||
IsCanceled bool `json:"isCanceled,omitempty"`
|
||||
Offer Offer `json:"offer,omitempty"`
|
||||
Properties []*Property `json:"properties,omitempty,brackets"`
|
||||
PriceType *PriceType `json:"priceType,omitempty"`
|
||||
Id int `json:"id,omitempty"`
|
||||
InitialPrice float32 `json:"initialPrice,omitempty"`
|
||||
PurchasePrice float32 `json:"purchasePrice,omitempty"`
|
||||
DiscountTotal float32 `json:"discountTotal,omitempty"`
|
||||
DiscountManualAmount float32 `json:"discountManualAmount,omitempty"`
|
||||
DiscountManualPercent float32 `json:"discountManualPercent,omitempty"`
|
||||
ProductName string `json:"productName,omitempty"`
|
||||
VatRate string `json:"vatRate,omitempty"`
|
||||
CreatedAt string `json:"createdAt,omitempty"`
|
||||
Quantity float32 `json:"quantity,omitempty"`
|
||||
Status string `json:"status,omitempty"`
|
||||
Comment string `json:"comment,omitempty"`
|
||||
IsCanceled bool `json:"isCanceled,omitempty"`
|
||||
Offer Offer `json:"offer,omitempty"`
|
||||
Properties []Property `json:"properties,omitempty,brackets"`
|
||||
PriceType *PriceType `json:"priceType,omitempty"`
|
||||
}
|
||||
|
||||
// OrdersHistoryRecord type
|
||||
|
@ -298,15 +299,15 @@ type OrdersHistoryRecord struct {
|
|||
|
||||
// Pack type
|
||||
type Pack struct {
|
||||
Id int `json:"id,omitempty"`
|
||||
PurchasePrice float32 `json:"purchasePrice,omitempty"`
|
||||
Quantity float32 `json:"quantity,omitempty"`
|
||||
Store string `json:"store,omitempty"`
|
||||
ShipmentDate string `json:"shipmentDate,omitempty"`
|
||||
InvoiceNumber string `json:"invoiceNumber,omitempty"`
|
||||
DeliveryNoteNumber string `json:"deliveryNoteNumber,omitempty"`
|
||||
Item PackItem `json:"item,omitempty"`
|
||||
ItemId int `json:"itemId,omitempty"`
|
||||
Id int `json:"id,omitempty"`
|
||||
PurchasePrice float32 `json:"purchasePrice,omitempty"`
|
||||
Quantity float32 `json:"quantity,omitempty"`
|
||||
Store string `json:"store,omitempty"`
|
||||
ShipmentDate string `json:"shipmentDate,omitempty"`
|
||||
InvoiceNumber string `json:"invoiceNumber,omitempty"`
|
||||
DeliveryNoteNumber string `json:"deliveryNoteNumber,omitempty"`
|
||||
Item *PackItem `json:"item,omitempty"`
|
||||
ItemId int `json:"itemId,omitempty"`
|
||||
}
|
||||
|
||||
// PackItem type
|
||||
|
@ -330,23 +331,23 @@ type PacksHistoryRecord struct {
|
|||
|
||||
// Offer type
|
||||
type Offer struct {
|
||||
Id int `json:"id,omitempty"`
|
||||
ExternalId string `json:"externalId,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
XmlId string `json:"xmlId,omitempty"`
|
||||
Article string `json:"article,omitempty"`
|
||||
VatRate string `json:"vatRate,omitempty"`
|
||||
Price float32 `json:"price,omitempty"`
|
||||
PurchasePrice float32 `json:"purchasePrice,omitempty"`
|
||||
Quantity float32 `json:"quantity,omitempty"`
|
||||
Height float32 `json:"height,omitempty"`
|
||||
Width float32 `json:"width,omitempty"`
|
||||
Length float32 `json:"length,omitempty"`
|
||||
Weight float32 `json:"weight,omitempty"`
|
||||
Stores []Inventory `json:"stores,omitempty,brackets"`
|
||||
Properties []map[string]string `json:"properties,omitempty,brackets"`
|
||||
Prices []OfferPrice `json:"prices,omitempty,brackets"`
|
||||
Images []string `json:"images,omitempty,brackets"`
|
||||
Id int `json:"id,omitempty"`
|
||||
ExternalId string `json:"externalId,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
XmlId string `json:"xmlId,omitempty"`
|
||||
Article string `json:"article,omitempty"`
|
||||
VatRate string `json:"vatRate,omitempty"`
|
||||
Price float32 `json:"price,omitempty"`
|
||||
PurchasePrice float32 `json:"purchasePrice,omitempty"`
|
||||
Quantity float32 `json:"quantity,omitempty"`
|
||||
Height float32 `json:"height,omitempty"`
|
||||
Width float32 `json:"width,omitempty"`
|
||||
Length float32 `json:"length,omitempty"`
|
||||
Weight float32 `json:"weight,omitempty"`
|
||||
Stores []Inventory `json:"stores,omitempty,brackets"`
|
||||
Properties map[string]string `json:"properties,omitempty,brackets"`
|
||||
Prices []OfferPrice `json:"prices,omitempty,brackets"`
|
||||
Images []string `json:"images,omitempty,brackets"`
|
||||
}
|
||||
|
||||
// Inventory type
|
||||
|
@ -378,6 +379,21 @@ type OfferPrice struct {
|
|||
PriceType string `json:"priceType,omitempty"`
|
||||
}
|
||||
|
||||
// OfferPriceUpload type
|
||||
type OfferPriceUpload struct {
|
||||
Id int `json:"id,omitempty"`
|
||||
ExternalId string `json:"externalId,omitempty"`
|
||||
XmlId string `json:"xmlId,omitempty"`
|
||||
Site string `json:"site,omitempty"`
|
||||
Prices []PriceUpload `json:"prices,omitempty"`
|
||||
}
|
||||
|
||||
// PriceUpload type
|
||||
type PriceUpload struct {
|
||||
Code string `json:"code,omitempty"`
|
||||
Price float32 `json:"price,omitempty"`
|
||||
}
|
||||
|
||||
/**
|
||||
User related types
|
||||
*/
|
||||
|
@ -680,3 +696,35 @@ type Store struct {
|
|||
Phone *Phone `json:"phone,omitempty"`
|
||||
Address *Address `json:"address,omitempty"`
|
||||
}
|
||||
|
||||
// ProductGroup type
|
||||
type ProductGroup struct {
|
||||
Id int `json:"id,omitempty"`
|
||||
ParentId int `json:"parentId,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Site string `json:"site,omitempty"`
|
||||
Active bool `json:"active,omitempty"`
|
||||
}
|
||||
|
||||
// Product type
|
||||
type Product struct {
|
||||
Id int `json:"id,omitempty"`
|
||||
MaxPrice float32 `json:"maxPrice,omitempty"`
|
||||
MinPrice float32 `json:"minPrice,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Url string `json:"url,omitempty"`
|
||||
Article string `json:"article,omitempty"`
|
||||
ExternalId string `json:"externalId,omitempty"`
|
||||
Manufacturer string `json:"manufacturer,omitempty"`
|
||||
ImageUrl string `json:"imageUrl,omitempty"`
|
||||
Description string `json:"description,omitempty"`
|
||||
Popular bool `json:"popular,omitempty"`
|
||||
Stock bool `json:"stock,omitempty"`
|
||||
Novelty bool `json:"novelty,omitempty"`
|
||||
Recommended bool `json:"recommended,omitempty"`
|
||||
Active bool `json:"active,omitempty"`
|
||||
Quantity float32 `json:"quantity,omitempty"`
|
||||
Offers []Offer `json:"offers,omitempty,brackets"`
|
||||
Groups []ProductGroup `json:"groups,omitempty,brackets"`
|
||||
Properties map[string]string `json:"properties,omitempty,brackets"`
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue