70ab3f38c6
- Header wordmark Fabled -> Scribe; fable:calendar-changed event -> scribe:calendar-changed; SettingsView CSS comment. - Drop dead Project.auto_summary + summary_updated_at columns (migration 0063) -- the Ollama-era summarizer is gone; model + 2 frontend types + projects test updated. - Remove pivot vestiges: diagnostics _curator_busy()/curator_busy heartbeat field, tz BRIEFING_DAY_START_HOUR/user_briefing_date dead aliases, the ignored 'model' param on get_embedding (+ its test). ruff src/ clean; CI is the gate. Part of scribe plan #599. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
37 lines
1.3 KiB
Python
37 lines
1.3 KiB
Python
import enum
|
|
from sqlalchemy import ForeignKey, Integer, Text
|
|
from sqlalchemy.orm import Mapped, mapped_column
|
|
from scribe.models import Base
|
|
from scribe.models.base import TimestampMixin, SoftDeleteMixin
|
|
|
|
|
|
class ProjectStatus(str, enum.Enum):
|
|
active = "active"
|
|
paused = "paused"
|
|
completed = "completed"
|
|
archived = "archived"
|
|
|
|
|
|
class Project(Base, TimestampMixin, SoftDeleteMixin):
|
|
__tablename__ = "projects"
|
|
id: Mapped[int] = mapped_column(primary_key=True)
|
|
user_id: Mapped[int | None] = mapped_column(Integer, ForeignKey("users.id", ondelete="CASCADE"), nullable=True)
|
|
title: Mapped[str] = mapped_column(Text, default="")
|
|
description: Mapped[str] = mapped_column(Text, default="")
|
|
goal: Mapped[str] = mapped_column(Text, default="")
|
|
status: Mapped[str] = mapped_column(Text, default="active")
|
|
color: Mapped[str | None] = mapped_column(Text, nullable=True) # hex color
|
|
|
|
def to_dict(self) -> dict:
|
|
return {
|
|
"id": self.id,
|
|
"user_id": self.user_id,
|
|
"title": self.title,
|
|
"description": self.description,
|
|
"goal": self.goal,
|
|
"status": self.status,
|
|
"color": self.color,
|
|
"created_at": self.created_at.isoformat(),
|
|
"updated_at": self.updated_at.isoformat(),
|
|
}
|