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

class TCGPlayerPriceHistory(Base):
    __tablename__ = "tcgplayer_price_history"

    id = Column(Integer, primary_key=True, index=True)
    product_id = Column(Integer, index=True)
    date = Column(DateTime, index=True)
    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)
    
    created_at = Column(DateTime(timezone=True), server_default=func.now())
    updated_at = Column(DateTime(timezone=True), onupdate=func.now()) 