from datetime import datetime from typing import Optional from sqlalchemy import String, DateTime, BigInteger from sqlalchemy.dialects.mysql import LONGTEXT from sqlalchemy.orm import Mapped, mapped_column from alien_database.base import Base, AuditMixin class LawyerContract(Base, AuditMixin): __tablename__ = "lawyer_contract" id: Mapped[int] = mapped_column(BigInteger, primary_key=True, autoincrement=True, comment="主键") lawyer_id: Mapped[int] = mapped_column(BigInteger, comment="律所id") law_firm_name: Mapped[str] = mapped_column(String(100), comment="律所名称") business_segment: Mapped[str] = mapped_column(String(100), comment="业务板块") contact_name: Mapped[str] = mapped_column(String(100), comment="联系人姓名") contact_phone: Mapped[str] = mapped_column(String(20), comment="联系电话") signing_status: Mapped[str] = mapped_column(String(20), default="未签署", comment="签署状态") contract_url: Mapped[str] = mapped_column(LONGTEXT, comment="合同URL") ord_id: Mapped[str] = mapped_column(LONGTEXT, comment="统一社会信用代码") signing_time: Mapped[Optional[datetime]] = mapped_column(DateTime, nullable=True, comment="签署时间") effective_time: Mapped[Optional[datetime]] = mapped_column(DateTime, nullable=True, comment="生效时间") expiry_time: Mapped[Optional[datetime]] = mapped_column(DateTime, nullable=True, comment="到期时间")