from sqlalchemy import BigInteger, String from sqlalchemy.dialects.mysql import LONGTEXT from sqlalchemy.orm import Mapped, mapped_column from alien_database.base import Base, AuditMixin class ContractEvent(Base, AuditMixin): __tablename__ = "contract_event" id: Mapped[int] = mapped_column(BigInteger, primary_key=True, autoincrement=True) bundle_id: Mapped[int | None] = mapped_column(BigInteger, nullable=True) document_id: Mapped[int | None] = mapped_column(BigInteger, nullable=True) sign_flow_id: Mapped[str] = mapped_column(String(64), index=True) event_type: Mapped[str] = mapped_column(String(50)) payload_json: Mapped[str] = mapped_column(LONGTEXT)