feat: bot-bridge+verify合并 — API+数据库+验证引擎
This commit is contained in:
@@ -204,6 +204,9 @@ class ActionPlan(Base):
|
||||
status = Column(String(20), default="pending", comment="pending/in_progress/completed/cancelled")
|
||||
progress = Column(Integer, default=0, comment="完成进度 0-100")
|
||||
result = Column(Text, nullable=True, comment="改善结果")
|
||||
auto_verify_rule = Column(JSON, nullable=True, comment="自动验证规则: {\"condition\": \"value > target\"}")
|
||||
verify_result = Column(String(20), nullable=True, comment="验证结果: pass/fail/pending")
|
||||
verify_log = Column(JSON, nullable=True, comment="验证历史日志")
|
||||
created_by = Column(String(100), nullable=True, comment="创建人")
|
||||
created_at = Column(DateTime, server_default=func.now())
|
||||
updated_at = Column(DateTime, server_default=func.now(), onupdate=func.now())
|
||||
@@ -266,6 +269,27 @@ class KPICausality(Base):
|
||||
updated_at = Column(DateTime, server_default=func.now(), onupdate=func.now())
|
||||
|
||||
|
||||
class MpmResult(Base):
|
||||
"""MPM财务Bot分析结果记录"""
|
||||
__tablename__ = "mpm_results"
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
entity_id = Column(Integer, ForeignKey("entities.id"), nullable=False, comment="企业实体ID")
|
||||
period = Column(String(20), nullable=False, comment="期间 YYYY-MM")
|
||||
source = Column(String(50), default="finance-bot", comment="来源Bot标识")
|
||||
raw_data = Column(JSON, nullable=False, comment="完整的MPM计算结果")
|
||||
created_at = Column(DateTime, server_default=func.now())
|
||||
|
||||
|
||||
class BotBridgeConfig(Base):
|
||||
"""Bot桥接鉴权配置"""
|
||||
__tablename__ = "bot_bridge_config"
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
bot_name = Column(String(50), unique=True, nullable=False, comment="Bot名称")
|
||||
token = Column(String(64), nullable=False, comment="鉴权Token")
|
||||
is_active = Column(Boolean, default=True, comment="是否激活")
|
||||
created_at = Column(DateTime, server_default=func.now())
|
||||
|
||||
|
||||
class KpiDataQualityLog(Base):
|
||||
"""数据质量监控日志"""
|
||||
__tablename__ = "kpi_data_quality_log"
|
||||
|
||||
Reference in New Issue
Block a user