v1.8.0: YandexGPT-only NLP, unknown questions system, callback dedup, consent flow fixes, DELETE cascade, UTC+3, auto-detect sidebar menu, tel:/mailto: links
This commit is contained in:
+33
-1
@@ -92,7 +92,7 @@ class BotConversation(Base):
|
||||
class BotMessage(Base):
|
||||
__tablename__ = "bot_messages"
|
||||
id = Column(BigInteger, primary_key=True, autoincrement=True)
|
||||
conversation_id = Column(BigInteger, ForeignKey("bot_conversations.id"), nullable=False)
|
||||
conversation_id = Column(BigInteger, ForeignKey("bot_conversations.id", ondelete="CASCADE"), nullable=False)
|
||||
direction = Column(String(10), nullable=False)
|
||||
text = Column(Text, nullable=True)
|
||||
attachment_json = Column(Text, nullable=True)
|
||||
@@ -111,6 +111,9 @@ class BotTicket(Base):
|
||||
status = Column(String(20), default="Новая")
|
||||
created_by = Column(String(100), default="bot")
|
||||
assigned_to = Column(BigInteger, nullable=True)
|
||||
contact_name = Column(String(500), nullable=True)
|
||||
contact_phone = Column(String(50), nullable=True)
|
||||
contact_email = Column(String(255), nullable=True)
|
||||
created_at = Column(DateTime, default=datetime.datetime.utcnow)
|
||||
updated_at = Column(DateTime, default=datetime.datetime.utcnow, onupdate=datetime.datetime.utcnow)
|
||||
|
||||
@@ -128,6 +131,20 @@ class BotTicketMessage(Base):
|
||||
ticket = relationship("BotTicket", lazy="joined")
|
||||
|
||||
|
||||
class BotProcessingLog(Base):
|
||||
__tablename__ = "bot_processing_logs"
|
||||
id = Column(BigInteger, primary_key=True, autoincrement=True)
|
||||
user_id = Column(BigInteger, ForeignKey("bot_users.id"), nullable=False)
|
||||
conversation_id = Column(BigInteger, ForeignKey("bot_conversations.id", ondelete="CASCADE"), nullable=True)
|
||||
step = Column(String(50), nullable=False)
|
||||
status = Column(String(20), default="ok")
|
||||
message = Column(Text, nullable=True)
|
||||
detail = Column(Text, nullable=True)
|
||||
created_at = Column(DateTime, default=datetime.datetime.utcnow)
|
||||
|
||||
user = relationship("BotUser", lazy="joined")
|
||||
|
||||
|
||||
class BotTicketStatus(Base):
|
||||
__tablename__ = "bot_ticket_statuses"
|
||||
id = Column(BigInteger, primary_key=True, autoincrement=True)
|
||||
@@ -138,3 +155,18 @@ class BotTicketStatus(Base):
|
||||
created_at = Column(DateTime, default=datetime.datetime.utcnow)
|
||||
|
||||
ticket = relationship("BotTicket", lazy="joined")
|
||||
|
||||
|
||||
class BotUnknownQuestion(Base):
|
||||
__tablename__ = "bot_unknown_questions"
|
||||
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||
question_text = Column(Text, nullable=False)
|
||||
normalized_text = Column(Text, nullable=True)
|
||||
ask_count = Column(Integer, default=1)
|
||||
user_ids = Column(ARRAY(BigInteger), default=[])
|
||||
status = Column(String(50), default="new")
|
||||
generated_answer = Column(Text, nullable=True)
|
||||
generated_keywords = Column(ARRAY(String), nullable=True)
|
||||
generated_category_id = Column(Integer, nullable=True)
|
||||
created_at = Column(DateTime, default=datetime.datetime.utcnow)
|
||||
reviewed_at = Column(DateTime, nullable=True)
|
||||
|
||||
Reference in New Issue
Block a user