Skip to content

Commit

Permalink
Update November 13, 2024 (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
diPhantxm authored Dec 15, 2024
1 parent d1fd698 commit 8a585d0
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 3 deletions.
47 changes: 47 additions & 0 deletions ozon/fbs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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"`

Expand Down
49 changes: 46 additions & 3 deletions ozon/fbs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ func TestListUnprocessedShipments(t *testing.T) {
"cancellation_initiator": ""
},
"customer": null,
"quantum_id": 0,
"products": [
{
"currency_code": "RUB",
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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": ""
}
]
}
}`,
},
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 8a585d0

Please sign in to comment.