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:
@@ -17,6 +17,7 @@ class OrderItem:
|
||||
price: float
|
||||
quantity: float
|
||||
vat: float
|
||||
baseprice: float = 0.0
|
||||
|
||||
@dataclass
|
||||
class OrderBilling:
|
||||
@@ -116,7 +117,8 @@ def _parse_order(order_id: str, data: dict, source_file: str) -> OrderData:
|
||||
name=str(item.get("name", "")),
|
||||
price=float(item.get("price", 0) or 0),
|
||||
quantity=float(item.get("quantity", 0) or 0),
|
||||
vat=float(item.get("vat", 0) or 0)
|
||||
vat=float(item.get("vat", 0) or 0),
|
||||
baseprice=float(item.get("baseprice", 0) or 0)
|
||||
))
|
||||
|
||||
# Parse billing
|
||||
|
||||
Reference in New Issue
Block a user