From d5c56e929259666a2274038a5383d325512ca593 Mon Sep 17 00:00:00 2001 From: huangzhuang_3rd Date: Wed, 12 Aug 2026 13:30:46 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20AI=20Worker=20=E5=B9=B3=E5=8F=B0=20MVP?= =?UTF-8?q?=20v1.0.0=20-=20=E5=A4=9A=E7=A7=9F=E6=88=B7/=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E7=AE=A1=E7=90=86/AI=20Worker/=E4=BB=BB=E5=8A=A1=E7=BC=96?= =?UTF-8?q?=E6=8E=92/HITL=E5=AE=A1=E6=A0=B8/=E6=88=90=E6=9C=AC=E6=B2=BB?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/models/project.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 backend/app/models/project.py diff --git a/backend/app/models/project.py b/backend/app/models/project.py new file mode 100644 index 0000000..2d7f95c --- /dev/null +++ b/backend/app/models/project.py @@ -0,0 +1,35 @@ +"""Project model.""" +from sqlalchemy import Column, String, Integer, Text, DateTime, ForeignKey, Boolean +from app.models.base import Base, TimestampMixin, TenantMixin + + +class Project(Base, TimestampMixin, TenantMixin): + """A project is the top-level business unit. + + Lifecycle: draft -> planning -> in_progress -> review -> accepted -> archived + """ + __tablename__ = "projects" + + id = Column(Integer, primary_key=True, autoincrement=True) + name = Column(String(300), nullable=False) + description = Column(Text, default="") + status = Column(String(50), nullable=False, default="draft") + + # Owner (project manager) + owner_id = Column(Integer, ForeignKey("users.id"), nullable=False) + + # Timeline + start_date = Column(DateTime, nullable=True) + end_date = Column(DateTime, nullable=True) + + # Budget (in cents to avoid float issues) + budget_limit_cents = Column(Integer, nullable=True) + + # Acceptance criteria + acceptance_criteria = Column(Text, default="") + + # Tags for categorization + tags = Column(String(500), default="") + + def __repr__(self): + return f""