"""Model Pricing Model"""
from sqlalchemy import Column, String, Numeric, Enum, Boolean
from sqlalchemy.dialects.postgresql import UUID
from sqlalchemy.sql import func
import uuid
from app.database import Base

class ModelPricing(Base):
    __tablename__ = "model_pricing"

    id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
    provider = Column(String(100), nullable=False)  # openai, google, runway...
    model_name = Column(String(100), nullable=False) # gpt-4o, gen-3-alpha...
    
    # Pricing Metrics
    cost_per_input_token = Column(Numeric(10, 8), default=0)
    cost_per_output_token = Column(Numeric(10, 8), default=0)
    cost_per_image = Column(Numeric(10, 4), default=0)
    cost_per_second = Column(Numeric(10, 4), default=0)
    cost_per_1k_chars = Column(Numeric(10, 4), default=0)
    cost_per_request = Column(Numeric(10, 4), default=0)
    
    # Metadata
    currency = Column(String(3), default="USD")
    effective_date = Column(String(20)) # e.g. "2024-12-01"
    is_active = Column(Boolean, default=True)
