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


class Ticket_summaries(Base):
    __tablename__ = "ticket_summaries"
    __table_args__ = {"extend_existing": True}

    id = Column(Integer, primary_key=True, index=True, autoincrement=True, nullable=False)
    ticket_id = Column(String, nullable=False)
    last_reply_id = Column(String, nullable=False)
    summary = Column(String, nullable=False)
    model = Column(String, nullable=True)
    created_at = Column(DateTime(timezone=True), default=datetime.now)
    updated_at = Column(DateTime(timezone=True), default=datetime.now, onupdate=datetime.now)