event.py 928 B

1234567891011121314151617
  1. from sqlalchemy import BigInteger, String
  2. from sqlalchemy.dialects.mysql import LONGTEXT
  3. from sqlalchemy.orm import Mapped, mapped_column
  4. from alien_database.base import Base, AuditMixin
  5. class ContractEvent(Base, AuditMixin):
  6. """合同事件"""
  7. __tablename__ = "contract_event"
  8. id: Mapped[int] = mapped_column(BigInteger, primary_key=True, autoincrement=True, comment="事件唯一标识")
  9. bundle_id: Mapped[int | None] = mapped_column(BigInteger, nullable=True, comment="关联合同包ID")
  10. document_id: Mapped[int | None] = mapped_column(BigInteger, nullable=True, comment="关联合同文档ID")
  11. sign_flow_id: Mapped[str] = mapped_column(String(64), index=True, comment="e签宝签署流程ID")
  12. event_type: Mapped[str] = mapped_column(String(50), comment="事件类型(esign_callback:{action})")
  13. payload_json: Mapped[str] = mapped_column(LONGTEXT, comment="e签宝回调原始JSON报文")