feat(price): detect quantity discounts via baseprice, show Disc. badge

GoMag sends baseprice (catalog price) alongside price (discounted).
When baseprice > price, the item is volume-discounted — skip ROA
price comparison and show amber "Disc." badge instead of false
mismatch. Strikethrough baseprice in price column for transparency.

Pipeline: parse baseprice → store in SQLite → skip in validation →
pass flag to frontend → render badge (desktop + mobile pill badge
with aria-label, opacity 0.6 for dark mode).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Claude Agent
2026-04-07 17:06:37 +00:00
parent 0f817b2130
commit 057e62fc04
10 changed files with 103 additions and 18 deletions

View File

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