From b26dd5bbee79edcf2f92b0377d47cce030769a91 Mon Sep 17 00:00:00 2001 From: Zloy_Leshiy Date: Mon, 3 Jun 2024 13:40:55 +0300 Subject: [PATCH] Archived fields for product details and fix filter for GetStockInfo (#94) Co-authored-by: o.tyurin --- ozon/products.go | 8 +++++++- ozon/products_test.go | 6 ++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ozon/products.go b/ozon/products.go index 4f7da57..98f6546 100644 --- a/ozon/products.go +++ b/ozon/products.go @@ -30,7 +30,7 @@ type GetStocksInfoFilter struct { OfferId []string `json:"offer_id,omitempty"` // Filter by the product_id parameter. It is possible to pass a list of values - ProductId int64 `json:"product_id,omitempty"` + ProductId []int64 `json:"product_id,omitempty"` // Filter by product visibility Visibility string `json:"visibility,omitempty"` @@ -246,6 +246,12 @@ type ProductDetails struct { // Product volume weight VolumeWeight float64 `json:"volume_weight"` + + // 'true' if the item is archived manually. + IsArchived bool `json:"is_archived"` + + // 'true' if the item is archived automatically. + IsArchivedAuto bool `json:"is_autoarchived"` } type ProductDetailCommission struct { diff --git a/ozon/products_test.go b/ozon/products_test.go index 56093f0..6512d1b 100644 --- a/ozon/products_test.go +++ b/ozon/products_test.go @@ -27,7 +27,7 @@ func TestGetStocksInfo(t *testing.T) { LastId: "", Filter: GetStocksInfoFilter{ OfferId: []string{"136834"}, - ProductId: 214887921, + ProductId: []int64{214887921}, Visibility: "ALL", }, }, @@ -251,7 +251,9 @@ func TestGetProductDetails(t *testing.T) { } ], "state_updated_at": "2021-10-21T15:48:03.927309Z" - } + }, + "is_archived": false, + "is_autoarchived": false } }`, },