Skip to content

Commit ae9280d

Browse files
committed
feat: combine title and description for a more exhaustive seko commodity descriptions for customs declaration
1 parent 88b9811 commit ae9280d

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

modules/connectors/seko/karrio/providers/seko/rate.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ def rate_request(
7272
recipient=payload.recipient,
7373
weight_unit="KG",
7474
)
75-
commodities = lib.identity(customs.commodities if any(customs.commodities) else packages.items)
75+
commodities = lib.identity(
76+
customs.commodities if any(customs.commodities) else packages.items
77+
)
7678

7779
# map data to convert karrio model to seko specific type
7880
request = seko.RatingRequestType(
@@ -120,7 +122,9 @@ def rate_request(
120122
DangerousGoods=None,
121123
Commodities=[
122124
seko.CommodityType(
123-
Description=commodity.description,
125+
Description=lib.text(
126+
commodity.title, commodity.description, separator=" - ", max=200
127+
),
124128
HarmonizedCode=commodity.sku,
125129
Units=commodity.quantity,
126130
UnitValue=commodity.value_amount,

modules/connectors/seko/karrio/providers/seko/shipment/create.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,9 @@ def shipment_request(
185185
Commodities=[
186186
seko.CommodityType(
187187
Description=lib.identity(
188-
lib.text(commodity.description or commodity.title, max=200)
188+
lib.text(
189+
commodity.title, commodity.description, separator=" - ", max=200
190+
)
189191
or "item"
190192
),
191193
HarmonizedCode=commodity.hs_code or "0000.00.00",

modules/connectors/seko/tests/seko/test_rate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def test_parse_rate_response(self):
137137
"Commodities": [
138138
{
139139
"Currency": "EUR",
140-
"Description": "Stainless steel gold plated necklace",
140+
"Description": "Bullet Punch Necklace - Stainless steel gold plated necklace",
141141
"HarmonizedCode": "1234567890",
142142
"UnitCostValue": 180.81,
143143
"UnitKg": 0.002,

0 commit comments

Comments
 (0)