fix(price): skip price check for kit/complex articles

Kit articles (multi-component or cantitate_roa≠1) have expected price
differences between GoMag (commercial) and ROA (component sum).
Skip comparison entirely, mark with kit=True flag for UI badge.

Fix kit detection to use float()!=1 (catches cantitate_roa<1 like 0.5).
Update 3 existing tests + add multi-component kit test.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Claude Agent
2026-04-02 13:01:41 +00:00
parent 219c821df4
commit ffd4cc0800
3 changed files with 38 additions and 11 deletions

View File

@@ -463,6 +463,8 @@ async def order_detail(order_number: str):
if pi:
item["pret_roa"] = pi.get("pret_roa")
item["price_match"] = pi.get("match")
if pi.get("kit"):
item["kit"] = True
order_price_check = price_data.get("summary", {})
# Cache price_match in SQLite if changed
if order_price_check.get("oracle_available") is not False: