feat(plan): task_kind on Note model + to_dict

This commit is contained in:
2026-05-28 08:15:29 -04:00
parent ac462d1203
commit 8754b1c94d
+5
View File
@@ -60,6 +60,10 @@ class Note(Base, TimestampMixin):
# Structured metadata for entity types (person/place/list)
# Named 'entity_meta' to avoid collision with SQLAlchemy's reserved 'metadata' attribute
entity_meta: Mapped[dict | None] = mapped_column("metadata", JSONB, nullable=True)
# Task sub-kind — 'work' (default) or 'plan'. Only meaningful when the note
# is a task (status is not None); ordinary notes keep the 'work' default and
# ignore it. Orthogonal to note_type (which is the note/entity axis).
task_kind: Mapped[str] = mapped_column(Text, default="work", server_default="work")
__table_args__ = (
Index("ix_notes_tags", "tags", postgresql_using="gin"),
@@ -106,6 +110,7 @@ class Note(Base, TimestampMixin):
),
"is_task": self.is_task,
"note_type": self.entity_type,
"task_kind": self.task_kind,
"metadata": self.entity_meta or {},
"created_at": self.created_at.isoformat(),
"updated_at": self.updated_at.isoformat(),