Skip to content

Commit a533495

Browse files
committed
fix: articles ebay conditions mapping
1 parent e85f797 commit a533495

1 file changed

Lines changed: 25 additions & 9 deletions

File tree

api/services/ebay_publish_service.py

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -56,27 +56,43 @@ async def _emit_ebay(
5656
_TCG_LEAF_CATEGORY_IDS = frozenset({"183050", "183454", "261328"})
5757
# Card condition descriptor (non-graded cards) — eBay name + value IDs.
5858
_CARD_CONDITION_DESCRIPTOR_NAME = "40001"
59-
# Maps article form « Condition » (ArticleForm.vue) + legacy DB values.
59+
# Maps article form « Condition » (ArticleForm.vue) + legacy DB values to the
60+
# value IDs used by the eBay.fr listing editor for the "Card Condition"
61+
# descriptor (name=40001) on TCG leaf categories:
62+
# 400010 → Near Mint or Better (Quasi neuf ou mieux)
63+
# 400015 → Lightly Played / Excellent (légers défauts)
64+
# 400016 → Moderately Played / Very Good (état moyen)
65+
# 400017 → Heavily Played / Poor (très abîmée)
6066
_APP_TO_CARD_CONDITION_VALUE_ID: dict[str, str] = {
6167
"Mint": "400010",
6268
"Near Mint": "400010",
6369
"NM": "400010",
64-
"Excellent": "400011",
65-
"Good": "400012",
70+
"Excellent": "400015",
6671
"Lightly Played": "400015",
67-
"Played": "400016",
72+
"Good": "400016",
73+
"Moderately Played": "400016",
74+
"Very Good": "400016",
75+
"Played": "400017",
76+
"Heavily Played": "400017",
6877
"Poor": "400017",
6978
}
70-
# Inventory item condition (conditionId) for TCG categories — from ``article.condition``.
79+
# Inventory item condition (``condition`` enum) for TCG leaf categories. eBay
80+
# only accepts "Ungraded" (conditionId 4000 / USED_VERY_GOOD) for non-graded
81+
# cards in these categories — other enums (USED_GOOD=5000, USED_ACCEPTABLE=6000)
82+
# are rejected with errorId 25059 ("condition 5000 is not valid for category
83+
# 183454"). The fine-grained state is carried by the conditionDescriptor above.
7184
_TCG_ITEM_CONDITION_ENUM: dict[str, str] = {
7285
"Mint": "USED_VERY_GOOD",
7386
"Near Mint": "USED_VERY_GOOD",
7487
"NM": "USED_VERY_GOOD",
7588
"Excellent": "USED_VERY_GOOD",
76-
"Good": "USED_GOOD",
77-
"Lightly Played": "USED_GOOD",
78-
"Played": "USED_ACCEPTABLE",
79-
"Poor": "USED_ACCEPTABLE",
89+
"Lightly Played": "USED_VERY_GOOD",
90+
"Good": "USED_VERY_GOOD",
91+
"Moderately Played": "USED_VERY_GOOD",
92+
"Very Good": "USED_VERY_GOOD",
93+
"Played": "USED_VERY_GOOD",
94+
"Heavily Played": "USED_VERY_GOOD",
95+
"Poor": "USED_VERY_GOOD",
8096
}
8197

8298
_MARKETPLACE_CURRENCY: dict[str, str] = {

0 commit comments

Comments
 (0)