Skip to content

Commit

Permalink
Update November 22, 2024 (#123)
Browse files Browse the repository at this point in the history
  • Loading branch information
diPhantxm authored Dec 27, 2024
1 parent 7b5f44e commit 2f4d207
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 19 deletions.
22 changes: 11 additions & 11 deletions ozon/reports.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,15 @@ type GetReturnsReportsFilter struct {
// Order delivery scheme: fbs — delivery from seller's warehouse
DeliverySchema string `json:"delivery_schema"`

// Order identifier
OrderId int64 `json:"order_id"`
// Date from which the data is displayed in the report.
//
// Available for the last three months only
DateFrom time.Time `json:"date_from"`

// Date up to which the data is displayed in the report.
//
// Available for the last three months only
DateTo time.Time `json:"date_to"`

// Order status
Status string `json:"status"`
Expand All @@ -473,20 +480,13 @@ type GetReturnsReportsFilter struct {
type GetReturnsReportResponse struct {
core.CommonResponse

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

type GetReturnReportResult struct {
// Unique report identifier. The report is available for downloading within 3 days after making a request.
Code string `json:"code"`
}

// The report contains information about returned products that were accepted from the customer, ready for pickup, or delivered to the seller.
//
// The method is only suitable for orders shipped from the seller's warehouse
// Method for getting a report on FBO and FBS returns
func (c Reports) GetReturns(ctx context.Context, params *GetReturnsReportParams) (*GetReturnsReportResponse, error) {
url := "/v1/report/returns/create"
url := "/v2/report/returns/create"

resp := &GetReturnsReportResponse{}

Expand Down
10 changes: 2 additions & 8 deletions ozon/reports_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,7 @@ func TestGetReturnsReport(t *testing.T) {
},
},
`{
"result": {
"code": "d55f4517-8347-4e24-9d93-d6e736c1c07c"
}
"code": "REPORT_seller_products_924336_1720170405_a9ea2f27-a473-4b13-99f9-d0cfcb5b1a69"
}`,
},
// Test No Client-Id or Api-Key
Expand All @@ -407,16 +405,12 @@ func TestGetReturnsReport(t *testing.T) {
continue
}

compareJsonResponse(t, test.response, &GetReturnsReportResponse{})

if resp.StatusCode != test.statusCode {
t.Errorf("got wrong status code: got: %d, expected: %d", resp.StatusCode, test.statusCode)
}

if resp.StatusCode == http.StatusOK {
if resp.Result.Code == "" {
t.Errorf("Code cannot be empty")
}
compareJsonResponse(t, test.response, &GetReturnsReportResponse{})
}
}
}
Expand Down

0 comments on commit 2f4d207

Please sign in to comment.