aboutsummaryrefslogtreecommitdiff
path: root/src/ee/digikey/search_parts.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/ee/digikey/search_parts.py')
-rw-r--r--src/ee/digikey/search_parts.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ee/digikey/search_parts.py b/src/ee/digikey/search_parts.py
index 9c8eb74..61c5c1b 100644
--- a/src/ee/digikey/search_parts.py
+++ b/src/ee/digikey/search_parts.py
@@ -27,6 +27,14 @@ def resolved(p: DigikeyProduct) -> bomFile.Part:
key = make_digikey_fact_key(a.attribute_type.id)
facts.append(bomFile.Fact(key=key, label=a.attribute_type.label, value=a.value))
+ if len(p.price_breaks):
+ part.price_breaksProp = bomFile.PriceBreakList()
+
+ price_breaks: List[bomFile.PriceBreak] = part.price_breaksProp.price_break
+ for pb in p.price_breaks:
+ amount = bomFile.Amount(value=str(pb.per_piece_price.amount), currency=pb.per_piece_price.currency)
+ price_breaks.append(bomFile.PriceBreak(pb.quantity, amount=amount))
+
return part