Skip to content

Commit

Permalink
Update December 6, 2024 (#126)
Browse files Browse the repository at this point in the history
  • Loading branch information
diPhantxm authored Jan 10, 2025
1 parent 14986eb commit 32bd774
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
16 changes: 10 additions & 6 deletions ozon/certificates.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,6 @@ type ListOfCertifiedCategoriesParams struct {
type ListOfCertifiedCategoriesResponse struct {
core.CommonResponse

// Method result
Result ListOfCertifiedCategoriesResult `json:"result"`
}

type ListOfCertifiedCategoriesResult struct {
// Certified categories details
Certification []ListOfCertifiedCategoriesResultCert `json:"certification"`

Expand All @@ -112,16 +107,25 @@ type ListOfCertifiedCategoriesResult struct {
}

type ListOfCertifiedCategoriesResultCert struct {
// Identifier of the certified category
CategoryId int64 `json:"category_id"`

// Category name
CategoryName string `json:"category_name"`

// Indication of a mandatory category
IsRequired bool `json:"is_required"`

// Type identifier of the certified category
TypeId int64 `json:"type_id"`

// Name of the type of certified category
TypeName string `json:"type_name"`
}

// List of certified categories
func (c Certificates) ListOfCertifiedCategories(ctx context.Context, params *ListOfCertifiedCategoriesParams) (*ListOfCertifiedCategoriesResponse, error) {
url := "/v1/product/certification/list"
url := "/v2/product/certification/list"

resp := &ListOfCertifiedCategoriesResponse{}

Expand Down
19 changes: 10 additions & 9 deletions ozon/certificates_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,16 @@ func TestListOfCertifiedCategories(t *testing.T) {
PageSize: 100,
},
`{
"result": {
"certification": [
{
"is_required": true,
"category_name": "Витаминно-минеральные комплексы для взрослых"
}
],
"total": 1
}
"certification": [
{
"category_id": 0,
"category_name": "string",
"is_required": true,
"type_id": 0,
"type_name": "string"
}
],
"total": 1
}`,
},
// Test No Client-Id or Api-Key
Expand Down

0 comments on commit 32bd774

Please sign in to comment.