from sqlalchemy.orm import Session from app.models.tcgplayer_products import TCGPlayerProduct class InventoryProductContext: def __init__(self, product: TCGPlayerProduct, db: Session): self.product = product self.prices = product.most_recent_tcgplayer_price self.db = db @property def market_price(self) -> float: return self.product.most_recent_tcgplayer_price.market_price @property def low_price(self) -> float: return self.product.most_recent_tcgplayer_price.low_price @property def name(self) -> str: return self.product.name @property def image_url(self) -> str: return self.product.image_url @property def id(self) -> int: return self.product.id