document.py 1.3 KB

1234567891011121314151617181920212223242526
  1. from datetime import datetime
  2. from sqlalchemy import BigInteger, DateTime, Integer, String, ForeignKey
  3. from sqlalchemy.dialects.mysql import LONGTEXT
  4. from sqlalchemy.orm import Mapped, mapped_column
  5. from alien_database.base import Base, AuditMixin
  6. class ContractDocument(Base, AuditMixin):
  7. __tablename__ = "contract_document"
  8. id: Mapped[int] = mapped_column(BigInteger, primary_key=True, autoincrement=True)
  9. bundle_id: Mapped[int] = mapped_column(BigInteger, ForeignKey("contract_bundle.id"), index=True)
  10. contract_type: Mapped[str] = mapped_column(String(50))
  11. contract_name: Mapped[str] = mapped_column(String(100))
  12. is_primary: Mapped[int] = mapped_column(Integer, default=0)
  13. status: Mapped[int] = mapped_column(Integer, default=0)
  14. sign_flow_id: Mapped[str] = mapped_column(String(64), unique=True)
  15. file_id: Mapped[str] = mapped_column(String(64))
  16. template_url: Mapped[str] = mapped_column(LONGTEXT)
  17. sign_url: Mapped[str] = mapped_column(LONGTEXT)
  18. download_url: Mapped[str] = mapped_column(LONGTEXT)
  19. signing_time: Mapped[datetime | None] = mapped_column(DateTime, nullable=True)
  20. effective_time: Mapped[datetime | None] = mapped_column(DateTime, nullable=True)
  21. expiry_time: Mapped[datetime | None] = mapped_column(DateTime, nullable=True)