From 8a585d086ad1ac421d22546923946c860e13674e Mon Sep 17 00:00:00 2001 From: Kirill Date: Sun, 15 Dec 2024 21:03:19 +0300 Subject: [PATCH] Update November 13, 2024 (#116) --- ozon/fbs.go | 47 ++++++++++++++++++++++++++++++++++++++++++++++ ozon/fbs_test.go | 49 +++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 93 insertions(+), 3 deletions(-) diff --git a/ozon/fbs.go b/ozon/fbs.go index 3876fff..8bd7833 100644 --- a/ozon/fbs.go +++ b/ozon/fbs.go @@ -186,6 +186,44 @@ type FBSPosting struct { // Shipment tracking number TrackingNumber string `json:"tracking_number"` + + // Details on shipping rate + Tariffication []FBSPostingTariffication `json:"tariffication"` + + // Economy product identifier + QuantumId int64 `json:"quantum_id"` +} + +type FBSPostingTariffication struct { + // Current shipping rate as a percentage + CurrentTariffRate float64 `json:"current_tariff_rate"` + + // Type of shipping rate adjustment: discount or surcharge + CurrentTariffType string `json:"current_tariff_type"` + + // Current amount of discount or surcharge + CurrentTariffCharge string `json:"current_tariff_charge"` + + // Currency of the amount + CurrencyTariffCurrencyCode string `json:"current_tariff_charge_currency_code"` + + // Percentage by which the shipping rate is adjusted + // after the time specified in the next_tariff_starts_at parameter + NextTariffRate float64 `json:"next_tariff_rate"` + + // The adjustment type applied to the shipping rate + // after the time specified in the next_tariff_starts_at parameter: + // discount or surcharge + NextTariffType string `json:"next_tariff_type"` + + // Discount or surcharge amount applied during the next shipping rate adjustment step + NextTariffCharge string `json:"next_tariff_charge"` + + // Date and time when the new shipping rate is applied + NextTariffStartsAt time.Time `json:"next_tariff_starts_at"` + + // New shipping rate currency + NextTariffCurrencyCode string `json:"next_tariff_charge_currency_code"` } type FBSPostingAddressee struct { @@ -1015,6 +1053,9 @@ type GetShipmentDataByIdentifierResult struct { // Shipment tracking number TrackingNumber string `json:"tracking_number"` + + // Details on shipping rate + Tariffication []FBSPostingTariffication `json:"tariffication"` } type GetShipmentDataByIdentifierResultAdditionalData struct { @@ -2204,6 +2245,12 @@ type AvailableFreightsListResult struct { // Number of already packaged shipments MandatoryPackagedCount int32 `json:"mandatory_packaged_count"` + // Recommended local time of shipping to the pick-up point + RecommendedTimeLocal string `json:"recommended_time_local"` + + // Time zone offset of the recommended shipping time from UTC-0 in minutes + RecommendedTimeUTCOffset int32 `json:"recommended_time_utc_offset_in_minutes"` + // Delivery service icon link TPLProviderIconURL string `json:"tpl_provider_icon_url"` diff --git a/ozon/fbs_test.go b/ozon/fbs_test.go index 50c5765..928dec9 100644 --- a/ozon/fbs_test.go +++ b/ozon/fbs_test.go @@ -66,6 +66,7 @@ func TestListUnprocessedShipments(t *testing.T) { "cancellation_initiator": "" }, "customer": null, + "quantum_id": 0, "products": [ { "currency_code": "RUB", @@ -146,7 +147,20 @@ func TestListUnprocessedShipments(t *testing.T) { "requirements": { "products_requiring_gtd": [], "products_requiring_country": [] - } + }, + "tariffication": [ + { + "current_tariff_rate": 0, + "current_tariff_type": "", + "current_tariff_charge": "", + "current_tariff_charge_currency_code": "", + "next_tariff_rate": 0, + "next_tariff_type": "", + "next_tariff_charge": "", + "next_tariff_starts_at": "2023-11-13T08:05:57.657Z", + "next_tariff_charge_currency_code": "" + } + ] } ], "count": 55 @@ -264,11 +278,25 @@ func TestGetFBSShipmentsList(t *testing.T) { "analytics_data": null, "financial_data": null, "is_express": false, + "quantum_id": 0, "requirements": { "products_requiring_gtd": [], "products_requiring_country": [], "products_requiring_mandatory_mark": [] - } + }, + "tariffication": [ + { + "current_tariff_rate": 0, + "current_tariff_type": "", + "current_tariff_charge": "", + "current_tariff_charge_currency_code": "", + "next_tariff_rate": 0, + "next_tariff_type": "", + "next_tariff_charge": "", + "next_tariff_starts_at": "2023-11-13T08:05:57.657Z", + "next_tariff_charge_currency_code": "" + } + ] } ], "has_next": true @@ -616,7 +644,20 @@ func TestGetShipmentDataByIdentifier(t *testing.T) { "products_requiring_gtd": [], "products_requiring_country": [] }, - "product_exemplars": null + "product_exemplars": null, + "tariffication": [ + { + "current_tariff_rate": 0, + "current_tariff_type": "", + "current_tariff_charge": "", + "current_tariff_charge_currency_code": "", + "next_tariff_rate": 0, + "next_tariff_type": "", + "next_tariff_charge": "", + "next_tariff_starts_at": "2023-11-13T08:05:57.657Z", + "next_tariff_charge_currency_code": "" + } + ] } }`, }, @@ -1883,6 +1924,8 @@ func TestAvailableFreightsList(t *testing.T) { "has_entrusted_acceptance": true, "mandatory_postings_count": 0, "mandatory_packaged_count": 0, + "recommended_time_local": "string", + "recommended_time_utc_offset_in_minutes": 0, "tpl_provider_icon_url": "string", "tpl_provider_name": "string", "warehouse_city": "string",