"""董事会会议模型。 议程、纪要、决议追踪。 """ import uuid from datetime import datetime, timezone from sqlalchemy import DateTime, ForeignKey, String, Text from sqlalchemy.orm import Mapped, mapped_column from app.core.database import Base from app.core.types import JSONBType class BoardMeeting(Base): """董事会会议。""" __tablename__ = "board_meetings" id: Mapped[str] = mapped_column(String(36), primary_key=True, default=lambda: str(uuid.uuid4())) company_id: Mapped[str] = mapped_column(String(36), ForeignKey("companies.id"), nullable=False, index=True) title: Mapped[str] = mapped_column(String(200), nullable=False, comment="会议主题") meeting_at: Mapped[datetime | None] = mapped_column(DateTime(timezone=True), nullable=True, comment="会议时间") status: Mapped[str] = mapped_column(String(20), nullable=False, default="scheduled", comment="scheduled/in_progress/completed") agenda: Mapped[dict | None] = mapped_column(JSONBType, nullable=True, comment="议程列表") materials_summary: Mapped[str | None] = mapped_column(Text, nullable=True, comment="AI 会前材料摘要") minutes: Mapped[str | None] = mapped_column(Text, nullable=True, comment="会议纪要") resolutions: Mapped[dict | None] = mapped_column(JSONBType, nullable=True, comment="决议列表 — 含状态追踪") questions: Mapped[dict | None] = mapped_column(JSONBType, nullable=True, comment="AI 提问清单") created_at: Mapped[datetime] = mapped_column( DateTime(timezone=True), default=lambda: datetime.now(timezone.utc) ) updated_at: Mapped[datetime] = mapped_column( DateTime(timezone=True), default=lambda: datetime.now(timezone.utc), onupdate=lambda: datetime.now(timezone.utc), )