feat: schedule full ppt auto generation cadence
Some checks failed
CD Pipeline / deploy (push) Has been cancelled
Some checks failed
CD Pipeline / deploy (push) Has been cancelled
This commit is contained in:
@@ -35,6 +35,7 @@ from .autoheal_models import ( # noqa: F401 - ADR-013 AIOps 自動修復表
|
||||
from .import_models import ImportJob, ImportConfig # noqa: F401 - 確保 import_jobs/import_config 被 Base.metadata 管理
|
||||
from .notification_models import NotificationTemplate # noqa: F401 - 確保 notification_templates 表被 Base.metadata 管理
|
||||
from .ppt_reports import PPTReport # noqa: F401 - 確保 ppt_reports 表被 Base.metadata 管理
|
||||
from .ppt_generation_runs import PPTGenerationRun # noqa: F401 - 確保 ppt_generation_runs 表被 Base.metadata 管理
|
||||
from .vendor_models import VendorStockout, VendorList, VendorEmail, EmailSendLog # noqa: F401 - 確保 vendor 表被 Base.metadata 管理
|
||||
from .realtime_sales_models import RealtimeSalesMonthly # noqa: F401 - 確保 realtime_sales_monthly 被 Base.metadata 管理
|
||||
from .market_intel_models import ( # noqa: F401 - ADR-035 market_* 表
|
||||
|
||||
32
database/ppt_generation_runs.py
Normal file
32
database/ppt_generation_runs.py
Normal file
@@ -0,0 +1,32 @@
|
||||
"""PPT 定期產出執行紀錄模型。"""
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
from sqlalchemy import Column, DateTime, Integer, String, Text
|
||||
|
||||
from database.models import Base
|
||||
|
||||
|
||||
class PPTGenerationRun(Base):
|
||||
"""每次日/週/月/季/半年/年度 PPT 產出嘗試。"""
|
||||
|
||||
__tablename__ = "ppt_generation_runs"
|
||||
|
||||
id = Column(Integer, primary_key=True)
|
||||
schedule_kind = Column(String(40), nullable=False, index=True)
|
||||
report_type = Column(String(50), nullable=False, index=True)
|
||||
target_label = Column(String(160))
|
||||
status = Column(String(30), nullable=False)
|
||||
parameters_json = Column(Text)
|
||||
file_path = Column(String(500))
|
||||
file_size = Column(Integer)
|
||||
error_msg = Column(Text)
|
||||
result_payload = Column(Text)
|
||||
started_at = Column(DateTime, default=datetime.now, index=True)
|
||||
finished_at = Column(DateTime)
|
||||
|
||||
def __repr__(self):
|
||||
return (
|
||||
f"<PPTGenerationRun(kind={self.schedule_kind}, "
|
||||
f"type={self.report_type}, status={self.status})>"
|
||||
)
|
||||
Reference in New Issue
Block a user