From a9d7a5c6d33e90deec635ea68414560ebcef8d97 Mon Sep 17 00:00:00 2001 From: Kirill Date: Fri, 11 Apr 2025 01:41:48 +0300 Subject: [PATCH] Update March 3, 2025 (#153) --- ozon/fbs.go | 22 +++++++++++++++++++--- ozon/fbs_test.go | 30 ++++++++++++++++++++++-------- 2 files changed, 41 insertions(+), 11 deletions(-) diff --git a/ozon/fbs.go b/ozon/fbs.go index afe89ad..5eb511a 100644 --- a/ozon/fbs.go +++ b/ozon/fbs.go @@ -195,6 +195,14 @@ type FBSPosting struct { // Economy product identifier QuantumId int64 `json:"quantum_id"` + + // List of products with additional characteristics + Optional FBSPostingOptional `json:"optional"` +} + +type FBSPostingOptional struct { + // List of products with optional labeling + ProductsWithPossibleMandatoryMark []int `json:"products_with_possible_mandatory_mark"` } type FBSPostingTariffication struct { @@ -373,9 +381,6 @@ type FBSRequirements struct { } type PostingProduct struct { - // Mandatory product labeling - MandatoryMark []string `json:"mandatory_mark"` - // Product name Name string `json:"name"` @@ -393,6 +398,9 @@ type PostingProduct struct { // Product identifier in the Ozon system, SKU SKU int64 `json:"sku"` + + // Product traceability attribute + IsBLRTraceable bool `json:"is_blr_traceable"` } type FBSCustomer struct { @@ -1043,6 +1051,9 @@ type GetShipmentDataByIdentifierResult struct { // Number of the parent shipment which split resulted in the current shipment ParentPostingNumber string `json:"parent_posting_number"` + // List of products with additional characteristics + Optional GetShipmentDataByIdentifierOptional `json:"optional"` + // Shipment number PostingNumber string `json:"posting_number"` @@ -1094,6 +1105,11 @@ type GetShipmentDataByIdentifierResult struct { Tariffication []FBSPostingTariffication `json:"tariffication"` } +type GetShipmentDataByIdentifierOptional struct { + // List of products with optional labeling + ProductsWithPossibleMandatoryMark []int `json:"products_with_possible_mandatory_mark"` +} + type GetShipmentDataByIdentifierResultAdditionalData struct { // Key Key string `json:"key"` diff --git a/ozon/fbs_test.go b/ozon/fbs_test.go index d5b26c8..6a79967 100644 --- a/ozon/fbs_test.go +++ b/ozon/fbs_test.go @@ -58,6 +58,11 @@ func TestListUnprocessedShipments(t *testing.T) { "in_process_at": "2021-08-25T10:48:38Z", "shipment_date": "2021-08-26T10:00:00Z", "delivering_date": null, + "optional": { + "products_with_possible_mandatory_mark": [ + 0 + ] + }, "cancellation": { "cancel_reason_id": 0, "cancel_reason": "", @@ -71,12 +76,12 @@ func TestListUnprocessedShipments(t *testing.T) { "products": [ { "currency_code": "RUB", + "is_blr_traceable": true, "price": "1259", "offer_id": "УТ-0001365", "name": "Мяч, цвет: черный, 5 кг", "sku": 140048123, - "quantity": 1, - "mandatory_mark": [] + "quantity": 1 } ], "addressee": null, @@ -255,6 +260,11 @@ func TestGetFBSShipmentsList(t *testing.T) { "in_process_at": "2022-05-13T07:07:32Z", "shipment_date": "2022-05-13T10:00:00Z", "delivering_date": null, + "optional": { + "products_with_possible_mandatory_mark": [ + 0 + ] + }, "cancellation": { "cancel_reason_id": 0, "cancel_reason": "", @@ -267,12 +277,12 @@ func TestGetFBSShipmentsList(t *testing.T) { "products": [ { "currency_code": "RUB", + "is_blr_traceable": true, "price": "1390.000000", "offer_id": "205953", "name": " Электронный конструктор PinLab Позитроник", "sku": 358924380, - "quantity": 1, - "mandatory_mark": [] + "quantity": 1 } ], "addressee": null, @@ -303,7 +313,7 @@ func TestGetFBSShipmentsList(t *testing.T) { ], "has_next": true } - }`, + }`, }, // Test No Client-Id or Api-Key { @@ -531,8 +541,7 @@ func TestGetShipmentDataByBarcode(t *testing.T) { "offer_id": "250-7898-1", "name": "Кофе ароматизированный \"Шоколадный апельсин\" 250 гр", "sku": 180550365, - "quantity": 1, - "mandatory_mark": [] + "quantity": 1 } ], "barcodes": null, @@ -621,6 +630,11 @@ func TestGetShipmentDataByIdentifier(t *testing.T) { "delivering_date": null, "provider_status": "", "delivery_price": "", + "optional": { + "products_with_possible_mandatory_mark": [ + 0 + ] + }, "cancellation": { "cancel_reason_id": 0, "cancel_reason": "", @@ -634,12 +648,12 @@ func TestGetShipmentDataByIdentifier(t *testing.T) { "products": [ { "currency_code": "RUB", + "is_blr_traceable": true, "price": "279.0000", "offer_id": "250-7898-1", "name": "Кофе ароматизированный \"Шоколадный апельсин\" 250 гр", "sku": 180550365, "quantity": 1, - "mandatory_mark": [], "dimensions": { "height": "40.00", "length": "240.00",