PMFlow/backend/app/models/project_suggestion.py

26 lines
1.2 KiB
Python

"""飞书项目建议模型"""
from __future__ import annotations
from sqlalchemy import BigInteger, Float, ForeignKey, Integer, TEXT, VARCHAR
from sqlalchemy.orm import Mapped, mapped_column
from typing import Optional
from .base import Base
class ProjectSuggestion(Base):
__tablename__ = "project_suggestions"
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
feishu_item_id: Mapped[int] = mapped_column(
BigInteger, ForeignKey("feishu_items.id"), nullable=False, index=True
)
suggested_name: Mapped[Optional[str]] = mapped_column(VARCHAR(255), nullable=True)
suggested_description: Mapped[Optional[str]] = mapped_column(TEXT, nullable=True)
suggested_owner: Mapped[Optional[str]] = mapped_column(VARCHAR(120), nullable=True)
suggested_timeline: Mapped[Optional[str]] = mapped_column(VARCHAR(120), nullable=True)
confidence: Mapped[Optional[float]] = mapped_column(Float, nullable=True)
reasoning: Mapped[Optional[str]] = mapped_column(TEXT, nullable=True)
status: Mapped[str] = mapped_column(VARCHAR(30), nullable=False, default="pending", index=True)
created_project_id: Mapped[Optional[int]] = mapped_column(BigInteger, nullable=True, index=True)