from sqlalchemy import Column, Integer, String, Float, DateTime, ForeignKey
from sqlalchemy.sql import func
from app.db.database import Base

class TCGPlayerInventory(Base):
    __tablename__ = "tcgplayer_inventory"

    id = Column(Integer, primary_key=True, index=True)
    tcgplayer_sku_id = Column(Integer, ForeignKey("mtgjson_skus.tcgplayer_sku_id"), unique=True, index=True)
    product_line = Column(String)
    set_name = Column(String)
    product_name = Column(String)
    title = Column(String)
    number = Column(String)
    rarity = Column(String)
    condition = Column(String)
    tcg_market_price = Column(Float)
    tcg_direct_low = Column(Float)
    tcg_low_price_with_shipping = Column(Float)
    tcg_low_price = Column(Float)
    total_quantity = Column(Integer)
    add_to_quantity = Column(Integer)
    tcg_marketplace_price = Column(Float)
    photo_url = Column(String)
    created_at = Column(DateTime(timezone=True), server_default=func.now())
    updated_at = Column(DateTime(timezone=True), server_default=func.now(), onupdate=func.now())