Skip to content

Commit

Permalink
Archived fields for product details and fix filter for GetStockInfo (#94
Browse files Browse the repository at this point in the history
)

Co-authored-by: o.tyurin <[email protected]>
  • Loading branch information
zloyleshiy and o.tyurin committed Jun 3, 2024
1 parent 9ea1380 commit b26dd5b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 7 additions & 1 deletion ozon/products.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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 {
Expand Down
6 changes: 4 additions & 2 deletions ozon/products_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func TestGetStocksInfo(t *testing.T) {
LastId: "",
Filter: GetStocksInfoFilter{
OfferId: []string{"136834"},
ProductId: 214887921,
ProductId: []int64{214887921},
Visibility: "ALL",
},
},
Expand Down Expand Up @@ -251,7 +251,9 @@ func TestGetProductDetails(t *testing.T) {
}
],
"state_updated_at": "2021-10-21T15:48:03.927309Z"
}
},
"is_archived": false,
"is_autoarchived": false
}
}`,
},
Expand Down

0 comments on commit b26dd5b

Please sign in to comment.