from core.database import Base
from datetime import datetime
from sqlalchemy import Column, DateTime, Integer, String


class Kb_article_feedback(Base):
    __tablename__ = "kb_article_feedback"
    __table_args__ = {"extend_existing": True}

    id = Column(Integer, primary_key=True, index=True, autoincrement=True, nullable=False)
    article_id = Column(String, nullable=False)
    category_id = Column(String, nullable=True)
    rating = Column(String, nullable=False)
    comment = Column(String(2000), nullable=True)
    user_id = Column(String, nullable=True)
    user_email = Column(String(255), nullable=True)
    page_url = Column(String(500), nullable=True)
    user_agent = Column(String(500), nullable=True)
    created_at = Column(DateTime(timezone=True), default=datetime.now)
    updated_at = Column(DateTime(timezone=True), default=datetime.now, onupdate=datetime.now)