fix imports and price
This commit is contained in:
1 parent
832122e63c
commit
1e96dead07
2 files changed
+9
-10
No files matched your search
+8
-8
@@ -7,6 +7,7 @@ import asyncio
|
||||
import os
|
||||
import aiohttp
|
||||
import json
|
||||
import math
|
||||
import dotenv
|
||||
from typing import Dict, Any, Optional
|
||||
from datetime import datetime, timedelta
|
||||
@@ -215,22 +216,21 @@ class AsyncBricksetAPI:
|
||||
barcode_data = set_data.get("barcode", {})
|
||||
upc_code = barcode_data.get("UPC") or barcode_data.get("EAN")
|
||||
|
||||
# Get retail price before rounding
|
||||
retail_price = set_data["LEGOCom"]["US"]["retailPrice"]
|
||||
|
||||
our_set = {
|
||||
"set_num": set_data["number"],
|
||||
"set_name": set_data["name"],
|
||||
"set_theme": set_data["theme"],
|
||||
"set_image": set_data["image"]["thumbnailURL"],
|
||||
"set_barcode": upc_code,
|
||||
"set_retailprice": round(
|
||||
set_data["LEGOCom"]["US"]["retailPrice"]
|
||||
),
|
||||
"set_retailprice": round(retail_price),
|
||||
}
|
||||
|
||||
# Calculate adjusted price (10% markup)
|
||||
retail_price = our_set["set_retailprice"]
|
||||
our_set["set_adjustredprice"] = retail_price + (
|
||||
(10 / 100) * retail_price
|
||||
)
|
||||
# Calculate adjusted price (10% markup), then round up
|
||||
adjusted_price = retail_price * 1.10
|
||||
our_set["set_adjustredprice"] = math.ceil(adjusted_price)
|
||||
|
||||
# Set PW inventory name with theme
|
||||
our_set["pw_name"] = (
|
||||
|
||||
Reference in new issue
Block a user