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""