feat: AI Worker 平台 MVP v1.0.0 - 多租户/项目管理/AI Worker/任务编排/HITL审核/成本治理
This commit is contained in:
@@ -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"<Project {self.name} [{self.status}]>"
|
||||
Reference in New Issue
Block a user