Skip to content

Commit e5f2007

Browse files
authored
Fix fields in Finance methods (#45)
Fixed operation type field in getting transaction list Fixed fields in params for getting finance realization report
1 parent 40d9fc3 commit e5f2007

File tree

2 files changed

+48
-52
lines changed

2 files changed

+48
-52
lines changed

ozon/finance.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ type ReportOnSoldProductsResponse struct {
2121
core.CommonResponse
2222

2323
// Query result
24-
Result []ReportonSoldProductsResult `json:"result"`
24+
Result ReportonSoldProductsResult `json:"result"`
2525
}
2626

2727
type ReportonSoldProductsResult struct {
2828
// Report title page
29-
Header []ReportOnSoldProductsResultHeader `json:"header"`
29+
Header ReportOnSoldProductsResultHeader `json:"header"`
3030

3131
// Report table
3232
Rows []ReportOnSoldProductsResultRow `json:"rows"`
@@ -272,7 +272,7 @@ type ListTransactionsFilter struct {
272272
Date ListTransactionsFilterDate `json:"date"`
273273

274274
// Operation type
275-
OperationType string `json:"operation_type"`
275+
OperationType []string `json:"operation_type"`
276276

277277
// Shipment number
278278
PostingNumber string `json:"posting_number"`

ozon/finance_test.go

Lines changed: 45 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -25,55 +25,51 @@ func TestReportOnSoldProducts(t *testing.T) {
2525
&ReportOnSoldProductsParams{
2626
Date: "2022-09",
2727
},
28-
`{
29-
"result": [
30-
{
31-
"header": [
32-
{
33-
"doc_date": "2022-09-22",
34-
"num": "string",
35-
"start_date": "2022-09-02",
36-
"stop_date": "2022-09-22",
37-
"contract_date": "2022-09-02",
38-
"contract_num": "string",
39-
"payer_name": "string",
40-
"payer_inn": "string",
41-
"payer_kpp": "string",
42-
"rcv_name": "string",
43-
"rcv_inn": "string",
44-
"rcv_kpp": "string",
45-
"doc_amount": 1,
46-
"vat_amount": 1,
47-
"currency_code": "string"
48-
}
49-
],
50-
"rows": [
51-
{
52-
"row_number": 0,
53-
"product_id": 0,
54-
"product_name": "string",
55-
"offer_id": "string",
56-
"barcode": "string",
57-
"price": 0,
58-
"commission_percent": 0,
59-
"price_sale": 0,
60-
"sale_qty": 0,
61-
"sale_amount": 0,
62-
"sale_discount": 0,
63-
"sale_commission": 0,
64-
"sale_price_seller": 0,
65-
"return_sale": 0,
66-
"return_qty": 0,
67-
"return_amount": 0,
68-
"return_discount": 0,
69-
"return_commission": 0,
70-
"return_price_seller": 0
71-
}
72-
]
73-
}
74-
]
75-
}`,
76-
"",
28+
`{
29+
"result": {
30+
"header": {
31+
"doc_date": "2022-09-22",
32+
"num": "string",
33+
"start_date": "2022-09-02",
34+
"stop_date": "2022-09-22",
35+
"contract_date": "2022-09-02",
36+
"contract_num": "string",
37+
"payer_name": "string",
38+
"payer_inn": "string",
39+
"payer_kpp": "string",
40+
"rcv_name": "string",
41+
"rcv_inn": "string",
42+
"rcv_kpp": "string",
43+
"doc_amount": 1,
44+
"vat_amount": 1,
45+
"currency_code": "string"
46+
},
47+
"rows": [
48+
{
49+
"row_number": 0,
50+
"product_id": 0,
51+
"product_name": "string",
52+
"offer_id": "string",
53+
"barcode": "string",
54+
"price": 0,
55+
"commission_percent": 0,
56+
"price_sale": 0,
57+
"sale_qty": 0,
58+
"sale_amount": 0,
59+
"sale_discount": 0,
60+
"sale_commission": 0,
61+
"sale_price_seller": 0,
62+
"return_sale": 0,
63+
"return_qty": 0,
64+
"return_amount": 0,
65+
"return_discount": 0,
66+
"return_commission": 0,
67+
"return_price_seller": 0
68+
}
69+
]
70+
}
71+
}`,
72+
"",
7773
},
7874
// Test No Client-Id or Api-Key
7975
{

0 commit comments

Comments
 (0)