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

class TCGPlayerProduct(Base):
    __tablename__ = "tcgplayer_products"

    id = Column(Integer, primary_key=True, index=True)
    product_id = Column(Integer, index=True)
    name = Column(String, nullable=False)
    clean_name = Column(String)
    image_url = Column(String)
    category_id = Column(Integer)
    group_id = Column(Integer)
    url = Column(String)
    modified_on = Column(DateTime)
    image_count = Column(Integer)
    ext_rarity = Column(String)
    ext_subtype = Column(String)
    ext_oracle_text = Column(String)
    ext_number = Column(String)
    low_price = Column(Float)
    mid_price = Column(Float)
    high_price = Column(Float)
    market_price = Column(Float)
    direct_low_price = Column(Float)
    sub_type_name = Column(String)
    ext_power = Column(String)
    ext_toughness = Column(String)
    ext_flavor_text = Column(String)
    
    created_at = Column(DateTime(timezone=True), server_default=func.now())
    updated_at = Column(DateTime(timezone=True), onupdate=func.now()) 